Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
19074 naman 1
<head>
2
<style>
3
table, th, td {
4
    border: 1px solid black;
5
}
6
</style>
7
</head>
8
<?php echo $_SESSION["group_id"];?>
9
<div class="notificationCampaigns index">
10
 
11
	<h2><?php echo __('Notification Campaigns'); ?></h2>
12
 
13
	<table cellpadding="0" cellspacing="0" border="1" class="table table-striped" >
14
	<tr>
15
			<th style="text-align:center"><?php echo $this->Paginator->sort('id'); ?></th>
16
			<th style="text-align:center"><?php echo $this->Paginator->sort('name'); ?></th>
17
			<th style="text-align:center"><?php echo $this->Paginator->sort('title'); ?></th>
18
			<th style="text-align:center"><?php echo $this->Paginator->sort('created'); ?></th>
19
			<th style="text-align:center"><?php echo $this->Paginator->sort('expiresat'); ?></th>
20
			<th style="text-align:center">Total</th>
21
			<th style="text-align:center">Failed</th>
22
			<th style="text-align:center">Success</th>
23
			<th style="text-align:center">Recieved</th>
24
			<th style="text-align:center">Expired</th>
25
			<th style="text-align:center">Gap</th>
26
			<th style="text-align:center">Opened</th>
27
			<th style="text-align:center">Referrer</th>
28
			<th style="text-align:center">Login</th>		
29
			<th style="text-align:center">Total Sms</th>
30
			<th style="text-align:center">Failed Sms</th>
31
			<th style="text-align:center">Success Sms</th>
32
			<th style="text-align:center">Received Sms</th>
33
			<th style="text-align:center">Expired Sms</th>
34
			<th style="text-align:center">Sent To Operator</th>
35
			<th style="text-align:center">Gap Sms</th>
36
			<th style="text-align:center" class="actions"><?php echo __('Actions'); ?></th>
37
 
38
	</tr>
39
 
40
	<?php foreach ($notificationCampaigns as $key=> $notificationCampaign): ?>
41
	<?php 
42
	if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['sent']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['sent'])){
43
 
44
		$successSent=$notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['sent'];}
45
	else{
46
		$successSent=0;
47
	}
48
	if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['0']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['0'])){
49
		$successFailed=$notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['0'];
50
	}else{
51
		$successFailed=0;
52
	}
53
	?>	
54
	<tr>
55
 
56
		<td align="center" width="4%"><?php echo h($notificationCampaign['NotificationCampaign']['id']); ?>&nbsp;</td>
57
		<td align="center"><?php echo h($notificationCampaign['NotificationCampaign']['name']); ?>&nbsp;</td>
58
		<td align="center"><?php echo h($notificationCampaign['NotificationCampaign']['title']); ?>&nbsp;</td>
59
		<!-- <td align="center"><?php //echo h($notificationCampaign['NotificationCampaign']['message']); ?>&nbsp;</td> -->
60
		<td align="center"><?php echo h($notificationCampaign['NotificationCampaign']['created']); ?>&nbsp;</td>
61
		<td align="center"><?php echo h($notificationCampaign['NotificationCampaign']['expiresat']); ?>&nbsp;</td>
62
		<td> 
63
			<?php 
64
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['total'])){
65
					echo $result[$notificationCampaign['NotificationCampaign']['id']]['total'];
66
					$total = $result[$notificationCampaign['NotificationCampaign']['id']]['total'];
67
				}else {echo '0';
68
					$total = 0;
69
			}
70
			?>
71
			&nbsp;
72
 
73
		</td>
74
 
75
		<td align="center">
76
			<?php 
77
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['failed'])){
78
					//echo $this->Html->link(__(h($result[$notificationCampaign['NotificationCampaign']['id']]['failed'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'sent',0));
79
					echo h($result[$notificationCampaign['NotificationCampaign']['id']]['failed']);
80
				}else {echo h('0');}
81
			?>
82
			&nbsp;
83
		</td>
84
 
85
		<td align="center" width="15%">
86
			<?php //if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['sent']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['sent'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['sent'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'sent',1)); } else {echo h('0');}?>
87
			<?php 
