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


PHP Restaurant::updatePicture方法代碼示例

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


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

示例1: isset

$restaurant_picture_oid = isset($_POST['restaurant_picture_oid']) ? $_POST['restaurant_picture_oid'] : 'NULL';
// to keep postgres clean
$restaurant_picture_type = isset($_FILES['restaurant_picture']['type']) ? $_FILES['restaurant_picture']['type'] : '';
$remove_picture = isset($_POST['remove_picture']) ? $_POST['remove_picture'] : '';
$restaurant_menu_text = isset($_POST['restaurant_menu_text']) ? htmlentities(stripslashes($_POST['restaurant_menu_text']), ENT_QUOTES) : '';
$restaurant_comments = isset($_POST['restaurant_comments']) ? htmlentities(stripslashes($_POST['restaurant_comments']), ENT_QUOTES) : '';
if ($restaurant_id && !$SMObj->checkAccessLevel("EDITOR")) {
    // Figure out who the owner of this restaurant is, Editors can edit anyones items
    $sql = "SELECT restaurant_user FROM {$db_table_restaurants} WHERE restaurant_id = " . $DB_LINK->addq($restaurant_id, get_magic_quotes_gpc());
    $rc = $DB_LINK->Execute($sql);
    // If the recipe is owned by someone else then do not allow editing
    if ($rc->fields['restaurant_user'] != "" && $rc->fields['restaurant_user'] != $SMObj->getUserID()) {
        die($LangUI->_('You are not the owner of this restaurant, you are not allowed to edit it'));
    }
}
$restObj = new Restaurant($restaurant_id, $restaurant_name, $restaurant_website, $restaurant_address, $restaurant_city, $restaurant_state, $restaurant_zip, $restaurant_country, $restaurant_phone, $restaurant_hours, $restaurant_menu_text, $_FILES['restaurant_picture'], $restaurant_picture_type, $restaurant_picture_oid, $restaurant_comments, $restaurant_price, $restaurant_delivery, $restaurant_carry_out, $restaurant_dine_in, $restaurant_credit, $SMObj->getUserID());
// Add or Update the restaurant
$restObj->addUpdate();
// Handle the picture
if ($remove_picture == "yes") {
    $restObj->deletePicture();
} else {
    $restObj->updatePicture();
}
// Now that wasn't so painful was it?
if ($restaurant_id) {
    echo $LangUI->_('restaurant successfully updated');
} else {
    echo $LangUI->_('restaurant successfully added');
}
echo "<p>";
開發者ID:pjflameboy,項目名稱:phprecipebook,代碼行數:31,代碼來源:update.php


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