Commit 2acbd7bc by Tobin

dc

parent 1e7fb03a
...@@ -82,7 +82,7 @@ $db['default'] = array( ...@@ -82,7 +82,7 @@ $db['default'] = array(
'hostname' => '192.168.140.123', 'hostname' => '192.168.140.123',
'username' => 'root', 'username' => 'root',
'password' => 'Golden_123', 'password' => 'Golden_123',
'database' => 'tobin_dcarfixers', 'database' => 'tobin_eventTimeOut',
'dbdriver' => 'mysqli', 'dbdriver' => 'mysqli',
'dbprefix' => '', 'dbprefix' => '',
'pconnect' => FALSE, 'pconnect' => FALSE,
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Customer extends CI_Controller {
public function __construct() {
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'));
}
}
}
?>
\ No newline at end of file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Host extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Host_model');
$this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
}
function listHostCategory(){
$template['page'] = 'Host/viewHostCategories';
$template['menu'] = 'Host Category Management';
$template['smenu'] = 'View Host Categories';
$template['pTitle'] = "Host Category Management";
$template['pDescription'] = "View Host Categories";
$template['host_data'] = $this->Host_model->getHostCategories();
$this->load->view('template',$template);
}
function addHostCategory(){
$template['page'] = 'Host/hostCategoryForm';
$template['menu'] = 'Host Category Management';
$template['smenu'] = 'Add Host Category';
$template['pTitle'] = "Add Host Category";
$template['pDescription'] = "Create New Host Category";
$this->load->view('template',$template);
}
function createHostCategory(){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Host/addHostCategory'));
}
$err = 0;
$errMsg = '';
if($err == 0 && (!isset($_POST['host_category']) || empty($_POST['host_category']))){
$err = 1;
$errMsg = 'Provide a Host Category Name';
}
else if($err == 0 && (!isset($_POST['show_layout']) || $_POST['show_layout'] == '' )){
$err = 1;
$errMsg = 'Provide a Seat Layout Type';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Host/addHostCategory'));
}
$status = $this->Host_model->createHostCategory($_POST);
if($status == 1){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'Host Category Created';
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Host/listHostCategory'));
}
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Host/addHostCategory'));
}
function editHostCategory($host_id=''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($host_id) || empty(decode_param($host_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Host/listHostCategory'));
}
$template['page'] = 'Host/hostCategoryForm';
$template['menu'] = 'Host Category Management';
$template['smenu'] = 'Edit Host Category';
$template['pTitle'] = "Edit Host Category";
$template['pDescription'] = "Update Host Category Data";
$template['host_id'] = $host_id;
$template['host_data'] = $this->Host_model->getHostCategories(decode_param($host_id));
$this->load->view('template',$template);
}
function updateHostCategory($host_id=''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST) || empty($host_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Host/listHostCategory'));
}
$err = 0;
$errMsg = '';
if($err == 0 && (!isset($_POST['host_category']) || empty($_POST['host_category']))){
$err = 1;
$errMsg = 'Provide a Host Category Name';
}
else if($err == 0 && (!isset($_POST['show_layout']) || $_POST['show_layout'] == '')){
$err = 1;
$errMsg = 'Provide a Seat Layout Type';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Host/editHostCategory/'.$host_id));
}
$status = $this->Host_model->updateHostCategory(decode_param($host_id),$_POST);
if($status == 1){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'Host Category Created';
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Host/listHostCategory'));
}
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Host/editHostCategory/'.$host_id));
}
function changeStatus($host_id = '',$status = '1'){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($host_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Host/listHostCategory'));
}
$host_id = decode_param($host_id);
$status = $this->Host_model->changeStatus($host_id,$status);
if(!$status){
$this->session->set_flashdata('message',$flashMsg);
}
redirect(base_url('Host/listHostCategory'));
}
}
?>
\ No newline at end of file
...@@ -36,10 +36,9 @@ class Login extends CI_Controller { ...@@ -36,10 +36,9 @@ class Login extends CI_Controller {
if($result && !empty($result)) { if($result && !empty($result)) {
$this->session->set_userdata('id',$result->id); $this->session->set_userdata('id',$result->id);
$this->session->set_userdata('user',$result); $this->session->set_userdata('user',$result);
$this->session->set_userdata('username',$result->username);
$this->session->set_userdata('logged_in','1'); $this->session->set_userdata('logged_in','1');
$this->session->set_userdata('user_type',$result->user_type); $this->session->set_userdata('user_type',$result->user_type);
$this->session->set_userdata('mechanic_data',$result->mechanic_data);
$this->session->set_userdata('mechanic_shop_data',$result->mechanic_shop_data);
return TRUE; return TRUE;
} }
else { else {
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Provider extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Provider_model');
$this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
}
}
?>
\ No newline at end of file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Region extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Region_model');
$this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
}
function listRegion(){
$template['page'] = 'Region/viewRegionList';
$template['menu'] = 'Region Management';
$template['smenu'] = 'View Region List';
$template['pTitle'] = "Region Management";
$template['pDescription'] = "View Region List";
$template['regionData'] = $this->Region_model->getRegionData();
$this->load->view('template',$template);
}
function addRegion(){
$this->load->model('Region_model');
$template['regionData'] = $this->Region_model->getRegionData();
$template['page'] = 'Region/regionAddForm';
$template['menu'] = 'Region Management';
$template['smenu'] = 'Add Region';
$template['pTitle'] = "Add Region";
$template['pDescription'] = "Create New Region";
$this->load->view('template',$template);
}
function createRegion(){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Region/addRegion'));
}
$err = 0;
$errMsg = '';
if($err == 0 && (!isset($_POST['name']) || empty($_POST['name']))){
$err = 1;
$errMsg = 'Provide a Region Name';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Region/addRegion'));
}
$status = $this->Region_model->createRegion($_POST);
if($status == 1){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'Region Created';
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Region/listRegion'));
}
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Region/addRegion'));
}
function editRegion($region_id=''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($region_id) || empty(decode_param($region_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Region/listRegion'));
}
$template['page'] = 'Region/regionAddForm';
$template['menu'] = 'Region Management';
$template['smenu'] = 'Edit Region';
$template['pTitle'] = "Edit Region";
$template['pDescription'] = "Update Region Data";
$template['region_id'] = $region_id;
$template['regionData'] = $this->Region_model->getRegionData(decode_param($region_id));
$this->load->view('template',$template);
}
function updateRegion($region_id=''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST) || empty($region_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Region/listRegion'));
}
$err = 0;
$errMsg = '';
if($err == 0 && (!isset($_POST['name']) || empty($_POST['name']))){
$err = 1;
$errMsg = 'Provide a Region Name';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Region/editRegion/'.$region_id));
}
$status = $this->Region_model->updateRegion(decode_param($region_id),$_POST);
if($status == 1){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'Region Created';
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Region/listRegion'));
}
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Region/editRegion/'.$region_id));
}
function changeStatus($region_id = '',$status = '1'){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($region_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Region/listRegion'));
}
$region_id = decode_param($region_id);
$status = $this->Region_model->changeStatus($region_id,$status);
if(!$status){
$this->session->set_flashdata('message',$flashMsg);
}
redirect(base_url('Region/listRegion'));
}
}
?>
\ No newline at end of file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Tag extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Tag_model');
$this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
}
function listTags(){
$template['page'] = 'Tag/viewTagList';
$template['menu'] = 'Tag Management';
$template['smenu'] = 'View Tag List';
$template['pTitle'] = "Tag Management";
$template['pDescription'] = "View Tag List";
$template['tag_data'] = $this->Tag_model->getTagData();
$this->load->view('template',$template);
}
function addTags(){
$template['page'] = 'Tag/tagAddForm';
$template['menu'] = 'Tag Management';
$template['smenu'] = 'Add Tag';
$template['pTitle'] = "Add Tag";
$template['pDescription'] = "Create New Tag";
$this->load->view('template',$template);
}
function createTags(){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Tag/addTags'));
}
$err = 0;
$errMsg = '';
if($err == 0 && (!isset($_POST['tag_name']) || empty($_POST['tag_name']))){
$err = 1;
$errMsg = 'Provide a Tag Name';
}
$status = $this->Tag_model->createTag($_POST);
if($status == 1){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'Tag Created';
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Tag/listTags'));
}
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Tag/addTags'));
}
function editTags($tag_id=''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($tag_id) || empty(decode_param($tag_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Tag/listTags'));
}
$template['page'] = 'Tag/tagAddForm';
$template['menu'] = 'Tag Management';
$template['smenu'] = 'Edit Tag';
$template['pTitle'] = "Edit Tag";
$template['pDescription'] = "Update Tag Data";
$template['tag_id'] = $tag_id;
$template['tag_data'] = $this->Tag_model->getTagData(decode_param($tag_id));
$this->load->view('template',$template);
}
function updateTags($tag_id=''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST) || empty($tag_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Tag/listTags'));
}
$err = 0;
$errMsg = '';
if($err == 0 && (!isset($_POST['tag_name']) || empty($_POST['tag_name']))){
$err = 1;
$errMsg = 'Provide a Tag Name';
}
$status = $this->Tag_model->updateTags(decode_param($tag_id),$_POST);
if($status == 1){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'Tag Created';
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Tag/listTags'));
}
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Tag/editTags/'.$tag_id));
}
function changeStatus($tag_id = '',$status = '1'){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($tag_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Tag/listTags'));
}
$tag_id = decode_param($tag_id);
$status = $this->Tag_model->changeStatus($tag_id,$status);
if(!$status){
$this->session->set_flashdata('message',$flashMsg);
}
redirect(base_url('Tag/listTags'));
}
function getTagData(){
$resArr = array('status'=>0);
if(!isset($_POST) || empty($_POST) || !isset($_POST['tag_id']) || empty($_POST['tag_id']) ||
empty($tag_id = decode_param($_POST['tag_id']))){
echo json_encode($resArr);exit;
}
$tagData = $this->Tag_model->getTagData($tag_id);
if(!empty($tagData)){
$resArr['status'] = 1;
$resArr['data'] = $tagData;
}
echo json_encode($resArr);exit;
}
}
?>
\ No newline at end of file
<?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');
$this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
}
public function viewProfile() {
if(!isset($this->session->userdata['id']) || empty($this->session->userdata['id'])){
redirect(base_url());
}
$template['provider'] = '';
$template['customer'] = '';
if(($user_type = $this->session->userdata('user_type')) != 1){
if($user_type != 1){
if($user_type == 2){
$this->load->model('Provider_model');
$template['provider'] = $this->Provider_model->getProviderData();
} else if ($user_type == 3){
$this->load->model('Customer_model');
$template['customer'] = $this->Customer_model->getCustomerData();
}
}
}
$template['page'] = 'User/viewProfile';
$template['menu'] = 'User';
$template['smenu'] = 'View Profile';
$template['pTitle'] = "User Profile";
$template['pDescription'] = "Edit or View Profile";
$this->load->view('template',$template);
}
public function editProfile() {
$template['provider'] = '';
$template['customer'] = '';
if(($user_type = $this->session->userdata('user_type')) != 1){
if($user_type != 1){
if($user_type == 2){
$this->load->model('Provider_model');
$template['provider'] = $this->Provider_model->getProviderData();
} else if ($user_type == 3){
$this->load->model('Customer_model');
$template['customer'] = $this->Customer_model->getCustomerData();
}
}
}
$template['page'] = 'User/editProfile';
$template['menu'] = "Profile";
$template['smenu'] = "Edit Profile";
$template['pTitle'] = "Edit Profile";
$template['pDescription'] = "Edit User Profile";
$this->load->view('template',$template);
}
public function updateUser(){
$user_id = $this->session->userdata('id');
$user_type = $this->session->userdata('user_type');
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($user_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('User/editProfile'));
}
if(isset($_FILES['profile_image']) && !empty($_FILES['profile_image'])){
$config = set_upload_service("assets/uploads/services");
$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'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
}
$password = $_POST['password'];
unset($_POST['password']);
unset($_POST['cPassword']);
$_POST['password'] = md5($password);
} else {
unset($_POST['password']);
unset($_POST['cPassword']);
}
if(!isset($_POST['display_name']) || empty($_POST['display_name'])){
$flashMsg = array('message'=>'Provide a valid Display Name..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['username']) || empty($_POST['username'])){
$flashMsg = array('message'=>'Provide a valid Username..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
}
if ($user_type == 2) {
if (!isset($_POST['name']) || empty($_POST['name'])){
$flashMsg = array('message'=>'Provide a Name..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['phone']) || empty($_POST['phone'])){
$flashMsg = array('message'=>'Provide a valid Phone Number..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['email']) || empty($_POST['email'])){
$flashMsg = array('message'=>'Provide a valid Email ID..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
}
} else if ($user_type == 2) {
if (!isset($_POST['name']) || empty($_POST['name'])){
$flashMsg = array('message'=>'Provide a Name..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['phone']) || empty($_POST['phone'])){
$flashMsg = array('message'=>'Provide a valid Phone Number..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['email']) || empty($_POST['email'])){
$flashMsg = array('message'=>'Provide a valid Email ID..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
}
}
$status = $this->User_model->updateUser($user_id,$user_type,$_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 if($status == 2){
$flashMsg = array('message'=>'Email ID alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if($status == 3){
$flashMsg = array('message'=>'Phone Number alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if($status == 4){
$flashMsg = array('message'=>'User Name alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
}
}
}
?>
\ No newline at end of file
<?php
class Customer_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function getCustomerData($customer_id='',$view=''){
$cond = (!empty($view))?" USR.status IN ($view) ":" USR.status != '2' ";
$cond .= (!empty($customer_id))?" AND CUST.customer_id='$customer_id' ":"";
$sql = "SELECT USR.username,USR.display_name,USR.profile_image,USR.user_type,USR.status,
CUST.customer_id,CUST.name,CUST.email,CUST.phone,CUST.profile_image
FROM customer AS CUST
INNER JOIN users AS USR ON (USR.id=CUST.customer_id)
WHERE $cond";
$customerData = $this->db->query($sql);
if(!empty($customerData)){
return (!empty($customer_id))?$customerData->result():$customerData->row();
}
return 0;
}
}
?>
\ No newline at end of file
<?php
class Event_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function getEventData($event_id='',$view=''){
$cond = (!empty($view))?" VNE.status IN ($view) ":" VNE.status != '2' ";
$cond .= (!empty($event_id))?" AND VNE.id='$event_id' ":"";
$sql = "SELECT VNE.id AS event_id,VNE.*,REG.name AS region_name,HST.host_category,HST.show_layout
FROM venue AS VNE
INNER JOIN region AS REG ON (VNE.region_id=REG.id)
INNER JOIN host_categories AS HST ON (HST.host_cat_id=VNE.host_cat_id)
WHERE $cond";
$venueData = $this->db->query($sql);
if(!empty($venueData)){
return (empty($event_id))?$venueData->result():$venueData->row();
}
return 0;
}
public function createEvent($venueData = array()){
if(empty($venueData)){
return 0;
}
$status = $this->db->insert('venue',$venueData);
return $status;
}
public function updateEvents($event_id = '', $venueData = array()){
if(empty($event_id) || empty($venueData)){
return 0;
}
$status = $this->db->update('venue',$venueData,array('id'=>$event_id));
return $status;
}
public function changeStatus($event_id = '', $status = '0'){
if(empty($event_id)){
return 0;
}
$status = $this->db->update('venue',array('status'=>$status),array('id'=>$event_id));
return $status;
}
}
?>
\ No newline at end of file
<?php
class Host_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function getHostCategories($host_id='',$view=''){
$cond = (!empty($view))?" status IN ($view) ":" status != '2' ";
$cond .= (!empty($host_id))?" AND host_cat_id='$host_id' ":"";
$hostData = $this->db->query("SELECT * FROM host_categories WHERE $cond");
if(!empty($hostData)){
return (empty($host_id))?$hostData->result():$hostData->row();
}
return 0;
}
public function createHostCategory($hostData = array()){
if(empty($hostData)){
return 0;
}
$status = $this->db->insert('host_categories',$hostData);
return $status;
}
public function updateHostCategory($host_id = '', $hostData = array()){
if(empty($host_id) || empty($hostData)){
return 0;
}
$status = $this->db->update('host_categories',$hostData,array('host_cat_id'=>$host_id));
return $status;
}
public function changeStatus($host_id = '', $status = '0'){
if(empty($host_id)){
return 0;
}
$status = $this->db->update('host_categories',array('status'=>$status),
array('host_cat_id'=>$host_id));
return $status;
}
}
?>
\ No newline at end of file
...@@ -7,26 +7,25 @@ class Login_model extends CI_Model { ...@@ -7,26 +7,25 @@ class Login_model extends CI_Model {
} }
public function login($username, $password) { public function login($username, $password) {
$query = $this->db->get_where('admin_users', $query = $this->db->query("SELECT * FROM users
array('username'=>$username, WHERE username='$username' AND password='$password' AND
'password'=>$password, user_type IN (1,2) AND status='1'");
'status'=>'1'));
if($query->num_rows() > 0 && !empty($query)){ if($query->num_rows() > 0 && !empty($query)){
$result = $query->row(); $result = $query->row();
$result->mechanic_data = '';
$result->mechanic_shop_data = '';
if($result->user_type == 2){
$this->load->model('Mechanic_model');
$result->mechanic_data = $this->Mechanic_model->getMechanic($result->id);
if(!empty($result->mechanic_data->shop_id)){ $result->profile_image;
$this->load->model('Shop_model'); if(isset($result->user_type) && !empty($result->user_type)){
$shop_data = $this->Shop_model->getShop($result->mechanic_data->shop_id); if($result->user_type == 2){
$this->load->model('Provider_model');
$provider = $this->Provider_model->getProviderData();
if(!empty($shop_data)){ $result->profile_image = $provider->profile_image;
$result->mechanic_shop_data = $shop_data; } else if ($result->user_type == 3){
} $this->load->model('Customer_model');
$customer = $this->Customer_model->getCustomerData();
$result->profile_image = $customer->profile_image;
} }
} }
} else { } else {
......
<?php
class Provider_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function getProviderData($provider_id='',$view=''){
$cond = (!empty($view))?" USR.status IN ($view) ":" USR.status != '2' ";
$cond .= (!empty($provider_id))?" AND PRV.provider_id='$provider_id' ":"";
$sql = "SELECT USR.username,USR.display_name,USR.profile_image,USR.user_type,USR.status,
PRV.provider_id,PRV.name,PRV.email,PRV.phone,PRV.profile_image
FROM provider AS PRV
INNER JOIN users AS USR ON (USR.id=PRV.provider_id)
WHERE $cond";
$providerData = $this->db->query($sql);
if(!empty($providerData)){
return (!empty($provider_id))?$providerData->result():$providerData->row();
}
return 0;
}
}
?>
\ No newline at end of file
<?php
class Region_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function getRegionData($region_id='',$view=''){
$cond = (!empty($view))?" status IN ($view) ":" status != '2' ";
$cond .= (!empty($region_id))?" AND id='$region_id' ":"";
$regionData = $this->db->query("SELECT * FROM region WHERE $cond");
if(!empty($regionData)){
return (empty($region_id))?$regionData->result():$regionData->row();
}
return 0;
}
public function createRegion($regionData = array()){
if(empty($regionData)){
return 0;
}
$status = $this->db->insert('region',$regionData);
return $status;
}
public function updateRegion($region_id = '', $regionData = array()){
if(empty($region_id) || empty($regionData)){
return 0;
}
$status = $this->db->update('region',$regionData,array('id'=>$region_id));
return $status;
}
public function changeStatus($region_id = '', $status = '0'){
if(empty($region_id)){
return 0;
}
$status = $this->db->update('region',array('status'=>$status),
array('id'=>$region_id));
return $status;
}
}
?>
\ No newline at end of file
<?php
class Tag_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function getTagData($tag_id='',$view=''){
$cond = (!empty($view))?" status IN ($view) ":" status != '2' ";
$cond .= (!empty($tag_id))?" AND tag_id='$tag_id' ":"";
$tagData = $this->db->query("SELECT * FROM tags WHERE $cond");
if(!empty($tagData)){
return (empty($tag_id))?$tagData->result():$tagData->row();
}
return 0;
}
public function createTag($tagData = array()){
if(empty($tagData)){
return 0;
}
$status = $this->db->insert('tags',$tagData);
return $status;
}
public function updateTags($tag_id = '', $tagData = array()){
if(empty($tag_id) || empty($tagData)){
return 0;
}
$status = $this->db->update('tags',$tagData,array('tag_id'=>$tag_id));
return $status;
}
public function changeStatus($tag_id = '', $status = '0'){
if(empty($tag_id)){
return 0;
}
$status = $this->db->update('tags',array('status'=>$status),array('tag_id'=>$tag_id));
return $status;
}
}
?>
\ No newline at end of file
<?php
class User_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
function getUserData($user_id = ''){
if(empty($user_id)){
return 0;
}
$userData = array();
$query = $this->db->get_where('users',array('id'=>$user_id));
if($query->num_rows() > 0 && !empty($query)){
$result = $query->row();
if(isset($result->user_type) && !empty($result->user_type)){
if($result->user_type == 2){
$this->load->model('Provider_model');
$userData = $this->Provider_model->getProviderData();
} else if ($result->user_type == 3){
$this->load->model('Customer_model');
$userData = $this->Customer_model->getCustomerData();
}
}
$userData->id = $result->id;
$userData->status = $result->status;
$userData->username = $result->username;
$userData->user_type = $result->user_type;
$userData->display_name = $result->display_name;
$userData->profile_image = $result->profile_image;
return $userData;
}
return 0;
}
function updateUser($user_id = '',$user_type = '',$user_data = array()){
if(empty($user_id) || empty($user_type) || empty($user_data)){
return 0;
}
$chkUser = $this->db->query("SELECT * FROM users WHERE status!='2' AND id!='".$user_id."' AND
username='".$user_data['username']."'");
if(!empty($chkUser) && $chkUser->num_rows() > 0) {
return 4;
}
if ($user_type == 2) {
$chkUser = $this->db->query("SELECT * FROM users AS USR
INNER JOIN provider AS PRV ON (USR.id = PRV.provider_id)
WHERE USR.status!='2' AND USR.id!='".$user_id."' AND
PRV.email='".$user_data['email']."'");
if(!empty($chkUser) && $chkUser->num_rows() > 0) return 5;
$chkUser = $this->db->query("SELECT * FROM users AS USR
INNER JOIN provider AS PRV ON (USR.id = PRV.provider_id)
WHERE USR.status!='2' AND USR.id!='".$user_id."' AND
PRV.phone='".$user_data['phone']."'");
if(!empty($chkUser) && $chkUser->num_rows() > 0) return 6;
$status = $this->db->update('provider',array('name'=>$user_data['name'],
'email'=>$user_data['email'],
'phone'=>$user_data['phone']),
array('provider_id'=>$user_id));
} else if ($user_type == 3) {
$chkUser = $this->db->query("SELECT * FROM users AS USR
INNER JOIN customer AS CUST ON (USR.id = CUST.customer_id)
WHERE USR.status!='2' AND USR.id!='".$user_id."' AND
CUST.email='".$user_data['email']."'");
if(!empty($chkUser) && $chkUser->num_rows() > 0) return 5;
$chkUser = $this->db->query("SELECT * FROM users AS USR
INNER JOIN customer AS CUST ON (USR.id = CUST.customer_id)
WHERE USR.status!='2' AND USR.id!='".$user_id."' AND
CUST.phone='".$user_data['phone']."'");
if(!empty($chkUser) && $chkUser->num_rows() > 0) return 6;
$status = $this->db->update('customer',array('name'=>$user_data['name'],
'email'=>$user_data['email'],
'phone'=>$user_data['phone']),
array('customer_id'=>$user_id));
}
if($status){
$userData['username'] = $user_data['username'];
$userData['display_name'] = $user_data['display_name'];
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_image'] = $user_data['profile_image'];
}
$this->db->update('users',$userData,array('id'=>$user_id));
$usrData = $this->getUserData($user_id);
if(!empty($usrData)){
$this->session->set_userdata('id',$usrData->id);
$this->session->set_userdata('user',$usrData);
$this->session->set_userdata('username',$usrData->username);
$this->session->set_userdata('logged_in','1');
$this->session->set_userdata('user_type',$usrData->user_type);
}
return 1;
}
return 0;
}
}
?>
\ No newline at end of file
<?php
class Venue_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function getVenueData($venue_id='',$view=''){
$cond = (!empty($view))?" VNE.status IN ($view) ":" VNE.status != '2' ";
$cond .= (!empty($venue_id))?" AND VNE.id='$venue_id' ":"";
$sql = "SELECT VNE.id AS venue_id,VNE.*,REG.name AS region_name,HST.host_category,HST.show_layout
FROM venue AS VNE
INNER JOIN region AS REG ON (VNE.region_id=REG.id)
INNER JOIN host_categories AS HST ON (HST.host_cat_id=VNE.host_cat_id)
WHERE $cond";
$venueData = $this->db->query($sql);
if(!empty($venueData)){
return (empty($venue_id))?$venueData->result():$venueData->row();
}
return 0;
}
public function createVenue($venueData = array()){
if(empty($venueData)){
return 0;
}
$status = $this->db->insert('venue',$venueData);
return $status;
}
public function updateVenues($venue_id = '', $venueData = array()){
if(empty($venue_id) || empty($venueData)){
return 0;
}
$status = $this->db->update('venue',$venueData,array('id'=>$venue_id));
return $status;
}
public function changeStatus($venue_id = '', $status = '0'){
if(empty($venue_id)){
return 0;
}
$status = $this->db->update('venue',array('status'=>$status),array('id'=>$venue_id));
return $status;
}
}
?>
\ No newline at end of file
<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 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" name="venueForm" action="<?= base_url('Event/addEvent')?>" method="post"
class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="col-md-12">
<?php if(!empty($venueList)){ ?>
<div class="form-group">
<label>Choose Venue</label>
<select name="venue_id" class="form-control"
placeholder="Select Venue" onchange="venueSubmitForm()">
<option selected disabled>Choose a Venue</option>
<?php
foreach ($venueList as $venue) {
$select = (isset($venue->venue_id) && $venue->venue_id==$venue_id)?'selected':'';
echo '<option '.$select.' value="'.$venue->venue_id.'">'.
$venue->venue_name.', '.$venue->region_name.' - '.$venue->location.
'</option>';
}
?>
</select>
</div>
<?php } ?>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
<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">Venue List</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Venue/addVenues') ?>">
Add New Venue
</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="100px;">Venue Name</th>
<th width="100px;">Region</th>
<th width="100px;">Host Type</th>
<th width="120px;">Location</th>
<th width="50px;">Status</th>
<th width="250px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($venue_data)){
foreach($venue_data as $venue) { ?>
<tr>
<th class="hidden"><?= $venue->venue_id ?></th>
<th class="center"><?= $venue->venue_name ?></th>
<th class="center"><?= $venue->region_name ?></th>
<th class="center"><?= $venue->host_category ?></th>
<th class="center"><?= $venue->location ?></th>
<th class="center"><?= ($venue->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<button class="btn btn-sm btn-info" id="viewVenueDetails"
venue_id="<?= encode_param($venue->venue_id) ?>">
<i class="fa fa-fw fa-eye"></i>View
</button>
<a class="btn btn-sm btn-primary"
href="<?= base_url('Venue/editVenues/'.encode_param($venue->venue_id))?>">
<i class="fa fa-fw fa-edit"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Venue/changeStatus/".encode_param($venue->venue_id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($venue->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Venue/changeStatus/".encode_param($venue->venue_id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Venue/changeStatus/".encode_param($venue->venue_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
<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($host_id)||empty($host_id))
?'Host/createHostCategory':'Host/updateHostCategory/'.$host_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">
<div class="col-md-6">
<div class="form-group">
<label>Host Category 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="host_category" required="" value="<?= (isset($host_data->host_category))?$host_data->host_category:'' ?>"placeholder="Host Category Name">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Have Layout</label>
<div>
<?php
$dCheck = 'checked';
if(isset($host_data->show_layout) && $host_data->show_layout != ''){
$dCheck = $host_data->show_layout;
}
?>
<input type="radio" name="show_layout" value="1" <?=($dCheck=='1')?'checked':$dCheck ?>>
<label class="padAll-10">Yes</label>
<input type="radio" name="show_layout" value="0" <?=($dCheck=='0')?'checked':'' ?>>
<label class="padAll-10">No</label>
</div>
<span class="glyphicon form-control-feedback"></span>
</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('Host/listHostCategory') ?>" class="btn btn-primary">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
<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">Host Category List</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Host/addHostCategory') ?>">
Add Host Category
</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 width="80px;">Host ID</th>
<th width="250px;">Host Category</th>
<th width="80px;">Show Layout</th>
<th width="100px;">Status</th>
<th width="250px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($host_data)){
foreach($host_data as $host) { ?>
<tr>
<th class="center"><?= $host->host_cat_id ?></th>
<th class="center"><?= $host->host_category ?></th>
<th class="center">
<?= ($host->show_layout == 0)?'NO':'YES' ?>
</th>
<th class="center"><?= ($host->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-primary"
href="<?= base_url('Host/editHostCategory/'.encode_param($host->host_cat_id))?>">
<i class="fa fa-fw fa-edit"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Host/changeStatus/".encode_param($host->host_cat_id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($host->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Host/changeStatus/".encode_param($host->host_cat_id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Host/changeStatus/".encode_param($host->host_cat_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
<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($region_id)||empty($region_id))
?'Region/createRegion':'Region/updateRegion/'.$region_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">
<div class="col-md-6">
<div class="form-group">
<label>Region 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($regionData->name))?$regionData->name:'' ?>"placeholder="Region Name">
<span class="glyphicon form-control-feedback"></span>
</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('Region/listRegion') ?>" class="btn btn-primary">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
<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">Region List</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Region/addRegion') ?>">
Add New Region
</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="250px;">Region</th>
<th width="100px;">Status</th>
<th width="200px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($regionData)){
foreach($regionData as $region) { ?>
<tr>
<th class="hidden"><?= $region->id ?></th>
<th class="center"><?= $region->name ?></th>
<th class="center"><?= ($region->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-primary"
href="<?= base_url('Region/editRegion/'.encode_param($region->id))?>">
<i class="fa fa-fw fa-edit"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Region/changeStatus/".encode_param($region->id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($region->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Region/changeStatus/".encode_param($region->id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Region/changeStatus/".encode_param($region->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
...@@ -91,12 +91,6 @@ ...@@ -91,12 +91,6 @@
<input type="text" name="google_api_key" class="form-control required" placeholder="Enter Google API" value="<?= $data['google_api_key'] ?>"> <input type="text" name="google_api_key" class="form-control required" placeholder="Enter Google API" value="<?= $data['google_api_key'] ?>">
</div> </div>
</div> </div>
<div class="row">
<div class="form-group col-xs-3">
<label>Vin Audit API</label>
<input type="text" name="vin_audit_api" class="form-control required" placeholder="Enter Vin Audit API" value="<?= $data['vin_audit_api'] ?>">
</div>
</div>
</div> </div>
<div class="box-footer" style="padding-left:46%"> <div class="box-footer" style="padding-left:46%">
<button type="submit" class="btn btn-info">Update</button> <button type="submit" class="btn btn-info">Update</button>
......
<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($tag_id)||empty($tag_id))?'Tag/createTags':'Tag/updateTags/'.$tag_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">
<div class="col-md-6">
<div class="form-group">
<label>Tag Title</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="tag_name" required=""
placeholder="Enter Tag Title" value="<?= (isset($tag_data->tag_name))?$tag_data->tag_name:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-12 padTop10">
<div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button>
<a href="<?= base_url('Tag/listTags') ?>" class="btn btn-primary">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
<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">Tag List</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Tag/addTags') ?>">
Add New Tag
</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="500px;">Tag Name</th>
<th width="100px;">Status</th>
<th width="200px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($tag_data)){
foreach($tag_data as $tag) { ?>
<tr>
<th class="hidden"><?= $tag->tag_id ?></th>
<th class="center"><?= $tag->tag_name ?></th>
<th class="center"><?= ($tag->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-primary"
href="<?= base_url('Tag/editTags/'.encode_param($tag->tag_id))?>">
<i class="fa fa-fw fa-edit"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Tag/changeStatus/".encode_param($tag->tag_id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($tag->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Tag/changeStatus/".encode_param($tag->tag_id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Tag/changeStatus/".encode_param($tag->tag_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
...@@ -16,13 +16,16 @@ ...@@ -16,13 +16,16 @@
<script src="<?= base_url('assets/js/app.min.js') ?>"></script> <script src="<?= base_url('assets/js/app.min.js') ?>"></script>
<script src="<?= base_url('assets/js/custom-script.js') ?>"></script> <script src="<?= base_url('assets/js/custom-script.js') ?>"></script>
<script src="<?= base_url('assets/js/parsley.min.js') ?>"></script> <script src="<?= base_url('assets/js/parsley.min.js') ?>"></script>
<script src="<?= base_url('assets/js/ckeditor.js') ?>"></script> <script src="https://cdn.ckeditor.com/4.5.7/standard/ckeditor.js"></script>
<script src="<?= base_url('assets/js/bootstrap-datepicker.js') ?>"></script> <script src="<?= base_url('assets/js/bootstrap-datepicker.js') ?>"></script>
<script src="<?= base_url('assets/js/clockpicker.js') ?>" type="text/javascript"></script> <script src="<?= base_url('assets/js/clockpicker.js') ?>" type="text/javascript"></script>
<script> <script>
jQuery('.clockpicker').clockpicker(); jQuery('.clockpicker').clockpicker();
jQuery( document ).ready(function() {
if(jQuery('#rich_editor').length == 1) { CKEDITOR.replace('rich_editor'); }
});
function doconfirm(){ function doconfirm(){
action = confirm("Are you sure to delete permanently?"); action = confirm("Are you sure to delete permanently?");
if(action != true) return false; if(action != true) return false;
......
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar"> <aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar"> <section class="sidebar">
<!-- Sidebar user panel -->
<div class="user-panel"> <div class="user-panel">
<div class="pull-left image"> <div class="pull-left image">
<img src="<?=base_url($this->session->userdata('profile_pic'))?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>'" class="user-image left-sid" alt="User Image"> <img src="<?=base_url($this->session->userdata('profile_pic'))?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>'" class="user-image left-sid" alt="User Image">
</div> </div>
<div class="pull-left info"> <div class="pull-left info">
<p><?php echo $this->session->userdata('logged_in_admin')['username']; ?></p> <p><?php echo $this->session->userdata('logged_in_admin')['username']; ?></p>
<a href="#"><i class="fa fa-circle text-success"></i> Online</a> <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
</div> </div>
</div> </div>
<ul class="sidebar-menu"> <ul class="sidebar-menu">
<li><a href="<?= base_url('Dashboard') ?>"><i class="fa fa-wrench" aria-hidden="true"> <li><a href="<?= base_url('Dashboard') ?>"><i class="fa fa-wrench" aria-hidden="true">
</i><span>Dashboard</span></a> </i><span>Dashboard</span></a>
</li> </li>
<li><a href="<?= base_url('Tag/listTags') ?>"><i class="fa fa-bars" aria-hidden="true">
</i><span>Tag Management</span></a>
</li>
<li class="treeview"> <li class="treeview">
<a href="#"> <a href="#">
<i class="fa fa-bars" aria-hidden="true"></i> <i class="fa fa-bars" aria-hidden="true"></i>
<span>Shop Management</span> <span>Host Categories</span>
<i class="fa fa-angle-left pull-right"></i> <i class="fa fa-angle-left pull-right"></i>
</a> </a>
<ul class="treeview-menu"> <ul class="treeview-menu">
<li> <li>
<a href="<?= base_url('Shop/addShop') ?>"> <a href="<?= base_url('Host/addHostCategory') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
Add Mechanic Shop Add Host Category
</a> </a>
</li> </li>
<li> <li>
<a href="<?= base_url('Shop/viewShops') ?>"> <a href="<?= base_url('Host/listHostCategory') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
View Mechanic Shops View Host Category
</a> </a>
</li> </li>
</ul> </ul>
</li> </li>
<li><a href="<?= base_url('Region/listRegion') ?>"><i class="fa fa-bars" aria-hidden="true">
</i><span>Region Management</span></a>
</li>
<li class="treeview"> <li class="treeview">
<a href="#"> <a href="#">
<i class="fa fa-bars" aria-hidden="true"></i> <i class="fa fa-bars" aria-hidden="true"></i>
<span>Issue Management</span> <span>Venue Management</span>
<i class="fa fa-angle-left pull-right"></i> <i class="fa fa-angle-left pull-right"></i>
</a> </a>
<ul class="treeview-menu"> <ul class="treeview-menu">
<li> <li>
<a href="<?= base_url('Issue/addIssue') ?>"> <a href="<?= base_url('Venue/addVenues') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
Add New Issue Add Venue
</a> </a>
</li> </li>
<li> <li>
<a href="<?= base_url('Issue/viewIssues') ?>"> <a href="<?= base_url('Venue/listVenues') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
View All Issues View Venue
</a> </a>
</li> </li>
<?php if($this->session->userdata['user_type'] != 1){ ?> </ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
<span>Event Management</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li> <li>
<a href="<?= base_url('Issue/issueMapping') ?>"> <a href="<?= base_url('Event/addEvent') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
Issue Mapping Add Event
</a> </a>
</li> </li>
<?php } ?>
<li> <li>
<a href="<?= base_url('Issue/viewMappedIssues') ?>"> <a href="<?= base_url('Event/listEvents') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
Manage Mapped Issues View Events
</a> </a>
</li> </li>
</ul> </ul>
</li> </li>
<?php if($this->session->userdata['user_type'] == 1){ ?> <?php if($this->session->userdata['user_type'] == 1){ ?>
<li class="treeview"> <!-- super admin user menu -->
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
<span>Mechanic Management</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li>
<a href="<?= base_url('Mechanic/addMechanic') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Add Mechanic
</a>
</li>
<li>
<a href="<?= base_url('Mechanic/viewMechanics') ?>">
<i class="fa fa-circle-o text-aqua"></i>
View Mechanics
</a>
</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/addCustomerUser') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Add Customer
</a>
</li>
<li>
<a href="<?= base_url('Customer/listCustomerUsers') ?>">
<i class="fa fa-circle-o text-aqua"></i>
View Customers
</a>
</li>
</ul>
</li>
<?php } ?>
<li>
<a href="<?= base_url('Bookings/listBookings') ?>"><i class="fa fa-book" aria-hidden="true">
</i><span>Request Management</span></a>
</li>
<?php if($this->session->userdata['user_type'] == 1){ ?>
<li><a href="<?= base_url('Settings') ?>">
<i class="fa fa-wrench" aria-hidden="true">
</i><span>Settings</span></a>
</li>
<?php } ?> <?php } ?>
</ul> </ul>
</section> </section>
<!-- /.sidebar -->
</aside> </aside>
<?php
$user_data = $this->session->userdata['user'];
?>
<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
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('User/updateUser')?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<!-- Basic Details -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Basic 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=""
value="<?= $user_data->display_name ?>" placeholder="Enter 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=""
data-parsley-pattern="^[a-zA-Z0-9\ . _ @ \/]+$"
value="<?= $user_data->username ?>" placeholder="Enter User Name">
<span class="glyphicon form-control-feedback"></span>
</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="<?= base_url($user_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>
<?php
$user_type = $this->session->userdata('user_type');
if($user_type == 2 || $user_type == 3){ ?>
<!-- Mechanic Data -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Personal Details</h3>
</div><br>
</div>
<?php if(!empty($provider)){ ?>
<div class="col-md-6">
<div class="form-group">
<label>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="<?= $provider->name ?>"
placeholder="Enter First Name">
<span class="glyphicon form-control-feedback"></span>
</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="<?= $provider->email ?>" >
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<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="" name="phone" placeholder="Enter Phone Number" value="<?= $provider->phone ?>" >
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<?php } if(!empty($customer)){ ?>
<div class="col-md-6">
<div class="form-group">
<label>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="<?= $customer->name ?>"
placeholder="Enter First Name">
<span class="glyphicon form-control-feedback"></span>
</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="<?= $customer->email ?>" >
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<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="" name="phone" placeholder="Enter Phone Number" value="<?= $customer->phone ?>" >
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<?php } } ?>
<!-- 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 class="col-md-6">
<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>
</div>
<div class="col-md-6">
<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>
</div>
<div class="col-md-12">
<div class="box-footer" style="padding-left:46%;">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
<?php
$user_data = $this->session->userdata['user'];
?>
<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
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-header with-border">
<div class="col-md-6"><h3 class="box-title">Admin Details</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('User/editProfile') ?>">Edit</a>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
<div class="box-body">
<div class="col-md-12">
<div class="col-md-2">
<div class="form-group has-feedback">
<img src="<?= base_url($user_data->profile_image) ?>" class="cpoint"
onclick="viewImageModal('Profile Image','<?= base_url($user_data->profile_image) ?>');"
onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="100" width="100" />
</div>
</div>
<div class="col-md-5">
<div class="row">
<div class="col-md-5"><span>Display Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $user_data->display_name ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>User Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $user_data->username ?>
</label>
</div>
</div>
<?php
if($this->session->userdata('user_type') == 2 || $this->session->userdata('user_type') == 3){
if(!empty($provider)){ ?>
<div class="row padTop20">
<div class="col-md-5"><span>Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $provider->name ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Email </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $provider->email ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Phone Number </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $provider->phone ?>
</label>
</div>
</div>
<?php } if(!empty($customer)){ ?>
<div class="row padTop20">
<div class="col-md-5"><span>Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $customer->name ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Email </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $customer->email ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Phone Number </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $customer->phone ?>
</label>
</div>
</div>
<?php } } else { ?>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
<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">Venue List</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Venue/addVenues') ?>">
Add New Venue
</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="100px;">Venue Name</th>
<th width="100px;">Region</th>
<th width="100px;">Host Type</th>
<th width="120px;">Location</th>
<th width="50px;">Status</th>
<th width="250px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($venue_data)){
foreach($venue_data as $venue) { ?>
<tr>
<th class="hidden"><?= $venue->venue_id ?></th>
<th class="center"><?= $venue->venue_name ?></th>
<th class="center"><?= $venue->region_name ?></th>
<th class="center"><?= $venue->host_category ?></th>
<th class="center"><?= $venue->location ?></th>
<th class="center"><?= ($venue->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<button class="btn btn-sm btn-info" id="viewVenueDetails"
venue_id="<?= encode_param($venue->venue_id) ?>">
<i class="fa fa-fw fa-eye"></i>View
</button>
<a class="btn btn-sm btn-primary"
href="<?= base_url('Venue/editVenues/'.encode_param($venue->venue_id))?>">
<i class="fa fa-fw fa-edit"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Venue/changeStatus/".encode_param($venue->venue_id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($venue->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Venue/changeStatus/".encode_param($venue->venue_id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Venue/changeStatus/".encode_param($venue->venue_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
...@@ -495,3 +495,33 @@ ...@@ -495,3 +495,33 @@
border-right: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5;
border-top: 1px solid #e5e5e5; border-top: 1px solid #e5e5e5;
} }
.dropZoneContainer{
position: relative;
}
.dropZoneOverlay, .FileUpload {
width: 250px;
height: 250px;
}
.dropZoneOverlay {
border: dotted 1px;
font-family: cursive;
color: #040404;
text-align: center;
position: absolute;
top:0px;
left:0px;
right:0px;
}
.FileUpload {
opacity: 0;
position: relative;
z-index: 1;
}
.padTop30{
padding-top: 30px;
}
...@@ -90,4 +90,164 @@ function initLocSearch_3() { ...@@ -90,4 +90,164 @@ function initLocSearch_3() {
var options = {componentRestrictions: {country: country_flag}}; var options = {componentRestrictions: {country: country_flag}};
var autocomplete = new google.maps.places.Autocomplete(input, options); var autocomplete = new google.maps.places.Autocomplete(input, options);
} }
google.maps.event.addDomListener(window,'load',initLocSearch_3); google.maps.event.addDomListener(window,'load',initLocSearch_3);
\ No newline at end of file
function addLayoutPricing(thisObj){
var count = thisObj.attr('count'),
html = jQuery('[id="subIssueAdd"]').html();
if(count == '' || count == null || count == 'null' || count == undefined || count == 'undefined' || html == '' || html == null || html == 'null' || html == undefined || html == 'undefined'){
return false;
}
count = parseInt(count)+1;
thisObj.attr('count',count);
html = html.replace(/{:count}/g, count);
jQuery('[id="subIssueCntr"]').append('<div class="col-md-12 dispInLine" id="newSubIssue_'+count+'">'+html+'</div>');
}
function remSubIssue(count){
if(count == '' || count == null || count == 'null' || count == undefined || count == 'undefined'){
return false;
}
jQuery('[id="newSubIssue_'+count+'"]').remove();
}
function setLayout(){
var layoutFlag = jQuery('[name="host_cat_id"]').find(":selected").attr('haveLayout');
if(layoutFlag == 1){
jQuery('[id="layoutCntr"]').html(jQuery('[id="layoutCntrHtml"]').html());
} else {
jQuery('[id="layoutCntr"]').html('');
}
}
jQuery('[id="viewVenueDetails"]').on('click',function() {
var venue_id = jQuery(this).attr('venue_id');
if(venue_id=='' || venue_id==undefined || venue_id=='undefined' || venue_id==null || venue_id=='null'){
return true;
}
modalTrigger('Venue Details','');
addModalLoader();
jQuery.ajax({
url : base_url+"Venue/getVenueData",
type : 'POST',
data : {'venue_id':venue_id},
success: function(resp){
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 resp_data = jQuery.parseJSON(resp);
if(resp_data['status'] == '0'){
remModalLoader();
jQuery('[id="modal_content"]').html('Something went wrong, please try again later...!');
return false;
}
var venue_data = resp_data['data'];
jQuery.each(venue_data, function (index, value) {
if(venue_data[index] != 'layout' && venue_data[index] != 'layout_details' && (value == '' || value == null || value == undefined || value == 'null' || value == 'undefined')){
venue_data[index] = ' -- ';
}
});
var layoutHtml = '';
if(venue_data['show_layout'] == '1'){
layoutHtml = '<div class="col-md-6">'+
'<div class="row"><label>Layout Details</label></div>'+
'<div class="row"> '+
'<div class="col-md-7" style="text-align:center;"> '+
'<img id="driverLicenceImg" src="'+base_url+venue_data['layout']+'"'+
'style="margin-top:10px;width:auto;max-width:225px;height:225px;" />'+
'</div><br>';
jQuery.each(jQuery.parseJSON(venue_data['layout_details']), function (indexLayout, layoutValue) {
layoutHtml += '<div class="col-md-5">'+
'<label>'+layoutValue['color']+'</label> Block <label>'+layoutValue['price']+'</label> /Seat'+
'</div>';
});
layoutHtml += '</div></div>';
}
var colSlot = (layoutHtml != '')?'6':'12';
var html = '<div id="map-canvas-assign" style="width: 100%; height: 200px;"></div><br>'+
'<div class="col-xs-12">'+
'<div class="col-md-'+colSlot+'">'+
'<div class="row"><label>Venue Details</label></div>'+
'<div class="row">'+
'<div class="col-md-4">Venue Name</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+ venue_data['venue_name']+'</label></div>'+
'</div> '+
'<div class="row">'+
'<div class="col-md-4">Venue Region</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+venue_data['region_name']+'</label></div>'+
'</div> '+
'<div class="row">'+
'<div class="col-md-4">Host Type</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+venue_data['host_category']+'</label></div>'+
'</div> '+
'<div class="row"> '+
'<div class="col-md-4">Venue Address</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+venue_data['location']+'</label></div>'+
'</div> '+
'<div class="row">'+
'<div class="col-md-4">Venue Details</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+ venue_data['venue_details']+'</label></div>'+
'</div> '+
'</div> '+
''+
layoutHtml
'</div> '+
'</div>';
remModalLoader();
jQuery('[id="modal_content"]').html(html);
jQuery('[id="driverLicenceImg"]').error(function() {
jQuery('[id="driverLicenceImg"]').attr('src',base_url+'assets/images/no_image.png');
});
var map, geocoder, marker, latlng, infowindow;
var mapOptions = {center: new google.maps.LatLng(venue_data['location_lat'],venue_data['location_lng']),
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map-canvas-assign"), mapOptions);
geocoder = new google.maps.Geocoder();
infowindow = new google.maps.InfoWindow();
var lat = parseFloat(venue_data['location_lat']);
var lng = parseFloat(venue_data['location_lng']);
latlng = new google.maps.LatLng(lat,lng);
marker = new google.maps.Marker({
position: latlng,
map: map,
html: venue_data['location']
});
google.maps.event.addListener(marker, 'click', function(event) {
infowindow.setContent(this.html);
infowindow.setPosition(event.latLng);
infowindow.open(map, this);
});
},
fail: function(xhr, textStatus, errorThrown){
remModalLoader();
jQuery('[id="modal_content"]').html('Something went wrong, please try again later...!');
},
error: function (ajaxContext) {
remModalLoader();
jQuery('[id="modal_content"]').html('Something went wrong, please try again later...!');
}
});
});
function venueSubmitForm(){
jQuery('[name="venueForm"]').submit();
}
\ No newline at end of file
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