Commit 3bd08006 by Tobin

dc

parent 73d6668f
...@@ -114,9 +114,25 @@ class Customer extends CI_Controller { ...@@ -114,9 +114,25 @@ class Customer extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg); $this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/addCustomer')); redirect(base_url('Customer/addCustomer'));
} }
$temp_password = rand(10000000, 99999999);
$_POST['password'] = md5($temp_password);
$status = $this->Customer_model->addCustomer($_POST); $status = $this->Customer_model->addCustomer($_POST);
if($status == 1){ if($status == 1){
$this->load->model('Api_model');
$subject = "Your TimeOut Account is now activated";
$email_id = $_POST['email'];
$template = getNotifTemplate();
$message .= "<html>
<body>
Hi,\n\r Welcome to TimeOut. \r\n Please use username:
".$_POST['email']." and Password: ".$temp_password."
for access your account <br>
".$template['registration_mail']."
</body>
</html>";
$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('Customer/viewCustomers')); redirect(base_url('Customer/viewCustomers'));
......
...@@ -1037,12 +1037,12 @@ class Api_model extends CI_Model { ...@@ -1037,12 +1037,12 @@ class Api_model extends CI_Model {
$this->db->update('customer', $this->db->update('customer',
array('reset_key'=>''), array('reset_key'=>''),
array('customer_id'=>$cust['customer_id'])); array('customer_id'=>$cust['customer_id']));
$res= array('status'=>1,'data'=>'Success'); $res= array('status'=>1,'data'=>'Password Updated Successfully');
}else{ }else{
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER24'); $res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER24');
} }
} else { } else {
$res = array('status'=>0,'message'=>'User Doesn\'t Exist','code'=>'ER25'); $res = array('status'=>0,'message'=>'Sorry, Reset Key Expired','code'=>'ER25');
} }
}catch(Exception $e){ }catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); $res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
......
...@@ -42,6 +42,7 @@ class Customer_model extends CI_Model { ...@@ -42,6 +42,7 @@ class Customer_model extends CI_Model {
$status = $this->db->insert('users', $status = $this->db->insert('users',
array('username'=>$customer_data['email'], array('username'=>$customer_data['email'],
'password'=>$customer_data['password'],
'display_name'=>$customer_data['name'], 'display_name'=>$customer_data['name'],
'profile_image'=>$customer_data['profile_image'], 'profile_image'=>$customer_data['profile_image'],
'user_type'=>'3','status'=>'1')); 'user_type'=>'3','status'=>'1'));
......
...@@ -46,7 +46,7 @@ x <aside class="main-sidebar"> ...@@ -46,7 +46,7 @@ x <aside class="main-sidebar">
<li> <li>
<a href="<?= base_url('Region/listRegion') ?>"> <a href="<?= base_url('Region/listRegion') ?>">
<img src="<?=base_url("assets/images/m4.png") ?>"> <img src="<?=base_url("assets/images/m4.png") ?>">
<span>Region Management</span> <span>City Management</span>
</a> </a>
</li> </li>
<li> <li>
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<?php } ?> <?php } ?>
<div class="form-group"> <div class="form-group">
<label>Venue Details</label> <label>Venue Details</label>
<textarea type="text" class="ip_reg_form_input form-control reset-form-custom required" placeholder="Venue Details" name="venue_details" data-parsley-trigger="change" data-parsley-minlength="1" required="" style="height:34px;"><?= (isset($venue_data->venue_details))?$venue_data->venue_details:'' ?></textarea> <textarea type="text" class="ip_reg_form_input form-control reset-form-custom required" placeholder="Venue Details" name="venue_details" data-parsley-trigger="change" data-parsley-minlength="1" required="" style="height:106px;"><?= (isset($venue_data->venue_details))?$venue_data->venue_details:'' ?></textarea>
<span class="glyphicon form-control-feedback"></span> <span class="glyphicon form-control-feedback"></span>
</div> </div>
<?php if(!isset($venue_id) || empty($venue_id)){ ?> <?php if(!isset($venue_id) || empty($venue_id)){ ?>
......
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