Commit 4fec86f5 by Jansa Jose

bug fixing

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