Subversion Repositories SmartDukaan

Rev

Rev 19804 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 19804 Rev 19812
Line 957... Line 957...
957
    		$this->loadModel('Retailer');
957
    		$this->loadModel('Retailer');
958
    		$this->Retailer->create();
958
    		$this->Retailer->create();
959
    		if ($retdata = $this->Retailer->save($retailer)) {
959
    		if ($retdata = $this->Retailer->save($retailer)) {
960
    			$this->Session->setFlash(__('The user has been saved'));
960
    			$this->Session->setFlash(__('The user has been saved'));
961
    			$callhistoryquery = "insert into callhistory (retailer_id,agent_id,mobile_number,call_type,sms_verified,call_time,duration_sec,last_fetch_time,call_disposition,disposition_description,disposition_comments,created) values (".$retdata['Retailer']['id'].",".$agentid.",'".$retailer['Retailer']['contact1']."','inbound',1,'".$cur_date."',0,'".$cur_date."','verified_link_sent','autosms of code will be sent','autosms of code will be sent','".$cur_date."')";
961
    			$callhistoryquery = "insert into callhistory (retailer_id,agent_id,mobile_number,call_type,sms_verified,call_time,duration_sec,last_fetch_time,call_disposition,disposition_description,disposition_comments,created) values (".$retdata['Retailer']['id'].",".$agentid.",'".$retailer['Retailer']['contact1']."','inbound',1,'".$cur_date."',0,'".$cur_date."','verified_link_sent','autosms of code will be sent','autosms of code will be sent','".$cur_date."')";
962
    			$contactquery = "insert into retailercontacts (retailer_id,agent_id,mobile_number,contact_type,call_type,created) values (".$retdata['Retailer']['id'].",".$agentid.",'".$retailer['Retailer']['contact1']."','sms','inbound','".date('Y-m-d h:i:s', time())."')";
962
    			$contactquery = "insert into retailercontacts (retailer_id,agent_id,mobile_number,contact_type,call_type,created) values (".$retdata['Retailer']['id'].",".$agentid.",'".$retailer['Retailer']['contact1']."','sms','inbound','".$cur_date."')";
963
    			$this->User->query($contactquery);
963
    			$this->User->query($contactquery);
964
    			$this->User->query($callhistoryquery);
964
    			$this->User->query($callhistoryquery);
965
    			$this->redirect('userretailer');
965
    			$this->redirect('userretailer');
966
    		} else {
966
    		} else {
967
    			$this->Session->setFlash(__('The user could not be saved. Please, try again.'));
967
    			$this->Session->setFlash(__('The user could not be saved. Please, try again.'));