Subversion Repositories SmartDukaan

Rev

Rev 19725 | Rev 19774 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 19725 Rev 19737
Line 1... Line 1...
1
<script>
1
<script>
-
 
2
	$(document).on('click','.getcode',function(){
-
 
3
		var ret_id = $(this).data('id');
-
 
4
		$.ajax({
-
 
5
			'url' : "<?php echo $base_url;?>users/getcode/"+ret_id,
-
 
6
			'type': "GET"
-
 
7
		},'json')
-
 
8
		.done(function(msg){
-
 
9
			val = JSON.parse(msg);
-
 
10
			if(val["code"] != ""){
-
 
11
				alert("Retailer code is : "+ val["code"]);
-
 
12
			}	
-
 
13
			else{
-
 
14
				alert("No code found..");
-
 
15
			}
-
 
16
		});
-
 
17
	});
2
	$(document).ready(function(){
18
	$(document).ready(function(){
3
		$('.userretailer').click(function(){
19
		$('.userretailer').click(function(){
4
			var searchfor = $('.userretailer').val();
20
			var searchfor = $('.userretailer').val();
5
			var sendata = "";
21
			var sendata = "";
6
			var that = this.id;
22
			var that = this.id;
Line 17... Line 33...
17
			.done(function(msg){
33
			.done(function(msg){
18
				val = eval(msg);
34
				val = eval(msg);
19
				if(that == "usertype"){
35
				if(that == "usertype"){
20
					$(".usertable tbody").empty();
36
					$(".usertable tbody").empty();
21
					for(var i in val){
37
					for(var i in val){
22
						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>";
38
						var html = "<tr><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>";
23
						$(".usertable tbody").append(html);
39
						$(".usertable tbody").append(html);
24
					}
40
					}
25
					$('.usertable').removeClass('hidden');
41
					$('.usertable').removeClass('hidden');
26
				}
42
				}
27
				else if(that == "retailertype"){
43
				else if(that == "retailertype"){
28
					$(".retailertable tbody").empty();
44
					$(".retailertable tbody").empty();
-
 
45
					var codebutton;
29
					for(var i in val){
46
					for(var i in val){
-
 
47
						if(val[i]['Retailer']['isvalidated'] == "1"){
-
 
48
							codebutton = "<button type='button' class='btn btn-primary btn-xs getcode' data-id="+val[i]['Retailer']['id']+">Get Code</button>";
-
 
49
						}
-
 
50
						else{
-
 
51
							codebutton = "";
-
 
52
						}
30
						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>";
53
						var html = "<tr><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><td>"+codebutton+"</td><tr>";
31
						$(".retailertable tbody").append(html);
54
						$(".retailertable tbody").append(html);
32
					}
55
					}
33
					$('.retailertable').removeClass('hidden');
56
					$('.retailertable').removeClass('hidden');
34
				}
57
				}
35
				
58
				
Line 43... Line 66...
43
</script>
66
</script>
44
 
67
 
45
<div class="container">
68
<div class="container">
46
    <div class="row">
69
    <div class="row">
47
        <div class="col-lg-12 table-responsive">	
70
        <div class="col-lg-12 table-responsive">	
-
 
71
        	
-
 
72
        	<a href="<?php echo $base_url;?>admin/users/addretailer" style="float:right;" class="btn btn-primary">Create New Retailer</a>
-
 
73
  			<br><br>      
48
            <form class="navbar-form" role="search" method="GET" name="search" action="#" id="userform">
74
            <form class="navbar-form" role="search" method="GET" name="search" action="#" id="userform">
49
        		<div class="input-group col-xs-6 text-left">
75
        		<div class="input-group col-xs-6 text-left">
50
        			Search User By:         			
76
        			Search User By:         			
51
        			<input type="hidden" name="searchfor" value="usertype" class="searchfor">
77
        			<input type="hidden" name="searchfor" value="usertype" class="searchfor">
52
        			<input type="radio" name="type" value="mobile_number" checked="checked"/>Mobile
78
        			<input type="radio" name="type" value="mobile_number" checked="checked"/>Mobile
Line 58... Line 84...
58
                        <button class="btn btn-default userretailer" id="usertype" type=""><i class="glyphicon glyphicon-search"></i></button>
84
                        <button class="btn btn-default userretailer" id="usertype" type=""><i class="glyphicon glyphicon-search"></i></button>
59
                    </div>
85
                    </div>
60
                </div>
86
                </div>
61
            </form>
87
            </form>
62
            <?php //if(!empty($users)):?>
88
            <?php //if(!empty($users)):?>
63
            <div style="height:50%;">
89
            <div style="height:40%;">
64
	            <table class="table table-striped usertable hidden">
90
	            <table class="table table-striped usertable hidden">
65
	                <thead>
91
	                <thead>
66
	                    <tr>
92
	                    <tr>
67
	                        <th><?php echo 'Id';?></th>
93
	                
68
	                        <th><?php echo 'Email';?></th>
94
	                        <th><?php echo 'Email';?></th>
69
	                        <th><?php echo 'Name';?></th>
95
	                        <th><?php echo 'Name';?></th>
70
	                        <th><?php echo 'Referrer';?></th>                        
96
	                        <th><?php echo 'Referrer';?></th>                        
71
	                        <th><?php echo 'Utm Campaign';?></th>
97
	                        <th><?php echo 'Utm Campaign';?></th>
72
	                        <th><?php echo 'Mobile Number';?></th>
98
	                        <th><?php echo 'Mobile Number';?></th>
Line 102... Line 128...
102
            </form>
128
            </form>
103
            <?php //if(!empty($retailers)):?>
129
            <?php //if(!empty($retailers)):?>
104
            <table class="table table-striped retailertable hidden">
130
            <table class="table table-striped retailertable hidden">
105
                <thead>
131
                <thead>
106
                    <tr>
132
                    <tr>
107
                        <th><?php echo 'Id';?></th>
133
                        
108
                        <th><?php echo 'Identifier';?></th>
-
 
109
                        <th><?php echo 'Title';?></th>
134
                        <th><?php echo 'Title';?></th>
110
                        <th><?php echo 'Address';?></th>                        
135
                        <th><?php echo 'Address';?></th>                        
111
                        <th><?php echo 'Contact1';?></th>
136
                        <th><?php echo 'Contact1';?></th>
112
                        <th><?php echo 'Contact2';?></th>
137
                        <th><?php echo 'Contact2';?></th>
113
                        <th><?php echo 'Pin';?></th>  
138
                        <th><?php echo 'Pin';?></th>  
114
                        <th><?php echo 'City';?></th>
139
                        <th><?php echo 'City';?></th>
115
                        <th><?php echo 'State';?></th>
140
                        <th><?php echo 'State';?></th>
116
                        <th><?php echo 'Tin';?></th>                     
141
                        <th><?php echo 'Tin';?></th>                     
117
                          
142
                        <th>&nbsp;</th>
118
                    </tr>
143
                    </tr>
119
                </thead>
144
                </thead>
120
                <tbody>
145
                <tbody>
121
                
146
                
122
                </tbody>
147
                </tbody>