Commit c47c39ff by Ajil

commit

parent d88d6be0
......@@ -133,15 +133,18 @@ public function getExpressData(){
$status = $this->Express_model->addExpress($_POST);
if($status['status'] == 1){
$profile_id =encode_param($status['profile_id']);
$template = getNotifTemplate();
$to =$_POST['email'];
$sender_email = "[email protected]";
$data['name']=$_POST['name'];
$data['email']=$_POST['email'];
$data['reg_url']=base_url('Registration_request/editExpresss/'.$profile_id);
$data['registration_mail']=$template['registration_mail'];
$data['password']=$temp_password;
$mail_head = "Your Access Account is now activated";
if(isset($template['registration_mail']) && !empty($template['registration_mail'])){
......
......@@ -134,12 +134,13 @@ public function getGarageData(){
$status = $this->Garage_model->addGarage($_POST);
if($status['status'] == 1){
$profile_id =encode_param($status['profile_id']);
$template = getNotifTemplate();
$to =$_POST['email'];
$sender_email = "[email protected]";
$data['name']=$_POST['name'];
$data['email']=$_POST['email'];
$data['reg_url']=base_url('Registration_request/editGarege/'.$profile_id);
$data['registration_mail']=$template['registration_mail'];
$data['password']=$temp_password;
$mail_head = "Your Access Account is now activated";
......
......@@ -132,9 +132,9 @@ public function get_all_Garage_response($request) {
$vehicle_dtl = "Model:".$r->model."<br>
Make:".$r->make."<br>
Year:".$r->year."<br>";
if($r->quote_type ='1') { $quote_type = "BASE";}
if($r->quote_type ='2') { $quote_type = "MEDIUM";}
if($r->quote_type ='3') { $quote_type = "PREMIUM";}
if($r->quote_type ='1') { $quote_types = "BASE";}
if($r->quote_type ='2') { $quote_types = "MEDIUM";}
if($r->quote_type ='3') { $quote_types = "PREMIUM";}
// $action = " <a class='btn btn-sm btn-info' onclick='viewResponseDetails(".$request_id.",".'1'.")'>
// <i class='fa fa-cog'></i> VIEW
// </a>";
......@@ -172,7 +172,7 @@ $action = " <a class='btn btn-sm btn-success' href='".base_url()."Garage_respon
// $r->customer_name.'</br>'.'<b>'.'Phone:'.'</b>'. $r->phone_no,
// $vehicle_dtl,
// $r->sub_services,
$quote_type,
$quote_types,
$r->labour_cost,
$r->parts_cost,
......
......@@ -134,12 +134,13 @@ public function getPosData(){
$status = $this->Pos_model->addPos($_POST);
if($status['status'] == 1){
$profile_id =encode_param($status['profile_id']);
$template = getNotifTemplate();
$to =$_POST['email'];
$sender_email = "[email protected]";
$data['name']=$_POST['name'];
$data['email']=$_POST['email'];
$data['reg_url']=base_url('Registration_request/editPos/'.$profile_id);
$data['registration_mail']=$template['registration_mail'];
$data['password']=$temp_password;
$mail_head = "Your Access Account is now activated";
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Rassist_booking extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Rassist_booking_model');
$this->load->helper('generals_helper');
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
}
}
public function index(){
$template['page'] = 'Road_assist/booking_list';
$template['menu'] = 'Roadassist Requet Management';
$template['smenu'] = 'View Roadassist bookings';
$template['pTitle'] = "View Roadassist bookings";
$template['pDescription'] = "View and Manage Roadassist bookings";
$template['page_head'] = "Roadassist booking Management";
$template['datatable'] = 1;
$this->load->view('template',$template);
}
public function get_all_booking() {
$data = $_GET;
$col = $data['order'][0]['column'];
$col_type = $data['order'][0]['dir'];
$columns = array("customer.name","vehicle_model.vehicle_name","vehicle_model.make","customer.email_id");
$value['order_by'] = $columns[$col];
$value['order_type'] = $col_type;
$value['search'] = $data['search']['value'];
$value['start'] = $data['start'];
$value['length'] = $data['length'];
$value['where'] = '';
if(!empty($value['search'])) {
$where = array();
foreach($columns as $c) {
$where_data[] = $c." like '%".$value['search']."%' ";
}
$where = implode(" OR ", $where_data);
$where = "(".$where.")";
$value['where'] = $where;
}
$prod_list = $this->Rassist_booking_model->get_all_Assist_booking($value);
$all_list = $this->Rassist_booking_model->get_all_Assist_booking();
$recordsTotal = count($all_list);
$filtered = count($all_list);
if($value['where']!='') {
$value['length'] = '-1';
$all_list = $this->Rassist_booking_model->get_all_Assist_booking($value);
$filtered = count($all_list);
}
$data = array();
foreach ($prod_list as $r) {
$vehicle_dtl = "Model:".$r->model."<br>
Make:".$r->make."<br>
Year:".$r->year."<br>";
$customer_dtl = "Name:".$r->customer_name."<br>
Phone:".$r->customer_phone."<br>
Email:".$r->email_id."<br>";
if($r->status != 1){
$assist_dtl = "Name:".$r->road_assist_name."<br>
Phone:".$r->road_assist_phone."<br>
Email:".$r->road_assist_email."<br>";
} else{
$assist_dtl ='Waiting....';
}
$action = " <a class='btn btn-sm btn-info' onclick='viewBookingDetails(".$r->id.")'>
<i class='fa fa-cog'></i> VIEW
</a>";
if($r->status == 1){
$status = "<button type='button' class='btn btn-primary'>Requested</button>";
} else if ($r->status == 2) {
$status = "<button type='button' class='btn btn-info'>Accept</button>";
} else if ($r->status == 3) {
$status = "<button type='button' class='btn btn-warning'>Completed</button>";
}else if ($r->status == 0) {
$status = "<button type='button' class='btn btn-danger'>Cancelled</button>";
}
array_push($data, array(
$r->cust_id,
$r->booking_id,
$customer_dtl,
$vehicle_dtl,
$assist_dtl,
$r->location,
$r->date,
$status,
$action));
}
echo json_encode(array('recordsFiltered' => $filtered, 'recordsTotal' => $recordsTotal, 'data' => $data));
}
public function getAssist_bookingData(){
$resArr = array('status'=>0);
if(!isset($_POST)||empty($_POST)||!isset($_POST['booking_id'])||empty($_POST['booking_id']) ||
!is_numeric($booking_id = $_POST['booking_id'])){
echo json_encode($resArr);exit;
}
//$view_all = (isset($_POST['view_all']) && !empty($_POST['view_all']))?$_POST['view_all']:'';
$booking_id = $_POST['booking_id'];
$bokData = $this->Rassist_booking_model->getAssist_bookingData($booking_id);
//print_r($bokData);exit;
if(empty($bokData)){
echo json_encode($resArr);exit;
}
$resArr['status'] = 1;
$resArr['data'] = $bokData;
echo json_encode($resArr);exit;
}
function changeStatus($booking_id = '',$status ='1'){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'danger');
if(empty($booking_id) || !is_numeric($booking_id = decode_param($booking_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Assist_booking'));
}
$status = $this->Rassist_booking_model->changeStatus($booking_id,$status);
if(!$status){
$this->session->set_flashdata('message',$flashMsg);
}
redirect(base_url('Assist_booking'));
}
public function check_email_availability() {
$email=$this->input->Assistt('email');
$result = $this->Rassist_booking_model->email_availability_check($email);
echo json_encode($result);
}
}
?>
\ No newline at end of file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Registration_request extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('Regrequest_model');
}
public function editExpresss($Express_id){
$id=decode_param($Express_id);
$template['Express_id'] =encode_param($id);
$template['page_title'] = "Login";
$template['ExpressData'] = $this->Regrequest_model->getExpressData($id);
$this->load->view('Regexpress_request', $template);
}
public function updateExpress($Express_id = ''){
$id=decode_param($Express_id);
$err = 0;
$errMsg = '';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'danger');
if(!isset($_POST) || empty($_POST) || !isset($_FILES) || empty($_FILES)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Registration_request/editExpresss/'.$Express_id));
}
if($err == 0 && (!isset($_POST['name']) || empty($_POST['name']))){
$err = 1;
$errMsg = 'Provide Express Name';
}else if($err == 0 && (!isset($_POST['email']) || empty($_POST['email']))){
$err = 1;
$errMsg = 'Provide a Express Email';
}else if($err == 0 && (!isset($_POST['phone']) || empty($_POST['phone']))){
$err = 1;
$errMsg = 'Provide Express Phone';
}
if($err == 0){
$config = set_upload_service("assets/uploads/express");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['profile_image']['name'];
$this->upload->initialize($config);
if(!$this->upload->do_upload('profile_image')){
$err = 1;
$errMsg = $this->upload->display_errors();
}else{
$upload_data = $this->upload->data();
$image = $upload_data['file_name'];
$new_array = array('width'=>100, 'height'=>100);
$image_file = $config['upload_path']."/".$upload_data['file_name'];
$_POST['profile_image'] = $image_file;
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Registration_request/editExpresss/'.$Express_id));
}
$status = $this->Regrequest_model->updateExpress($id,$_POST);
if($status == 1){
$flashMsg = array('message'=>'Update Successfully!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url());
} else if($status == 2){
$flashMsg = array('message'=>'Email ID already exist..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editExpresss/'.$Express_id));
} else if($status == 3){
$flashMsg = array('message'=>'Phone Number already exist..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editExpresss/'.$Express_id));
} else if($status == 4){
$flashMsg = array('message'=>'User Name already exist..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editExpresss/'.$Express_id));
}
else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editExpresss/'.$Express_id));
}
}
public function editGarege($Garege_id){
$id=decode_param($Garege_id);
$template['Garege_id'] =encode_param($id);
$template['page_title'] = "Login";
$template['services'] = $this->Regrequest_model->getGarageServices();
$template['garageData'] = $this->Regrequest_model->getGarageData($id);
$template['amenities'] = $this->Regrequest_model->getAmenities();
$template['serviceData'] = $this->Regrequest_model->getServiceData($id);
$this->load->view('Reggarage_request', $template);
}
public function updateGarage($Garage_id = ''){
$id=decode_param($Garage_id);
$err = 0;
$errMsg = '';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'danger');
if(!isset($_POST) || empty($_POST) || !isset($_FILES) || empty($_FILES)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Registration_request/editGarege/'.$Garage_id));
}
if($err == 0 && (!isset($_POST['name']) || empty($_POST['name']))){
$err = 1;
$errMsg = 'Provide Garage Name';
}else if($err == 0 && (!isset($_POST['email']) || empty($_POST['email']))){
$err = 1;
$errMsg = 'Provide a Garage Email';
}else if($err == 0 && (!isset($_POST['phone']) || empty($_POST['phone']))){
$err = 1;
$errMsg = 'Provide Garage Phone';
}
if($err == 0){
$config = set_upload_service("assets/uploads/Garage");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['profile_image']['name'];
$this->upload->initialize($config);
if(!$this->upload->do_upload('profile_image')){
$err = 1;
$errMsg = $this->upload->display_errors();
}else{
$upload_data = $this->upload->data();
$image = $upload_data['file_name'];
$new_array = array('width'=>100, 'height'=>100);
$image_file = $config['upload_path']."/".$upload_data['file_name'];
$_POST['profile_image'] = $image_file;
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Registration_request/editGarege/'.$Garage_id));
}
$status = $this->Regrequest_model->updateGarage($id,$_POST);
if($status == 1){
$flashMsg = array('message'=>'Update Successfully!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editGarege/'.encode_param($id)));
} else if($status == 2){
$flashMsg = array('message'=>'Email ID already exist..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editGarege/'.$Garage_id));
} else if($status == 3){
$flashMsg = array('message'=>'Phone Number already exist..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editGarege/'.$Garage_id));
} else if($status == 4){
$flashMsg = array('message'=>'User Name already exist..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editGarege/'.$Garage_id));
}
else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editGarege/'.$Garage_id));
}
}
public function editPos($Pos_id){
$id=decode_param($Pos_id);
$template['Pos_id'] =encode_param($id);
$template['page_title'] = "Login";
$template['PosData'] = $this->Regrequest_model->getPosData($id);
$this->load->view('Regpos_request', $template);
//print_r($template['PosData']);exit;
}
public function updatePos($Pos_id = ''){
$id=decode_param($Pos_id);
$err = 0;
$errMsg = '';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'danger');
if(!isset($_POST) || empty($_POST) || !isset($_FILES) || empty($_FILES)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Registration_request/editPos/'.$Pos_id));
}
if($err == 0 && (!isset($_POST['name']) || empty($_POST['name']))){
$err = 1;
$errMsg = 'Provide Pos Name';
}else if($err == 0 && (!isset($_POST['email']) || empty($_POST['email']))){
$err = 1;
$errMsg = 'Provide a Pos Email';
}else if($err == 0 && (!isset($_POST['phone']) || empty($_POST['phone']))){
$err = 1;
$errMsg = 'Provide Pos Phone';
}
if($err == 0){
$config = set_upload_service("assets/uploads/Pos");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['profile_image']['name'];
$this->upload->initialize($config);
if(!$this->upload->do_upload('profile_image')){
$err = 1;
$errMsg = $this->upload->display_errors();
}else{
$upload_data = $this->upload->data();
$image = $upload_data['file_name'];
$new_array = array('width'=>100, 'height'=>100);
$image_file = $config['upload_path']."/".$upload_data['file_name'];
$_POST['profile_image'] = $image_file;
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Registration_request/editPos/'.$Pos_id));
}
$status = $this->Regrequest_model->updatePos($id,$_POST);
if($status == 1){
$flashMsg = array('message'=>'Update Successfully!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editPos/'.$Pos_id));
} else if($status == 2){
$flashMsg = array('message'=>'Email ID already exist..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editPos/'.$Pos_id));
} else if($status == 3){
$flashMsg = array('message'=>'Phone Number already exist..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editPos/'.$Pos_id));
} else if($status == 4){
$flashMsg = array('message'=>'User Name already exist..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editPos/'.$Pos_id));
}
else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Registration_request/editPos/'.$Pos_id));
}
}
}
......@@ -8,7 +8,7 @@ class Service_booking extends CI_Controller {
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Service_booking_model');
$this->load->helper('generals_helper');
if(!$this->session->userdata('logged_garage')) {
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
}
......@@ -26,7 +26,6 @@ class Service_booking extends CI_Controller {
$template['pDescription'] = "View and Manage Service Booking";
$template['page_head'] = "Service Booking Management";
$template['datatable'] = 1;
//$template['Service_booking_data'] = $this->Service_booking_model->getService_bookingData();
$this->load->view('template',$template);
}
......
......@@ -81,6 +81,7 @@ class Express_model extends CI_Model {
$data['status']=1;
$data['profile_id']=$Express_id;
}
......
......@@ -80,7 +80,7 @@ class Garage_model extends CI_Model {
'website'=>$Garage_data['website'],
'amenities' => implode(",",$Garage_data['amenities']),
'address'=>$Garage_data['address'],
'working_hours'=>$Garage_data['working_hours'],
// 'working_hours'=>$Garage_data['working_hours'],
'profile_pic'=>$Garage_data['profile_image']));
$Garage_id = $this->db->insert_id();
......@@ -118,6 +118,7 @@ if (isset($Garage_data['services']) && isset($Garage_data['amount']) &&
$data['status']=1;
$data['profile_id']=$Garage_id;
}
......
......@@ -27,7 +27,7 @@ class Pos_model extends CI_Model {
if(empty($Pos_data))
return 0;
$userNameChk = $this->db->query("SELECT * FROM users
WHERE user_type='2' AND username='".$Pos_data['email']."'");
WHERE user_type='3' AND username='".$Pos_data['email']."'");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 2;
......@@ -91,6 +91,7 @@ if (isset($Pos_data['services']) && isset($Pos_data['amount']) &&
$data['status']=1;
$data['profile_id']=$pos_id;
}
......
<?php
class Rassist_booking_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function get_all_Assist_booking($filter=null) {
if($filter){
$this->db->order_by($filter['order_by'], $filter['order_type']);
if(!empty($filter['where'])){
$this->db->where($filter['where']);
}
if($filter['length']!=-1)
$this->db->limit($filter['length'],$filter['start']);
}
$this->db->order_by('road_booking.date','desc');
$this->db->select("customer.name as customer_name,customer.phone_no as customer_phone,customer.email_id,road_booking.*,vehicle_model.year,vehicle_model.vin,vehicle_model.model,vehicle_model.make,vehicle_model.vehicle_name,vehicle_model.mileage,road_assist.road_assist_code,road_assist.name as road_assist_name,road_assist.phone_no as road_assist_phone,road_assist.email_id as road_assist_email");
$this->db->from('road_booking');
$this->db->join('customer', 'customer.cust_id = road_booking.cust_id');
$this->db->join('vehicle_model', 'vehicle_model.id = road_booking.vehicle_id');
$this->db->join('road_assist', 'road_assist.road_assist_id = road_booking.road_assist_id');
$res = $this->db->get();
return $res->result();
}
public function getAssist_bookingData($booking_id=''){
$this->db->order_by('road_booking.date','desc');
$this->db->where('road_booking.id',$booking_id);
$this->db->select("customer.name as customer_name,customer.phone_no as customer_phone,customer.email_id,road_booking.*,vehicle_model.year,vehicle_model.vin,vehicle_model.model,vehicle_model.make,vehicle_model.vehicle_name,vehicle_model.mileage,road_assist.road_assist_code,road_assist.name as road_assist_name,road_assist.phone_no as road_assist_phone");
$this->db->from('road_booking');
$this->db->join('customer', 'customer.cust_id = road_booking.cust_id');
$this->db->join('vehicle_model', 'vehicle_model.id = road_booking.vehicle_id');
$this->db->join('road_assist', 'road_assist.road_assist_id = road_booking.road_assist_id');
$res = $this->db->get();
return $res->result();
}
public function changeStatus($booking_id = '', $status = '0'){
if(empty($booking_id)){
return 0;
}
$status = $this->db->update('users',array('status'=>$status),array('profile_id'=>$booking_id,'user_type'=>'1'));
return $status;
}
public function email_availability_check($email)
{
if($email!=''){
$query = "SELECT * FROM Assist_booking AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.cust_id)
WHERE USR.status!='2' AND CUST.cust_id!='".$booking_id."' AND
USR.username='".$email."'";
$query=$this->db->query($query,array($email));
if($query->num_rows()>0)
{
return $query->row_array();
} else
{
return false;
}
}
return false;
}
}
?>
\ No newline at end of file
<?php
class Regrequest_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function getExpressData($express_id='',$view=''){
$sql = "SELECT * FROM express WHERE carrier_id='$express_id' Order by carrier_id DESC";
$ExpressData = $this->db->query($sql);
if(isset($ExpressData)){
return ($ExpressData->row());
}
return 0;
}
function updateExpress($Express_id = '', $Express_data = array()){
if(empty($Express_id) || empty($Express_data))
return 0;
$userIdChk = $this->db->query("SELECT * FROM express AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.carrier_id)
WHERE USR.status!='2' AND CUST.carrier_id!='".$Express_id."' AND
USR.username='".$Express_data['email']."'");
if(!empty($userIdChk) && $userIdChk->num_rows() > 0) { return 4; }
$emailChk = $this->db->query("SELECT * FROM express AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.carrier_id)
WHERE USR.status!='2' AND CUST.carrier_id!='".$Express_id."' AND
CUST.email_id='".$Express_data['email']."'");
if(!empty($emailChk) && $emailChk->num_rows() > 0) { return 2; }
$phoneChk = $this->db->query("SELECT * FROM express AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.carrier_id)
WHERE USR.status!='2' AND CUST.carrier_id!='".$Express_id."' AND
CUST.phone_no='".$Express_data['phone']."'");
if(!empty($phoneChk) && $phoneChk->num_rows() > 0) { return 3; }
$upMecArr = array('name'=>$Express_data['name'],
'email_id'=>$Express_data['email'],
'code'=>$Express_data['phone_code'],
'phone_no'=>$Express_data['phone'],
'altered_no'=>$Express_data['altered_no'],
'location'=>$Express_data['location'],
'lat'=>$Express_data['lat'],
'lng'=>$Express_data['lng'],
'express_code'=>$Express_data['express_code'],
'address'=>$Express_data['address']);
$admUpdateArr = array('username'=>$Express_data['email']);
if(isset($Express_data['profile_image']) && !empty($Express_data['profile_image'])){
$upMecArr['image'] = $Express_data['profile_image'];
//$admUpdateArr['profile_photo'] = $Express_data['profile_image'];
}
//echo json_encode($upMecArr);exit;
$status = $this->db->update('users',$admUpdateArr,array('profile_id'=>$Express_id,'user_type'=>'1'));
//echo $this->db->last_query();exit;
if(!$status) { return 0; }
$status = $this->db->update('express',$upMecArr,array('carrier_id'=>$Express_id));
return $status;
}
public function getGarageServices(){
$sql = "SELECT *
FROM sub_services WHERE status!='2' Order by id DESC";
$GarageData = $this->db->query($sql);
if(isset($GarageData)){
return ($GarageData->result());
}
return 0;
}
public function getGarageData($Garage_id='',$view=''){
$sql = "SELECT garage.*
FROM garage
INNER JOIN users AS USR ON (USR.profile_id=garage.garage_id)
WHERE garage.garage_id='$Garage_id' AND USR.user_type='2' Order by garage.garage_id DESC";
$GarageData = $this->db->query($sql);
if(isset($GarageData)){
return ($GarageData->row());
}
return 0;
}
public function getServiceData($Garage_id='',$view=''){
$sql = "SELECT garage_services.*,services.service_name,sub_services.sub_services as subservice_name
FROM garage_services
INNER JOIN sub_services ON (sub_services.id=garage_services.subservice_id)
INNER JOIN services ON (services.id=sub_services.id)
WHERE garage_services.garage_id='$Garage_id' AND garage_services.status='1' Order by garage_services.garage_id DESC";
$GarageData = $this->db->query($sql);
if(isset($GarageData)){
return ($GarageData->result());
}
return 0;
}
public function getAmenities(){
$sql = "SELECT *
FROM amenities WHERE status!='3' Order by id DESC";
$amenitiesData = $this->db->query($sql);
if(isset($amenitiesData)){
return ($amenitiesData->result());
}
return 0;
}
function updateGarage($Garage_id = '', $Garage_data = array()){
if(empty($Garage_id) || empty($Garage_data))
return 0;
$userIdChk = $this->db->query("SELECT * FROM garage AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.garage_id)
WHERE USR.status!='2' AND CUST.garage_id!='".$Garage_id."' AND
USR.username='".$Garage_data['email']."'");
if(!empty($userIdChk) && $userIdChk->num_rows() > 0) { return 4; }
$emailChk = $this->db->query("SELECT * FROM garage AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.garage_id)
WHERE USR.status!='2' AND CUST.garage_id!='".$Garage_id."' AND
CUST.email='".$Garage_data['email']."'");
if(!empty($emailChk) && $emailChk->num_rows() > 0) { return 2; }
$phoneChk = $this->db->query("SELECT * FROM garage AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.garage_id)
WHERE USR.status!='2' AND CUST.garage_id!='".$Garage_id."' AND
CUST.phone_no='".$Garage_data['phone']."'");
if(!empty($phoneChk) && $phoneChk->num_rows() > 0) { return 3; }
$upMecArr = array('name'=>$Garage_data['name'],
'email'=>$Garage_data['email'],
'code'=>$Garage_data['phone_code'],
'phone_no'=>$Garage_data['phone'],
'altered_no'=>$Garage_data['altered_no'],
'location'=>$Garage_data['location'],
'lat'=>$Garage_data['lat'],
'lng'=>$Garage_data['lng'],
'garage_code'=>$Garage_data['garage_code'],
'working_from'=>$Garage_data['working_from'],
'working_to'=>$Garage_data['working_to'],
'website'=>$Garage_data['website'],
'amenities' => implode(",",$Garage_data['amenities']),
'address'=>$Garage_data['address']);
$admUpdateArr = array('username'=>$Garage_data['email']);
if(isset($Garage_data['profile_image']) && !empty($Garage_data['profile_image'])){
$upMecArr['profile_pic'] = $Garage_data['profile_image'];
}
$status = $this->db->update('users',$admUpdateArr,array('profile_id'=>$Garage_id,'user_type'=>'1'));
if(!$status) { return 0; }
if (isset($Garage_data['services']) && isset($Garage_data['amount']) &&
!empty($Garage_data['services']) && !empty($Garage_data['amount'])) {
$this->db->where('garage_id',$Garage_id);
$dltstatus = $this->db->delete('garage_services');
if($dltstatus) {
foreach ($Garage_data['services'] as $key => $service_id) {
$amount = $Garage_data['amount'][$key];
$services = $Garage_data['services'][$key];
$this->db->query("INSERT INTO garage_services (subservice_id, cost, garage_id) VALUES ('$services', '$amount', '$Garage_id')");
}
}
}
$status = $this->db->update('garage',$upMecArr,array('garage_id'=>$Garage_id));
return $status;
}
public function getPosData($Pos_id=''){
$sql = "SELECT * FROM pos WHERE pos_id='$Pos_id' Order by pos_id DESC";
$PosData = $this->db->query($sql);
if(isset($PosData)){
return ($PosData->row());
}
return 0;
}
function updatePos($Pos_id = '', $Pos_data = array()){
if(empty($Pos_id) || empty($Pos_data))
return 0;
$userIdChk = $this->db->query("SELECT * FROM pos AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.pos_id)
WHERE CUST.pos_id!='".$Pos_id."' AND
USR.username='".$Pos_data['email']."'");
if(!empty($userIdChk) && $userIdChk->num_rows() > 0) { return 4; }
$emailChk = $this->db->query("SELECT * FROM pos AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.pos_id)
WHERE CUST.pos_id!='".$Pos_id."' AND
CUST.email_id='".$Pos_data['email']."'");
if(!empty($emailChk) && $emailChk->num_rows() > 0) { return 2; }
$phoneChk = $this->db->query("SELECT * FROM pos AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.pos_id)
WHERE CUST.pos_id!='".$Pos_id."' AND
CUST.phone_no='".$Pos_data['phone']."'");
if(!empty($phoneChk) && $phoneChk->num_rows() > 0) { return 3; }
$upMecArr = array('name'=>$Pos_data['name'],
'email_id'=>$Pos_data['email'],
'code'=>$Pos_data['phone_code'],
'phone_no'=>$Pos_data['phone'],
'altered_no'=>$Pos_data['altered_no'],
'location'=>$Pos_data['location'],
'lat'=>$Pos_data['lat'],
'lng'=>$Pos_data['lng'],
'Pos_code'=>$Pos_data['Pos_code'],
'address'=>$Pos_data['address'],
'working_from'=>$Pos_data['working_from'],
'working_to'=>$Pos_data['working_to']);
$admUpdateArr = array('username'=>$Pos_data['email']);
if(isset($Pos_data['profile_image']) && !empty($Pos_data['profile_image'])){
$upMecArr['profile_photo'] = $Pos_data['profile_image'];
//$admUpdateArr['profile_photo'] = $Pos_data['profile_image'];
}
//echo json_encode($upMecArr);exit;
$status = $this->db->update('users',$admUpdateArr,array('profile_id'=>$Pos_id,'user_type'=>'1'));
//echo $this->db->last_query();exit;
if(!$status) { return 0; }
$status = $this->db->update('pos',$upMecArr,array('pos_id'=>$Pos_id));
return $status;
}
}
\ No newline at end of file
......@@ -173,12 +173,16 @@
</tr>
</thead>
<?php foreach ($prod_list as $r) { ?>
<?php if($r->quote_type ='1') { $quote_types = "BASE";}
if($r->quote_type ='2') { $quote_types = "MEDIUM";}
if($r->quote_type ='3') { $quote_types = "PREMIUM";} ?>
<tbody>
<tr>
<td><?= $r->quote_code ?></td>
<td><?= $r->garage_code ?></td>
<td><?= $r->garage_name ?></td>
<td><?= $r->quote_type ?></td>
<td><?= $quote_types ?></td>
<td><?= $r->labour_cost ?></td>
<td><?= $r->parts_cost ?></td>
<td>
......
<!DOCTYPE html>
<html>
<?php
$this->load->view('template/header_script');
$Currency = getCurrency();
?>
<style>
.profile_div{
width:100%;
text-align: center;
padding-top:0px;
padding-bottom: 30px;
}
.profile_circle{
width:120px;
height:120px;
border-radius: 50%;
background-color: #a8a8a8;
margin: 0 auto;
position: relative;
}
.profile_circle img{
width:100%;
height:100%;
border-radius: 50%;
object-position: center;
object-fit: cover;
}
.profile_circle input{
position: absolute;
top:0px;
left:0px;
right:0px;
bottom: 0px;
opacity: 0;
}
</style>
<body class="bg-dark">
<div class="sufee-login d-flex align-content-center flex-wrap">
<div class="container">
<div class="login-content">
<div class="login-logo">
<a href="index.html">
<label><h1>Express Registration</h1></label>
</a>
</div>
<div class="login-form">
<?php
$url = (isset($Express_id)||!empty($Express_id))
?'Registration_request/updateExpress/'.$Express_id:'';
if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
<form role="form" action="<?= base_url($url) ?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="profile_div">
<div class="profile_circle">
<?php $req = (!isset($Express_id)||empty($Express_id))
?'form-control required':'form-control';?>
<img id="image_id_1" src="<?= (isset($ExpressData->image))?base_url($ExpressData->image):'' ?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="75" width="75" />
<input name="profile_image" type="file" accept="image/*" onchange="setImg(this,'image_id_1');" class="<?= base_url($req) ?>"/>
</div>
</div>
<div class="form-group">
<label>User Name</label>
<input type="text" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="name" placeholder="Enter Name" class="form-control required" value="<?= (isset($ExpressData->name))?$ExpressData->name:'' ?>" >
</div>
<div class="form-group">
<div class="row">
<div class="col-md-3">
<label for="nf-email" class=" form-control-label">Code</label>
<select name="phone_code" id="selectSm" class="form-control required">
<option value=""></option>
<?php foreach($Currency as $crny) { ?>
<?php if (isset($Express_id)||!empty($Express_id)) { ?>
<option <?= $ExpressData->code == $crny['code'] ? "selected" : "" ; ?> value="<?= $crny['code'] ?>"><?= $crny['code'] ?></option>
<?php }else { ?>
<option value="<?= $crny['code'] ?>"><?= $crny['code'] ?></option>
<?php }} ?>
</select>
</div>
<div class="col-md-9">
<label for="nf-email" class=" form-control-label">Phone Number</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="phone" placeholder="Enter Phone Number" class="form-control required" value="<?= (isset($ExpressData->phone_no))?$ExpressData->phone_no:'' ?>" >
</div>
</div>
<div class="form-group">
<label>Email address</label>
<input type="email" id="pd_email" name="email" placeholder="Enter Email" class="form-control required" readonly="" onfocusout="myFunction()" value="<?= (isset($ExpressData->email_id))?$ExpressData->email_id:'' ?>" >
</div>
<div class="form-group">
<label>Password</label>
<input type="password" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="password" placeholder="Enter Password" class="form-control required" value="" >
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Location</label>
<input type="text" name="location" id="location" required class="form-control required" placeholder="Enter Location" onkeypress="ratelocation()" value="<?= (isset($ExpressData->location))?$ExpressData->location:'' ?>">
<input type="hidden" name="lat" id="lat" value="<?= (isset($ExpressData->lat))?$ExpressData->lat:'' ?>" required class="form-control required" readonly="">
<input type="hidden" name="lng" id="lng" value="<?= (isset($ExpressData->lng))?$ExpressData->lng:'' ?>" required class="form-control required" readonly="">
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Express Code</label>
<input type="text" readonly="" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="express_code" placeholder="Express Code" class="form-control required" value="<?= (isset($ExpressData->express_code))?$ExpressData->express_code:'' ?>" >
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Altered Number</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="altered_no" placeholder="Enter Altered Number" class="form-control required" value="<?= (isset($ExpressData->altered_no))?$ExpressData->altered_no:'' ?>" >
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Address</label>
<textarea type="text" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="address" placeholder="Enter Address" class="form-control required" ><?= (isset($ExpressData->address))?$ExpressData->address:'' ?></textarea>
</div>
<!-- <div class="checkbox">
<label>
<input type="checkbox"> Agree the terms and policy
</label>
</div> -->
<button type="submit" class="btn btn-primary btn-flat m-b-30 m-t-30">Register</button>
<div class="social-login-content">
<!-- <div class="social-button">
<button type="button" class="btn social facebook btn-flat btn-addon mb-3"><i class="ti-facebook"></i>Register with facebook</button>
<button type="button" class="btn social twitter btn-flat btn-addon mt-2"><i class="ti-twitter"></i>Register with twitter</button>
</div> -->
</div>
<!-- <div class="register-link m-t-15 text-center">
<p>Already have account ? <a href="#"> Sign in</a></p>
</div> -->
</form>
</div>
</div>
</div>
</div>
<?php
$this->load->view('template/footer_script');
?>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<?php
$this->load->view('template/header_script');
$Currency = getCurrency();
?>
<style>
.profile_div{
width:100%;
text-align: center;
padding-top:0px;
padding-bottom: 30px;
}
.profile_circle{
width:120px;
height:120px;
border-radius: 50%;
background-color: #a8a8a8;
margin: 0 auto;
position: relative;
}
.profile_circle img{
width:100%;
height:100%;
border-radius: 50%;
object-position: center;
object-fit: cover;
}
.profile_circle input{
position: absolute;
top:0px;
left:0px;
right:0px;
bottom: 0px;
opacity: 0;
}
</style>
<body class="bg-dark">
<div class="sufee-login d-flex align-content-center flex-wrap">
<div class="container">
<div class="login-content">
<div class="login-logo">
<a href="index.html">
<label><h1>Garage Registration</h1></label>
</a>
</div>
<div class="login-form">
<?php
$url = (isset($Garege_id)||!empty($Garege_id))
?'Registration_request/updateGarage/'.$Garege_id:'';
if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
<form role="form" action="<?= base_url($url) ?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="profile_div">
<div class="profile_circle">
<?php $req = (!isset($Garege_id)||empty($Garege_id))
?'form-control required':'form-control';?>
<img id="image_id_1" src="<?= (isset($garageData->profile_pic))?base_url($garageData->profile_pic):'' ?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="75" width="75" />
<input name="profile_image" type="file" accept="image/*" onchange="setImg(this,'image_id_1');" class="<?= base_url($req) ?>"/>
</div>
</div>
<div class="form-group">
<label>User Name</label>
<input type="text" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="name" placeholder="Enter Name" class="form-control required" value="<?= (isset($garageData->name))?$garageData->name:'' ?>" >
</div>
<div class="form-group">
<div class="row">
<div class="col-md-3">
<label for="nf-email" class=" form-control-label">Code</label>
<select name="phone_code" id="selectSm" class="form-control required">
<option value=""></option>
<?php foreach($Currency as $crny) { ?>
<?php if (isset($Garage_id)||!empty($Garage_id)) { ?>
<option <?= $garageData->code == $crny['code'] ? "selected" : "" ; ?> value="<?= $crny['code'] ?>"><?= $crny['code'] ?></option>
<?php }else { ?>
<option value="<?= $crny['code'] ?>"><?= $crny['code'] ?></option>
<?php }} ?>
</select>
</div>
<div class="col-md-9">
<label for="nf-email" class=" form-control-label">Phone Number</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="phone" placeholder="Enter Phone Number" class="form-control required" value="<?= (isset($garageData->phone_no))?$garageData->phone_no:'' ?>" >
</div>
</div>
<div class="form-group">
<label>Email address</label>
<label for="nf-email" class=" form-control-label">Email</label>
<input type="email" id="pd_email" name="email" placeholder="Enter Email" class="form-control required" onfocusout="myFunction()" value="<?= (isset($garageData->email))?$garageData->email:'' ?>" >
</div>
<div class="form-group">
<label>Password</label>
<input type="password" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="password" placeholder="Enter Password" class="form-control required" value="" >
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Location</label>
<input type="text" name="location" id="location" required class="form-control required" placeholder="Enter Location" onkeypress="ratelocation()" value="<?= (isset($garageData->location))?$garageData->location:'' ?>">
<input type="hidden" name="lat" id="lat" value="<?= (isset($garageData->lat))?$garageData->lat:'' ?>" required class="form-control required" readonly="">
<input type="hidden" name="lng" id="lng" value="<?= (isset($garageData->lng))?$garageData->lng:'' ?>" required class="form-control required" readonly="">
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Garage Code</label>
<input type="text" readonly="" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="garage_code" placeholder="Garage Code" class="form-control required" value="<?= (isset($garageData->garage_code))?$garageData->garage_code:$garage_code ?>" >
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Altered Number</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="altered_no" placeholder="Enter Altered Number" class="form-control required" value="<?= (isset($garageData->altered_no))?$garageData->altered_no:'' ?>" >
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Address</label>
<textarea type="text" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="address" placeholder="Enter Address" class="form-control required" ><?= (isset($garageData->address))?$garageData->address:'' ?></textarea>
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Website</label>
<input type="url" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" id="nf-brand" name="website" placeholder="Enter Website url" class="form-control required" value="<?= (isset($garageData->website))?$garageData->website:'' ?>" >
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Working From</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" id="nf-brand" name="working_from" placeholder="Working From" class="form-control required" value="<?= (isset($garageData->working_from))?$garageData->working_from:'' ?>" >
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Working To</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" id="nf-brand" name="working_to" placeholder="Working To" class="form-control required" value="<?= (isset($garageData->working_to))?$garageData->working_to:'' ?>" >
</div>
<!-- <div class="form-group">
<label for="nf-email" class=" form-control-label">Provide Amenities</label>
<select name="amenities[]" id="second" class="form-control chosen-select" multiple data-placeholder="Choose Services...">
<?php foreach($amenities as $amenitie) { ?>
<?php if (isset($Garage_id)||!empty($Garage_id)) {
$garage = explode(',', $garageData->amenities);
$selected = in_array($amenitie->id, $garage) ? 'selected="selected"': '';
?>
<option <?= $selected ? "selected" : "" ; ?> value="<?= $amenitie->id ?>"><?= $amenitie->name ?></option>
<?php }else { ?>
<option value="<?= $amenitie->id ?>"><?= $amenitie->name ?></option>
<?php }} ?>
</select>
</div> -->
<!-- <div class="form-group">
<label for="nf-email" class=" form-control-label">Provide Amenities</label>
<select name="amenities[]" id="second" class="form-control chosen-select" multiple data-placeholder="Choose Services...">
<?php foreach($amenities as $amenitie) { ?>
<?php if (isset($Garage_id)||!empty($Garage_id)) {
$garage = explode(',', $garageData->amenities);
$selected = in_array($amenitie->id, $garage) ? 'selected="selected"': '';
?>
<option <?= $selected ? "selected" : "" ; ?> value="<?= $amenitie->id ?>"><?= $amenitie->name ?></option>
<?php }else { ?>
<option value="<?= $amenitie->id ?>"><?= $amenitie->name ?></option>
<?php }} ?>
</select>
</div> -->
<!-- <div class="checkbox">
<label>
<input type="checkbox"> Agree the terms and policy
</label>
</div> -->
<button type="submit" class="btn btn-primary btn-flat m-b-30 m-t-30">Register</button>
<div class="social-login-content">
<!-- <div class="social-button">
<button type="button" class="btn social facebook btn-flat btn-addon mb-3"><i class="ti-facebook"></i>Register with facebook</button>
<button type="button" class="btn social twitter btn-flat btn-addon mt-2"><i class="ti-twitter"></i>Register with twitter</button>
</div> -->
</div>
<!-- <div class="register-link m-t-15 text-center">
<p>Already have account ? <a href="#"> Sign in</a></p>
</div> -->
</form>
</div>
</div>
</div>
</div>
<?php
$this->load->view('template/footer_script');
?>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<?php
$this->load->view('template/header_script');
$Currency = getCurrency();
?>
<style>
.profile_div{
width:100%;
text-align: center;
padding-top:0px;
padding-bottom: 30px;
}
.profile_circle{
width:120px;
height:120px;
border-radius: 50%;
background-color: #a8a8a8;
margin: 0 auto;
position: relative;
}
.profile_circle img{
width:100%;
height:100%;
border-radius: 50%;
object-position: center;
object-fit: cover;
}
.profile_circle input{
position: absolute;
top:0px;
left:0px;
right:0px;
bottom: 0px;
opacity: 0;
}
</style>
<body class="bg-dark">
<div class="sufee-login d-flex align-content-center flex-wrap">
<div class="container">
<div class="login-content">
<div class="login-logo">
<a href="index.html">
<label><h1>POS Registration</h1></label>
</a>
</div>
<div class="login-form">
<?php
$url = (isset($Pos_id)||!empty($Pos_id))
?'Registration_request/updatePos/'.$Pos_id:'';
if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
<form role="form" action="<?= base_url($url) ?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="profile_div">
<div class="profile_circle">
<?php $req = (!isset($Pos_id)||empty($Pos_id))
?'form-control required':'form-control';?>
<img id="image_id_1" src="<?= (isset($PosData->profile_photo))?base_url($PosData->profile_photo):'' ?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="75" width="75" />
<input name="profile_image" type="file" accept="image/*" onchange="setImg(this,'image_id_1');" class="<?= base_url($req) ?>"/>
</div>
</div>
<div class="form-group">
<label>User Name</label>
<input type="text" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="name" placeholder="Enter Name" class="form-control required" value="<?= (isset($PosData->name))?$PosData->name:'' ?>" >
</div>
<div class="form-group">
<div class="row">
<div class="col-md-3">
<label for="nf-email" class=" form-control-label">Code</label>
<select name="phone_code" id="selectSm" class="form-control required">
<option value="">Code</option>
<?php foreach($Currency as $crny) { ?>
<?php if (isset($Pos_id)||!empty($Pos_id)) { ?>
<option <?= $PosData->code == $crny['code'] ? "selected" : "" ; ?> value="<?= $crny['code'] ?>"><?= $crny['code'] ?></option>
<?php }else { ?>
<option value="<?= $crny['code'] ?>"><?= $crny['code'] ?></option>
<?php }} ?>
</select>
</div>
<div class="col-md-9">
<label for="nf-email" class=" form-control-label">Phone Number</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="phone" placeholder="Enter Phone Number" class="form-control required" value="<?= (isset($PosData->phone_no))?$PosData->phone_no:'' ?>" >
</div>
</div>
<div class="form-group">
<label>Email address</label>
<label for="nf-email" class=" form-control-label">Email</label>
<input type="email" id="pd_email" name="email" placeholder="Enter Email" class="form-control required" onfocusout="myFunction()" value="<?= (isset($PosData->email_id))?$PosData->email_id:'' ?>" >
</div>
<div class="form-group">
<label>Password</label>
<input type="password" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="password" placeholder="Enter Password" class="form-control required" value="" >
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Location</label>
<input type="text" name="location" id="location" required class="form-control required" placeholder="Enter Location" onkeypress="ratelocation()" value="<?= (isset($PosData->location))?$PosData->location:'' ?>">
<input type="hidden" name="lat" value="<?= (isset($PosData->lat))?$PosData->lat:'' ?>" id="lat" required class="form-control required" readonly="">
<input type="hidden" name="lng" id="lng" value="<?= (isset($PosData->lng))?$PosData->lng:'' ?>" required class="form-control required" readonly="">
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Pos Code</label>
<input type="text" readonly="" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="Pos_code" placeholder="Pos Code" class="form-control required" value="<?= (isset($PosData->pos_code))?$PosData->pos_code:'' ?>" >
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Altered Number</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="altered_no" placeholder="Enter Altered Number" class="form-control required" value="<?= (isset($PosData->altered_no))?$PosData->altered_no:'' ?>" >
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Address</label>
<textarea type="text" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="address" placeholder="Enter Address" class="form-control required" ><?= (isset($PosData->address))?$PosData->address:'' ?></textarea>
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Working From</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" id="nf-brand" name="working_from" placeholder="Working From" class="form-control required" value="<?= (isset($PosData->working_from))?$PosData->working_from:'' ?>" >
</div>
<div class="form-group">
<label for="nf-email" class=" form-control-label">Working To</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" id="nf-brand" name="working_to" placeholder="Working To" class="form-control required" value="<?= (isset($PosData->working_to))?$PosData->working_to:'' ?>" >
</div>
<button type="submit" class="btn btn-primary btn-flat m-b-30 m-t-30">Register</button>
<div class="social-login-content">
</div>
</form>
</div>
</div>
</div>
</div>
<?php
$this->load->view('template/footer_script');
?>
</body>
</html>
\ No newline at end of file
<!-- PAGE-INDEX-STARTS -->
<div class="breadcrumbs">
<div class="breadcrumbs-inner">
<?php
if($this->session->flashdata('message')) {
$message = $this->session->flashdata('message');
?>
<div class="alert alert-<?php echo $message['class']; ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?php echo $message['message']; ?>
</div>
<?php } ?>
<div class="row m-0">
<div class="col-sm-4">
<div class="page-header float-left">
<div class="page-title">
<h1><?= $pTitle ?></h1>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="page-header float-right">
<div class="page-title">
<ol class="breadcrumb text-right">
<li><a href="<?= base_url() ?>">Dashboard</a></li>
<li><a ><?= $menu ?></a></li>
</ol>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- PAGE-INDEX-ENDS -->
<!-- PAGE-CONTENT-STARTS -->
<div class="content">
<div class="animated fadeIn">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<strong class="card-title"><?= $pDescription ?></strong>
</div>
<div class="card-body">
<table id="" class="table table-striped table-bordered dataTable-custom" data-ajax="Rassist_booking/get_all_booking">
<thead>
<tr>
<th>No</th>
<th>Booking ID</th>
<th>Customer Details</th>
<th>Vehicle Details</th>
<th>Road Assist</th>
<th>Location</th>
<th>Date</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<th>No</th>
<th>Booking ID</th>
<th>Customer Details</th>
<th>Vehicle Details</th>
<th>Road Assist </th>
<th>Location</th>
<th>Date</th>
<th>Status</th>
<th>Action</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- PAGE-CONTENT-ENDS -->
<!-- .model -->
<div id="myModal23" class="modal fade" role="dialog" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Booking Details</h4>
</div>
<div class="modal-body" id="details" >
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- .card -->
</div>
<!-- PAGE-CONTENT-ENDS -->
<script type="text/javascript">
function doconfirm(){
action = confirm("Are you sure to delete permanently?");
if(action != true) return false;
}
</script>
<script type="text/javascript">
function viewBookingDetails(booking_id){
if(booking_id=='' || booking_id==undefined || booking_id=='undefined' || booking_id==null || booking_id=='null'){
return true;
}
// modalTrigger('Quote Details','');
// addModalLoader();
jQuery('[id="myModal23"]').modal('show');
var resp = post_ajax(base_url+"Rassist_booking/getAssist_bookingData",{'booking_id':booking_id});
if(resp == '' || resp == undefined || resp == 'undefined' || resp == null || resp == 'null'){
remModalLoader();
jQuery('[id="modal_content"]').html('Something went wrong, please try again later...!');
return false;
}
var quote_data = jQuery.parseJSON(resp).data;
jQuery.each(quote_data, function (index, value) {
if(value == '' || value == null || value == undefined || value == 'null' || value == 'undefined'){
quote_data[index] = ' -- ';
}
});
var html = '<table id="DataTables_Table_0" class="table table-striped table-bordered dataTable-custom dataTable" data-ajax="Garage_request/get_all_Garage_request" role="grid" aria-describedby="DataTables_Table_0_info">'+
'<thead>'+
'<tr role="row">'+
'<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" style="width: 200px;" aria-label="Request Code: activate to sort column ascending">Booking Code:'+ quote_data[0]['booking_id']+'</th>'+
'</tr>'+
'</thead>'+
'</table>'+
'<table id="DataTables_Table_0" class="table table-striped table-bordered dataTable-custom dataTable" data-ajax="Garage_request/get_all_Garage_request" role="grid" aria-describedby="DataTables_Table_0_info">'+
'<thead>'+
'<tr role="row">'+
'<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" style="width: 200px;" aria-label="Request Code: activate to sort column ascending">Customer</th>'+
'</tr>'+
'</thead>'+
'<tbody>'+
'<tr role="row" class="odd">'+
'<td>Name</td>'+
'<td>'+ quote_data[0]['customer_name']+'</td>'+
'</tr>'+
'<tr role="row" class="odd">'+
'<td>Phone No</td>'+
'<td>'+ quote_data[0]['customer_phone']+'</td>'+
'</tr>'+
'<tr role="row" class="odd">'+
'<td>Email ID</td>'+
'<td>'+ quote_data[0]['email_id']+'</td>'+
'</tr>'+
'</tbody>'+
'</table>';
if(quote_data[0]['status'] != 1){
html += '<table id="DataTables_Table_0" class="table table-striped table-bordered dataTable-custom dataTable" data-ajax="Garage_request/get_all_Garage_request" role="grid" aria-describedby="DataTables_Table_0_info">'+
'<thead>'+
'<tr role="row">'+
'<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" style="width: 200px;" aria-label="Request Code: activate to sort column ascending">Road Assist</th>'+
'</tr>'+
'</thead>'+
'<tbody>'+
'<tr role="row" class="odd">'+
'<td>Roadassist Code</td>'+
'<td>'+ quote_data[0]['road_assist_code']+'</td>'+
'</tr>'+
'<tr role="row" class="odd">'+
'<td>Name</td>'+
'<td>'+ quote_data[0]['road_assist_name']+'</td>'+
'</tr>'+
'<tr role="row" class="odd">'+
'<td>Phone No</td>'+
'<td>'+ quote_data[0]['road_assist_phone']+'</td>'+
'</tr>'+
'</tbody>'+
'</table>';
}
html += '<table id="DataTables_Table_0" class="table table-striped table-bordered dataTable-custom dataTable" data-ajax="Garage_request/get_all_Garage_request" role="grid" aria-describedby="DataTables_Table_0_info">'+
'<thead>'+
'<tr role="row">'+
'<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" style="width: 200px;" aria-label="Request Code: activate to sort column ascending">Vehicle</th>'+
'</tr>'+
'</thead>'+
'<tbody>'+
'<tr role="row" class="odd">'+
'<td>Vehicle Name</td>'+
'<td>'+ quote_data[0]['vehicle_name']+'</td>'+
'</tr>'+
'<tr role="row" class="odd">'+
'<td>Vehicle Modal</td>'+
'<td>'+ quote_data[0]['model']+'</td>'+
'</tr>'+
'<tr role="row" class="odd">'+
'<td>Vehicle Make</td>'+
'<td>'+ quote_data[0]['make']+'</td>'+
'</tr>'+
'<tr role="row" class="odd">'+
'<td>Vehicle Year</td>'+
'<td>'+ quote_data[0]['year']+'</td>'+
'</tr>'+
'<tr role="row" class="odd">'+
'<td>Vehicle Mileage</td>'+
'<td>'+ quote_data[0]['mileage']+'</td>'+
'</tr>'+
'</tbody>'+
'</table>'+
'<table id="DataTables_Table_0" class="table table-striped table-bordered dataTable-custom dataTable" data-ajax="Garage_request/get_all_Garage_request" role="grid" aria-describedby="DataTables_Table_0_info">'+
'<thead>'+
'<tr role="row">'+
'<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" style="width: 200px;" aria-label="Request Code: activate to sort column ascending">Booking Details</th>'+
'</tr>'+
'</thead>'+
'<tbody>'+
'<tr role="row" class="odd">'+
'<td>Service cost</td>'+
'<td>'+ quote_data[0]['cost']+'</td>'+
'</tr>'+
'<tr role="row" class="odd">'+
'<td>Booking Date</td>'+
'<td>'+ quote_data[0]['date']+'</td>'+
'</tr>'+
'<tr role="row" class="odd">'+
'<td>Requirement</td>'+
'<td>'+ quote_data[0]['requirement']+'</td>'+
'</tr>'+
'</tbody>'+
'</table>';
remModalLoader();
jQuery('[id="details"]').html(html);
jQuery('[id="customerProfileImg"]').error(function() {
jQuery('[id="customerProfileImg"]').attr('src',base_url+'assets/images/no_image.png');
});
}
/*[customer_name] => customerA
[customer_phone] => 9998887774
[email_id] => [email protected]
[id] => 3
[cust_id] => 4
[vehicle_id] => 2
[date] => 2019-08-15 00:00:00
[requirement] => ghfh
[lat] => 10.023676
[lng] => 76.311623
[road_assist_id] => 1
[cost] => 0
[status] => 1
[year] => fg
[vin] => gfgf4436547546
[model] => ggfg
[make] => ghg
[vehicle_name] => fgh
[mileage] => 55*/
</script>
\ No newline at end of file
<!DOCTYPE html>
<html>
<?php
$this->load->view('template/header_script');
?>
<body class="bg-dark">
<div class="sufee-login d-flex align-content-center flex-wrap">
<div class="container">
<div class="login-content">
<div class="login-logo">
<a href="index.html">
<img class="align-content" src="<?php echo base_url('assets/images/logo.png'); ?>" alt="">
</a>
</div>
<div class="login-form">
<form>
<div class="form-group">
<label>Email address</label>
<input type="email" class="form-control" placeholder="Email">
</div>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control" placeholder="Password">
</div>
<div class="checkbox">
<label>
<input type="checkbox"> Remember Me
</label>
<label class="pull-right">
<a href="#">Forgotten Password?</a>
</label>
</div>
<button type="submit" class="btn btn-success btn-flat m-b-30 m-t-30">Sign in</button>
<div class="register-link m-t-15 text-center">
<p>Don't have account ? <a href="#"> Sign Up Here</a></p>
</div>
</form>
</div>
</div>
</div>
</div>
<?php
$this->load->view('template/footer_script');
?>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Access - Customer Login Details</title>
<title>ALLO - Customer Login Details</title>
<style>
.pin_container{
background: #a8a8a8;
......@@ -35,13 +35,11 @@
<h2 style="color: #555555; font-weight: bold; margin: 0; padding: 0 0 10px; line-height: 25px; font-size: 15px; font-family:'Roboto',sans-serif; border-bottom: 1px dashed #ccc; " align="center"></h2>
<div style="border-bottom: 1px dashed #ccc; padding: 10px 0; line-height: 160%; font-size: 15px;">
<div style="color: #555555; line-height: 160%;font-family:'Roboto',sans-serif;">
<?php echo ($registration_mail);?>
<center>
<div class="pin_container">
Username: <?php echo ($email);?><br>
Password: <?php echo ($password);?>
Garage Registration Link: <?php echo ($reg_url);?><br>
</div>
</center><br>
......
<!DOCTYPE html>
<html>
<head>
<title>Access - Customer Login Details</title>
<title>ALLO</title>
<style>
.pin_container{
background: #a8a8a8;
......@@ -31,17 +31,16 @@
<tbody>
<tr>
<td align="left" style="padding: 25px;">
<h3 style="margin: 0; text-align: center; padding: 0 0 10px; font-weight: normal; font-weight: normal; font-size: 26px; color: #09ad8b; line-height: 32px; font-family:'Roboto',sans-serif; "> <strong>Hi <?php echo ($name);?></strong>, Welcome to Access.</h3>
<h3 style="margin: 0; text-align: center; padding: 0 0 10px; font-weight: normal; font-weight: normal; font-size: 26px; color: #09ad8b; line-height: 32px; font-family:'Roboto',sans-serif; "> <strong>Hi <?php echo ($name);?></strong>, Welcome to ALLO.</h3>
<h2 style="color: #555555; font-weight: bold; margin: 0; padding: 0 0 10px; line-height: 25px; font-size: 15px; font-family:'Roboto',sans-serif; border-bottom: 1px dashed #ccc; " align="center"></h2>
<div style="border-bottom: 1px dashed #ccc; padding: 10px 0; line-height: 160%; font-size: 15px;">
<div style="color: #555555; line-height: 160%;font-family:'Roboto',sans-serif;">
<?php echo ($registration_mail);?>
<center>
<div class="pin_container">
Username: <?php echo ($email);?><br>
Password: <?php echo ($password);?>
Garage Registration Link: <?php echo ($reg_url);?><br>
</div>
</center><br>
......
......@@ -31,18 +31,18 @@
<tbody>
<tr>
<td align="left" style="padding: 25px;">
<h3 style="margin: 0; text-align: center; padding: 0 0 10px; font-weight: normal; font-weight: normal; font-size: 26px; color: #09ad8b; line-height: 32px; font-family:'Roboto',sans-serif; "> <strong>Hi <?php echo ($name);?></strong>, Welcome to Access.</h3>
<h3 style="margin: 0; text-align: center; padding: 0 0 10px; font-weight: normal; font-weight: normal; font-size: 26px; color: #09ad8b; line-height: 32px; font-family:'Roboto',sans-serif; "> <strong>Hi <?php echo ($name);?></strong>, Welcome to Allo.</h3>
<h2 style="color: #555555; font-weight: bold; margin: 0; padding: 0 0 10px; line-height: 25px; font-size: 15px; font-family:'Roboto',sans-serif; border-bottom: 1px dashed #ccc; " align="center"></h2>
<div style="border-bottom: 1px dashed #ccc; padding: 10px 0; line-height: 160%; font-size: 15px;">
<div style="color: #555555; line-height: 160%;font-family:'Roboto',sans-serif;">
<?php echo ($shopper_mail);?>
<!-- <?php echo ($shopper_mail);?> -->
<center>
<div class="pin_container">
Username: <?php echo ($email);?><br>
Password: <?php echo ($password);?>
Express Registration Link: <?php echo ($reg_url);?><br>
</div>
</center><br>
......
......@@ -5,6 +5,8 @@
<nav class="navbar navbar-expand-sm navbar-default">
<div id="main-menu" class="main-menu collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active">
<a href="<?php echo base_url('dashboard'); ?>"><i class="menu-icon fa fa-laptop"></i>Dashboard </a>
</li>
......@@ -18,24 +20,7 @@
</ul>
</li>
<!-- <li class="menu-item-has-children dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="menu-icon fa fa-circle-o"></i>Manage Garage Request</a>
<ul class="sub-menu children dropdown-menu">
<li><i class="fa fa-tasks"></i><a href="<?php echo base_url('Garage_request'); ?>">List </a></li>
</ul>
</li> -->
<!-- <li class="menu-item-has-children dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="menu-icon fa fa-check-circle-o"></i>Manage Garage Response</a>
<ul class="sub-menu children dropdown-menu">
<li><i class="fa fa-tasks"></i><a href="<?php echo base_url('Garage_response'); ?>">List</a></li>
</ul>
</li> -->
<li class="menu-item-has-children dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="menu-icon fa fa-book"></i>Service Booking</a>
......@@ -108,8 +93,6 @@
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="menu-icon fa fa-users"></i>Customer</a>
<ul class="sub-menu children dropdown-menu">
<!-- <li><i class="fa fa-user-plus"></i><a href="<?php echo base_url('index.php/customer/create'); ?>">Create</a></li> -->
<li><i class="fa fa-tasks"></i><a href="<?php echo base_url('index.php/customer'); ?>">List</a></li>
</ul>
......@@ -167,7 +150,12 @@
</ul>
</li>
<li class="menu-item-has-children dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="menu-icon fa fa-circle-o"></i>Roadassist Booking</a>
<ul class="sub-menu children dropdown-menu">
<li><i class="fa fa-tasks"></i><a href="<?php echo base_url('Rassist_booking'); ?>">List</a></li>
</ul>
</li>
<li class="menu-item-has-children dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="menu-icon fa fa-braille"></i>Amenities</a>
......@@ -210,8 +198,6 @@
</ul>
</li>
</ul>
</div>
</nav>
......
......@@ -12,8 +12,6 @@ class Garage extends CI_Controller {
redirect(base_url());
}
}
......@@ -37,9 +35,9 @@ public function create(){
$template['smenu'] = 'Add Garage';
$template['pTitle'] = "Add Garage";
$template['pDescription'] = "Create New Garage";
$template['services'] = $this->Garage_model->getGarageServices();
$template['amenities'] = $this->Garage_model->getAmenities();
//echo json_encode($template['amenities']);exit;
$template['services'] = $this->Garage_model->getGarageServices();
$template['amenities'] = $this->Garage_model->getAmenities();
$this->load->view('template',$template);
}
......@@ -51,7 +49,7 @@ public function getGarageData(){
echo json_encode($resArr);exit;
}
$view_all = (isset($_POST['view_all']) && !empty($_POST['view_all']))?$_POST['view_all']:'';
//$view_all = (isset($_POST['view_all']) && $_POST['view_all'] == 1)?1:0;
$mechData = $this->Garage_model->getGarageData($garage_id,$view_all);
if(empty($mechData)){
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Garage_profile extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Garage_profile_model');
if(!$this->session->userdata('logged_garage')) {
redirect(base_url());
}
}
public function viewProfile() {
$id = $this->session->userdata('garage_id');
$template['page'] = 'Profile/viewProfile';
$template['menu'] = "Profile";
$template['smenu'] = "Edit Profile";
$template['pTitle'] = "Edit Profile";
$template['pDescription'] = "Edit User Profile";
$template['admin'] = $this->Garage_profile_model->getAdminData($this->session->userdata('id'));
$template['services'] = $this->Garage_profile_model->getGarageServices();
$template['garageData'] = $this->Garage_profile_model->getGarageData($id);
$template['Garage_id'] =encode_param($id);
$template['amenities'] = $this->Garage_profile_model->getAmenities();
$template['serviceData'] = $this->Garage_profile_model->getServiceData($id);
//echo json_encode($template);exit;
$this->load->view('template',$template);
}
public function updateGarage($Garage_id = ''){
$id=decode_param($Garage_id);
$err = 0;
$errMsg = '';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'danger');
if(!isset($_POST) || empty($_POST) || !isset($_FILES) || empty($_FILES)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Garage_profile/viewProfile'.$Garage_id));
}
if($err == 0 && (!isset($_POST['name']) || empty($_POST['name']))){
$err = 1;
$errMsg = 'Provide Garage Name';
}else if($err == 0 && (!isset($_POST['email']) || empty($_POST['email']))){
$err = 1;
$errMsg = 'Provide a Garage Email';
}else if($err == 0 && (!isset($_POST['phone']) || empty($_POST['phone']))){
$err = 1;
$errMsg = 'Provide Garage Phone';
}
if($err == 0){
$config = set_upload_service("assets/uploads/Garage");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['profile_image']['name'];
$this->upload->initialize($config);
if(!$this->upload->do_upload('profile_image')){
$err = 1;
$errMsg = $this->upload->display_errors();
}else{
$upload_data = $this->upload->data();
$image = $upload_data['file_name'];
$new_array = array('width'=>100, 'height'=>100);
$image_file = $config['upload_path']."/".$upload_data['file_name'];
$_POST['profile_image'] = $image_file;
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Garage_profile/viewProfile/'.$Garage_id));
}
$status = $this->Garage_profile_model->updateGarage($id,$_POST);
if($status == 1){
$flashMsg = array('message'=>'Update Successfully!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Garage_profile/viewProfile/'.encode_param($id)));
} else if($status == 2){
$flashMsg = array('message'=>'Email ID already exist..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Garage_profile/viewProfile/'.$Garage_id));
} else if($status == 3){
$flashMsg = array('message'=>'Phone Number already exist..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Garage_profile/viewProfile/'.$Garage_id));
} else if($status == 4){
$flashMsg = array('message'=>'User Name already exist..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Garage_profile/viewProfile/'.$Garage_id));
}
else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Garage_profile/viewProfile/'.$Garage_id));
}
}
}
?>
\ No newline at end of file
......@@ -16,11 +16,8 @@ public function __construct() {
$template['page_title'] = "Login";
if(isset($_POST)) {
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Username', 'trim|required');
$this->form_validation->set_rules('password', 'Password', 'trim|required|callback_check_database');
if($this->form_validation->run() == TRUE) {
redirect(base_url().'Dashboard');
}
......@@ -29,7 +26,6 @@ public function __construct() {
}
$this->load->view('login', $template);
......@@ -44,8 +40,7 @@ public function __construct() {
$sess_array = array(
'garage_id' => $result->profile_id,
'username' => $result->username,
'user_type'=> $result->user_type
);
'user_type'=> $result->user_type);
$this->session->set_userdata('logged_garage',$sess_array);
$this->session->set_userdata('user_type',$result->user_type);
$this->session->set_userdata('garage_id',$result->profile_id);
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class User extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('User_model');
if(!$this->session->userdata('logged_garage')) {
redirect(base_url());
}
}
public function viewProfile() {
$template['page'] = 'Profile/viewProfile';
$template['menu'] = "Profile";
$template['smenu'] = "Edit Profile";
$template['pTitle'] = "Edit Profile";
$template['pDescription'] = "Edit User Profile";
$template['admin'] = $this->User_model->getAdminData($this->session->userdata('id'));
//echo json_encode($template);exit;
$this->load->view('template',$template);
}
public function updateUser(){
$user_id = $this->session->userdata('id');
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'danger');
if(empty($user_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('User/viewProfile'));
}
if(isset($_FILES['profile_image']) && !empty($_FILES['profile_image'])){
$config = set_upload_service("uploads/profile");
$this->load->library('upload');
$new_name = time()."_".$_FILES['profile_image']['name'];
$config['file_name'] = $new_name;
$this->upload->initialize($config);
if($this->upload->do_upload('profile_image')){
$upload_data = $this->upload->data();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
if((isset($_POST['password']) || isset($_POST['cPassword'])) &&
(!empty($_POST['password']) || !empty($_POST['cPassword']))){
if($_POST['password'] != $_POST['cPassword']){
$flashMsg = array('message'=>'Re-enter Password..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/viewProfile'));
}
$password = $_POST['password'];
unset($_POST['password']);
unset($_POST['cPassword']);
$_POST['password'] = md5($password);
} else {
unset($_POST['password']);
unset($_POST['cPassword']);
}
if (!isset($_POST['username']) || empty($_POST['username'])){
$flashMsg = array('message'=>'Provide a valid Username..!','class'=>'danger');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/viewProfile'));
}
$status = $this->User_model->updateUser($user_id,$_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/viewProfile'));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/viewProfile'));
}
}
}
?>
\ No newline at end of file
<?php
class Garage_profile_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
function getAdminData($user_id = ''){
if(empty($user_id)){
return 0;
}
$query = $this->db->get_where('admin',array('id'=>$user_id));
if($query->num_rows() > 0 && !empty($query)){
$result = $query->row();
return $result;
}
return 0;
}
function updateUser($user_id = '',$user_data = array()){
if(empty($user_id) || empty($user_data)){
return 0;
}
$userData['username'] = $user_data['username'];
if(isset($user_data['password']) && !empty($user_data['password'])){
$userData['password'] = $user_data['password'];
}
if(isset($user_data['profile_image']) && !empty($user_data['profile_image'])){
$userData['profile_picture'] = $user_data['profile_image'];
}
$this->db->update('admin',$userData,array('id'=>$user_id));
if(!empty($usrData)){
$this->session->set_userdata('id',$usrData->id);
$this->session->set_userdata('username',$usrData->username);
$this->session->set_userdata('logged_in','1');
$this->session->set_userdata('user_type','1');
}
return 1;
}
public function getGarageServices(){
$sql = "SELECT *
FROM sub_services WHERE status!='2' Order by id DESC";
$GarageData = $this->db->query($sql);
if(isset($GarageData)){
return ($GarageData->result());
}
return 0;
}
public function getGarageData($Garage_id='',$view=''){
$sql = "SELECT garage.*
FROM garage
INNER JOIN users AS USR ON (USR.profile_id=garage.garage_id)
WHERE garage.garage_id='$Garage_id' AND USR.user_type='2' Order by garage.garage_id DESC";
$GarageData = $this->db->query($sql);
if(isset($GarageData)){
return ($GarageData->row());
}
return 0;
}
public function getServiceData($Garage_id='',$view=''){
$sql = "SELECT garage_services.*,services.service_name,sub_services.sub_services as subservice_name
FROM garage_services
INNER JOIN sub_services ON (sub_services.id=garage_services.subservice_id)
INNER JOIN services ON (services.id=sub_services.id)
WHERE garage_services.garage_id='$Garage_id' AND garage_services.status='1' Order by garage_services.garage_id DESC";
$GarageData = $this->db->query($sql);
if(isset($GarageData)){
return ($GarageData->result());
}
return 0;
}
public function getAmenities(){
$sql = "SELECT *
FROM amenities WHERE status!='3' Order by id DESC";
$amenitiesData = $this->db->query($sql);
if(isset($amenitiesData)){
return ($amenitiesData->result());
}
return 0;
}
function updateGarage($Garage_id = '', $Garage_data = array()){
if(empty($Garage_id) || empty($Garage_data))
return 0;
$userIdChk = $this->db->query("SELECT * FROM garage AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.garage_id)
WHERE USR.status!='2' AND CUST.garage_id!='".$Garage_id."' AND
USR.username='".$Garage_data['email']."'");
if(!empty($userIdChk) && $userIdChk->num_rows() > 0) { return 4; }
$emailChk = $this->db->query("SELECT * FROM garage AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.garage_id)
WHERE USR.status!='2' AND CUST.garage_id!='".$Garage_id."' AND
CUST.email='".$Garage_data['email']."'");
if(!empty($emailChk) && $emailChk->num_rows() > 0) { return 2; }
$phoneChk = $this->db->query("SELECT * FROM garage AS CUST
INNER JOIN users AS USR ON (USR.profile_id=CUST.garage_id)
WHERE USR.status!='2' AND CUST.garage_id!='".$Garage_id."' AND
CUST.phone_no='".$Garage_data['phone']."'");
if(!empty($phoneChk) && $phoneChk->num_rows() > 0) { return 3; }
$upMecArr = array('name'=>$Garage_data['name'],
'email'=>$Garage_data['email'],
'code'=>$Garage_data['phone_code'],
'phone_no'=>$Garage_data['phone'],
'altered_no'=>$Garage_data['altered_no'],
'location'=>$Garage_data['location'],
'lat'=>$Garage_data['lat'],
'lng'=>$Garage_data['lng'],
'garage_code'=>$Garage_data['garage_code'],
'working_from'=>$Garage_data['working_from'],
'working_to'=>$Garage_data['working_to'],
'website'=>$Garage_data['website'],
'amenities' => implode(",",$Garage_data['amenities']),
'address'=>$Garage_data['address']);
$admUpdateArr = array('username'=>$Garage_data['email']);
if(isset($Garage_data['profile_image']) && !empty($Garage_data['profile_image'])){
$upMecArr['profile_pic'] = $Garage_data['profile_image'];
}
$status = $this->db->update('users',$admUpdateArr,array('profile_id'=>$Garage_id,'user_type'=>'1'));
if(!$status) { return 0; }
if (isset($Garage_data['services']) && isset($Garage_data['amount']) &&
!empty($Garage_data['services']) && !empty($Garage_data['amount'])) {
$this->db->where('garage_id',$Garage_id);
$dltstatus = $this->db->delete('garage_services');
if($dltstatus) {
foreach ($Garage_data['services'] as $key => $service_id) {
$amount = $Garage_data['amount'][$key];
$services = $Garage_data['services'][$key];
$this->db->query("INSERT INTO garage_services (subservice_id, cost, garage_id) VALUES ('$services', '$amount', '$Garage_id')");
}
}
}
$status = $this->db->update('garage',$upMecArr,array('garage_id'=>$Garage_id));
return $status;
}
}
?>
\ No newline at end of file
<?php
class User_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
function getAdminData($user_id = ''){
if(empty($user_id)){
return 0;
}
$query = $this->db->get_where('admin',array('id'=>$user_id));
if($query->num_rows() > 0 && !empty($query)){
$result = $query->row();
return $result;
}
return 0;
}
function updateUser($user_id = '',$user_data = array()){
if(empty($user_id) || empty($user_data)){
return 0;
}
$userData['username'] = $user_data['username'];
if(isset($user_data['password']) && !empty($user_data['password'])){
$userData['password'] = $user_data['password'];
}
if(isset($user_data['profile_image']) && !empty($user_data['profile_image'])){
$userData['profile_picture'] = $user_data['profile_image'];
}
$this->db->update('admin',$userData,array('id'=>$user_id));
if(!empty($usrData)){
$this->session->set_userdata('id',$usrData->id);
$this->session->set_userdata('username',$usrData->username);
$this->session->set_userdata('logged_in','1');
$this->session->set_userdata('user_type','1');
}
return 1;
}
}
?>
\ No newline at end of file
<?php
$Currency = getCurrency();
?>
<!-- PAGE-INDEX-STARTS -->
<div class="breadcrumbs">
<div class="breadcrumbs-inner">
......@@ -5,7 +10,7 @@
<div class="col-sm-4">
<div class="page-header float-left">
<div class="page-title">
<h1><?= $menu ?></h1>
<h1><?= $pTitle ?></h1>
</div>
</div>
</div>
......@@ -25,23 +30,20 @@
</div>
<!-- PAGE-INDEX-ENDS -->
<?php
$garage_code = getgarage_code();
$country = getCurrency();
?>
<!-- PAGE-CONTENT-STARTS -->
<div class="content">
<div class="animated fadeIn">
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<strong class="card-title"><?= $smenu ?></strong>
</div>
<div class="card-body">
<!-- Credit Card -->
<div id="pay-invoice">
<?php
$url = (!isset($subcat_id)||empty($subcat_id))
?'Sub_category/create_Subcategory':'Sub_category/edit_Subcategory/'.$subcat_id;
$url = (!isset($Garage_id)||empty($Garage_id))
?'Garage_profile/createGarage':'Garage_profile/updateGarage/'.$Garage_id;
if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
......@@ -49,78 +51,309 @@
<?= $flashdata['message'] ?>
</div>
<?php } ?>
<form role="form" action="<?=base_url('User/updateUser')?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<!-- Basic Details -->
<form role="form" action="<?= base_url($url) ?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="card">
<div class="card-header">
<strong><?= $pDescription ?></strong>
</div>
<div class="card-body card-block">
<div class="form-group">
<div class="row">
<div class="col-md-6">
<label for="nf-email" class=" form-control-label">Name</label>
<input type="text" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="name" placeholder="Enter Name" class="form-control required" value="<?= (isset($garageData->name))?$garageData->name:'' ?>" >
</div>
<?php $req = (!isset($Garage_id)||empty($Garage_id))
?'form-control required':'form-control';?>
<div class="col-md-6">
<label>Profile Picture</label><br>
<div class="row">
<div class="col-6">
<img id="image_id_1" src="<?= (isset($garageData->profile_pic))?base_url($garageData->profile_pic):'' ?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="75" width="75" />
<input name="profile_image" type="file" accept="image/*" onchange="setImg(this,'image_id_1');" class="<?= base_url($req) ?>"/>
</div>
</div>
</div>
<div class="form-group">
<label>User Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="username" required=""
data-parsley-pattern="^[a-zA-Z0-9\ . _ @ \/]+$"
value="<?= $admin->username ?>" placeholder="Enter User Name">
<span class="glyphicon form-control-feedback"></span>
<div class="row">
<div class="col-md-2">
<label for="nf-email" class=" form-control-label">Code</label>
<select name="phone_code" id="selectSm" class="form-control required">
<option value="">Code</option>
<?php foreach($Currency as $crny) { ?>
<?php if (isset($Garage_id)||!empty($Garage_id)) { ?>
<option <?= $garageData->code == $crny['code'] ? "selected" : "" ; ?> value="<?= $crny['code'] ?>"><?= $crny['code'] ?></option>
<?php }else { ?>
<option value="<?= $crny['code'] ?>"><?= $crny['code'] ?></option>
<?php }} ?>
</select>
</div>
<div class="col-md-4">
<label for="nf-email" class=" form-control-label">Phone Number</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="phone" placeholder="Enter Phone Number" class="form-control required" value="<?= (isset($garageData->phone_no))?$garageData->phone_no:'' ?>" >
</div>
<div class="col-md-6">
<label for="nf-email" class=" form-control-label">Email</label>
<input type="email" id="pd_email" name="email" placeholder="Enter Email" class="form-control required" onfocusout="myFunction()" value="<?= (isset($garageData->email))?$garageData->email:'' ?>" >
<br>
<div id="email_req" style="color: red"></div>
</div>
</div>
</div>
<div class="form-group">
<label>Profile Picture</label>
<div class="col-md-12" style="padding-bottom:10px;">
<div class="row">
<div class="col-md-6">
<label for="nf-email" class=" form-control-label">Location</label>
<input type="text" name="location" id="location" required class="form-control required" placeholder="Enter Location" onkeypress="ratelocation()" value="<?= (isset($garageData->location))?$garageData->location:'' ?>">
</div>
<div class="col-md-3">
<label for="nf-email" class=" form-control-label">Latitude</label>
<input type="text" name="lat" id="lat" required class="form-control required" readonly="" value="<?= (isset($garageData->lat))?$garageData->lat:'' ?>">
</div>
<div class="col-md-3">
<img id="image_id" src="<?= base_url($admin->profile_picture) ?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="75" width="75" />
<label for="nf-email" class=" form-control-label">Longitude</label>
<input type="text" name="lng" id="lng" required class="form-control required" readonly="" value="<?= (isset($garageData->lng))?$garageData->lng:'' ?>">
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="profile_image" type="file" accept="image/*" onchange="setImg(this,'image_id');" />
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-6">
<label for="nf-email" class=" form-control-label">Garage Code</label>
<input type="text" readonly="" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="garage_code" placeholder="Garage Code" class="form-control required" value="<?= (isset($garageData->garage_code))?$garageData->garage_code:$garage_code ?>" >
</div>
<div class="col-md-6">
<label for="nf-email" class=" form-control-label">Altered Number</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="altered_no" placeholder="Enter Altered Number" class="form-control required" value="<?= (isset($garageData->altered_no))?$garageData->altered_no:'' ?>" >
</div>
<!-- Change Password -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Change Password</h3>
</div><br>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-6">
<label for="nf-email" class=" form-control-label">Address</label>
<textarea type="text" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="address" placeholder="Enter Address" class="form-control required" ><?= (isset($garageData->address))?$garageData->address:'' ?></textarea>
</div>
<div class="col-md-6">
<label for="nf-email" class=" form-control-label">Website</label>
<input type="url" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" id="nf-brand" name="website" placeholder="Enter Website url" class="form-control required" value="<?= (isset($garageData->website))?$garageData->website:'' ?>" >
</div>
</div>
</div>
<div class="form-group">
<label>New Password</label>
<input type="password" class="form-control" name="password" placeholder="New Password">
<span class="glyphicon form-control-feedback"></span>
<div class="row">
<div class="col-md-3">
<label for="nf-email" class=" form-control-label">Working From</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" id="nf-brand" name="working_from" placeholder="Working From" class="form-control required" value="<?= (isset($garageData->working_from))?$garageData->working_from:'' ?>" >
</div>
<div class="col-md-3">
<label for="nf-email" class=" form-control-label">Working To</label>
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" id="nf-brand" name="working_to" placeholder="Working To" class="form-control required" value="<?= (isset($garageData->working_to))?$garageData->working_to:'' ?>" >
</div>
<div class="col-md-6">
<label for="nf-email" class=" form-control-label">Provide Amenities</label>
<select name="amenities[]" id="second" class="form-control chosen-select" multiple data-placeholder="Choose Services...">
<?php foreach($amenities as $amenitie) { ?>
<?php if (isset($Garage_id)||!empty($Garage_id)) {
$garage = explode(',', $garageData->amenities);
$selected = in_array($amenitie->id, $garage) ? 'selected="selected"': '';
?>
<option <?= $selected ? "selected" : "" ; ?> value="<?= $amenitie->id ?>"><?= $amenitie->name ?></option>
<?php }else { ?>
<option value="<?= $amenitie->id ?>"><?= $amenitie->name ?></option>
<?php }} ?>
</select>
</div>
</div>
</div>
<div class="form-group">
<label>Confirm Password</label>
<input type="password" class="form-control" name="cPassword" placeholder="Confirm Password">
<span class="glyphicon form-control-feedback"></span>
<div class="row">
<div class="col-md-6">
<label for="nf-email" class=" form-control-label">Provide services</label>
</div>
<div class="col-md-5">
<label for="nf-email" class=" form-control-label">Services Amount </label>
</div>
<div class="col-md-1">
<div class="row marginTop10">
<div class="col-md-6">
<div class="col-sm-2" style="padding-left: initial;">
<i class="fa fa-plus-circle cpoint fav-add-icon" onclick="addTimePicker(jQuery(this))" count="1"></i>
</div>
</div>
</div>
</div>
<div>
</div>
<?php
if(isset($Garage_id) && !empty($Garage_id)) {
$count = 1;
foreach ($serviceData as $key => $serData) { ?>
<div class="row" id="timePicker_<?= $count ?>">
<div class="col-md-6">
<select name="services[]" class="form-control" data-placeholder="Choose Services...">
<?php foreach($services as $service) { ?>
<option <?= $serData->subservice_id == $service->id ? "selected" : "" ; ?> value="<?= $service->id ?>"><?= $service->sub_services ?></option>
<div>
<?php } ?>
</select>
</div>
<div class="col-md-5">
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="amount[]" placeholder="Enter Services Amount" class="form-control required" value="<?= (isset($serData->cost))?$serData->cost:'' ?>" >
</div>
<div class="col-md-1">
<div class="row marginTop10">
<div class="col-md-6">
<div class="col-sm-2" style="padding-left: initial;">
<i class="padTop12 fa fa-times-circle-o cpoint fav-rem-icon" onclick="remTimePicker(<?= $count ?>)"></i>
</div>
</div>
</div>
</div>
</div>
<?php
$count +=1;
}
} else { ?>
<div class="row">
<div class="col-md-6">
<select name="services[]" class="form-control" data-placeholder="Choose Services...">
<?php foreach($services as $service) { ?>
<option value="<?= $service->id ?>"><?= $service->sub_services ?></option>
<?php } ?>
</select>
</div>
<div class="col-md-5">
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="amount[]" placeholder="Enter Services Amount" class="form-control required" value="<?= (isset($garageData->working_hours))?$garageData->working_hours:'' ?>" >
</div>
<div class="col-md-1">
<div class="row marginTop10">
<div class="col-md-6">
<div class="col-sm-2" style="padding-left: initial;">
<!-- <i class="fa fa-plus-circle cpoint fav-add-icon" onclick="addTimePicker(jQuery(this))" count="1"></i> -->
</div>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
<div id="scheduleTimerCntr"></div>
<div class="form-group">
<div class="row">
<div class="col-md-12">
<button type="submit" class="btn btn-primary">
<i class="fa fa-dot-circle-o"></i> Submit
<i class="fa "></i>Submit
</button>
</div>
</div>
</div>
</div>
</form>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="clear-fix"></div>
<div class="form-group" id="scheduleTimerHtml" class="hide">
<div class="row" id="timePicker_{:count}">
<div class="col-md-6">
<!-- <label for="nf-email" class=" form-control-label">Provide services</label> -->
<select name="services[]" class="form-control" data-placeholder="Choose Services...">
<option value="">Select Service</option>
<?php foreach($services as $service) { ?>
<option value="<?= $service->id ?>"><?= $service->sub_services ?></option>
<?php } ?>
</select>
</div>
<div class="col-md-5">
<!-- <label for="nf-email" class=" form-control-label">Services Amount </label> -->
<input type="text" data-parsley-trigger="change" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="amount[]" placeholder="Enter Services Amount" class="form-control required" value="<?= (isset($garageData->working_hours))?$garageData->working_hours:'' ?>" >
</div>
<div class="col-md-1">
<div class="row marginTop10">
<div class="col-md-6"></div>
<div class="col-md-6">
<i class="padTop12 fa fa-times-circle-o cpoint fav-rem-icon" onclick="remTimePicker({:count})"></i>
</div>
</div>
</div>
</div>
</div></div>
</div>
<script type="text/javascript">
function addTimePicker(thisObj){
var count = thisObj.attr('count')+1,
inputHtml = jQuery('[id="scheduleTimerHtml"]').html();
thisObj.attr('count',count);
jQuery('[id="scheduleTimerCntr"]').append(inputHtml.replace(/{:count}/g,count));
}
function remTimePicker(count){
jQuery('[id="timePicker_'+count+'"]').remove();
}
<!-- PAGE-CONTENT-ENDS -->
</script>
......@@ -31,7 +31,7 @@
<li class="">
<a href="<?php echo base_url('User/viewProfile'); ?>"><i class="menu-icon fa fa-user"></i>My Profile</a>
<a href="<?php echo base_url('Garage_profile/viewProfile'); ?>"><i class="menu-icon fa fa-user"></i>My Profile</a>
</li>
<li class="">
<a href="<?php echo base_url('Settings'); ?>"><i class="menu-icon fa fa-cogs"></i>Settings</a>
......
......@@ -8,7 +8,7 @@ class Country extends CI_Controller {
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Country_model');
$this->load->helper('generals_helper');
if(!$this->session->userdata('logged_in')) {
if(!$this->session->userdata('logged_pos')) {
redirect(base_url());
}
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Dashboard extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->helper('generals_helper');
if(!$this->session->userdata('logged_pos')) {
redirect(base_url());
}
}
public function index()
{
$data['page'] = 'dashboard/dashboard';
$this->load->view('template',$data);
}
}
......@@ -9,13 +9,13 @@ class Logout extends CI_Controller {
//$this->load->model('shop_model');
if(!$this->session->userdata('logged_in')) {
if(!$this->session->userdata('logged_pos')) {
redirect(base_url());
}
}
function index() {
$this->session->unset_userdata('logged_in');
$this->session->unset_userdata('logged_pos');
session_destroy();
redirect(base_url());
}
......
......@@ -31,13 +31,13 @@
<tbody>
<tr>
<td align="left" style="padding: 25px;">
<h3 style="margin: 0; text-align: center; padding: 0 0 10px; font-weight: normal; font-weight: normal; font-size: 26px; color: #09ad8b; line-height: 32px; font-family:'Roboto',sans-serif; "> <strong>Hi <?php echo ($name);?></strong>, Welcome to Access.</h3>
<h3 style="margin: 0; text-align: center; padding: 0 0 10px; font-weight: normal; font-weight: normal; font-size: 26px; color: #09ad8b; line-height: 32px; font-family:'Roboto',sans-serif; "> <strong>Hi <?php echo ($name);?></strong>, Welcome to Allo.</h3>
<h2 style="color: #555555; font-weight: bold; margin: 0; padding: 0 0 10px; line-height: 25px; font-size: 15px; font-family:'Roboto',sans-serif; border-bottom: 1px dashed #ccc; " align="center"></h2>
<div style="border-bottom: 1px dashed #ccc; padding: 10px 0; line-height: 160%; font-size: 15px;">
<div style="color: #555555; line-height: 160%;font-family:'Roboto',sans-serif;">
<?php echo ($shopper_mail);?>
<center>
<div class="pin_container">
......
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