/home/desid573/public_html/payment/pdd/app/Controller
NameSizeModeActions
Component/-0755rm
AppController.php19430644editdlrm
Component.zip55800644editdlrm
CustomersController.php36380644editdlrm
DashboardsController.php5420644editdlrm
PagesController.php19360644editdlrm
SettingsController.php11610644editdlrm
UsersController.php115140644editdlrm
Edit: /home/desid573/public_html/payment/pdd/app/Controller/CustomersController.php (3638B)
layout = 'employee'; $data = $this->Customer->find('all',array('conditions' => array('is_delete' => 0))); $this->set('customer',$data); } public function employee_addcustomer(){ $this->layout = 'employee'; if(!empty($this->request->data)){ if($this->Customer->save($this->request->data)){ $this->Session->setFlash("Customer SuccessFully Added"); $this->redirect(array('action' => 'customer')); } } } public function employee_editcustomer($id = null){ $this->layout = 'employee'; $customer = $this->Customer->find('first',array('conditions' => array('id' => $id))); $this->set('customer',$customer); if(!empty($this->request->data)){ $this->Customer->create(); $this->Customer->id=$id; if($this->Customer->save($this->request->data)){ $this->Session->setFlash("Customer SuccessFully Edited"); $this->redirect(array('action' => 'customer')); } } $this->request->data = $customer; $this->set('editcustomer',$customer); } public function employee_deletecustomer($id = null) { $this->Customer->id = $id; if (!$this->Customer->exists()) { throw new NotFoundException(__('Invalid Category')); } $status = $this->Customer->activedelete($id); $this->Session->setFlash("Customer SuccessFully Deleted"); $this->redirect(array('action' => 'customer')); } public function employee_payment(){ $this->loadModel('Payment'); $this->layout = 'employee'; $data=$this->Customer->find('list'); $this->set('customer',$data); $payment_data=$this->request->data; if(!empty($payment_data)){ $transactionId = $this->Eway->payment($payment_data); $transactionId = $this->Eway->payment($payment_data); if($transactionId!=0){ $transaction_data=array(); $transaction_data['transaction_id']=$transactionId; $transaction_data['customer_name']=$payment_data['CustomerCredit']['customer_id']; $transaction_data['driver_id']=$this->Auth->user('id'); $transaction_data['amount']=$payment_data['CustomerCredit']['amount']; if($this->Payment->save($transaction_data)){ $this->Session->setFlash("Transaction Occured SuccessFully!"); } } else{ $this->Session->setFlash("Error Occured In Transaction!"); } } /*else{ $this->Session->setFlash("Sorry Customer ALready Exist!"); } */ } public function employee_sendsms() { $this->layout = 'employee'; $this->loadModel('Message'); $data=$this->request->data; if(!empty($data)){ $contact_no=$data['Customer']['mobile']; $customer_name=$data['Customer']['name']; $is_customer=$this->Customer->find('all', array('conditions'=>array('Customer.mobile'=>$contact_no))); if(!$is_customer){ $data['Customer']['is_delete']=0; $this->Customer->save($data); $messageData=$this->Message->find('all', array('conditions'=>array('Message.type'=>'FIRST'))); $message=$messageData[0]['Message']['message']; $sms = $this->Twilio->sendmessage($message, $contact_no); $this->Session->setFlash("SMS Sent SuccessFully!"); } else{ $this->Session->setFlash("Sorry Customer ALready Exist!"); } } } } ?>