| Line 246... |
Line 246... |
| 246 |
$data = $this->request->data;
|
246 |
$data = $this->request->data;
|
| 247 |
$retId = $data['Retailer']['retId'];
|
247 |
$retId = $data['Retailer']['retId'];
|
| 248 |
$retcontact = $data['Retailer']['contact'];
|
248 |
$retcontact = $data['Retailer']['contact'];
|
| 249 |
$cur_date = date('Y-m-d h:i:s', time());
|
249 |
$cur_date = date('Y-m-d h:i:s', time());
|
| 250 |
if($data['type'] == "Verify"){
|
250 |
if($data['type'] == "Verify"){
|
| 251 |
$retquery ="update retailers set status = 'retailer_verified' , isvalidated = 1 where id = ".$retId."";
|
251 |
$retquery ="update retailers set status = 'retailer_verified' ,modified = '".$cur_date."' , isvalidated = 1 where id = ".$retId."";
|
| 252 |
$this->Retailer->query($retquery);
|
252 |
$this->Retailer->query($retquery);
|
| 253 |
}elseif($data['type'] == "Cancel"){
|
253 |
}elseif($data['type'] == "Cancel"){
|
| 254 |
$retquery ="update retailers set status = 'not_verified' , comments = '".$data['Retailer']['text']."' where id = ".$retId."";
|
254 |
$retquery ="update retailers set status = 'not_verified' ,modified = '".$cur_date."' , comments = '".$data['Retailer']['text']."' where id = ".$retId."";
|
| 255 |
$this->Retailer->query($retquery);
|
255 |
$this->Retailer->query($retquery);
|
| 256 |
|
256 |
|
| 257 |
$callhistoryquery = "insert into callhistory
|
257 |
$callhistoryquery = "insert into callhistory
|
| 258 |
(retailer_id,agent_id,mobile_number,call_type,sms_verified,call_time,duration_sec,
|
258 |
(retailer_id,agent_id,mobile_number,call_type,sms_verified,call_time,duration_sec,
|
| 259 |
last_fetch_time,call_disposition,disposition_description,disposition_comments,created)
|
259 |
last_fetch_time,call_disposition,disposition_description,disposition_comments,created)
|
| 260 |
values
|
260 |
values
|
| 261 |
(".$retId.",'2','".$retcontact."','verification',0,'".$cur_date."',0,'".$cur_date."',
|
261 |
(".$retId.",'2','".$retcontact."','verification',0,'".$cur_date."',0,'".$cur_date."',
|
| 262 |
'other','verification cancelled','verification cancelled','".$cur_date."')";
|
262 |
'other','verification cancelled','".$data['Retailer']['text']."','".$cur_date."')";
|
| 263 |
$this->Retailer->query($callhistoryquery);
|
263 |
$this->Retailer->query($callhistoryquery);
|
| 264 |
}elseif($data['type'] == "Pending"){
|
264 |
}elseif($data['type'] == "Pending"){
|
| 265 |
$retquery ="update retailers set comments = '".$data['Retailer']['text']."' where id = ".$retId."";
|
265 |
$retquery ="update retailers set comments = '".$data['Retailer']['text']."' ,modified = '".$cur_date."' where id = ".$retId."";
|
| 266 |
$this->Retailer->query($retquery);
|
266 |
$this->Retailer->query($retquery);
|
| 267 |
$callhistoryquery = "insert into callhistory
|
267 |
$callhistoryquery = "insert into callhistory
|
| 268 |
(retailer_id,agent_id,mobile_number,call_type,sms_verified,call_time,duration_sec,
|
268 |
(retailer_id,agent_id,mobile_number,call_type,sms_verified,call_time,duration_sec,
|
| 269 |
last_fetch_time,call_disposition,disposition_description,disposition_comments,created)
|
269 |
last_fetch_time,call_disposition,disposition_description,disposition_comments,created)
|
| 270 |
values
|
270 |
values
|
| 271 |
(".$retId.",'2','".$retcontact."','verification',0,'".$cur_date."',0,'".$cur_date."',
|
271 |
(".$retId.",'2','".$retcontact."','verification',0,'".$cur_date."',0,'".$cur_date."',
|
| 272 |
'other','verification still in process','verification still in process','".$cur_date."')";
|
272 |
'other','verification still in process','".$data['Retailer']['text']."','".$cur_date."')";
|
| 273 |
$this->Retailer->query($callhistoryquery);
|
273 |
$this->Retailer->query($callhistoryquery);
|
| 274 |
}
|
274 |
}
|
| 275 |
$this->redirect("pendingretailer");
|
275 |
$this->redirect("pendingretailer");
|
| 276 |
}
|
276 |
}
|
| 277 |
$options['conditions'] = array('id'=> $id);
|
277 |
$options['conditions'] = array('id'=> $id);
|