EVOLUTION-NINJA
Edit File: Dashboard.php
<?php namespace App\Controllers; use App\Models\Gss_model; class Dashboard extends BaseController { public function access_id() { $gss_model = new Gss_model(); $id=session()->get('admin_id'); $table='gss_login'; $where=array('user_id'=>$id); $d=$gss_model->get_where_row($table,$where); return $d->user_type_id; } public function access_details() { $gss_model = new Gss_model(); $id=session()->get('admin_id'); $table='gss_login'; $where=array('user_id'=>$id); $d=$gss_model->get_where_row($table,$where); $data['user_type_id']=$d->user_type_id; $table='gss_access_controls'; $where=array('department_id'=>$data['user_type_id']); return $gss_model->get_where_result($table,$where); } public function admin_dashboard() { $session = session(); $admin_id = $session->get('admin_id'); if ($admin_id) { $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); return view('admin/admin_dashboard', $data); } else { return redirect()->to('/'); } } public function get_menu_list() { $db = \Config\Database::connect(); $builder = $db->table('gss_menu'); $result = $builder->where('delete_status', 'ACTIVE')->get()->getResult(); if (!empty($result)) { return $this->response->setJSON(['menu_list' => $result, 'result' => 1]); } else { return $this->response->setJSON(['result' => 0, 'message' => 'No menu items found']); } } public function get_all_sales() { $db = \Config\Database::connect(); // Query to get project details $query = $db->query(" SELECT B.project_name, B.project_id, B.project_status FROM gss_new_projects B WHERE B.delete_status = 'ACTIVE' AND B.project_status = 'ONGOING' "); $projects = $query->getResult(); $salesData = []; foreach ($projects as $project) { $project_id = $project->project_id; $data = [ 'project' => $project->project_name, 'project_status' => $project->project_status, 'dimension' => 0, // Default if no bookings found ]; // Query to get total dimension sum for the project $dimensionQuery = $db->query(" SELECT SUM(C.dimension) as total FROM gss_bookings A JOIN gss_booking_details C ON C.booking_id = A.booking_id WHERE A.delete_status = 'ACTIVE' AND C.delete_status = 'ACTIVE' AND A.booking_status = 'BOOKED' AND C.project_id = ? ", [$project_id]); $dimensionResult = $dimensionQuery->getRow(); if ($dimensionResult && $dimensionResult->total !== null) { $data['dimension'] = $dimensionResult->total; } $salesData[] = $data; } return $this->response->setJSON([ 'result' => 1, 'total' => count($salesData), 'all_sales' => $salesData ]); } public function get_project_total_sqft() { $db = \Config\Database::connect(); // Fetch all active ongoing projects $query = $db->query(" SELECT B.project_name, B.project_id FROM gss_new_projects B WHERE B.delete_status = 'ACTIVE' AND B.project_status = 'ONGOING' "); $projects = $query->getResult(); $projectData = []; foreach ($projects as $project) { $project_id = $project->project_id; $data = [ 'project' => $project->project_name, 'dimension' => 0 // Default if no sites found ]; // Fetch total sqft for the project $dimensionQuery = $db->query(" SELECT SUM(A.total_in_sqft) as total FROM gss_new_sites A WHERE A.delete_status = 'ACTIVE' AND A.project_id = ? ", [$project_id]); $dimensionResult = $dimensionQuery->getRow(); if ($dimensionResult && $dimensionResult->total !== null) { $data['dimension'] = $dimensionResult->total; } $projectData[] = $data; } return $this->response->setJSON([ 'result' => 1, 'total' => count($projectData), 'all_sales' => $projectData ]); } public function get_project_total_sqft_left() { $db = \Config\Database::connect(); // Fetch all active ongoing projects $projects = $db->table('gss_new_projects') ->select('project_name, project_id') ->where(['delete_status' => 'ACTIVE', 'project_status' => 'ONGOING']) ->get() ->getResult(); $projectData = []; foreach ($projects as $project) { $project_id = $project->project_id; $data = [ 'project' => $project->project_name, 'dimension' => 0 // Default if no sites or bookings found ]; // Fetch total sqft for the project $total_sqft = $db->table('gss_new_sites') ->selectSum('total_in_sqft', 'total') ->where(['delete_status' => 'ACTIVE', 'project_id' => $project_id]) ->get() ->getRow() ->total ?? 0; // Fetch booked sqft for the project $booked_sqft = $db->table('gss_bookings A') ->selectSum('C.dimension', 'total') ->join('gss_booking_details C', 'C.booking_id = A.booking_id') ->where([ 'A.delete_status' => 'ACTIVE', 'C.delete_status' => 'ACTIVE', 'A.booking_status' => 'BOOKED', 'C.project_id' => $project_id ]) ->get() ->getRow() ->total ?? 0; // Calculate remaining sqft $data['dimension'] = $total_sqft - $booked_sqft; $projectData[] = $data; } return $this->response->setJSON([ 'result' => 1, 'total' => count($projectData), 'all_sales' => $projectData ]); } public function get_all_menu() { $db = \Config\Database::connect(); $builder = $db->table('gss_menu') ->select('*') ->where(['parent_id' => '0', 'delete_status' => 'ACTIVE']); $result = $builder->get()->getResult(); $array = []; foreach ($result as $val) { $data = [ 'menu_id' => $val->menu_id, 'menu_name' => $val->menu_name, 'parent_id' => $val->parent_id ]; // Fetch submenus $subMenu = $db->table('gss_menu') ->select('*') ->where(['delete_status' => 'ACTIVE']) ->where('parent_id !=', '0') ->where('parent_id', $val->menu_id) ->get() ->getResult(); $data['sub_menu'] = !empty($subMenu) ? $subMenu : []; $array[] = $data; } return $this->response->setJSON($array); // Return JSON response } public function get_all_staff() { $db = \Config\Database::connect(); $builder = $db->table('gss_login A') ->select('A.username, A.user_id, B.user_type') ->join('gss_user_type B', 'B.user_type_id = A.user_type_id') ->where('A.delete_status', 'ACTIVE') ->where('B.delete_status', 'ACTIVE'); $result = $builder->get()->getResult(); return $this->response->setJSON([ 'staff_list' => $result, 'result' => !empty($result) ? 1 : 0 ]); } public function get_all_departments() { $db = \Config\Database::connect(); $result=$db->table('gss_user_type') ->select('*') ->where('delete_status', 'ACTIVE') ->get() ->getResult(); return $this->response->setJSON([ 'departments' => $result, 'result' => !empty($result) ? 1 : 0 ]); } public function get_access_list() { $db = \Config\Database::connect(); $builder = $db->table('gss_access_controls A') ->select('A.*, B.user_type') ->join('gss_user_type B', 'B.user_type_id = A.department_id') ->where('A.delete_status', 'ACTIVE') ->where('B.delete_status', 'ACTIVE'); $result = $builder->get()->getResult(); $array = []; foreach ($result as $val) { $data = [ 'department_id' => $val->department_id, 'department' => $val->user_type, 'menu' => [] // Initialize empty menu array ]; // Fetch menu IDs for the department $menuQuery = $db->table('gss_access_controls C') ->select('C.menu_id') ->where('C.department_id', $val->department_id) ->where('C.delete_status', 'ACTIVE') ->get() ->getRow(); if ($menuQuery) { $data['menu'] = array_map('trim', explode(",", $menuQuery->menu_id)); } $array[] = $data; } return $this->response->setJSON([ 'access_list' => $array, 'result' => !empty($array) ? 1 : 0 ]); } public function access_roles() { $db = \Config\Database::connect(); $table = 'gss_access_controls'; $where = ['delete_status' => 'ACTIVE']; $builder = $db->table($table); $result = $builder->select('*') ->where($where) ->get() ->getResult(); return $this->response->setJSON([ 'access_roles' => $result, 'result' => !empty($result) ? 1 : 0 ]); } // public function get_all_menu() // { // $table = 'gss_menu'; // $where = array('delete_status'=>'ACTIVE'); // $result = $this->gss_model->get_all_menu(); // if($result) // { // echo json_encode(array('menu_list'=>$result,'result'=>1)); // } // else // { // echo json_encode(array('result'=>0)); // } // } // public function get_menu_list() // { // $gss_model=new Gss_model(); // $table = 'gss_menu'; // $where = array('delete_status'=>'ACTIVE'); // $result = $gss_model->get_where_result($table,$where); // if($result) // { // echo json_encode(array('menu_list'=>$result,'result'=>1)); // } // else // { // echo json_encode(array('result'=>0)); // } // } public function get_all_reminder() { $gss_model=new Gss_model(); $total_admin_reminder_notifications = ''; $admin_id = session()->get('admin_id'); $type=session()->get('user_type_id'); $result=""; $comment=""; $reply=""; $reminder=""; if($type >1) { $data = $gss_model->get_follow_up_reminders($admin_id); foreach($data as $res) { $dmy = date('d-m-Y'); $date = $res->reminder; $newdate = strtotime ( '-2 day' , strtotime ($date) ) ; $newdate = date ( 'd-m-Y' , $newdate ); $d = array(); if($newdate == $dmy) { array_push($d, $res->reminder); } else { } foreach($d as $det) { $table = 'gss_follow_ups'; $admin_id = session()->get('admin_id'); $type=session()->get('user_type_id'); if($type >1) { $where = array('reminder'=>$det,'user_id'=>$admin_id); $where1 = array('user_id'=>$admin_id); $result = $gss_model->get_follow_up_reminderss($where); $total_user_reminder_notifications = $gss_model->get_total_follow_up_reminder($where); $current_date = date('d-m-Y'); $new = array(); array_push($new,$result); } } } $data['detail']=$result; $total_user_reminders = $total_user_reminder_notifications; if($result) { return $this->response->setJSON(['result'=>1,'total_user_reminders'=>$total_user_reminder_notifications,'detail'=>$result]); } else { return $this->response->setJSON(['result'=>0]); } } else { $admin_id = session()->get('admin_id'); $data = $gss_model->get_follow_up_admin_reminders($admin_id); foreach($data as $res) { $current_date = date('d-m-Y'); $admin_reminder_date = $res->admin_reminder_date; $newdate = strtotime ( '-2 day' , strtotime ($admin_reminder_date) ) ; $newdate = date ( 'd-m-Y' , $newdate ); $admin_date = array(); if($newdate == $current_date) { array_push($admin_date, $res->admin_reminder_date); } else { } foreach($admin_date as $adm_det) { $table = 'gss_comment'; $admin_id = session()->get('admin_id'); $type=session()->get('user_type_id'); $where = array('admin_reminder_date'=>$adm_det); $result = $gss_model->get_admin_reminders($where); $total_admin_reminder_notifications = $gss_model->get_total_follow_up_admin_reminder($where); } } $data['detail']=$result; $total_admin_reminders = $total_admin_reminder_notifications; if($result) { return $this->response->setJSON(['result'=>1,'total_admin_reminders'=>$total_admin_reminder_notifications,'detail'=>$result]); } else { return $this->response->setJSON(['result'=>0]); } } } public function get_all_comments() { $gss_model=new Gss_model(); $admin_id = session()->get('admin_id'); if($admin_id) { $type=session()->get('user_type_id'); $result=""; $comment=""; $reply=""; $reminder=""; if($type >1) { $admin_id = session()->get('admin_id'); $current_date = date('d-m-Y'); $comment = $gss_model->get_follow_up_comments($current_date,$admin_id); $total_comment_notifications = $gss_model->get_total_follow_up_commments($current_date,$admin_id); $data['comment']=$comment; $total_comments = $total_comment_notifications; if($comment) { return $this->response->setJSON(['result'=>1,'total_comments'=>$total_comment_notifications,'comment'=>$comment]); } else { return $this->response->setJSON(['result'=>0]); } } else { $admin_id = session()->get('admin_id'); $current_date = date('d-m-Y'); $reply = $gss_model->get_follow_up_user_replies($current_date); $total_reply_notifications = $gss_model->get_total_follow_up_replies($current_date); $total_replies = $total_reply_notifications; if($reply) { return $this->response->setJSON(['result'=>1,'total_replies'=>$total_reply_notifications,'reply'=>$reply]); } else { return $this->response->setJSON(['result'=>0]); } } } else { redirect('/'); } } public function get_total_reminder_comment() { $gss_model=new Gss_model(); $total_comment_notifications = ''; $admin_id = session()->get('admin_id'); $total_admin_reminder_notifications = 0; $type=session()->get('user_type_id'); $result = ""; $comment = ""; $reply = ""; $admin_reminders = ""; if($type >1) { $data = $gss_model->get_follow_up_reminders($admin_id); foreach($data as $res) { $dmy = date('d-m-Y'); $date = $res->reminder; if($date != "") { $newdate = strtotime ( '-2 day' , strtotime ($date) ) ; $newdate = date ( 'd-m-Y' , $newdate ); $d = array(); if($newdate == $dmy) { array_push($d, $res->reminder); } else { } foreach($d as $det) { $table = 'gss_follow_ups'; $admin_id = session()->get('admin_id'); $where = array('reminder'=>$det,'user_id'=>$admin_id,'notification_status'=>0); $result = $gss_model->get_follow_up_reminderss($where); $total_user_reminder_notifications = $gss_model->get_total_follow_up_reminder_notif($where); $current_date = date('d-m-Y'); $comment = $gss_model->get_follow_up_comments($current_date,$admin_id); $total_comment_notifications = $gss_model->get_total_follow_up_comment_notif($current_date); } } else { $total_user_reminder_notifications = 0; $current_date = date('d-m-Y'); $comment = $gss_model->get_follow_up_comments($current_date,$admin_id); $total_comment_notifications = $gss_model->get_total_follow_up_comment_notif($current_date); } } $data['reminder'] = $result; $user_reminder_notifications = $total_user_reminder_notifications; $data['comment'] = $comment; $user_comment_notifications = $total_comment_notifications; $total_user_notifications = $user_reminder_notifications + $user_comment_notifications; if($total_user_notifications) { return $this->response->setJSON(['result'=>1,'user_total'=>$total_user_notifications,'reminder'=>$result,'comment'=>$comment]); } else { return $this->response->setJSON(['result'=>0]); } } else { $total_admin_reminder_notifications = 0; $total_reply_notifications = 0; $admin_id = session()->get('admin_id'); $data = $gss_model->get_follow_up_admin_reminders($admin_id); foreach($data as $res) { $current_date = date('d-m-Y'); $admin_reminder_date = $res->admin_reminder_date; if($admin_reminder_date != "") { $newdate = strtotime ( '-2 day' , strtotime ($admin_reminder_date) ) ; $newdate = date ( 'd-m-Y' , $newdate ); $admin_date = array(); if($newdate == $current_date) { array_push($admin_date, $res->admin_reminder_date); } else { } foreach($admin_date as $adm_det) { $table = 'gss_comment'; $admin_id = session()->get('admin_id'); $where = array('admin_reminder_date'=>$adm_det,'user_id'=>$admin_id); $admin_reminders = $gss_model->get_admin_reminders($where); $total_admin_reminder_notifications = $gss_model->get_total_follow_up_admin_reminder_notif($where); $reply = $gss_model->get_follow_up_user_replies($current_date); $total_reply_notifications = $gss_model->get_total_follow_up_reply_notif($current_date); } } else { $total_admin_reminder_notifications = 0; $current_date = date('d-m-Y'); $reply = $gss_model->get_follow_up_user_replies($current_date); $total_reply_notifications = $gss_model->get_total_follow_up_reply_notif($current_date); } } $data['admin_reminder'] = $admin_reminders; $admin_reminder_notifications = $total_admin_reminder_notifications; $data['user_reply'] = $reply; $user_reply_notifications = $total_reply_notifications; $total_admin_notifications = $admin_reminder_notifications + $user_reply_notifications; if($total_admin_notifications) { return $this->response->setJSON(['result'=>1,'admin_total'=>$total_admin_notifications,'admin_reminder'=>$admin_reminders,'user_reply'=>$reply]); } else { return $this->response->setJSON(['result'=>0]); } } } public function get_admin_follow_project_details() { $admin_id = session()->get('admin_id'); if($admin_id) { $table='gss_new_projects'; $data['project_names']=$this->gss_model->get_where_reults_project_name(); $id = $this->request->getPost('id'); $site_number = $this->request->getPost('site_number'); $current_date = date('d-m-Y'); $data['details'] =$this->gss_model->get_admin_followup_details($id,$site_number,$current_date); $result = $data['details']; if($result) { echo json_encode(array('result'=>1,'details'=>$result)); } else { echo json_encode(array('result'=>0)); } } else { redirect('/'); } } public function status_conversation() { $gss_model=new Gss_model(); $user_type_id = session()->get('user_type_id'); if($user_type_id) { $booking_id = $this->uri->segment(2); $due_type = $this->uri->segment(3); $table = 'gss_status_conversation'; $where = array('booking_id'=>$booking_id); $data['detail'] = $gss_model->get_conversation_replies($booking_id); $data['due_type_detail'] = $gss_model->get_due_type_details($booking_id,$due_type); $data['project_details'] = $gss_model->conversation_booking_details($booking_id); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); return view('admin/conversation',$data); } else { redirect('/'); } } public function status_conversation_list() { $gss_model=new Gss_model(); $result = $gss_model->get_status_notifications(); if($result) { return $this->response->setJSON(['result'=>1,'conversations'=>$result,'total'=>count($result)]); } else { return $this->response->setJSON(['result'=>0]); } } public function notification_status_conversation() { $user_type_id = session()->get('user_type_id'); if($user_type_id) { $gss_model=new Gss_model(); $booking_id = $this->uri->segment(2); $table = 'gss_status_conversation'; $where = array('booking_id'=>$booking_id,'delete_status'=>'ACTIVE'); $data['detail'] = $gss_model->get_conversation_replies($booking_id); $table = 'gss_bookings'; $where = array('booking_id'=>$booking_id,'delete_status'=>'ACTIVE'); $bookings = $gss_model->get_where_row($table,$where); $data['customer_name'] = $bookings->customer_name; $project_id = $bookings->project_id; $table = 'gss_new_projects'; $where = array('project_id'=>$project_id,'delete_status'=>'ACTIVE'); $project = $gss_model->get_where_row($table,$where); $data['project'] = $project->project_name; $table = 'gss_booking_details'; $where = array('booking_id'=>$booking_id,'delete_status'=>'ACTIVE'); $booking_details = $gss_model->get_where_row($table,$where); $data['site_number'] = $booking_details->site_number; $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('admin/notification_status_conversation',$data); } else { redirect('/'); } } public function dob_calendar() { $admin_id = session()->get('admin_id'); if($admin_id) { $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); return view('admin/dob_calendar',$data); } else { redirect('/'); } } public function get_dob_dates() { $gss_model = new Gss_model(); $result = $gss_model->get_dob_list(); return $this->response->setJSON([ 'dob_list' => $result, 'result' => !empty($result) ? 1 : 0 ]); } public function user_booking_details() { $admin_id =session()->get('admin_id'); $gss_model = new Gss_model(); if($admin_id) { $table = 'gss_bookings'; $broker_table = 'gss_brokers'; $instal_table = 'gss_booking_installments'; $booking_id = $this->request->getUri()->getSegment(2); $data['site_result'] = $gss_model->user_site_booking_details1($booking_id); $data['instal_result'] = $gss_model->user_site_booking_detail($booking_id); // print_r($data['site_result']);die(); $payment_table = 'gss_plot_payments'; $payment_type_table = 'gss_plot_payment_types'; $where_booking = ['booking_id'=>$booking_id,'delete_status'=>'ACTIVE']; $type_result = $gss_model->get_where_row($payment_table,$where_booking); if($type_result){ $data['registration_date'] = date('d-m-Y', strtotime($type_result->registration_date)); $data['registration_status'] = 'Registered'; } else{ $data['registration_date'] = ''; $data['registration_status'] = 'Not Registered'; } $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); return view('admin/user_booking_details',$data); } else { redirect('/'); } } public function doa_calendar() { $admin_id = session()->get('admin_id'); if($admin_id) { $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); return view('admin/doa_calendar',$data); } else { redirect('/'); } } public function get_doa_dates() { $table = 'gss_bookings'; $gss_model = new Gss_model(); $where = ['delete_status'=>'ACTIVE']; $result = $gss_model->get_doa_list($table,$where); return $this->response->setJSON([ 'doa_list' => $result, 'result' => !empty($result) ? 1 : 0 ]); } public function get_total_stats() { $gss_model = new Gss_model(); $admin_id = session()->get('admin_id'); if($admin_id) { $land_table = 'gss_land_owners'; $broker_table = 'gss_brokers'; $project_table = 'gss_new_projects'; $enquiry_table = 'gss_enquiries'; $where = ['delete_status'=>'ACTIVE']; $total_owner_result = $gss_model->get_where_result($land_table,$where); $total_result_projects = $gss_model->get_where_result($project_table,$where); $total_result_brokers = $gss_model->get_where_result($broker_table,$where); $total_result_enquiries = $gss_model->get_where_result($enquiry_table,$where); $total_result_notification = $gss_model->commission_notifications(); $total_result_accounts = $gss_model->account_management_list(); $total_result_reception = $gss_model->reception_list(); $total_result_loans = $gss_model->get_loans_total(); $total_result_dob = $gss_model->get_dob_count(); $total_result_doa = $gss_model->get_doa_count(); if($total_owner_result) { return $this->response->setJSON([ 'result' => 1, 'total_owners' => count($total_owner_result), 'total_projects' => count($total_result_projects), 'total_brokers' => count($total_result_brokers), 'total_enquiries' => count($total_result_enquiries), 'total_notifications'=> count($total_result_notification), 'total_accounts' => count($total_result_accounts), 'total_reception' => count($total_result_reception), 'total_loans' => count($total_result_loans), 'total_dob' => $total_result_dob, // Already an int 'total_doa' => $total_result_doa // Already an int ]); } else { return $this->response->setJSON(['result'=>0,'message'=>'No data Found']); } } else { redirect('/'); } } public function datewise_sales_for_chart() { $gss_model = new Gss_model(); $from_date = $this->request->getPost('from_date'); if($from_date != "") { $date = new \DateTime($from_date); $from_date = $date->format('Y-m-d'); } $to_date = $this->request->getPost('to_date'); if($to_date != "") { $date = new \DateTime($to_date); $to_date = $date->format('Y-m-d'); } $result = $gss_model->datewise_sales_for_chart($from_date,$to_date); if($result) { return $this->response->setJSON(['result'=>1,'all_sales'=>$result,'total'=>count($result)]); } else { return $this->response->setJSON(['result'=>0]); } } public function get_status_notifications() { $session = session(); $gss_model = new Gss_model(); $admin_id = $session->get('admin_id'); $type = $session->get('user_type_id'); $total_count = ""; $conversations = ""; $result = $gss_model->get_status_notifications(); if ($result) { $total_count = count($result); return $this->response->setJSON([ 'result' => 1, 'conversation' => $result, 'total_status_notifications' => $total_count ]); } else { return $this->response->setJSON(['result' => 0]); } } public function get_not_viewed_notifications() { $session = session(); $admin_id = $session->get('admin_id'); $user_type_id = $session->get('user_type_id'); $booking_id = $this->request->getUri()->getSegment(2); $gssModel = new Gss_model(); // adjust namespace if needed $table = 'gss_status_notifications'; $where = ['booking_id' => $booking_id]; $data = []; if ($user_type_id == 1) { $data = ['admin' => 'VIEWED', 'viewed_by' => $admin_id]; } elseif ($user_type_id == 4) { $data = ['management' => 'VIEWED', 'viewed_by' => $admin_id]; } elseif ($user_type_id == 5) { $data = ['documentation' => 'VIEWED', 'viewed_by' => $admin_id]; } elseif ($user_type_id == 6) { $data = ['loan' => 'VIEWED', 'viewed_by' => $admin_id]; } $gssModel->updateData('gss_status_notifications', ['booking_id' => $booking_id], $data); $db = \Config\Database::connect(); if ($db->affectedRows() > 0) { $data = []; $data['detail'] = $gssModel->get_conversation_replies($booking_id); $bookings = $gssModel->get_where_row('gss_bookings', [ 'booking_id' => $booking_id, 'delete_status' => 'ACTIVE' ]); $data['customer_name'] = $bookings->customer_name ?? ''; $project_id = $bookings->project_id ?? null; $project = $gssModel->get_where_row('gss_new_projects', [ 'project_id' => $project_id, 'delete_status' => 'ACTIVE' ]); $data['project'] = $project->project_name ?? ''; $booking_details = $gssModel->get_where_row('gss_booking_details', [ 'booking_id' => $booking_id, 'delete_status' => 'ACTIVE' ]); $data['site_number'] = $booking_details->site_number ?? ''; $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); echo view('admin/notification_status_conversation', $data); } else { return $this->response->setJSON(['result' => 0]); } } }?>