當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Restaurant::get_restaurant_id方法代碼示例

本文整理匯總了PHP中Restaurant::get_restaurant_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP Restaurant::get_restaurant_id方法的具體用法?PHP Restaurant::get_restaurant_id怎麽用?PHP Restaurant::get_restaurant_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Restaurant的用法示例。


在下文中一共展示了Restaurant::get_restaurant_id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: intval

     $max_capacity += intval($_POST['numberCapacity4']) * 4;
 }
 if (isset($_POST['hasCapacity6']) && $_POST['hasCapacity6'] === 'true') {
     $max_capacity += intval($_POST['numberCapacity6']) * 6;
 }
 if (isset($_POST['hasCapacity8']) && $_POST['hasCapacity8'] === 'true') {
     $max_capacity += intval($_POST['numberCapacity8']) * 8;
 }
 // echo $max_capacity;
 $fields = array('name' => $name, 'address' => $address, 'city' => $city, 'state' => $state, 'zipcode' => $zipcode, 'phone_number' => $phone_number, 'cuisine_type' => $cuisine_type, 'description' => $description, 'max_capacity' => $max_capacity, 'rating' => $rating, 'approved' => 0, 'owner_user_id' => $owner_user_id);
 try {
     $newRestaurant = new Restaurant();
     $newRestaurant->create($fields);
     $success = true;
     $message = 'Restaurant sign up complete!';
     $restaurant_id = $newRestaurant->get_restaurant_id();
     // after insert restaurant info without errors
     // add image to images table
     require_once '../lib/helper.functions.php';
     $image_client_path = $_FILES['file']['name'];
     $image_mime = $_FILES['file']['type'];
     $image_size = $_FILES['file']['size'];
     $image_error = $_FILES['file']['error'];
     $image_original_path = 'upload/original/';
     $image_medium_path = 'upload/medium/';
     $image_small_path = 'upload/small/';
     $tmp_file = $_FILES["file"]["tmp_name"];
     if ($image_error > 0) {
         throw new Exception('Image file is not correct!');
     } else {
         date_default_timezone_set('UTC');
開發者ID:HuiSF,項目名稱:FineTable-Class-Project,代碼行數:31,代碼來源:sign-up-restaurant.logic.php


注:本文中的Restaurant::get_restaurant_id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。