home
/
zktecojo
/
public_html
/
app
/
controllers
/
admin
➕ New
📤 Upload
✎ Editing:
LocationController.php
← Back
<?php class LocationController extends BaseController { public function __construct(){ $this->is_admin_login(); parent::__construct(); } public function index(){ $this->data['locationList']= DB::table('location') ->orderBy('location_priority','asc') ->get(); // dd($this->data['locationList']); return View::make('admin.location.list',$this->data); } public function create(){ $this->data['messages']=''; if(Input::get('createbtnsubmit')){ // $this->data = Input::get(); // echo "DD";exit(); // $file = Input::file('location_image_name'); $insertDatas = array( 'location_address1' =>Input::get('location_address1'), 'location_address2' =>Input::get('location_address2'), 'location_address2_ar' =>Input::get('location_address2_ar'), 'location_address3' =>Input::get('location_address3'), 'location_website' =>Input::get('location_web'), 'location_phone' =>Input::get('location_phone'), 'location_fax' =>Input::get('location_fax'), 'location_mail' =>Input::get('location_email'), 'location_priority' =>Input::get('location_priority'), 'location_status' =>Input::get('location_status'), 'map_latitude' =>Input::get('map_latitude'), 'map_longitude' =>Input::get('map_longitude'), ); DB::table('location')->insert($insertDatas); $this->data['messages'] =$this->custom_message('Location Added Successfully','success'); } // $this->data['locationMenuList'] = DB::table('menus')->where('menu_status','=',1)->get(); return View::make('admin.location.add',$this->data); } public function edit($editID){ if(empty($editID)) { return Redirect::to('admin/location');} $this->data['messages'] =''; if(Input::get('updatebtnsubmit')){ // dd($_POST); $datasupdate = array( 'location_address1' =>Input::get('location_address1'), 'location_address1_ar' =>Input::get('location_address1_ar'), 'location_address2' =>Input::get('location_address2'), 'location_address2_ar' =>Input::get('location_address2_ar'), 'location_address3' =>Input::get('location_address3'), 'location_website' =>Input::get('location_web'), 'location_phone' =>Input::get('location_phone'), 'location_fax' =>Input::get('location_fax'), 'location_mail' =>Input::get('location_email'), 'map_latitude' =>Input::get('map_latitude'), 'map_longitude' =>Input::get('map_longitude'), 'location_priority' =>Input::get('location_priority'), 'location_status' =>Input::get('location_status'), ); DB::table('location')->where('location_id', '=',$editID)->update($datasupdate); $this->data['messages'] = $this->custom_message('Location updated successfully','success'); } $this->data['rsLocation'] = DB::table('location')->where('location_id','=',$editID)->first(); return View::make('admin.location.edit',$this->data); } public function changestatus($statusID,$currentStatus){ $currentStatus = ($currentStatus==0)?1:0; $currentStatusdatas = array("location_status"=>$currentStatus); DB::table('location')->where('location_id', '=',$statusID)->update($currentStatusdatas); return Redirect::to('admin/location')->with('flash_error','deleted'); } public function delete($deleteID){ if(empty($deleteID)) { return Redirect::to('admin/location');} DB::table('location')->where('location_id', '=',$deleteID)->delete(); $this->data['messages'] = $this->custom_message('Deleted Successfully','success'); return Redirect::to('admin/location')->with('flash_error','deleted'); } }
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel