本文整理汇总了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');