-
Notifications
You must be signed in to change notification settings - Fork 0
/
direct_telecalling.php
497 lines (480 loc) · 25.5 KB
/
direct_telecalling.php
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
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
<?php
include("includes/config.inc.php");
include("includes/crosssite.inc.php");
include("includes/simpleimage.php");
session_set_cookie_params(3600,"/");
session_start();
if ( isset ( $_GET['logout'] ) && $_GET['logout'] ==1 ) {
session_destroy();
header("location: index.php?token=".$token);
}
if (isset($_SESSION) && $_SESSION['login']=='')
{
session_destroy();
header("location: index.php?token=".$token);
}
$error =0;
if(isset($_POST['interested']))
{
$firstName = mysql_real_escape_string($_POST['firstName']);
$lastName = mysql_real_escape_string($_POST['lastName']);
$companyName = mysql_real_escape_string($_POST['companyName']);
$phone = mysql_real_escape_string($_POST['phone']);
$email = mysql_real_escape_string($_POST['email']);
$otherDetails = mysql_real_escape_string($_POST['otherDetails']);
$country = mysql_real_escape_string($_POST['country']);
$state = mysql_real_escape_string($_POST['state']);
$district = mysql_real_escape_string($_POST['district']);
$city = mysql_real_escape_string($_POST['city']);
$area = mysql_real_escape_string($_POST['area']);
$pin_code = mysql_real_escape_string($_POST['pin_code']);
$address = mysql_real_escape_string($_POST['address']);
$datasource = mysql_real_escape_string($_POST['datasource']);
$callingProduct = mysql_real_escape_string($_POST['callingProduct']);
$callingDate = mysql_real_escape_string($_POST['callingDate']);
$model = mysql_real_escape_string($_POST['model']);
$mobile = mysql_real_escape_string($_POST['mobile']);
$contactedStatus = mysql_real_escape_string($_POST['contactedStatus']);
$userId = $_SESSION['user_id'];
$branchId = $_SESSION['branch'];
// save Calling date
$checkDuplicate = mysql_query("SELECT `First_Name`,`Last_Name`,`Mobile` FROM `tblcallingdata` WHERE `First_Name`='$firstName' AND `Last_Name` = '$lastName' AND `Mobile`= '$mobile'");
if(mysql_num_rows($checkDuplicate) <= 0)
{
$sqlcallingData = "INSERT INTO `tblcallingdata` SET `First_Name` = '$firstName', `Last_Name` = '$lastName', `Company_Name` = '$companyName', `Address` = '$address',
`Area` = '$area', `City` = '$city', `District_id` = '$district', `State` = '$state', `Pin_code` = '$pin_code', `Country` = '$country', `Phone` = '$phone',
`Mobile` = '$mobile', `email` = '$email', `data_source` = '$datasource', `created`= Now(), `createdby` = '$userId',`status` ='1', `calling_status` = '1',
`contactedStatus` = '$contactedStatus'";
$callingDataResult = mysql_query($sqlcallingData);
$callingDataId = mysql_insert_id();
echo "<script> alert('Contact Added Successfully'); </script>";
}
else
{
echo "<script> alert('Contact already exits'); </script>";
}
// end save calling date
// assign contact branch
$checkDuplicate = mysql_query("SELECT * FROM tblassign WHERE callingdata_id='$chckvalue'");
if(mysql_num_rows($checkDuplicate) <= 0)
{
$sqlAssignBranch = "insert into tblassign set callingdata_id='$callingDataId', assign_by = '$userId',
callingcategory_id='$callingProduct', status_id='2', confirmBy = '$userId',
telecaller_id = '$userId', telecaller_assign_status = '1',
branch_id='$branchId',createdby='$userId',created=Now()";
$results = mysql_query($sqlAssignBranch);
}
else{
/*$_SESSION['sess_msg']="<span style='color:red;'>Lead already Assign</span>";*/
}
// end assing contact
}
// not contacted data save
if(isset($_POST['notContactedForm']))
{
$mobile = mysql_real_escape_string($_POST['mobile']);
$contactedStatus = mysql_real_escape_string($_POST['contactedStatus']);
$notcontactedRemark = mysql_real_escape_string($_POST['notcontactedRemark']);
$userId = $_SESSION['user_id'];
$sql = "INSERT INTO `tblcallingdata` SET `Mobile`= '$mobile', `contactedStatus`='$contactedStatus', `notContactedReason`='$notcontactedRemark',`created`=Now(), `createdby` = '$userId'";
$result = mysql_query($sql);
echo "<script> alert('Contact Added Successfully'); </script>";
}
// end not contacted
// not interested
if(isset($_POST['notInterested']))
{
$mobile = mysql_real_escape_string($_POST['mobile']);
$contactedStatus = mysql_real_escape_string($_POST['contactedStatus']);
$notInterestedReason = mysql_real_escape_string($_POST['notInterestedReason']);
$notInterestedremarks = mysql_real_escape_string($_POST['notInterestedremarks']);
$userId = $_SESSION['user_id'];
$sql = "INSERT INTO `tblcallingdata` SET `Mobile` = '$mobile',`contactedStatus` ='$contactedStatus'";
/*echo $sql;*/
$result = mysql_query($sql);
$id = mysql_insert_id();
$sql1 = "INSERT INTO `tbl_telecalling_status` Set `callingdata_id` = '$id', `not_interested_resason` = '$notInterestedReason',`remark_not_interested` = '$notInterestedremarks'";
/*echo $sql1;*/
$result1= mysql_query($sql1);
echo "<script> alert('Contact Added Successfully'); </script>";
}
// end not interested
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="images/ico.png" type="image/x-icon">
<title><?=SITE_PAGE_TITLE?></title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-submenu.min.css">
<link rel="stylesheet" href="css/custom.css">
<!--Datepicker-->
<link rel="stylesheet" type="text/css" href="css/jquery.datetimepicker.css"/>
<!--end-->
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="js/direct_telecalling_form_validate.js"></script>
<script src="js/ajax.js"></script>
<script src="js/combo_box.js"></script>
<script type="text/javascript">
function Contacted() {
/* alert("test");*/
document.getElementById("interest").style.display = "";
document.getElementById("notcontactedReason").style.display = "none";
}
function notContacted(){
/* alert("test");*/
document.getElementById("notcontactedReason").style.display = "";
document.getElementById("interest").style.display = "none";
document.getElementById("notinterested").style.display = "none";
document.getElementById("interested").style.display = "none";
}
function Interested(){
document.getElementById("interested").style.display = "";
document.getElementById("notinterested").style.display = "none";
}
function NotInterested(){
document.getElementById("notinterested").style.display = "";
document.getElementById("interested").style.display = "none";
}
var popUpObj;
function showModalPopUp() {
popUpObj = window.open("generate_ticket.php?id=<?php echo $row["callingdata_id"]; ?>&token=<?php echo $token ?>",
"ModalPopUp",
"toolbar=no," +
"scrollbars=no," +
"location=no," +
"statusbar=no," +
"menubar=no," +
"resizable=0," +
"width=800," +
"height=400," +
"left = 90," +
"top=300"
);
popUpObj.focus();
LoadModalDiv();
}
function CallState()
{
country = document.getElementById("country").value;
url="ajaxrequest/getstatelead.php?country="+country+"&token=<?php echo $token;?>";
/*alert(url);*/
xmlhttpPost(url,country,"GetState");
}
function GetState(str)
{
/*alert(str);*/
document.getElementById('Divstate').innerHTML=str;
}
function CallDistrict()
{
state = document.getElementById("state").value;
url="ajaxrequest/get_district_lead.php?state="+state+"&token=<?php echo $token;?>";
/*alert(url);*/
xmlhttpPost(url,state,"GetDistrict");
}
function GetDistrict(str)
{
/*alert(str);*/
document.getElementById('divdistrict').innerHTML=str;
}
function CallCity()
{
district = document.getElementById("district").value;
url="ajaxrequest/get_city_lead.php?district="+district+"&token=<?php echo $token;?>";
/*alert(url);*/
xmlhttpPost(url,state,"GetCity");
}
function GetCity(str)
{
/*alert(str);*/
document.getElementById('divcity').innerHTML=str;
}
function CallArea()
{
city = document.getElementById("city").value;
url="ajaxrequest/get_area_lead.php?city="+city+"&token=<?php echo $token;?>";
/*alert(url);*/
xmlhttpPost(url,city,"GetArea");
}
function GetArea(str)
{
/*alert(str);*/
document.getElementById('divarea').innerHTML=str;
}
function CallPincode()
{
area = document.getElementById("area").value;
url="ajaxrequest/getpincodelead.php?area="+area+"&token=<?php echo $token;?>";
/*alert(url);*/
xmlhttpPost(url,city,"GetPincode");
}
function GetPincode(str)
{
/*alert(str);*/
document.getElementById('divpincode').innerHTML=str;
}
</script>
</head>
<body>
<!--open of the wraper-->
<div id="wraper">
<!--include header-->
<?php include_once('includes/header.php');?>
<!--end-->
<!--open of the content-->
<div class="row" id="content">
<div class="col-md-12">
<h1>Telecalling Form</h1><br>
<hr>
</div>
<div class="clearfix"></div>
<div class="col-md-12" id="contactform"> <!--open of the single form-->
<div class="row">
<div class="col-md-12">
<form action="" method="post">
<input type="hidden" name="submitForm" value="yes" />
<input type='hidden' name='uid' id='uid'
value=""/>
<div class="form-group form_custom"><!-- form_custom -->
<div class="row"><!-- row -->
<div class="col-lg-6 col-sm-6 custom_field">
<span id="name" for="name"><strong>Mobile</strong> <i>*</i></span>
<input type="text" class="form-control" name="mobile" id="mobile">
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<!--<span><strong>Contacted / Not Contacted</strong> <i>*</i></span>
<select name="contactedStatus" id="contactedStatus" class="form-control">
<option value="">--Select--</option>
<option value="Mobile Siwtched Off">Mobile Siwtched Off</option>
<option value="Busy">Busy</option>
<option value="Not Answering">Not Answering</option>
<option value="Contact no does not exist">Contact no does not exist</option>
</select> -->
</div>
<div class="col-lg-12 col-sm-12 custom_field">
<input type="radio" name="contactedStatus" value="Contacted" id="contactec" onClick="Contacted();"/>
<strong> Contacted </strong>
<input type="radio" name="contactedStatus" value="Not Contacted" id="notconected" onClick="notContacted();"/>
<strong> Not Contacted </strong>
</div>
<div class="clearfix"></div>
<div class="col-lg-6 col-sm-6 custom_field" id="interest" style="display:none;">
<input type="radio" name="rdopt" value="Interested" id="single" onClick="Interested();" />
<strong> Interested </strong>
<input type="radio" name="rdopt" value="Not Interested" id="single" onClick="NotInterested();" />
<strong> Not Interested </strong>
</div>
<span id="notcontactedReason" style="display:none;">
<div class="col-lg-6 col-sm-6 custom_field" >
<span><strong>Reason</strong> <i>*</i></span>
<select name="notcontactedRemark" id="notcontactedRemark" class="form-control">
<option value="">Select Reason</option>
<option value="Busy">Busy</option>
<option value="Mobile Siwtched Off">Mobile Siwtched Off</option>
<option value="Not Answering">Not Answering</option>
<option value="Contact no does not exist">Contact no does not exist</option>
</select>
</div>
<div class="clearfix"></div>
<div class="form-group form_custom"><!-- form_custom -->
<div class="row">
<div class="col-lg-6 col-sm-6 custom_field">
<input type="submit" name="notContactedForm" id="notContactedForm" value="Submit" onClick = "return ValidateNotInterested();" class="btn btn-primary btn-sm">
<button type="reset" name="reset" id="reset" class="btn btn-primary btn-sm">Reset</button>
<button type="button" name="back" id="back" class="btn btn-primary btn-sm" onClick="window.location.href='telecalling_lead.php'">Back</button>
</div>
</div>
</div>
</span>
<div class="clearfix"></div>
<span id="interested" style="display:none;">
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>First Name</strong> <i>*</i></span>
<input type="text" name="firstName" id="firstName" value="" class="form-control">
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Last Name</strong> <i>*</i></span>
<input type="text" name="lastName" id="lastName" value="" class="form-control">
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Company Name</strong> <i>*</i></span>
<input type="text" name="companyName" id="companyName" value="" class="form-control">
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Phone</strong> <i>*</i></span>
<input type="text" name="phone" id="phone" value="" class="form-control">
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Email</strong> <i>*</i></span>
<input type="email" name="email" id="email" value="" class="form-control">
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Other Contact Details</strong> <i>*</i></span>
<input type="text" name="otherDetails" id="otherDetails" value="" class="form-control">
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Country</strong> <i>*</i></span>
<select name="country" id="country" class="form-control" onChange="return CallState(this.value)">
<option value="">Select Country</option>
<?php $Country=mysql_query("select * from tblcountry");
while($resultCountry=mysql_fetch_assoc($Country)){
?>
<option value="<?php echo $resultCountry['Country_id']; ?>" <?php if(isset($result['Country']) && $resultCountry['Country_id']==$result['Country']){ ?>selected<?php } ?>><?php echo stripslashes(ucfirst($resultCountry['Country_name'])); ?></option>
<?php } ?>
</select>
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>State</strong> <i>*</i></span>
<span id="Divstate">
<select name="state" id="state" onChange="return CallDistrict(this.value)" class="form-control">
<option value="">Select State</option>
</select>
</span>
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>District</strong> <i>*</i></span>
<span id="divdistrict">
<select name="district" id="district" class="form-control" onChange="return CallCity(this.value)">
<option value="">Select District</option>
</select>
</span>
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>City</strong> <i>*</i></span>
<span id="divcity">
<select name="city" id="city" onChange="return CallArea(this.value)" class="form-control" >
<option value="">Select City</option>
</select>
</span>
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Area</strong> <i>*</i></span>
<span id="divarea">
<select name="area" id="area" onChange="return CallPincode(this.value)" class="form-control">
<option value="">Select Area</option>
</select>
</span>
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Pincode</strong> <i>*</i></span>
<span id="divpincode">
<input name="pin_code" id="pin_code" class="form-control" value="" type="text" />
</span>
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Address</strong> <i>*</i></span>
<span id="divpincode">
<textarea class="form-control" name="address" id="address"></textarea>
</span>
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Data Source</strong> <i>*</i></span>
<select name="datasource" id="datasource" class="form-control">
<option label="" value="" selected="selected">Data Source</option>
<?php $Country=mysql_query("select * from tbldatasource");
while($resultCountry=mysql_fetch_assoc($Country)){
?>
<option value="<?php echo $resultCountry['datasource']; ?>" <?php if(isset($datasource) && $resultCountry['datasource']==$datasource){ ?>selected<?php } ?>><?php echo stripslashes(ucfirst($resultCountry['datasource'])); ?></option>
<?php } ?>
</select>
</div>
<div class="clearfix"></div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Calling Product</strong> <i>*</i></span>
<select name="callingProduct" id="callingProduct" class="form-control">
<option value="">Select Calling Product</option>
<?php $Country=mysql_query("SELECT * FROM `tblcallingcategory` ORDER BY `category`");
while($resultCountry=mysql_fetch_assoc($Country)){
?>
<option value="<?php echo $resultCountry['id']; ?>"><?php echo stripslashes(ucfirst($resultCountry['category'])); ?></option>
<?php } ?>
</select>
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Calling Date</strong> <i>*</i></span>
<input type="text" name="callingDate" id="callingDate" class="form-control date">
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Model</strong> <i>*</i></span>
<select name="model" id="model" class="form-control">
<option value="">Select</option>
<?php $Country=mysql_query("select * from tbldevicemodel order by model_name");
while($resultCountry=mysql_fetch_assoc($Country)){
?>
<option value="<?php echo $resultCountry['device_id']; ?>" <?php if(isset($result['device_model_id']) && $resultCountry['device_id']==$result['device_model_id']){ ?>selected<?php } ?>><?php echo stripslashes(ucfirst($resultCountry['model_name'])); ?></option>
<?php } ?>
</select>
</div>
<div class="clearfix"></div>
<div class="form-group form_custom"><!-- form_custom -->
<div class="row">
<div class="col-lg-6 col-sm-6 custom_field">
<input type="submit" name="interested" id="interested" value="Submit" onClick="return InterestedFormValidate();" class="btn btn-primary btn-sm">
<button type="reset" name="reset" id="reset" class="btn btn-primary btn-sm">Reset</button>
<button type="button" name="back" id="back" class="btn btn-primary btn-sm" onClick="window.location.href='telecalling_lead.php'">Back</button>
</div>
</div>
</div>
</span> <!--end interested section-->
<div class="clearfix"></div>
<span id="notinterested" style="display:none;">
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Reason</strong> <i>*</i></span>
<select name="notInterestedReason" id="notInterestedReason" class="form-control">
<option value="">Select </option>
<option value="Already Using Some Another Company GPS">Already Using Some Another Company GPS</option>
<option value="Rate Issue">Rate Issue</option>
<option value="Other">Other</option>
</select>
</div>
<div class="col-lg-6 col-sm-6 custom_field">
<span><strong>Remarks</strong> <i>*</i></span>
<input type="text" name="notInterestedremarks" id="notInterestedremarks" value="" class="form-control">
</div>
<div class="form-group form_custom"><!-- form_custom -->
<div class="row">
<div class="col-lg-6 col-sm-6 custom_field">
<input type="submit" name="notInterested" id="notInterested" onClick="return FormNotInterestedValidate();" value="Submit" class="btn btn-primary btn-sm">
<button type="reset" name="reset" id="reset" class="btn btn-primary btn-sm">Reset</button>
<button type="button" name="back" id="back" class="btn btn-primary btn-sm" onClick="window.location.href='telecalling_lead.php'">Back</button>
</div>
</div>
</div>
</span>
</div><!-- End row -->
</div><!--End form_custom -->
<div class="clearfix"></div>
</form>
</div>
</div><!-- /.row -->
</div>
<!--end single sim form-->
</div>
<!--end of the content-->
<!--open of the footer-->
<div class="row" id="footer">
<div class="col-md-12">
<p>Copyright © 2015 INDIAN TRUCKERS, All rights reserved.</p>
</div>
</div>
<!--end footer-->
</div>
<!--end wraper-->
<!-------Javascript------->
<script src="js/bootstrap.min.js"></script>
</body>
<script src="js/jquery.datetimepicker.js"></script>
<script>
$('.date').datetimepicker({
/*mask:'9999/19/39 29:59'*/
});
$('#follow_date').datetimepicker({
/*mask:'9999/19/39 29:59'*/
});
</script>
</html>