Rev 19737 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<script>$(document).ready(function(){$('.userretailer').click(function(){var searchfor = $('.userretailer').val();var sendata = "";var that = this.id;if(that == "usertype"){sendata = $('#userform').serialize();}else if(that == "retailertype"){sendata = $('#retailerform').serialize();}// debugger;$.ajax({'url' : "<?php echo $base_url;?>admin/users/searchuserretailer?"+sendata,'type': "GET"},'json').done(function(msg){val = eval(msg);if(that == "usertype"){$(".usertable tbody").empty();for(var i in val){var html = "<tr><td>"+val[i]['User']['id']+"</td><td>"+val[i]['User']['email']+"</td><td>"+val[i]['User']['first_name']+"</td><td>"+val[i]['User']['referrer']+"</td><td>"+val[i]['User']['utm_campaign']+"</td><td>"+val[i]['User']['mobile_number']+"</td><td>"+val[i]['User']['activated']+"</td><tr>";$(".usertable tbody").append(html);}$('.usertable').removeClass('hidden');}else if(that == "retailertype"){$(".retailertable tbody").empty();for(var i in val){var html = "<tr><td>"+val[i]['Retailer']['id']+"</td><td>"+val[i]['Retailer']['identifier']+"</td><td>"+val[i]['Retailer']['title']+"</td><td>"+val[i]['Retailer']['address']+"</td><td>"+val[i]['Retailer']['contact1']+"</td><td>"+val[i]['Retailer']['contact2']+"</td><td>"+val[i]['Retailer']['pin']+"</td><td>"+val[i]['Retailer']['city']+"</td><td>"+val[i]['Retailer']['state']+"</td><td>"+val[i]['Retailer']['tin']+"</td><tr>";$(".retailertable tbody").append(html);}$('.retailertable').removeClass('hidden');}});return false;});});</script><div class="container"><div class="row"><div class="col-lg-12 table-responsive"><form class="navbar-form" role="search" method="GET" name="search" action="#" id="userform"><div class="input-group col-xs-6 text-left">Search User By:<input type="hidden" name="searchfor" value="usertype" class="searchfor"><input type="radio" name="type" value="mobile_number" checked="checked"/>Mobile<input type="radio" name="type" value="email"/>Email</div><div class="input-group col-xs-6 text-right" id="remote"><input autocomplete="off" type="text" class="form-control" placeholder="Search for users" name="search" id="srch-term"><div class="input-group-btn w25px"><button class="btn btn-default userretailer" id="usertype" type=""><i class="glyphicon glyphicon-search"></i></button></div></div></form><?php //if(!empty($users)):?><div style="height:50%;"><table class="table table-striped usertable hidden"><thead><tr><th><?php echo 'Id';?></th><th><?php echo 'Email';?></th><th><?php echo 'Name';?></th><th><?php echo 'Referrer';?></th><th><?php echo 'Utm Campaign';?></th><th><?php echo 'Mobile Number';?></th><th><?php echo 'Activated';?></th></tr></thead><tbody></tbody></table></div><?php //endif;?></div></div><div class="row"><div class="col-lg-12 table-responsive"><form class="navbar-form" role="search" method="GET" name="search" id="retailerform" action="<?php echo $base_url;?>admin/users/userretailer"><div class="input-group col-xs-6 text-left">Search Retailer By:<input type="hidden" name="searchfor" value="retailertype"><input type="radio" name="type" value="tin"/>Tin<input type="radio" name="type" value="contact" checked="checked"/>Mobile</div><div class="input-group col-xs-6 text-right" id="remote"><input autocomplete="off" type="text" class="form-control" placeholder="Search for retailer" name="search" id="srch-term"><div class="input-group-btn w25px"><button class="btn btn-default userretailer" id="retailertype" type="submit"><i class="glyphicon glyphicon-search"></i></button></div></div></form><?php //if(!empty($retailers)):?><table class="table table-striped retailertable hidden"><thead><tr><th><?php echo 'Id';?></th><th><?php echo 'Identifier';?></th><th><?php echo 'Title';?></th><th><?php echo 'Address';?></th><th><?php echo 'Contact1';?></th><th><?php echo 'Contact2';?></th><th><?php echo 'Pin';?></th><th><?php echo 'City';?></th><th><?php echo 'State';?></th><th><?php echo 'Tin';?></th></tr></thead><tbody></tbody></table><?php //endif;?></div></div></div>