title = "Edit Guests" url = "/guests-list/:id?/edit" layout = "Dashboard" is_hidden = 0 [session] security = "user" allowedUserGroups[] = "admin" allowedUserGroups[] = "supplier" redirect = "dashboard/login" == param('id'))->first(); } } function onSave() { date_default_timezone_set('Asia/Singapore'); $dateNow = date('Y-m-d H:i:s'); $query = Guests::where('id', $this->param('id'))->first(); $query->firstname = Input::get('firstname'); $query->lastname = Input::get('lastname'); $query->username = Input::get('username'); $query->email = Input::get('email'); $query->phone = Input::get('phone'); $query->country = Input::get('country'); if(Input::get('password') != null){ $query->password = Hash::make(Input::get('password')); } //verified if(Input::get('verified') == 'on'){ $query->verified = 1; } else { $query->verified = 0; } $query->updated_at = $dateNow; $query->save(); Session::flash('success', 'Guest has been update successfully.'); return redirect('/guests-list'); } // public function onDeleteImg() // { // // Get the image ID from the post data // $imageId = post('id_img'); // // Find the image and delete it // $image = File::find($imageId); // if ($image) { // $image->delete(); // } // // Re-fetch the images // $category = Category::find($this->param('id')); // if (Input::post('type') == 'main'){ // $images = $category->icon_desktop; // } // if (Input::post('type') == 'other'){ // $images = $category->icon_mobile; // } // // Return the updated partial // if (Input::post('type') == 'main'){ // return ['#main-img-container' => $this->renderPartial('category/icon_desktop', ['images' => $images])]; // } // if (Input::post('type') == 'other'){ // return ['#other-img-container' => $this->renderPartial('category/icon_mobile', ['images' => $images])]; // } // } ?> ==
Edit Guest
{#
#}
{#
{% partial 'category/icon_desktop' images=categorys.icon_desktop %}
{% partial 'category/icon_mobile' images=categorys.icon_mobile %}
#}
{% put scripts %} {% endput %}