Commit c4787b65 by Tobin

dc

parent 64817b13
...@@ -531,5 +531,9 @@ class Api extends CI_Controller { ...@@ -531,5 +531,9 @@ class Api extends CI_Controller {
$this->errorResponse($res['code'],$res['message']); $this->errorResponse($res['code'],$res['message']);
} }
} }
public function verifyMail($unique_id = '') {
$res = $this->Api_model->verifyMail(array('unique_id'=>$unique_id));
}
} }
?> ?>
\ No newline at end of file
...@@ -5,7 +5,7 @@ class Booking extends CI_Controller { ...@@ -5,7 +5,7 @@ class Booking extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Booking_model'); $this->load->model('Booking_model');
if(!$this->session->userdata('logged_in')) { if(!$this->session->userdata('logged_in')) {
......
...@@ -5,7 +5,7 @@ class CMS extends CI_Controller { ...@@ -5,7 +5,7 @@ class CMS extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Cms_model'); $this->load->model('Cms_model');
if(!$this->session->userdata('logged_in')) { if(!$this->session->userdata('logged_in')) {
...@@ -102,12 +102,15 @@ class CMS extends CI_Controller { ...@@ -102,12 +102,15 @@ class CMS extends CI_Controller {
if(!isset($_POST['forgot_sms']) || empty($_POST['forgot_sms'])){ if(!isset($_POST['forgot_sms']) || empty($_POST['forgot_sms'])){
unset($_POST['forgot_sms']); unset($_POST['forgot_sms']);
} }
if(!isset($_POST['registration_mail']) || empty($_POST['registration_mail'])){ if(!isset($_POST['verify_mail']) || empty($_POST['verify_mail'])){
unset($_POST['registration_mail']); unset($_POST['verify_mail']);
} }
if(!isset($_POST['registration_sms']) || empty($_POST['registration_sms'])){ if(!isset($_POST['registration_sms']) || empty($_POST['registration_sms'])){
unset($_POST['registration_sms']); unset($_POST['registration_sms']);
} }
if(!isset($_POST['registration_mail']) || empty($_POST['registration_mail'])){
unset($_POST['registration_mail']);
}
if(!isset($_POST['checker_activation_mail']) || empty($_POST['checker_activation_mail'])){ if(!isset($_POST['checker_activation_mail']) || empty($_POST['checker_activation_mail'])){
unset($_POST['checker_activation_mail']); unset($_POST['checker_activation_mail']);
} }
......
...@@ -5,7 +5,7 @@ class Category extends CI_Controller { ...@@ -5,7 +5,7 @@ class Category extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Category_model'); $this->load->model('Category_model');
$this->load->model('Dashboard_model'); $this->load->model('Dashboard_model');
......
...@@ -5,7 +5,7 @@ class Checker extends CI_Controller { ...@@ -5,7 +5,7 @@ class Checker extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Checker_model'); $this->load->model('Checker_model');
$this->load->model('Provider_model'); $this->load->model('Provider_model');
...@@ -75,6 +75,22 @@ class Checker extends CI_Controller { ...@@ -75,6 +75,22 @@ class Checker extends CI_Controller {
$_POST['provider_id'] = $provider_id; $_POST['provider_id'] = $provider_id;
$status = $this->Checker_model->createChecker($_POST); $status = $this->Checker_model->createChecker($_POST);
if($status == 1){ if($status == 1){
$this->load->model('Api_model');
$subject = "Your TimeOut Checker Account is now activated";
$template = getNotifTemplate();
$message = "<html>
<body>
Your Checker Account for the username
<strong>".$_POST['username']."</strong> is now activated.
</body>
</html>";
if(isset($template['checker_activation_mail']) && !empty($template['checker_activation_mail'])){
$message = str_replace(array('{:user_name}'),array($email_id),
$template['checker_activation_mail']);
}
$this->Api_model->send_mail($subject,$_POST['username'],$message);
$flashMsg['class'] = 'success'; $flashMsg['class'] = 'success';
$flashMsg['message'] = 'Checker Created'; $flashMsg['message'] = 'Checker Created';
......
...@@ -5,7 +5,7 @@ class Customer extends CI_Controller { ...@@ -5,7 +5,7 @@ class Customer extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Customer_model'); $this->load->model('Customer_model');
if(!$this->session->userdata('logged_in')) { if(!$this->session->userdata('logged_in')) {
...@@ -115,6 +115,7 @@ class Customer extends CI_Controller { ...@@ -115,6 +115,7 @@ class Customer extends CI_Controller {
redirect(base_url('Customer/addCustomer')); redirect(base_url('Customer/addCustomer'));
} }
$temp_password = rand(10000000, 99999999); $temp_password = rand(10000000, 99999999);
$_POST['dob'] = strtotime($_POST['dob'])*1000;
$_POST['password'] = md5($temp_password); $_POST['password'] = md5($temp_password);
$status = $this->Customer_model->addCustomer($_POST); $status = $this->Customer_model->addCustomer($_POST);
if($status == 1){ if($status == 1){
...@@ -127,13 +128,12 @@ class Customer extends CI_Controller { ...@@ -127,13 +128,12 @@ class Customer extends CI_Controller {
$message = "<html> $message = "<html>
<body> <body>
Hi,\n\r Welcome to TimeOut. \r\n Please use username: Hi,\n\r Welcome to TimeOut. \r\n Please use username:
".$_POST['email']." and Password: ".$temp_password." ".$_POST['email']." for access your account <br>
for access your account <br>
</body> </body>
</html>"; </html>";
if(isset($template['registration_mail']) && !empty($template['registration_mail'])){ if(isset($template['registration_mail']) && !empty($template['registration_mail'])){
$message = str_replace(array('{:email}','{:password}'),array($email_id,$temp_password), $message = str_replace(array('{:email}'),array($email_id),
$template['registration_mail']); $template['registration_mail']);
} }
...@@ -224,6 +224,7 @@ class Customer extends CI_Controller { ...@@ -224,6 +224,7 @@ class Customer extends CI_Controller {
redirect(base_url('Customer/editCustomers/'.$customer_id)); redirect(base_url('Customer/editCustomers/'.$customer_id));
} }
$_POST['dob'] = strtotime($_POST['dob'])*1000;
$status = $this->Customer_model->updateCustomer(decode_param($customer_id),$_POST); $status = $this->Customer_model->updateCustomer(decode_param($customer_id),$_POST);
if($status == 1){ if($status == 1){
$flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success'); $flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
......
...@@ -5,7 +5,7 @@ class Dashboard extends CI_Controller { ...@@ -5,7 +5,7 @@ class Dashboard extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Dashboard_model'); $this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) { if(!$this->session->userdata('logged_in')) {
......
...@@ -5,7 +5,7 @@ class Event extends CI_Controller { ...@@ -5,7 +5,7 @@ class Event extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Event_model'); $this->load->model('Event_model');
$this->load->model('Dashboard_model'); $this->load->model('Dashboard_model');
......
...@@ -5,7 +5,7 @@ class Host extends CI_Controller { ...@@ -5,7 +5,7 @@ class Host extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Host_model'); $this->load->model('Host_model');
$this->load->model('Dashboard_model'); $this->load->model('Dashboard_model');
......
...@@ -5,7 +5,7 @@ class Login extends CI_Controller { ...@@ -5,7 +5,7 @@ class Login extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->helper(array('form')); $this->load->helper(array('form'));
$this->load->model('login_model'); $this->load->model('login_model');
$this->load->helper('security'); $this->load->helper('security');
......
...@@ -5,7 +5,7 @@ class Logout extends CI_Controller { ...@@ -5,7 +5,7 @@ class Logout extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
if(!$this->session->userdata('logged_in')) { if(!$this->session->userdata('logged_in')) {
redirect(base_url()); redirect(base_url());
......
...@@ -5,7 +5,7 @@ class Provider extends CI_Controller { ...@@ -5,7 +5,7 @@ class Provider extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Provider_model'); $this->load->model('Provider_model');
if(!$this->session->userdata('logged_in')) { if(!$this->session->userdata('logged_in')) {
...@@ -144,6 +144,27 @@ class Provider extends CI_Controller { ...@@ -144,6 +144,27 @@ class Provider extends CI_Controller {
$status = $this->Provider_model->addProvider($_POST); $status = $this->Provider_model->addProvider($_POST);
if($status == 1){ if($status == 1){
$this->load->model('Api_model');
$subject = "Your Organizer Account is now activated";
$email_id = $_POST['email'];
$template = getNotifTemplate();
$message = "<html>
<body>
Your Organizer Account for the username
<strong>".$providerData->username."</strong> is now activated. Please use this link for access your account
<a href='".base_url()."'>".base_url()."</a><br>
</body>
</html>";
if(isset($template['provider_activation_mail']) &&
!empty($template['provider_activation_mail'])){
$message = str_replace(array('{:user_name}','{:url}'),
array($email_id,base_url()),
$template['provider_activation_mail']);
}
$this->Api_model->send_mail($subject,$email_id,$message);
$flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success'); $flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Provider/viewProviders')); redirect(base_url('Provider/viewProviders'));
......
...@@ -5,7 +5,7 @@ class Region extends CI_Controller { ...@@ -5,7 +5,7 @@ class Region extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Region_model'); $this->load->model('Region_model');
$this->load->model('Dashboard_model'); $this->load->model('Dashboard_model');
......
...@@ -5,7 +5,7 @@ class Settings extends CI_Controller { ...@@ -5,7 +5,7 @@ class Settings extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Settings_model'); $this->load->model('Settings_model');
$this->load->model('Dashboard_model'); $this->load->model('Dashboard_model');
......
...@@ -5,7 +5,7 @@ class Tag extends CI_Controller { ...@@ -5,7 +5,7 @@ class Tag extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Tag_model'); $this->load->model('Tag_model');
$this->load->model('Dashboard_model'); $this->load->model('Dashboard_model');
......
...@@ -5,7 +5,7 @@ class User extends CI_Controller { ...@@ -5,7 +5,7 @@ class User extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('User_model'); $this->load->model('User_model');
$this->load->model('Dashboard_model'); $this->load->model('Dashboard_model');
......
...@@ -5,7 +5,7 @@ class Venue extends CI_Controller { ...@@ -5,7 +5,7 @@ class Venue extends CI_Controller {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
date_default_timezone_set("Asia/Kolkata"); date_default_timezone_set("Asia/Riyadh");
$this->load->model('Venue_model'); $this->load->model('Venue_model');
$this->load->model('Dashboard_model'); $this->load->model('Dashboard_model');
......
...@@ -8,7 +8,8 @@ class Api_model extends CI_Model { ...@@ -8,7 +8,8 @@ class Api_model extends CI_Model {
public function login($data){ public function login($data){
try{ try{
$this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city,customer.dob'); $this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image
AS image,customer.gender,users.id AS userId,customer.city,customer.dob,customer.email_verified');
$this->db->where('users.status',1); $this->db->where('users.status',1);
$this->db->where('users.password',md5($data['password'])); $this->db->where('users.password',md5($data['password']));
$this->db->where('customer.email',$data['email_id']); $this->db->where('customer.email',$data['email_id']);
...@@ -16,11 +17,16 @@ class Api_model extends CI_Model { ...@@ -16,11 +17,16 @@ class Api_model extends CI_Model {
$this->db->join('customer','customer.customer_id = users.id'); $this->db->join('customer','customer.customer_id = users.id');
$result = $this->db->get()->row(); $result = $this->db->get()->row();
if($result){ if($result){
if(isset($result->email_verified) && $result->email_verified == '1'){
$result->dob = (!empty($result->dob))?date("m/d/Y",$result->dob/1000):''; $result->dob = (!empty($result->dob))?date("m/d/Y",$result->dob/1000):'';
$result->auth_token = md5(microtime().rand()); $result->auth_token = md5(microtime().rand());
$this->generateAuth($result->userId,$result->auth_token); $this->generateAuth($result->userId,$result->auth_token);
$res = array('status'=>1,'data'=>$result); $res = array('status'=>1,'data'=>$result);
} else { } else {
$res = array('status'=>0,'message'=>'Verify Your E-Mail','code'=>'ER07');
}
} else {
$res = array('status'=>0,'message'=>'Invalid username / Password','code'=>'ER05'); $res = array('status'=>0,'message'=>'Invalid username / Password','code'=>'ER05');
} }
} catch(Exception $e) { } catch(Exception $e) {
...@@ -37,8 +43,12 @@ class Api_model extends CI_Model { ...@@ -37,8 +43,12 @@ class Api_model extends CI_Model {
try{ try{
$email = $data['email_id']; $email = $data['email_id'];
$phone = $data['phone']; $phone = $data['phone'];
$res_count = $this->db->query("SELECT * FROM customer INNER JOIN `users` ON users.id = customer.customer_id AND users.user_type = 3 WHERE users.status = 1 AND (customer.email = '$email' OR customer.phone LIKE '%$phone')")->row(); $res_count =
//$res_count = $this->db->where('email',$data['email_id'])->where()->or_where('phone',$data['phone'])->get('customer')->row(); $this->db->query("SELECT * FROM customer
INNER JOIN `users` ON users.id=customer.customer_id AND users.user_type='3'
WHERE users.status!='2' AND
(customer.email = '$email' OR customer.phone LIKE '%$phone')")->row();
if(count($res_count) > 0) { if(count($res_count) > 0) {
if($res_count->email == $data['email_id'] && $res_count->phone == $data['phone']){ if($res_count->email == $data['email_id'] && $res_count->phone == $data['phone']){
$res = array('status'=>0,'message'=>'Already have an account with email id and phone no. Please login','code'=>'ER12'); $res = array('status'=>0,'message'=>'Already have an account with email id and phone no. Please login','code'=>'ER12');
...@@ -48,16 +58,14 @@ class Api_model extends CI_Model { ...@@ -48,16 +58,14 @@ class Api_model extends CI_Model {
$res = array('status'=>0,'message'=>'Phone no already exists','code'=>'ER10'); $res = array('status'=>0,'message'=>'Phone no already exists','code'=>'ER10');
} }
} else { } else {
$unique_id = uniqid().time();
$temp_password = $data['password']; $temp_password = $data['password'];
$data['password'] = md5($data['password']); $data['password'] = md5($data['password']);
$user_data = array( $user_data = array('password'=>$data['password'],'display_name'=>'Customer','user_type'=>3);
'password'=>$data['password'],
'display_name'=>'Customer',
'user_type'=> 3
);
$this->db->insert('users',$user_data); $this->db->insert('users',$user_data);
$id = $this->db->insert_id(); $id = $this->db->insert_id();
if($id) { if($id) {
if(strpos($data['phone'],'+') === true){ if(strpos($data['phone'],'+') === true){
$data['phone'] = str_replace('+','',$data['phone']); $data['phone'] = str_replace('+','',$data['phone']);
...@@ -66,43 +74,43 @@ class Api_model extends CI_Model { ...@@ -66,43 +74,43 @@ class Api_model extends CI_Model {
$data['phone'] = '966'.$data['phone']; $data['phone'] = '966'.$data['phone'];
} }
$customer_data = array('customer_id'=>$id,'phone'=>$data['phone'], $customer_data = array('customer_id'=>$id,'phone'=>$data['phone'],'email_verified'=>'0',
'email'=>$data['email_id'],'name'=>$data['name']); 'email'=>$data['email_id'],'name'=>$data['name'],
'confirm_link'=>$unique_id);
$this->db->insert('customer', $customer_data); $this->db->insert('customer', $customer_data);
$subject = "New account created successfully"; $subject = "TimeOut, Verify your account";
$email_id = $data['email_id']; $email_id = $data['email_id'];
$reset_link = 'https://projects.nuvento.com/admin/Api/verifyMail/'.$unique_id;
$message = "<html> $message = "<html>
<body> <body>
Hi,\n\r Welcome to TimeOut. \r\n Please use username: Hi,\n\r Welcome to TimeOut. \r\n Please Verify your E-mail for the username: ".$email_id.". User the following link verify your account ".$reset_link.".
".$email_id." and Password: ".$temp_password."
for access your account <br>
</body> </body>
</html>"; </html>";
$template = getNotifTemplate(); $template = getNotifTemplate();
if(isset($template['registration_mail']) && !empty($template['registration_mail'])){ if(isset($template['verify_mail']) && !empty($template['verify_mail'])){
$message = str_replace(array('{:email}','{:password}'), $message = str_replace(array('{:user_name}','{:reset_link}'),
array($email_id,$temp_password), array($email_id,$reset_link),
$template['registration_mail']); $template['verify_mail']);
} }
$this->send_mail($subject,$email_id,$message); $this->send_mail($subject,$email_id,$message);
$this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city'); $res = array('status'=>1,'data'=>'');
$this->db->where('users.id',$id);
$this->db->from('users'); // $this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city');
$this->db->join('customer','customer.customer_id = users.id'); // $this->db->where('users.id',$id);
$result = $this->db->get()->row(); // $this->db->from('users');
if($result){ // $this->db->join('customer','customer.customer_id = users.id');
$result->dob = (!empty($result->dob))?date("m/d/Y",$result->dob/1000):''; // $result = $this->db->get()->row();
$result->auth_token = md5(microtime().rand()); // if($result){
$this->generateAuth($result->userId,$result->auth_token); // $result->dob = (!empty($result->dob))?date("m/d/Y",$result->dob/1000):'';
$res = array('status'=>1,'data'=>$result); // $result->auth_token = md5(microtime().rand());
} else { // $this->generateAuth($result->userId,$result->auth_token);
$res = array('status'=>0,'message'=>'No record found','code'=>'ER13'); // $res = array('status'=>1,'data'=>$result,'message'=>'An activation Email has been set to your mail id');
} // } else {
// $res = array('status'=>0,'message'=>'No record found','code'=>'ER13');
// }
} else { } else {
$res = array('status'=>0,'message'=>'Registration failed please try again','code'=>'ER11'); $res = array('status'=>0,'message'=>'Registration failed please try again','code'=>'ER11');
} }
...@@ -159,7 +167,7 @@ class Api_model extends CI_Model { ...@@ -159,7 +167,7 @@ class Api_model extends CI_Model {
$message = str_replace(array('{:url}'),array($url),$template['forgot_mail']); $message = str_replace(array('{:url}'),array($url),$template['forgot_mail']);
} }
$result = $this->send_mail($subject,$email,$message); $result = $this->send_mail($subject,$data['email_id'],$message);
if($result){ if($result){
$res = array('status'=>1,'data'=>null); $res = array('status'=>1,'data'=>null);
} else { } else {
...@@ -1077,11 +1085,14 @@ class Api_model extends CI_Model { ...@@ -1077,11 +1085,14 @@ class Api_model extends CI_Model {
public function reset_password($data){ public function reset_password($data){
try{ try{
$cust = $this->db->get_where('customer',array('reset_key'=>$data['reset_key']))->row_array(); $cust = $this->db->query("SELECT CUST.customer_id FROM customer AS CUST
INNER JOIN users AS USER ON (USER.id=CUST.customer_id)
WHERE CUST.reset_key='".$data['reset_key']."' AND USER.status!='2'");
if(!empty($cust)){ if(!empty($cust)){
if($this->db->update('users',array('password'=>md5($data['password'])),array('id'=>$cust['customer_id']))){ $cust = $cust->row_array();
$this->db->update('customer', if($this->db->update('users',array('password'=>md5($data['password'])),
array('reset_key'=>''), array('id'=>$cust['customer_id']))){
$this->db->update('customer',array('reset_key'=>''),
array('customer_id'=>$cust['customer_id'])); array('customer_id'=>$cust['customer_id']));
$res= array('status'=>1,'data'=>'Password Updated Successfully'); $res= array('status'=>1,'data'=>'Password Updated Successfully');
}else{ }else{
...@@ -1095,5 +1106,21 @@ class Api_model extends CI_Model { ...@@ -1095,5 +1106,21 @@ class Api_model extends CI_Model {
} }
return $res; return $res;
} }
public function verifyMail($data = ''){
try{
$cust = $this->db->query("SELECT CUST.customer_id FROM customer AS CUST
INNER JOIN users AS USER ON (USER.id=CUST.customer_id)
WHERE CUST.confirm_link='".$data['unique_id']."' AND USER.status!='2'");
if(!empty($cust)){
$cust = $cust->row_array();
if($this->db->update('customer',array('confirm_link'=>'','email_verified'=>'1'),
array('customer_id'=>$cust['customer_id']))){
header('Location:https://projects.nuvento.com/location?login=1');
}
}
}catch(Exception $e){}
header('Location:https://projects.nuvento.com/location');
}
} }
?> ?>
...@@ -12,7 +12,6 @@ class Checker_model extends CI_Model { ...@@ -12,7 +12,6 @@ class Checker_model extends CI_Model {
FROM checker AS CHK FROM checker AS CHK
INNER JOIN provider AS PRV ON (CHK.provider_id=PRV.provider_id) INNER JOIN provider AS PRV ON (CHK.provider_id=PRV.provider_id)
WHERE $cond"); WHERE $cond");
return $checkerData->result(); return $checkerData->result();
} }
......
...@@ -17,7 +17,17 @@ class Customer_model extends CI_Model { ...@@ -17,7 +17,17 @@ class Customer_model extends CI_Model {
$customerData = $this->db->query($sql); $customerData = $this->db->query($sql);
if(!empty($customerData)){ if(!empty($customerData)){
return (empty($customer_id))?$customerData->result():$customerData->row(); if(empty($customer_id)){
$custData = $customerData->result();
foreach ($custData AS $key => $value) {
$custData[$key]->dob = date("m/d/Y",$value->dob/1000);
}
return $custData;
} else {
$custData = $customerData->row();
$custData->dob = date("m/d/Y",$custData->dob/1000);
return $custData;
}
} }
return 0; return 0;
} }
...@@ -27,17 +37,20 @@ class Customer_model extends CI_Model { ...@@ -27,17 +37,20 @@ class Customer_model extends CI_Model {
return 0; return 0;
$userNameChk = $this->db->query("SELECT * FROM users $userNameChk = $this->db->query("SELECT * FROM users
WHERE status!='2' AND username='".$customer_data['email']."'"); WHERE status!='2' AND username='".$customer_data['email']."' AND
user_type='3'");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 4; if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 4;
$emailChk = $this->db->query("SELECT * FROM customer AS CUST $emailChk = $this->db->query("SELECT * FROM customer AS CUST
INNER JOIN users AS USR ON (USR.id=CUST.customer_id) INNER JOIN users AS USR ON (USR.id=CUST.customer_id)
WHERE USR.status!='2' AND CUST.email='".$customer_data['email']."'"); WHERE USR.status!='2' AND CUST.email='".$customer_data['email']."' AND
USR.user_type='3'");
if(!empty($emailChk) && $emailChk->num_rows() > 0) return 2; if(!empty($emailChk) && $emailChk->num_rows() > 0) return 2;
$phoneChk = $this->db->query("SELECT * FROM customer AS CUST $phoneChk = $this->db->query("SELECT * FROM customer AS CUST
INNER JOIN users AS USR ON (USR.id=CUST.customer_id) INNER JOIN users AS USR ON (USR.id=CUST.customer_id)
WHERE USR.status!='2' AND CUST.phone='".$customer_data['phone']."'"); WHERE USR.status!='2' AND CUST.phone='".$customer_data['phone']."' AND
USR.user_type='3'");
if(!empty($phoneChk) && $phoneChk->num_rows() > 0) return 3; if(!empty($phoneChk) && $phoneChk->num_rows() > 0) return 3;
$status = $this->db->insert('users', $status = $this->db->insert('users',
......
...@@ -226,6 +226,7 @@ class Validation_model extends CI_Model { ...@@ -226,6 +226,7 @@ class Validation_model extends CI_Model {
) , ) ,
) , ) ,
) , ) ,
'verifyMail' => array() ,
'search' => array( 'search' => array(
/*'auth_token' => array( /*'auth_token' => array(
'required' => array( 'required' => array(
...@@ -377,9 +378,6 @@ class Validation_model extends CI_Model { ...@@ -377,9 +378,6 @@ class Validation_model extends CI_Model {
} }
} }
break; break;
default: default:
# code... # code...
break; break;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <div class="form-group">
<label>Registration Mail</label> <label>Registration Mail</label>
<p>Email => {:email} , Password => {:password}</p> <p>Email => {:email}</p>
<textarea id="rich_editor" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Registration Mail" name="registration_mail" style="height:108px;" data-parsley-trigger="change"><?= $notificationData->registration_mail ?></textarea> <textarea id="rich_editor" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Registration Mail" name="registration_mail" style="height:108px;" data-parsley-trigger="change"><?= $notificationData->registration_mail ?></textarea>
</div> </div>
</div> </div>
...@@ -66,6 +66,17 @@ ...@@ -66,6 +66,17 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-sm-12">
<div class="col-sm-6">
<div class="form-group">
<label>Registration Verification Mail</label>
<p>Username => {:user_name} , Reset Link => {:reset_link}</p>
<textarea id="rich_editor_8" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Checker Activation Mail" name="verify_mail"
style="height:108px;" data-parsley-trigger="change"><?= $notificationData->verify_mail ?></textarea>
</div>
</div>
</div>
</div> </div>
<div class="box-header with-border"> <div class="box-header with-border">
......
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
<thead> <thead>
<tr> <tr>
<th class="hidden">ID</th> <th class="hidden">ID</th>
<th width="120px;">Organizer</th> <th width="100px;">Organizer</th>
<th width="120px;">User Name</th> <th width="100px;">User Name</th>
<th width="130px;">Email_id</th> <th width="110px;">Email_id</th>
<th width="80px;">Phone</th> <th width="70px;">Phone</th>
<th width="60px;">Status</th> <th width="60px;">Status</th>
<th width="520px;">Action</th> <th width="520px;">Action</th>
</tr> </tr>
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
if(jQuery('#rich_editor_1').length==1){CKEDITOR.replace('rich_editor_1'); } if(jQuery('#rich_editor_1').length==1){CKEDITOR.replace('rich_editor_1'); }
if(jQuery('#rich_editor_2').length==1){CKEDITOR.replace('rich_editor_2'); } if(jQuery('#rich_editor_2').length==1){CKEDITOR.replace('rich_editor_2'); }
if(jQuery('#rich_editor_6').length==1){CKEDITOR.replace('rich_editor_6'); } if(jQuery('#rich_editor_6').length==1){CKEDITOR.replace('rich_editor_6'); }
if(jQuery('#rich_editor_8').length==1){CKEDITOR.replace('rich_editor_8'); }
if(jQuery('#rich_editor_3').length==1){CKEDITOR.replace('rich_editor_3',{language:'ar'});} if(jQuery('#rich_editor_3').length==1){CKEDITOR.replace('rich_editor_3',{language:'ar'});}
if(jQuery('#rich_editor_4').length==1){CKEDITOR.replace('rich_editor_4',{language:'ar'});} if(jQuery('#rich_editor_4').length==1){CKEDITOR.replace('rich_editor_4',{language:'ar'});}
......
...@@ -501,7 +501,6 @@ jQuery('[id="viewCustomer"]').on('click',function() { ...@@ -501,7 +501,6 @@ jQuery('[id="viewCustomer"]').on('click',function() {
case '2': gender = 'Female';break; case '2': gender = 'Female';break;
case '3': gender = 'Others';break; case '3': gender = 'Others';break;
} }
var html = '<div class="col-xs-12">'+ var html = '<div class="col-xs-12">'+
'<div class="col-md-2">'+ '<div class="col-md-2">'+
'<div class="row">'+ '<div class="row">'+
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment