Commit 4fec86f5 by Jansa Jose

bug fixing

parent 57d20c27
...@@ -25,7 +25,7 @@ class Brand extends CI_Controller { ...@@ -25,7 +25,7 @@ class Brand extends CI_Controller {
} }
public function viewBrand(){ public function viewBrand(){
$template['page'] = 'brand/viewBrands'; $template['page'] = 'Brand/viewBrands';
$template['menu'] = 'brand Management'; $template['menu'] = 'brand Management';
$template['smenu'] = 'View brands'; $template['smenu'] = 'View brands';
$template['pTitle'] = "View brands"; $template['pTitle'] = "View brands";
...@@ -45,7 +45,7 @@ class Brand extends CI_Controller { ...@@ -45,7 +45,7 @@ class Brand extends CI_Controller {
if(!$status){ if(!$status){
$this->session->set_flashdata('message',$flashMsg); $this->session->set_flashdata('message',$flashMsg);
} }
redirect(base_url('brand/viewBrand')); redirect(base_url('Brand/viewBrand'));
} }
public function createbrand(){ public function createbrand(){
...@@ -54,7 +54,7 @@ class Brand extends CI_Controller { ...@@ -54,7 +54,7 @@ class Brand extends CI_Controller {
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error'); $flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST)){ if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg); $this->session->set_flashdata('message',$flashMsg);
redirect(base_url('brand/addbrand')); redirect(base_url('Brand/addbrand'));
} }
if($err == 0 && (!isset($_POST['brand_name']) || empty($_POST['brand_name']))){ if($err == 0 && (!isset($_POST['brand_name']) || empty($_POST['brand_name']))){
$err = 1; $err = 1;
...@@ -78,17 +78,17 @@ class Brand extends CI_Controller { ...@@ -78,17 +78,17 @@ class Brand extends CI_Controller {
if($err == 1){ if($err == 1){
$flashMsg['message'] = $errMsg; $flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg); $this->session->set_flashdata('message',$flashMsg);
redirect(base_url('brand/addbrand')); redirect(base_url('Brand/addbrand'));
} }
$status = $this->Brand_model->addbrand($_POST); $status = $this->Brand_model->addbrand($_POST);
if($status == 1){ if($status == 1){
$flashMsg =array('message'=>'Successfully Updated brand Details..!','class'=>'success'); $flashMsg =array('message'=>'Successfully Updated brand Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('brand/viewBrand')); redirect(base_url('Brand/viewBrand'));
} else { } else {
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('brand/addbrand')); redirect(base_url('Brand/addbrand'));
} }
} }
...@@ -96,10 +96,10 @@ class Brand extends CI_Controller { ...@@ -96,10 +96,10 @@ class Brand extends CI_Controller {
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error'); $flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($brand_id) || !is_numeric($brand_id = decode_param($brand_id))){ if(empty($brand_id) || !is_numeric($brand_id = decode_param($brand_id))){
$this->session->set_flashdata('message',$flashMsg); $this->session->set_flashdata('message',$flashMsg);
redirect(base_url('brand/viewBrand')); redirect(base_url('Brand/viewBrand'));
} }
$template['page'] = 'brand/addBrand'; $template['page'] = 'Brand/addBrand';
$template['menu'] = 'brand Management'; $template['menu'] = 'brand Management';
$template['smenu'] = 'Edit brand'; $template['smenu'] = 'Edit brand';
$template['pTitle'] = "Edit brand"; $template['pTitle'] = "Edit brand";
...@@ -120,7 +120,7 @@ class Brand extends CI_Controller { ...@@ -120,7 +120,7 @@ class Brand extends CI_Controller {
} }
if(!isset($_POST) || empty($_POST)){ if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg); $this->session->set_flashdata('message',$flashMsg);
redirect(base_url('brand/addbrand')); redirect(base_url('Brand/addbrand'));
} }
if($err == 0 && (!isset($_POST['brand_name']) || empty($_POST['brand_name']))){ if($err == 0 && (!isset($_POST['brand_name']) || empty($_POST['brand_name']))){
$err = 1; $err = 1;
...@@ -132,10 +132,7 @@ class Brand extends CI_Controller { ...@@ -132,10 +132,7 @@ class Brand extends CI_Controller {
$this->load->library('upload'); $this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['brand_logo']['name']; $config['file_name'] = time()."_".$_FILES['brand_logo']['name'];
$this->upload->initialize($config); $this->upload->initialize($config);
if(!$this->upload->do_upload('brand_logo')){ if($this->upload->do_upload('brand_logo')){
$err = 1;
$errMsg = $this->upload->display_errors();
}else{
$upload_data = $this->upload->data(); $upload_data = $this->upload->data();
$_POST['brand_logo'] = $config['upload_path']."/".$upload_data['file_name']; $_POST['brand_logo'] = $config['upload_path']."/".$upload_data['file_name'];
} }
...@@ -144,17 +141,17 @@ class Brand extends CI_Controller { ...@@ -144,17 +141,17 @@ class Brand extends CI_Controller {
if($err == 1){ if($err == 1){
$flashMsg['message'] = $errMsg; $flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg); $this->session->set_flashdata('message',$flashMsg);
redirect(base_url('brand/addbrand')); redirect(base_url('Brand/addbrand'));
} }
$status = $this->Brand_model->updateBrand(decode_param($brand_id),$_POST); $status = $this->Brand_model->updateBrand(decode_param($brand_id),$_POST);
if($status == 1){ if($status == 1){
$flashMsg =array('message'=>'Successfully Updated brand Details..!','class'=>'success'); $flashMsg =array('message'=>'Successfully Updated brand Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('brand/viewBrand')); redirect(base_url('Brand/viewBrand'));
} else { } else {
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('brand/editbrand/'.$brand_id)); redirect(base_url('Brand/editbrand/'.$brand_id));
} }
} }
......
...@@ -1429,7 +1429,7 @@ ...@@ -1429,7 +1429,7 @@
} }
public function fail($ref = ''){ public function fail($ref = ''){
header("Location: http://localhost:4200/dashboard?status=failure&tab=appointment&ref=".$ref); header("Location: https://carfixxers.com/dashboard?status=failure&tab=appointment&ref=".$ref);
} }
public function success($ref = ''){ public function success($ref = ''){
...@@ -1453,7 +1453,7 @@ ...@@ -1453,7 +1453,7 @@
$message = str_replace(array('{:car_name}','{:book_date}','{:amount}'),array($bookData->car_name,$bookData->scheduled_date,$bookData->cost),$template['success_booking']); $message = str_replace(array('{:car_name}','{:book_date}','{:amount}'),array($bookData->car_name,$bookData->scheduled_date,$bookData->cost),$template['success_booking']);
} }
send_mail($subject,$email_id,$message); send_mail($subject,$email_id,$message);
header("Location: http://localhost:4200/dashboard?status=success&tab=appointment&ref=".$ref); header("Location: https://carfixxers.com/dashboard?status=success&tab=appointment&ref=".$ref);
} }
} }
......
...@@ -103,27 +103,13 @@ ...@@ -103,27 +103,13 @@
} }
function send_mail($subject,$email,$message,$attach=null) { function send_mail($subject,$email,$message,$attach=null) {
$ci =& get_instance(); $headers = "MIME-Version: 1.0" . "\r\n";
$ci->load->library('email'); $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$ci->email->initialize(array( $headers .= "From: [email protected] \r\n";
'protocol' => 'smtp', $headers .= "Reply-To: ". $email. "\r\n";
'smtp_host' => 'smtp.sendgrid.net', $headers .= "X-Mailer: PHP/" . phpversion();
'smtp_user' => '[email protected]', $headers .= "X-Priority: 1" . "\r\n";
'smtp_pass' => 'Golden_123',
'smtp_port' => 587, mail($email, $subject, $message, $headers);
'crlf' => "\r\n", }
'newline' => "\r\n"
));
$ci->email->from('[email protected]', 'DcarFixxers');
$ci->email->to($email);
$ci->email->cc('[email protected]');
$ci->email->subject($subject);
$ci->email->message($message);
$ci->email->set_mailtype('html');
if($attach != null) {
$ci->email->attach($attach);
}
return $ci->email->send();
}
?> ?>
\ No newline at end of file
...@@ -51,7 +51,7 @@ class Customer_model extends CI_Model { ...@@ -51,7 +51,7 @@ class Customer_model extends CI_Model {
WHERE customer_veh_id IN ($saved_vehicles)"); WHERE customer_veh_id IN ($saved_vehicles)");
} }
$subject = "DcarFixxers,Activation Mail"; $subject = "Profile Activation";
$email_id = $customer_data['email']; $email_id = $customer_data['email'];
//$reset_link = 'https://projects.nuvento.com/admin/Api/verifyMail/'.$unique_id; //$reset_link = 'https://projects.nuvento.com/admin/Api/verifyMail/'.$unique_id;
$message = "<html> $message = "<html>
......
...@@ -134,7 +134,7 @@ class Mechanic_model extends CI_Model { ...@@ -134,7 +134,7 @@ class Mechanic_model extends CI_Model {
if($status == '1'){ if($status == '1'){
$mechData = $this->db->get_where('mechanic',array(' mechanic_id'=>$mechanic_id))->row(); $mechData = $this->db->get_where('mechanic',array(' mechanic_id'=>$mechanic_id))->row();
$subject = "DcarFixxers, Activation Mail"; $subject = "Profile Activation";
$email_id = $mechData->email_id; $email_id = $mechData->email_id;
$message = "<html> $message = "<html>
<body> <body>
......
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
</a> </a>
</li> </li>
<li> <li>
<a href="<?= base_url('Product/viewProduct') ?>"> <a href="<?= base_url('Product/viewProducts') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
View All Product View All Product
</a> </a>
......
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