-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdost_list.php
More file actions
446 lines (390 loc) · 15.4 KB
/
Copy pathdost_list.php
File metadata and controls
446 lines (390 loc) · 15.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
<?PHP session_start();
require_once 'Config.php';
require_once $COMMONPHP;
?>
<style type="text/css">
.style_prevu_kit:hover
{
z-index: 2;
-webkit-transition: all 200ms ease-in;
-webkit-transform: scale(3.9);
-ms-transition: all 200ms ease-in;
-ms-transform: scale(3.9);
-moz-transition: all 200ms ease-in;
-moz-transform: scale(3.9);
transition: all 200ms ease-in;
transform: scale(3.9);
}
</style>
<html>
<title></title>
<link href="css/stylenew.css" rel="stylesheet" type="text/css">
<head>
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="./js/global.js" type="text/javascript"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="js/CalendarPopup.js"></SCRIPT>
<SCRIPT language="javascript" src="js/AnchorPosition.js"></SCRIPT>
<SCRIPT language="javascript" src="js/date.js"></SCRIPT>
<SCRIPT language="javascript" src="js/PopupWindow.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var cal = new CalendarPopup();
</SCRIPT>
</head>
<body>
<?PHP
error_reporting(0);
$d1=$_POST['date1'];
$d2=$_POST['date2'];
$md1 = explode('/',$d1);
$md2 = explode('/',$d2);
$mdt1 = $md1[2]."-".$md1[0]."-".$md1[1]." ". 00 .":". 00 .":". 00;
$mdt2 = $md2[2]."-".$md2[0]."-".$md2[1]." ". 23 .":". 59 .":". 59;
?>
<table width="100%" border="0" cellspacing="5" cellpadding="0" align="center">
<tr>
<td valign="top">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="chn">
<form action="" method="post" name="frmdost" id="frmdost">
<tbody>
<tr>
<td height="28" colspan="8" align="center" class="headTitleRpt">SEARCH CRITERIA </td>
</tr> <tr>
<td width="91" height="28" align="right" bgcolor="#99CF78" class="TitleText">Sex: </td>
<td width="221" align="left" bgcolor="#DCF3D1" class="sptr1"><label>
<select name="sex">
<option></option>
<option value="1">Female</option>
<option value="2">Male</option>
</select>
</label>
<!--<script language="JavaScript" type="text/javascript">document.all("sex").value=""</script>--> </td>
<td width="74" align="right" bgcolor="#A0DF82" class="TitleText">Age: </td>
<td width="196" align="left" bgcolor="#DCF3D1" class="sptr1"><label>
<select name="age">
<option></option>
<option value="1">15-23</option>
<option value="2">24-32</option>
<option value="3">33+</option>
</select>
</label>
<!-- <script language="JavaScript" type="text/javascript">document.all("age").value=""</script>--> </td>
<td width="100" align="right" bgcolor="#A0DF82" class="TitleText">Mobile No: </td>
<td width="179" align="left" bgcolor="#DCF3D1" class="sptr1"><label>
<input name="mobileno" type="text" size="10" />
</label>
<!-- <script language="JavaScript" type="text/javascript">document.all("mobileno").value=""</script>--> </td>
</tr>
<tr>
<td align="right" bgcolor="#A0DF82" class="TitleText">Date From: </td>
<td align="left" bgcolor="#DCF3D1" class="sptr1"><input name="date1" type="text" class="newTextBox" value="" size="15">
<script language="JavaScript" type="text/javascript">document.all("date1").value=""</script>
<A HREF="#" onClick="cal.select(document.forms['frmdost'].date1,'anchor1','MM/dd/yyyy'); return false;"
NAME="anchor1" ID="anchor1"><img src="images/calendar_icon.png" width="25" height="25" border="0" align="absmiddle" /></A></td>
<td align="right" bgcolor="#99CF78" class="TitleText">To: </td>
<td align="left" bgcolor="#DCF3D1" class="sptr1"><input name="date2" type="text" class="newTextBox" id="date2" value="" size="15">
<script language="JavaScript" type="text/javascript">document.all("date2").value=""</script>
<a href="#" onClick="cal.select(document.forms['frmdost'].date2,'anchor1','MM/dd/yyyy'); return false;"
name="anchor1" id="anchor1"><img src="images/calendar_icon.png" width="25" height="25" border="0" align="absmiddle" /></a></td>
<td width="100" align="right" bgcolor="#A0DF82" class="TitleText">Dost ID: </td>
<td width="179" align="left" bgcolor="#DCF3D1" class="sptr1"><label>
<input name="dostid" type="text" size="10" />
</label></td>
</tr>
<tr>
<td width="110" align="right" bgcolor="#A0DF82" class="TitleText">Popularity From: </td>
<td width="179" align="left" bgcolor="#DCF3D1" class="sptr1"><label>
<input name="MinPopularity" type="text" size="10" />
</label></td>
<td width="100" align="right" bgcolor="#A0DF82" class="TitleText">To: </td>
<td width="179" align="left" bgcolor="#DCF3D1" class="sptr1"><label>
<input name="MaxPopularity" type="text" size="10" />
</label></td>
</tr>
<tr class="headTitleRpt">
<td height="24" colspan="8" align="center"><input name="Submit" type="submit" value="SEARCH"></td>
</tr>
</tbody>
</form>
</table>
<br>
<?php
$rowperpage = 25;
if(isset($_GET['pageno']) && $_GET['submit']!="SEARCH"){
$pageno = $_GET['pageno'];
}
else{
$pageno = 1;
}
$firstrow = ($pageno-1) * $rowperpage +1;
//$lastrow = $pageno * $rowperpage;
$lastrow = 25;
if(isset($_POST['Submit']) or $_GET['submit']=="Generate")
//if(isset($_POST['Submit']))
{
$cn = connectDB();
//echo "test";
$mobileno = $_REQUEST['mobileno'];
$dostid=$_REQUEST['dostid'];
$MaxPopularity=$_REQUEST['MaxPopularity'];
$MinPopularity=$_REQUEST['MinPopularity'];
$sex = $_REQUEST['sex'];
$age=$_REQUEST['age'];
$regdate1=$_REQUEST['date1'];
$regdate2 = $_REQUEST['date2'];
$md1 = explode('/',$regdate1);
$md2 = explode('/',$regdate2);
$mdt1 = "" . $md1[2]."-".$md1[0]."-".$md1[1]." 00:00:00";
$mdt2 = "" . $md2[2]."-".$md2[0]."-".$md2[1]." 23:59:59";
$cond = " where";
//$sex = (isset($_POST['sex']) and !empty($_POST['sex']))?trim($_POST['sex']):'';
if($sex != ""){
$cond .= " Gender = '$sex'";
}
//$age = (isset($_POST['age']) and !empty($_POST['age']))?trim($_POST['age']):'';
if($age != ""){
if($sex != ""){
$cond .= " and";
}
$cond .= " age_group = '$age'";
}
if($mobileno != ""){
if($cond != " where"){
$cond .= " and";
}
$cond .= " msisdn like '$mobileno%'";
}
if($dostid != ""){
if($cond != " where"){
$cond .= " and";
}
$cond .= " voice_chat_id like '$dostid%'";
}
if($regdate1 != "" && $regdate2 != ""){
if($cond != " where"){
$cond .= " and";
}
$cond .= " registration_date between '".$mdt1."' and '".$mdt2."' ";
}
if($MinPopularity != "" && $MaxPopularity != "") {
if($cond != " where"){
$cond .= " and";
}
$cond .= " popularity between ".$MinPopularity." and ".$MaxPopularity." ";
}
if($cond != " where")
{
$cond .= " and user_status='1'";
}
else
{
$cond .=" user_status='1'";
}
//$cond .= " user_status='1' AND profile <> '' ";
$orderBy=' popularity desc ';
//$qr="select DostID,Mobileno,Gender,Age,NickFile,RegDate,BusyStatus,popularity from (SELECT ROW_NUMBER() over (order by popularity desc) as rowno, DostID,Mobileno,Gender,Age,NickFile,RegDate,BusyStatus,popularity from [tempdostlist] ";
//$qr="SELECT DostID,Mobileno,Gender,Age,NickFile,RegDate,BusyStatus,popularity FROM tempdostlist ";
$qr="SELECT voice_chat_id AS DostID,msisdn AS Mobileno,gender AS Gender,age_group AS Age,profile AS NickFile,registration_date AS RegDate,busy_status AS BusyStatus,popularity FROM user ";
//$qr .= ") a where rowno>=$firstrow and rowno<=$lastrow";
$qr .= $cond;
$qr .= " order by ".$orderBy;
$firstrow = $firstrow -1;
$qr .= " LIMIT $firstrow,$lastrow";
//if($cond != '')
//$qr1="select count(*) as total from tempdostlist ";
$qr1="SELECT COUNT(*) AS total FROM user ";
if($cond != " where")
{
$qr1 .= " $cond "."and user_status='1'";
}
else
{
$qr1 .= " $cond "."user_status='1'";
}
// echo $qr . '<br />' . $qr1;
//echo $qr;
if($regdate1 != "" && $regdate2 != ""){
echo " Date:".$regdate1." to ". $regdate2;
}
if($MinPopularity != "" && $MaxPopularity != ""){
echo " Popularity:".$MinPopularity." to ". $MaxPopularity;
}
if($age != ""){
if($age==1)
echo " Age: 15-23";
elseif($age==2)
echo " Age: 24-32";
else
echo " Age: 33+";
}
if($sex != ""){
if($sex==1)
echo " Gender: Female";
else
echo " Gender: Male";
}
if($mobileno != ""){
echo " Mobileno:".$mobileno;
}
if($dostid != ""){
echo " Dost ID:".$dostid;
}
?>
<script language="JavaScript">
function selectAll(source) {
//console.log('here');
checkboxes = document.getElementsByName('check_list[]');
for(var i=0, n=checkboxes.length;i<n;i++) {
checkboxes[i].checked = source.checked;
}
}
</script>
<table width="100%" border="1" cellspacing="1" cellpadding="0" style="border-collapse: collapse" bordercolor="#FF9933" align="center">
<b></b>
<center>
<tr align="center" class="headTitleRpt">
<th width="5%"><b>Sl No.</b></th>
<th width="10%"><b>DostId</b></th>
<th width="10%"><b>MobileNo</b></th>
<th width="5%"><b>Sex</b></th>
<th width="5%"><b>Age</b></th>
<th width="10%"><b>RegistrationDate</b></th>
<th width="12%"><b>Popularity</b></th>
<th width="8%"><b>BusyStatus</b></th>
<th width="15%"><b>Wave Graph</b></th>
<th width="10%"><b>Preview</b></th>
<th width="8%"><b>Delete</b></th>
<th width="8%"><b>Edit</b></th>
<th width="15%"><b>Send SMS</b></th>
<th width="5%"><b>MarkAll</b><input type="checkbox" onClick="selectAll(this)" /></th>
<th width="5%"><b>Details</b></th>
<!--<td width="8%"><b>-->
<?php
//echo $qr;
?>
<!-- </b></td>-->
</tr>
</center>
<b></b>
<form action="sendbulkSMS.php" onsubmit="sendBulkSMS('sendbulkSMS.php', id); return false;" method="post" name="checked_list" id="checked_list">
<?PHP
// echo $qr;
$rs = Sql_exec($cn,$qr);
$count=1;
$count=25*($pageno-1)+1;
while($dt = Sql_fetch_array($rs))
{
?>
<tr align="center" class="textRpt">
<td height="23"><?php echo $count++; ?></td>
<td ><?php echo $dostid = $dt['DostID']; ?></td>
<td><?php echo $mn = $dt['Mobileno']; ?></td>
<td><?php echo $sex1 = $dt['Gender'];?></td>
<td><?php echo $age1 = $dt['Age']; ?></td>
<td><?php echo $reg_date = $dt['RegDate']; ?></td>
<td><?php echo $popularity = $dt['popularity']; ?></td>
<td><?php echo $BusyStatus = $dt['BusyStatus']; ?></td>
<td class="style_prevu_kit">
<?php set_time_limit(0);
$path='..'.$dt['NickFile'];
$path=str_replace('\\'.'\\','/',$path);
$path=str_replace('/ismp/shared/','/',$path);
$url='http://localhost/shared/wavegraphplot/graphplotter.php?file='.$path;
file_get_contents($url);?>
<img src="<?php $waveiew= '/shared'.str_ireplace('wav','png',str_replace('..','',$path));
echo $waveiew; ?>" alt="Bad Format Audio" style="width:100px;height:55px;">
</td>
<?php $nickname = $dt['NickFile']; ?>
<td align="center">
<?php if($nickname!=''){ ?>
<a href="#" onClick="StartPlaying(350,200,'<?php echo $mn;?>');"><img src="images/speaker.jpg" alt="Preview" width="16" border="0"/></a>
<?php } else{ ?>
<p>No Nick</p>
<?php } ?>
</td>
<td align="center">
<?php if($nickname!=''){ ?>
<a href="#" title="Delete" alt="Delete" <?php echo "onclick=\"deleteNickFile('$dostid','$mn');\"" ?>
<div class="crossIcon">
<div class="firstPortion">
<div class="secondPortion">
</div>
</div>
</div>
</a>
<?php } ?>
</td>
<td align="center"><a href="#" <?php echo "onclick=\"ShowDetails(470,460,'$dostid','$mn','$sex1','$age1','$reg_date','$popularity','$BusyStatus');\"" ?>><img src="images/ico_edit.gif" alt="Edit" width="15" border="0"></a>
</td>
<td>
<a href="#" onclick="sendSMS('<?php echo $mn; ?>')">Send</a>
</td>
<td>
<input type="checkbox" name="check_list[]" id="mark" value="<?php echo $mn; ?>">
</td>
<td
align="center"><a href="#" <?php echo "onclick=\"Detailslog(470,460,'$dostid','$mn','$sex1','$age1','$reg_date','$popularity','$BusyStatus');\"" ?>><span>show</span></a>
</td>
</tr>
<?PHP
}/// While loop
?>
</table>
</br>
<input type="submit" style="float:right;"; name="submit" Value="Send SMS to Marked"/>
</form>
<?PHP
$rs1=Sql_exec($cn,$qr1);
Sql_fetch_array($rs1);
$totalcolumn = Sql_GetField($rs1,"total");
$totalpage = ceil($totalcolumn/$rowperpage);
echo "<br><center>";
if($pageno>1){
// cdrlogreport.php?textfield=$srcmn&checkbox=$chkbox&yr1=2008&mn1=10&dt1=16&yr2=2008&mn2=10&dt2=19&type=MMSG&Submit=Generate
echo "<a href='main.php?submit=Generate&popularity=$popularity&BusyStatus=$BusyStatus&sex=$sex&age=$age&mobileno=$mobileno&date1=$regdate1&date2=$regdate2&pageno=1&MaxPopularity=$MaxPopularity&MinPopularity=$MinPopularity'>".'First'."</a> ";
$prev = ($pageno-1);
echo "<a href='main.php?submit=Generate&popularity=$popularity&BusyStatus=$BusyStatus&sex=$sex&age=$age&mobileno=$mobileno&date1=$regdate1&date2=$regdate2&pageno=$prev&MaxPopularity=$MaxPopularity&MinPopularity=$MinPopularity'>".'Previous'."</a> ";
}
else{
echo "First Previous ";
}
for($i=1;$i<=$totalpage;$i++){
if($pageno<=3){
$startno=1;
$endno=5;
}
elseif($pageno>=($totalpage-2)){
$startno=$totalpage-4;
$endno=$totalpage;
}
else{
$startno=$pageno-2;
$endno=$pageno+2;
}
if($i>=$startno && $i<=$endno){
if($i==$pageno){
echo "<a href='main.php?submit=Generate&popularity=$popularity&BusyStatus=$BusyStatus&sex=$sex&age=$age&mobileno=$mobileno&date1=$regdate1&date2=$regdate2&pageno=$i&MaxPopularity=$MaxPopularity&MinPopularity=$MinPopularity'><b>".$i."</b></a> ";
}
else{
echo "<a href='main.php?submit=Generate&popularity=$popularity&BusyStatus=$BusyStatus&sex=$sex&age=$age&mobileno=$mobileno&date1=$regdate1&date2=$regdate2&pageno=$i&MaxPopularity=$MaxPopularity&MinPopularity=$MinPopularity'>".$i."</a> ";
}
}
}
if($pageno<$totalpage)
{
$next=$pageno+1;
echo "<a href='main.php?submit=Generate&popularity=$popularity&BusyStatus=$BusyStatus&sex=$sex&age=$age&mobileno=$mobileno&date1=$regdate1&date2=$regdate2&pageno=$next&MaxPopularity=$MaxPopularity&MinPopularity=$MinPopularity'>".'Next'."</a> ";
echo "<a href='main.php?submit=Generate&popularity=$popularity&BusyStatus=$BusyStatus&sex=$sex&age=$age&mobileno=$mobileno&date1=$regdate1&date2=$regdate2&pageno=$totalpage&MaxPopularity=$MaxPopularity&MinPopularity=$MinPopularity'>".'Last'."</a> ";
}
else{
echo "Next Last ";
}
echo "<br><br>";
echo "Total Pages - ".$totalpage;
echo "</center>";
}//////////////// IF submitted /////////////////////////////
ClosedDBConnection($cn);
?> </td>
</tr>
</table>
</body>
</html>