Commit 09343300 by Tobin

daily commit

parent 1a7a3108
......@@ -7,10 +7,218 @@ class Customer extends CI_Controller {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Customer_model');
$this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
redirect(base_url());
}
}
public function addCustomer(){
$template['page'] = 'Customer/customerForm';
$template['menu'] = 'Customer Management';
$template['smenu'] = 'Add Customer';
$template['pTitle'] = "Add Customer";
$template['pDescription'] = "Create New Customer";
$this->load->view('template',$template);
}
public function viewCustomers(){
$template['page'] = 'Customer/viewCustomer';
$template['menu'] = 'Customer Management';
$template['smenu'] = 'View Customers';
$template['pTitle'] = "View Customers";
$template['pDescription'] = "View and Manage Customers";
$template['page_head'] = "Customer Management";
$template['customer_data'] = $this->Customer_model->getCustomerData('','0,1');
$this->load->view('template',$template);
}
public function getCustomerData(){
$resArr = array('status'=>0);
if(!isset($_POST)||empty($_POST)||!isset($_POST['customer_id'])||empty($_POST['customer_id']) ||
!is_numeric($customer_id = decode_param($_POST['customer_id']))){
echo json_encode($resArr);exit;
}
$view_all = (isset($_POST['view_all']) && $_POST['view_all'] == 1)?1:0;
$mechData = $this->Customer_model->getCustomerData($customer_id,$view_all);
if(empty($mechData)){
echo json_encode($resArr);exit;
}
$resArr['status'] = 1;
$resArr['data'] = $mechData;
echo json_encode($resArr);exit;
}
function changeStatus($customer_id = '',$status = '1'){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($customer_id) || !is_numeric($customer_id = decode_param($customer_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/viewCustomers'));
}
$status = $this->Customer_model->changeStatus($customer_id,$status);
if(!$status){
$this->session->set_flashdata('message',$flashMsg);
}
redirect(base_url('Customer/viewCustomers'));
}
public function createCustomer(){
$err = 0;
$errMsg = '';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST) || !isset($_FILES) || empty($_FILES)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/addCustomer'));
}
if($err == 0 && (!isset($_POST['display_name']) || empty($_POST['display_name']))){
$err = 1;
$errMsg = 'Provide a Display Name';
}else if($err == 0 && (!isset($_POST['username']) || empty($_POST['username']))){
$err = 1;
$errMsg = 'Provide a User Name';
}else if($err == 0 && (!isset($_POST['password']) || empty($_POST['password']) ||
empty($_POST['password'] = md5($_POST['password'])))){
$err = 1;
$errMsg = 'Provide a Password';
}else if($err == 0 && (!isset($_POST['name']) || empty($_POST['name']))){
$err = 1;
$errMsg = 'Provide a Name';
}else if($err == 0 && (!isset($_POST['email']) || empty($_POST['email']))){
$err = 1;
$errMsg = 'Provide an Email ID';
}else if($err == 0 && (!isset($_POST['phone']) || empty($_POST['phone']))){
$err = 1;
$errMsg = 'Provide a Phone Number';
}
if($err == 0){
$config = set_upload_service("assets/uploads/services");
$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();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/addCustomer'));
}
$status = $this->Customer_model->addCustomer($_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Customer/viewCustomers'));
} else if($status == 2){
$flashMsg = array('message'=>'Email ID alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Customer/addCustomer'));
} else if($status == 3){
$flashMsg = array('message'=>'Phone Number alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Customer/addCustomer'));
} else if($status == 4){
$flashMsg = array('message'=>'User Name alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Customer/addCustomer'));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Customer/addCustomer'));
}
}
public function editCustomers($customer_id){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($customer_id) || !is_numeric($customer_id = decode_param($customer_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/viewCustomers'));
}
$template['page'] = 'Customer/customerForm';
$template['menu'] = 'Customer Management';
$template['smenu'] = 'Edit Customer';
$template['pTitle'] = "Edit Customers";
$template['pDescription'] = "Update Customer Data";
$template['customer_data'] = $this->Customer_model->getCustomerData($customer_id,1);
$template['customer_id'] = encode_param($customer_id);
$this->load->view('template',$template);
}
public function updateCustomer($customer_id = ''){
$err = 0;
$errMsg = '';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST) || !isset($_FILES) || empty($_FILES)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/addCustomer'));
}
if($err == 0 && (!isset($_POST['display_name']) || empty($_POST['display_name']))){
$err = 1;
$errMsg = 'Provide a Display Name';
}else if($err == 0 && (!isset($_POST['username']) || empty($_POST['username']))){
$err = 1;
$errMsg = 'Provide a User Name';
}else if($err == 0 && (!isset($_POST['name']) || empty($_POST['name']))){
$err = 1;
$errMsg = 'Provide a Name';
}else if($err == 0 && (!isset($_POST['email']) || empty($_POST['email']))){
$err = 1;
$errMsg = 'Provide an Email ID';
}else if($err == 0 && (!isset($_POST['phone']) || empty($_POST['phone']))){
$err = 1;
$errMsg = 'Provide a Phone Number';
}
if($err == 0){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['profile_image']['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($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/editCustomers/'.$customer_id));
}
$status = $this->Customer_model->updateCustomer(decode_param($customer_id),$_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Customer/viewCustomers'));
} else if($status == 2){
$flashMsg = array('message'=>'Email ID alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Customer/editCustomers/'.$customer_id));
} else if($status == 3){
$flashMsg = array('message'=>'Phone Number alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Customer/editCustomers/'.$customer_id));
} else if($status == 4){
$flashMsg = array('message'=>'User Name alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Customer/editCustomers/'.$customer_id));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Customer/editCustomers/'.$customer_id));
}
}
}
......
......@@ -20,8 +20,8 @@ class Event extends CI_Controller {
$template['smenu'] = 'View Event List';
$template['pTitle'] = "Event Management";
$template['pDescription'] = "View Event List";
$template['event_data'] = $this->Event_model->getEventData();
$provider_id = ($this->session->userdata['user_type']==2)?$this->session->userdata['id']:'';
$template['event_data'] = $this->Event_model->getEventData('','',$provider_id);
$this->load->view('template',$template);
}
......
......@@ -21,5 +21,169 @@ class Customer_model extends CI_Model {
}
return 0;
}
public function addCustomer($customer_data = array()){
if(empty($customer_data))
return 0;
$userNameChk = $this->db->query("SELECT * FROM users
WHERE status!='2' AND username='".$customer_data['username']."'");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 4;
$emailChk = $this->db->query("SELECT * FROM customer AS PRV
INNER JOIN users AS USR ON (USR.id=PRV.customer_id)
WHERE USR.status!='2' AND PRV.email='".$customer_data['email']."'");
if(!empty($emailChk) && $emailChk->num_rows() > 0) return 2;
$phoneChk = $this->db->query("SELECT * FROM customer AS PRV
INNER JOIN users AS USR ON (USR.id=PRV.customer_id)
WHERE USR.status!='2' AND PRV.phone='".$customer_data['phone']."'");
if(!empty($phoneChk) && $phoneChk->num_rows() > 0) return 3;
$status = $this->db->insert('users',
array('username'=>$customer_data['username'],
'password'=>$customer_data['password'],
'display_name'=>$customer_data['display_name'],
'profile_image'=>$customer_data['profile_image'],
'user_type'=>'2','status'=>'1'));
if(!$status){
return 0;
}
$customer_id = $this->db->insert_id();
$status = $this->db->insert('customer',
array('customer_id'=>$customer_id,
'name'=>$customer_data['name'],
'email'=>$customer_data['email'],
'phone'=>$customer_data['phone'],
'profile_image'=>$customer_data['profile_image']));
return $status;
}
function updateCustomer($customer_id = '', $customer_data = array()){
if(empty($customer_id) || empty($customer_data))
return 0;
$userIdChk = $this->db->query("SELECT * FROM customer AS PRV
INNER JOIN users AS USR ON (USR.id = PRV.customer_id)
WHERE USR.status!='2' AND USR.id!='".$customer_id."' AND
USR.username='".$customer_data['username']."'");
if(!empty($userIdChk) && $userIdChk->num_rows() > 0) { return 4; }
$emailChk = $this->db->query("SELECT * FROM customer AS PRV
INNER JOIN users AS USR ON (USR.id = PRV.customer_id)
WHERE USR.status!='2' AND USR.id!='".$customer_id."' AND
PRV.email='".$customer_data['email']."'");
if(!empty($emailChk) && $emailChk->num_rows() > 0) { return 2; }
$phoneChk = $this->db->query("SELECT * FROM customer AS PRV
INNER JOIN users AS USR ON (USR.id = PRV.customer_id)
WHERE USR.status!='2' AND USR.id!='".$customer_id."' AND
PRV.phone='".$customer_data['phone']."'");
if(!empty($phoneChk) && $phoneChk->num_rows() > 0) { return 3; }
$upMecArr = array('name'=>$customer_data['name'],
'email'=>$customer_data['email'],
'phone'=>$customer_data['phone']);
$admUpdateArr = array('username'=>$customer_data['username'],
'display_name'=>$customer_data['display_name']);
if(isset($customer_data['profile_image']) && !empty($customer_data['profile_image'])){
$upMecArr['profile_image'] = $customer_data['profile_image'];
$admUpdateArr['profile_image'] = $customer_data['profile_image'];
}
$status = $this->db->update('users',$admUpdateArr,array('id'=>$customer_id));
if(!$status) { return 0; }
if(isset($customer_data['licence']) && !empty($customer_data['licence']))
$upMecArr['licence'] = $customer_data['licence'];
$status = $this->db->update('customer',$upMecArr,array('customer_id'=>$customer_id));
return $status;
}
function changeStatus($customer_id = '', $status = '0'){
if(empty($customer_id)){
return 0;
}
$status = $this->db->update('users',array('status'=>$status),array('id'=>$customer_id));
return $status;
}
function getNearByCustomers($location_data = array(),$sub_issues = array()){
if(empty($location_data) || empty($sub_issues)){
return 0;
}
$current_lat = $location_data['pickup_lat'];
$current_lng = $location_data['pickup_lng'];
$issue_cat_id = implode(',',$sub_issues);
$sql = "SELECT USR.display_name,USR.profile_image,ME.*,MS.shop_name,MS.address AS shop_address,
MS.phone AS shop_phone,MS.email_id AS shop_email_id,
3956*2*ASIN(SQRT(POWER(SIN(($current_lat-ME.location_lat)*pi()/180/2),2)+
COS($current_lat*pi()/180 )*COS(ME.location_lat*pi()/180)*
POWER(SIN(($current_lng-ME.location_lng)*pi()/180/2),2) )) AS distance
FROM customer AS ME
INNER JOIN users AS USR ON (USR.id=ME.customer_id)
LEFT JOIN customer_shop AS MS ON (MS.shop_id=ME.shop_id AND MS.status='1')
WHERE USR.status='1'
-- HAVING distance<30";
$mechData = $this->db->query($sql);
if(empty($mechData) || empty($mechData = $mechData->result_array())){
return 0;
}
$estimate = 0;
$mechDataArr = array();
foreach($mechData AS $index => $data){
if(empty($data['start_time']) || empty($data['end_time'])){
$scheduleTiming = array('09:00 AM','10:00 AM','11:00 AM','12:00 PM','01:00 PM',
'02:00 PM','03:00 PM','04:00 PM','05:00 PM','06:00 PM');
} else {
$endTime = strtotime($data['end_time']);
$schTime = strtotime($data['start_time']);
$scheduleTiming = array();
for( ; $schTime <= ($endTime-3600) ; $schTime += 3600){
$scheduleTiming[] = date('h:i A',$schTime);
}
}
$customer_id = $data['customer_id'];
$sql = "SELECT ISS.*, IC.*, MI.*
FROM issues_category AS IC
INNER JOIN issues AS ISS ON (IC.issue_id=ISS.issue_id)
LEFT JOIN customer_issues AS MI ON (MI.issue_cat_id=IC.issue_cat_id AND
MI.customer_id='$customer_id' AND MI.status='1')
WHERE ISS.status='1' AND IC.status='1' AND IC.issue_cat_id IN ($issue_cat_id)";
$subIssData = $this->db->query($sql);
$sIssueData = array();
if(!empty($subIssData) && !empty($subIssData = $subIssData->result_array())){
$sIssueData = $subIssData;
}
$estimate = 0;
foreach($sIssueData AS $sIndex => $sIssue){
if(!empty($sIssue['custom_service_fee'])){
$estimate += $sIssue['custom_service_fee'];
$sIssueData[$sIndex]['service_fee'] = $sIssue['custom_service_fee'];
} else {
$estimate += $sIssue['default_service_fee'];
$sIssueData[$sIndex]['service_fee'] = $sIssue['default_service_fee'];
}
}
$mechData[$index]['estimate'] = $estimate;
$mechData[$index]['sub_issues'] = $sIssueData;
$mechData[$index]['scheduleTiming'] = $scheduleTiming;
}
return $mechData;
}
}
?>
\ No newline at end of file
......@@ -4,9 +4,10 @@ class Event_model extends CI_Model {
parent::_construct();
}
public function getEventData($event_id='',$view=''){
public function getEventData($event_id='',$view='',$provider_id=''){
$cond = (!empty($view))?" EVT.status IN ($view) ":" EVT.status != '2' ";
$cond .= (!empty($event_id))?" AND EVT.event_id='$event_id' ":"";
$cond .= (!empty($provider_id))?" AND EVT.provider_id='$provider_id' ":"";
$sql = "SELECT EVT.*,EVT.status AS event_status,VEN.*,REG.name AS region_name,CAT.*,PRV.*,HST.*
FROM events AS EVT
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<?php
$url = (!isset($customer_id) || empty($customer_id))?'Customer/createCustomer':'Customer/updateCustomer/'.$customer_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 } ?>
</div>
<div class="col-md-12">
<div class="box box-warning">
<div class="box-body">
<form role="form" action="<?= base_url($url) ?>" method="post"
class="validate" data-parsley-validate="" enctype="multipart/form-data">
<!-- Customer Data -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Personal Details</h3>
</div><br>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Customer Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$"
name="name" required="" value="<?= (isset($customer_data->name))?$customer_data->name:'' ?>"placeholder="Enter Customer Name">
</div>
<div class="form-group">
<label>Email</label>
<input type="email" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="email" placeholder="Enter email ID" value="<?= (isset($customer_data->email))?$customer_data->email:'' ?>">
</div>
<div class="form-group">
<label>Phone</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" required=""
value="<?= (isset($customer_data->phone))?$customer_data->phone:'' ?>" name="phone" placeholder="Enter Phone Number" >
</div>
<div class="form-group">
<label>Phone</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" required=""
value="<?= (isset($customer_data->phone))?$customer_data->phone:'' ?>" name="phone" placeholder="Enter Phone Number" >
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Profile Picture</label>
<div class="col-md-12" style="padding-bottom:10px;">
<div class="col-md-3">
<img id="image_id" src="<?= (isset($customer_data->profile_image))?base_url($customer_data->profile_image):'' ?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="75" width="75" />
</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>
<div class="form-group" style="margin-top: 124px;">
<label>Gender</label>
<select name="gender" class="form-control">
<option selected value="1">Male</option>
<option value="2">Female</option>
<option value="3">Others</option>
</select>
</div>
<div class="form-group">
<label>City</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
id="loc_search_1" name="city" placeholder="City" value="<?= (isset($customer_data->city))?$customer_data->city:'' ?>" required>
</div>
</div>
<div class="col-md-12">
<div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button>
<a href="<?= base_url('Customer/viewCustomers') ?>" class="btn btn-primary">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- Basic Details -->
<!-- <div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Admin User Details</h3>
</div><br>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Display Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="display_name" required=""
placeholder="Enter Display Name" value="<?= (isset($customer_data->display_name))?$customer_data->display_name:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</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="" value="<?= (isset($customer_data->username))?$customer_data->username:'' ?>"
data-parsley-pattern="^[a-zA-Z0-9\ . _ @ \/]+$" placeholder="Enter User Name">
<span class="glyphicon form-control-feedback"></span>
</div>
<?php if(!isset($customer_id)){ ?>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control required" name="password" placeholder="Password" required="">
<span class="glyphicon form-control-feedback"></span>
</div>
<?php } ?>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Profile Picture</label>
<div class="col-md-12" style="padding-bottom:10px;">
<div class="col-md-3">
<img id="image_id" src="<?= (isset($customer_data->profile_image))?base_url($customer_data->profile_image):'' ?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="75" width="75" />
</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>
</div> -->
<div class="content-wrapper" >
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-12">
<?php 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 } ?>
</div>
<div class="col-xs-12">
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Customer List</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Customer/addCustomer')?>">
Add New Customer
</a>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
<div class="box-body">
<table id="mechanicUsers" class="table table-bordered table-striped datatable ">
<thead>
<tr>
<th class="hidden">ID</th>
<th width="150px;">Customer Name</th>
<th width="150px;">User Name</th>
<th width="150px;">Email_id</th>
<th width="100px;">Phone</th>
<th width="100px;">Status</th>
<th width="500px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($customer_data)){
foreach($customer_data as $customer) { ?>
<tr>
<th class="hidden"><?= $customer->customer_id ?></th>
<th class="center"><?= $customer->name ?></th>
<th class="center"><?= $customer->username ?></th>
<th class="center"><?= $customer->email ?></th>
<th class="center"><?= $customer->phone ?></th>
<th class="center"><?= ($customer->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-info" id="viewCustomer" customer_id="<?= encode_param($customer->customer_id) ?>">
<i class="fa fa-fw fa-eye"></i>View
</a>
<a class="btn btn-sm btn-primary"
href="<?= base_url('Customer/editCustomers/'.encode_param($customer->customer_id)) ?>">
<i class="fa fa-fw fa-edit"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Customer/changeStatus/".encode_param($customer->customer_id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($customer->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Customer/changeStatus/".encode_param($customer->customer_id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Customer/changeStatus/".encode_param($customer->customer_id))."/1" ?>">
<i class="fa fa-cog"></i> Activate
</a>
<?php } ?>
</td>
</tr>
<?php } } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
......@@ -20,8 +20,8 @@
<!-- POP-UP VIEW MODAL END -->
<footer class="main-footer">
<div class="pull-right hidden-xs">
<!-- <div class="pull-right hidden-xs">
<b>Version</b> 1.0
</div>
<strong>Copyright &copy; 2015-2016 <a href="#">Techware Solution</a>.</strong> All rights reserved.
<strong>Copyright &copy; 2015-2016 <a href="#">Techware Solution</a>.</strong> All rights reserved. -->
</footer>
\ No newline at end of file
......@@ -107,6 +107,27 @@
</li>
</ul>
</li>
<!-- <li class="treeview">
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
<span>Customer Management</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li>
<a href="<?= base_url('Customer/addCustomer') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Add Customer
</a>
</li>
<li>
<a href="<?= base_url('Customer/viewCustomers') ?>">
<i class="fa fa-circle-o text-aqua"></i>
View Customer
</a>
</li>
</ul>
</li> -->
<li><a href="<?= base_url('Settings') ?>">
<i class="fa fa-wrench" aria-hidden="true">
</i><span>Settings</span></a>
......
......@@ -659,3 +659,7 @@
margin-top: 0px;
margin-bottom: 15px;
}
.green {
color: #2d9652 !important;
}
\ No newline at end of file
......@@ -166,9 +166,9 @@ jQuery('[id="viewVenueDetails"]').on('click',function() {
jQuery.each(jQuery.parseJSON(venue_data['layout_details']), function (indexLayout, layoutValue) {
innerLyOut += '<div>'+
'<div onclick="showLyDivDtls(jQuery(this))" class="cpoint">'+
'<i class="fa fa-caret-square-o-down" aria-hidden="true"></i>'+
'<label class="padLeft10">'+layoutValue['color']+'</label> Block'+
'<div onclick="showLyDivDtls(jQuery(this))" show="0" class="cpoint">'+
'<i class="fa fa-caret-square-o-down green" aria-hidden="true"></i>'+
'<label class="padLeft10 cpoint">'+layoutValue['color']+'</label> Block'+
'</div>'+
'<div class="hide">'+
'<div class="padLeft40"><label>'+layoutValue['price']+'</label> /Seat</div>'+
......@@ -488,9 +488,11 @@ jQuery('[id="viewEventDetails"]').on('click',function(event) {
});
function showLyDivDtls(thisObj){
if(thisObj.attr('show') == '0'){
thisObj.attr('show','1');
thisObj.next("div").removeClass('hide');
setTimeout(function(){
} else {
thisObj.attr('show','0');
thisObj.next("div").addClass('hide');
}, 3000);
}
}
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