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
......@@ -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>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
<!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>
......
......@@ -7,13 +7,11 @@ class Garage extends CI_Controller {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Garage_model');
$this->load->helper('generals_helper');
$this->load->helper('generals_helper');
if(!$this->session->userdata('logged_garage')) {
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');
$this->form_validation->set_rules('password', 'Password', 'trim|required|callback_check_database');
if($this->form_validation->run() == TRUE) {
redirect(base_url().'Dashboard');
}
......@@ -28,7 +25,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
......@@ -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