Commit a59347af by Tobin

Merge branch 'master' into 'live_production'

Master See merge request !85
parents 4eac3f2e 385821f8
...@@ -64,6 +64,9 @@ class Notification extends CI_Controller { ...@@ -64,6 +64,9 @@ class Notification extends CI_Controller {
if(!isset($_POST['registration_mail']) || empty($_POST['registration_mail'])){ if(!isset($_POST['registration_mail']) || empty($_POST['registration_mail'])){
unset($_POST['registration_mail']); unset($_POST['registration_mail']);
} }
if(!isset($_POST['provider_verify_mail']) || empty($_POST['provider_verify_mail'])){
unset($_POST['provider_verify_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']);
} }
......
...@@ -31,7 +31,7 @@ class Provider extends CI_Controller { ...@@ -31,7 +31,7 @@ class Provider extends CI_Controller {
$template['pDescription'] = "View and Manage Organizers"; $template['pDescription'] = "View and Manage Organizers";
$template['page_head'] = "Organizer Management"; $template['page_head'] = "Organizer Management";
$template['provider_data'] = $this->Provider_model->getProviderData('','0,1'); $template['provider_data'] = $this->Provider_model->getProviderData('');
$this->load->view('template',$template); $this->load->view('template',$template);
} }
...@@ -198,7 +198,7 @@ class Provider extends CI_Controller { ...@@ -198,7 +198,7 @@ class Provider extends CI_Controller {
$template['pTitle'] = "Edit Organizers"; $template['pTitle'] = "Edit Organizers";
$template['pDescription'] = "Update Organizer Data"; $template['pDescription'] = "Update Organizer Data";
$template['provider_data'] = $this->Provider_model->getProviderData($provider_id,1); $template['provider_data'] = $this->Provider_model->getProviderData($provider_id,'0,1');
$template['provider_id'] = encode_param($provider_id); $template['provider_id'] = encode_param($provider_id);
$this->load->view('template',$template); $this->load->view('template',$template);
} }
...@@ -315,5 +315,44 @@ class Provider extends CI_Controller { ...@@ -315,5 +315,44 @@ class Provider extends CI_Controller {
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Provider/getProviderPayDetails/'.$_POST['provider_id'])); redirect(base_url('Provider/getProviderPayDetails/'.$_POST['provider_id']));
} }
function resetPassword($provider_id = ''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($provider_id) || !is_numeric($provider_id = decode_param($provider_id))){
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Provider/viewProviders'));
}
$unique_id = $this->Provider_model->resetPassword($provider_id);
$providerData = $this->Provider_model->getProviderData($provider_id);
if(empty($unique_id) || empty($providerData)){
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Provider/viewProviders'));
}
$this->load->model('Api_model');
$subject = "New Password for Organizer Account";
$email_id = $providerData->email;
$template = getNotifTemplate();
$message = "<html>
<body>
New password of your Organizer Account for the username
<strong>".$providerData->username."</strong> is <strong>".$unique_id."</strong><br>
</body>
</html>";
if(isset($template['provider_verify_mail']) && !empty($template['provider_verify_mail'])){
$message = str_replace(array('{:user_name}','{:password}'),
array($providerData->username,$resetLink),
$template['provider_verify_mail']);
}
$this->Api_model->send_mail($subject,$email_id,$message);
$flashMsg = array('message'=>'Password Generated..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Provider/viewProviders'));
}
} }
?> ?>
\ No newline at end of file
...@@ -137,7 +137,6 @@ class Api_model extends CI_Model { ...@@ -137,7 +137,6 @@ class Api_model extends CI_Model {
$ci->email->from('[email protected]', 'TimeOut'); $ci->email->from('[email protected]', 'TimeOut');
$ci->email->to($email); $ci->email->to($email);
$ci->email->cc('[email protected]');
$ci->email->subject($subject); $ci->email->subject($subject);
$ci->email->message($message); $ci->email->message($message);
$ci->email->set_mailtype('html'); $ci->email->set_mailtype('html');
...@@ -686,7 +685,7 @@ class Api_model extends CI_Model { ...@@ -686,7 +685,7 @@ class Api_model extends CI_Model {
FROM review WHERE event_id=$rs->event_id"; FROM review WHERE event_id=$rs->event_id";
$rating = $this->db->query($sql)->row_array(); $rating = $this->db->query($sql)->row_array();
$rate = isset($rating['rate'])&&!empty($rating['rate'])? $rate = isset($rating['rate'])&&!empty($rating['rate'])?
$rating['rate']:'0.0'; round($rating['rate'],1):'0.0';
$sql = "SELECT SUM(booking.no_of_ticket) AS attend FROM booking $sql = "SELECT SUM(booking.no_of_ticket) AS attend FROM booking
WHERE status IN (1,2) AND event_id=$rs->event_id"; WHERE status IN (1,2) AND event_id=$rs->event_id";
......
...@@ -42,7 +42,7 @@ class Provider_model extends CI_Model { ...@@ -42,7 +42,7 @@ class Provider_model extends CI_Model {
return $status; return $status;
} }
public function getProviderData($provider_id='',$view='1'){ public function getProviderData($provider_id='',$view=''){
$cond = (!empty($view))?" USR.status IN ($view) ":" USR.status != '2' "; $cond = (!empty($view))?" USR.status IN ($view) ":" USR.status != '2' ";
$cond .= (!empty($provider_id))?" AND PRV.provider_id='$provider_id' ":""; $cond .= (!empty($provider_id))?" AND PRV.provider_id='$provider_id' ":"";
...@@ -226,5 +226,15 @@ class Provider_model extends CI_Model { ...@@ -226,5 +226,15 @@ class Provider_model extends CI_Model {
} }
return ($status)?1:0; return ($status)?1:0;
} }
function resetPassword($provider_id = ''){
if(empty($provider_id)){
return 0;
}
$unique_id = rand(11111111,99999999);
$status = $this->db->update('users',array('password'=>md5($unique_id),'status'=>1),
array('id'=>$provider_id,'user_type'=>'2'));
return ($status)?$unique_id:0;
}
} }
?> ?>
\ No newline at end of file
...@@ -550,7 +550,7 @@ class Webservice_model extends CI_Model { ...@@ -550,7 +550,7 @@ class Webservice_model extends CI_Model {
FROM review WHERE event_id=$event_id"; FROM review WHERE event_id=$event_id";
$rating = $this->db->query($sql)->row_array(); $rating = $this->db->query($sql)->row_array();
$rate = isset($rating['rate'])&&!empty($rating['rate'])? $rate = isset($rating['rate'])&&!empty($rating['rate'])?
$rating['rate']:'0.0'; round($rating['rate'],1):'0.0';
$sql = "SELECT SUM(booking.no_of_ticket) AS attend FROM booking $sql = "SELECT SUM(booking.no_of_ticket) AS attend FROM booking
WHERE status IN (1,2) AND event_id=$event_id"; WHERE status IN (1,2) AND event_id=$event_id";
......
...@@ -78,15 +78,23 @@ ...@@ -78,15 +78,23 @@
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <div class="form-group">
<label>Provider Password Reset Mail</label>
<p>Username => {:user_name} , Reset Link => {:password}</p>
<textarea id="rich_editor_11" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Checker Activation Mail" name="provider_verify_mail"
style="height:108px;" data-parsley-trigger="change"><?= $notificationData->provider_verify_mail ?></textarea>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="col-sm-6">
<div class="form-group">
<label>Staff Registration Mail</label> <label>Staff Registration Mail</label>
<p>Username => {:user_name} , Password => {:password}</p> <p>Username => {:user_name} , Password => {:password}</p>
<textarea id="rich_editor_9" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Staff Registration Mail" name="staff_reg_mail" <textarea id="rich_editor_9" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Staff Registration Mail" name="staff_reg_mail"
style="height:108px;" data-parsley-trigger="change"><?= $notificationData->staff_reg_mail ?></textarea> style="height:108px;" data-parsley-trigger="change"><?= $notificationData->staff_reg_mail ?></textarea>
</div> </div>
</div> </div>
</div>
<div class="col-sm-12">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <div class="form-group">
<label>Booking Mail</label> <label>Booking Mail</label>
......
...@@ -60,7 +60,10 @@ ...@@ -60,7 +60,10 @@
<th class="center" id="statusFlag_<?= $provider->provider_id ?>"> <th class="center" id="statusFlag_<?= $provider->provider_id ?>">
<?= ($provider->status == 1)?'Active':'De-activate' ?> <?= ($provider->status == 1)?'Active':'De-activate' ?>
</th> </th>
<td class="center"> <td class="center">
<a class="btn btn-sm btn-link" style="margin-top:-13px;" href="<?= base_url('Provider/resetPassword/'.encode_param($provider->provider_id)) ?>">
<i class="fa fa-fw fa-key"></i>Reset Password
</a><br>
<a class="btn btn-sm btn-info" id="viewProvider" provider_id="<?= encode_param($provider->provider_id) ?>"> <a class="btn btn-sm btn-info" id="viewProvider" provider_id="<?= encode_param($provider->provider_id) ?>">
<i class="fa fa-fw fa-eye"></i>View <i class="fa fa-fw fa-eye"></i>View
</a> </a>
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
if(jQuery('#rich_editor_8').length==1){CKEDITOR.replace('rich_editor_8');} if(jQuery('#rich_editor_8').length==1){CKEDITOR.replace('rich_editor_8');}
if(jQuery('#rich_editor_9').length==1){CKEDITOR.replace('rich_editor_9');} if(jQuery('#rich_editor_9').length==1){CKEDITOR.replace('rich_editor_9');}
if(jQuery('#rich_editor_10').length==1){CKEDITOR.replace('rich_editor_10');} if(jQuery('#rich_editor_10').length==1){CKEDITOR.replace('rich_editor_10');}
if(jQuery('#rich_editor_11').length==1){CKEDITOR.replace('rich_editor_11');}
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'});}
......
INSERT INTO `review` (`id`, `event_id`, `customer_id`, `rate`, `feedback`) VALUES (NULL, '89', '107', '2', 'dff');
INSERT INTO `review` (`id`, `event_id`, `customer_id`, `rate`, `feedback`) VALUES (NULL, '89', '107', '2', 'dff');
INSERT INTO `review` (`id`, `event_id`, `customer_id`, `rate`, `feedback`) VALUES (NULL, '89', '107', '2', 'dff');
INSERT INTO `review` (`id`, `event_id`, `customer_id`, `rate`, `feedback`) VALUES (NULL, '89', '107', '2', 'dff');
INSERT INTO `review` (`id`, `event_id`, `customer_id`, `rate`, `feedback`) VALUES (NULL, '89', '107', '2', 'dff');
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