88
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['success'])){
89
					echo h($result[$notificationCampaign['NotificationCampaign']['id']]['success']); 
90
					$success = $result[$notificationCampaign['NotificationCampaign']['id']]['success'];
91
				}else {echo h('0');
92
				$success = 0;
93
			}
94
			?>
95
		<br>
96
		<?php //echo h('Trackable= '.$notificationWithVersionCode[$key]);?>
97
		<br>
98
		<?php //echo h('%= '.round((($notificationWithVersionCode[$key])/($successSent+$successFailed))*100));?>
99
		<?php echo h('Success %= '.round((($success)/($total))*100));?>
100
		</td>
101
 
102
		<td align="center">
103
			<?php //if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['recieved']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['recieved'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['recieved'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'recieved',1)); } else {echo h('0');}?>
104
			<?php 
105
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['recieved'])){
106
					echo h($result[$notificationCampaign['NotificationCampaign']['id']]['recieved']); 
107
				}else {echo h('0');}
108
			?>
109
			&nbsp;
110
		</td>
111
 
112
 		<td align="center">
113
 			<?php //if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['expired']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['expired'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['expired'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'expired',1)); } else {echo h('0');}?>
114
 			<?php 
115
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['expired'])){
116
					echo h($result[$notificationCampaign['NotificationCampaign']['id']]['expired']); 
117
				}else {echo h('0');}
118
			?>&nbsp;
119
 		</td>
120
 
121
 		<?php //if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['recieved']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['recieved'])){$recieved = $notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['recieved']; } else {$recieved =0;}?>
122
<?php //if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['expired']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['expired'])){$expired = $notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['expired']; } else {$expired=0;}?>
123
<?php 
124
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['recieved'])){
125
					$recieved = $result[$notificationCampaign['NotificationCampaign']['id']]['recieved'];  
126
				}else {$recieved =0;}
127
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['expired'])){
128
					$expired = $result[$notificationCampaign['NotificationCampaign']['id']]['expired'];  
129
				}else {$expired =0;}
130
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['1'])){
131
					$sent = $result[$notificationCampaign['NotificationCampaign']['id']]['1'];  
132
				}else {$sent =0;}
133
	?>
134
<td align="center" width="10%">
135
	<?php //echo($sent - ($recieved+$expired));?>
136
	<?php echo($success - ($recieved+$expired));?>
137
 
138
<br>
139
<?php //if($notificationWithVersionCode[$key]!=0){ echo('%= '.round((($notificationWithVersionCode[$key] - ($recieved+$expired))/$notificationWithVersionCode[$key])*100));}else {echo('%= 0');}?>
140
<?php if($success!=0){ echo('%= '.round((($success - ($recieved+$expired))/$success)*100));}else {echo('%= 0');}?>
141
</td>
142
		<td align="center">
143
			<?php //if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['opened']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['opened'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['opened'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'opened',1));  } else {echo h('0');}?>
144
			<?php 
145
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['opened'])){
146
					echo h($result[$notificationCampaign['NotificationCampaign']['id']]['opened']); 
147
				}else {echo h('0');}
148
			?>
149
			&nbsp;
150
		</td>
151
		<td align="center">
152
			<?php //if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['referrer']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['referrer'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['referrer'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'referrer',1));  } else {echo h('0');}?>
153
			<?php 
154
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['referrer'])){
155
					echo h($result[$notificationCampaign['NotificationCampaign']['id']]['referrer']); 
156
				}else {echo h('0');}
157
			?>&nbsp;
158
		</td>
159
		<td align="center">
160
			<?php //if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['login']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['login'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['login'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'login',1)); } else {echo h('0');}?>
161
			<?php 
162
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['login'])){
163
					echo h($result[$notificationCampaign['NotificationCampaign']['id']]['login']); 
164
				}else {echo h('0');}
165
			?>&nbsp;
166
		</td>
167
 
168
		<td align="center">
169
			<?php //if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['login']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['login'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['login'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'login',1)); } else {echo h('0');}?>
170
			<?php 
171
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['smssent'])){
172
					echo $result[$notificationCampaign['NotificationCampaign']['id']]['smssent']; 
173
					$smstotal = $result[$notificationCampaign['NotificationCampaign']['id']]['smssent'];
174
				}else {echo h('0');
175
					$smstotal=0;
176
					}
