Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
19771 naman 1
<script>
2
	$(document).ready(function(){
3
		$('.sendsms').click(function(){
4
			var retid = $(this).data('retid')
5
			var phone = $('#'+retid).val().trim();
6
			var value = true;
7
 
8
			if(phone != ''){
9
				if(phone.match(/^\d{10}$/) == null)
10
			    {
11
			        value = false;
12
			        message = "Invalid contact number";    
13
			        alert(message);
14
			    }
15
			}
16
 
17
			if(value){
18
				$.ajax({
19
					'url' : "<?php echo $base_url;?>retailers/sendsms?retid="+retid+"&contact="+phone,
20
					'type': "GET"
21
				},'json')
22
				.done(function(msg){
23
					val = JSON.parse(msg);
24
					if(val['result'] == "success")
25
					{
26
						alert("Sms sent successfully..");
27
					}
28
					else{
29
						alert("Sms sending failed..");
30
					}
31
				});
32
			}
33
 
34
		});
35
	});
36
</script>
37
<div class="container">
38
	<div class = "row">
39
		<div class="col-lg-12 table-responsive">
40
			<h2><?php echo __('Verified Retailers'); ?></h2>
41
 
42
				<table cellpadding="0" cellspacing="0" border="1" class="table table-striped" >
43
					<tr>
44
 
45
						<th style="text-align:center">Mobile No.</th>
46
						<th style="text-align:center">Tin</th>
47
						<th style="text-align:center">Address</th>
48
						<th style="text-align:center">City</th>
49
						<th style="text-align:center">State</th>
50
						<th style="text-align:center">If any other number</th>
51
						<th></th>
52
					</tr>
53
 
54
					<?php foreach($verified as $pkey => $pvalue):?>
55
					<tr>
56
						<td style="text-align:center"><?php echo $pvalue['Retailer']['contact1'];?></td>
57
						<td style="text-align:center"><?php echo $pvalue['Retailer']['tinnumber'];?></td>
58
						<td style="text-align:center"><?php echo $pvalue['Retailer']['address'];?></td>
59
						<td style="text-align:center"><?php echo $pvalue['Retailer']['city'];?></td>
60
						<td style="text-align:center"><?php echo $pvalue['Retailer']['state'];?></td>
61
						<td style="text-align:center">
62
								<input type ="text" class = "contact2" id= "<?php echo $pvalue['Retailer']['id'];?>">
63
						</td>
64
						<td style="text-align:center">
65
							<button type="button" class="btn btn-success btn-xs sendsms" data-retid= "<?php echo $pvalue['Retailer']['id'];?>">Send Sms</button>
66
						</td>
67
					</tr>
68
 
69
					<?php endforeach;?>
70
 
71
				</table>
72
		</div>
73
	</div>
74
 
75
</div>