function changePassword()
 {
     $this->form_validation->set_rules('old', 'Old Password', 'required|xss_clean|trim');
     $this->form_validation->set_rules('password', 'Password', 'required|xss_clean|trim');
     $this->form_validation->set_rules('confirm', 'Confirm Password', 'required|xss_clean|trim');
     if ($this->form_validation->run() == FALSE) {
         $responce = array('status' => 0, 'isAlive' => TRUE, 'errors' => ajax_validation_errors());
         echo json_encode($responce);
     } else {
         if (isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST") {
             $vendorId = array('vendorId' => $this->input->post('vendorId'));
             $vendor = $this->input->post('vendorId');
             $old = md5($this->input->post('old'));
             $query = "SELECT * FROM (`vendorMaster`) WHERE `vendorId` =  '{$vendor}' AND `password` =  '{$old}' AND `active` =  '1'";
             $users = $this->main_content_model->customQuery($query);
             if ($users) {
                 $data['password'] = md5($this->input->post('password'));
                 $updateOptions = array('where' => $vendorId, 'data' => $data, 'table' => 'vendorMaster');
                 $passwordChange = $this->main_content_model->customUpdate($updateOptions);
                 if ($passwordChange) {
                     $responce = array('status' => 1, 'msg' => 'Your password is successfully changed');
                 } else {
                     $error = array("TopError" => "<strong>Your last password and new password are same.</strong>");
                     $responce = array('status' => 0, 'isAlive' => TRUE, 'errors' => $error);
                 }
             } else {
                 $error = array("TopError" => "<strong>Your old password is wrong.</strong>");
                 $responce = array('status' => 0, 'isAlive' => TRUE, 'errors' => $error);
             }
             echo json_encode($responce);
         }
     }
 }
Beispiel #2
0
 function partnerWithUs()
 {
     $this->form_validation->set_rules('partnerName', 'Name', 'required|xss_clean|trim');
     $this->form_validation->set_rules('partnerEmail', 'Email', 'required|xss_clean|trim');
     $this->form_validation->set_rules('partnerMobile', 'Phone', 'required|xss_clean|trim');
     $this->form_validation->set_rules('partnerLocation', 'Location', 'required|xss_clean|trim');
     $this->form_validation->set_rules('partnerService', 'Service', 'required');
     if ($this->form_validation->run() == FALSE) {
         $responce = array('status' => 0, 'isAlive' => TRUE, 'errors' => ajax_validation_errors());
         echo json_encode($responce);
     } else {
         if (isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST") {
             $data = $this->input->post();
             $services = $this->input->post('partnerService');
             $servicesId = implode(",", $services);
             unset($data['partnerService']);
             $data['partnerService'] = $servicesId;
             $data['createAt'] = date('Y-m-d H:i:s');
             $options = array('data' => $data, 'table' => 'partner');
             $id = $this->main_content_model->customInsert($options);
             $this->email->from('*****@*****.**', 'Team Froyofit');
             $this->email->to($this->input->post('partnerEmail'));
             $this->email->subject("Froyofit");
             $this->email->message("Dear {$this->input->post('partnerName')},\r\n                        \r\n                        Thank you for showing keen interest in joining us. To initiate further procedure of registration, our representative will soon get in touch with you. Meanwhile, you can follow us on below mentioned links\r\n                        \r\n                        Facebook : https://www.facebook.com/froyofit\r\n                        Twitter : https://twitter.com/FroyoFit\r\n                        Linkedin : https://www.linkedin.com/company/froyofit");
             $this->email->send();
             //                    Admin Mail
             $this->email->from('*****@*****.**', 'Team Froyofit');
             $this->email->to('*****@*****.**');
             $this->email->subject("Froyofit");
             $this->email->message("Dear admin, \r\n                        \r\n                        {$this->input->post('partnerName')} contacted you with following details:\r\n                            \r\n                        Name : {$this->input->post('partnerName')}\r\n                        Email id : {$this->input->post('partnerEmail')}\r\n                        Number : {$this->input->post('partnerMobile')}\r\n                        Location: {$this->input->post('partnerLocation')}\r\n                        Services: {$servicesId}\r\n                        Any other fitness related activity : {$this->input->post('otherServiceText')}\r\n                        \r\n                        ");
             $this->email->send();
             if ($id) {
                 $responce = array('status' => 1, 'msg' => 'Hey thanks for providing these details. We will come back to you. Ciao till then!');
             } else {
                 $error = array("TopError" => "<strong>Something went wrong while saving your data... sorry.</strong>");
                 $responce = array('status' => 0, 'isAlive' => TRUE, 'errors' => $error);
             }
             echo json_encode($responce);
         }
     }
 }
Beispiel #3
0
 function partnerWithUs()
 {
     $this->form_validation->set_rules('partnerName', 'Name', 'required|xss_clean|trim');
     $this->form_validation->set_rules('partnerEmail', 'Email', 'required|xss_clean|trim');
     $this->form_validation->set_rules('partnerMobile', 'Phone', 'required|xss_clean|trim');
     $this->form_validation->set_rules('partnerLocation', 'Location', 'required|xss_clean|trim');
     $this->form_validation->set_rules('partnerService', 'Service', 'required');
     if ($this->form_validation->run() == FALSE) {
         $responce = array('status' => 0, 'isAlive' => TRUE, 'errors' => ajax_validation_errors());
         echo json_encode($responce);
     } else {
         if (isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST") {
             $data = $this->input->post();
             $services = $this->input->post('partnerService');
             $servicesId = implode(",", $services);
             unset($data['partnerService']);
             $data['partnerService'] = $servicesId;
             $data['createAt'] = date('Y-m-d H:i:s');
             $options = array('data' => $data, 'table' => 'partner');
             $id = $this->main_content_model->customInsert($options);
             if ($id) {
                 $responce = array('status' => 1, 'msg' => 'Hey thanks for providing these details. We will come back to you. Ciao till then!');
             } else {
                 $error = array("TopError" => "<strong>Something went wrong while saving your data... sorry.</strong>");
                 $responce = array('status' => 0, 'isAlive' => TRUE, 'errors' => $error);
             }
             echo json_encode($responce);
         }
     }
 }