177
			?>&nbsp;
178
		</td>
179
 
180
		<td align="center">
181
 			<?php //if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['smsrejected']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['smsrejected'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['smsrejected'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'smsrejected',1)); } else {echo h('0');}?>
182
 			<?php 
183
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['smsrejected'])){
184
					echo $this->Html->link(__(h($result[$notificationCampaign['NotificationCampaign']['id']]['smsrejected'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'smsrejected',1)); 
185
				}else {echo h('0');}
186
			?>&nbsp;
187
 		</td>
188
		<td align="center">
189
 			<?php //if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['smsrejected']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['smsrejected'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['smsrejected'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'smsrejected',1)); } else {echo h('0');}?>
190
 			<?php 
191
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['smsprocessed'])){
192
					echo $this->Html->link(__(h($result[$notificationCampaign['NotificationCampaign']['id']]['smsprocessed'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'smsprocessed',1)); 
193
					$smssuccess=$result[$notificationCampaign['NotificationCampaign']['id']]['smsprocessed'];
194
				}else {echo h('0');
195
					$smssuccess=0;
196
					}
197
				if($smstotal==0){
198
					$successpert = 0;
199
				}else{
200
					$successpert = round(($smssuccess)/($smstotal)*100);
201
				}
202
			?>&nbsp;
203
			<br>
204
			<br>
205
			<?php echo h('Success %= '.$successpert);?>
206
 		</td>
207
		<td align="center">
208
			<?php 
209
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['SMS_DELIVRD'])){
210
					echo $this->Html->link(__(h($result[$notificationCampaign['NotificationCampaign']['id']]['SMS_DELIVRD'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'SMS_DELIVRD',1)); 
211
					$receivedsms=$result[$notificationCampaign['NotificationCampaign']['id']]['SMS_DELIVRD'];
212
				}else {echo h('0');
213
					$receivedsms = 0;
214
				}
215
			?>&nbsp;
216
		</td>
217
		<td align="center">
218
			<?php 
219
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['SMS_EXPIRED'])){
220
					echo $this->Html->link(__(h($result[$notificationCampaign['NotificationCampaign']['id']]['SMS_EXPIRED'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'SMS_EXPIRED',1)); 
221
					$expiredsms = $result[$notificationCampaign['NotificationCampaign']['id']]['SMS_EXPIRED'];
222
				}else {echo h('0');
223
					$expiredsms = 0;
224
					}
225
			?>&nbsp;
226
		</td>
227
		<td align="center">
228
			<?php 
229
				if(isset($result[$notificationCampaign['NotificationCampaign']['id']]['SMS_SENT_OPERATOR'])){
230
					echo $this->Html->link(__(h($result[$notificationCampaign['NotificationCampaign']['id']]['SMS_SENT_OPERATOR'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'SMS_SENT_OPERATOR',1)); 
231
					$sentoperator = $result[$notificationCampaign['NotificationCampaign']['id']]['SMS_SENT_OPERATOR'];
232
				}else {echo h('0');
233
					$sentoperator = 0;
234
				}
235
			?>&nbsp;
236
		</td>
237
 
238
		<td align="center">
239
 
240
			<?php echo($smssuccess - ($receivedsms+$expiredsms+$sentoperator));?>
241
 
242
			<br>
243
 
244
			<?php if($smssuccess!=0){ echo('%= '.round((($smssuccess - ($receivedsms+$expiredsms+$sentoperator))/$smssuccess)*100));}else {echo('%= 0');}?>
245
			<br>
246
		</td>
247
 
248
 		<td align="center" width="15%" class="actions">
249
 
250
			<?php echo $this->Html->link(__('View'), array('action' => 'view', $notificationCampaign['NotificationCampaign']['id'])); ?>
251
			&nbsp;
252
 
253
		</td>
254
	</tr>
255
<?php endforeach; ?>
256
	</table>
257
 
258
	<ul class="pager">
259
	  	<?php if($page>1):?>
260
	    	<li><a href="?page=<?php echo $page-1;?>">Previous</a></li>
261
		<?php endif;?>
262
 
263
	    	<li><a href="?page=<?php echo $page+1;?>">Next</a></li>
264
 
265
  	</ul>
266
	</div>
267
</div>