本文整理匯總了PHP中Banner::edit方法的典型用法代碼示例。如果您正苦於以下問題:PHP Banner::edit方法的具體用法?PHP Banner::edit怎麽用?PHP Banner::edit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Banner
的用法示例。
在下文中一共展示了Banner::edit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: BannerCategoria
$bannerCategoria = new BannerCategoria();
require_once '../../models/Imagem.php';
$imagem = new Imagem();
foreach ($_REQUEST as $key => $value) {
if (!is_array($value)) {
$_REQUEST[$key] = utf8_decode($value);
} elseif (is_array($value)) {
foreach ($value as $key2 => $value2) {
$_REQUEST[$key][$key2] = utf8_decode($value2);
}
}
}
if ($_REQUEST['acao'] == 1 && $_REQUEST['operacao'] == 2) {
if ($data->add()) {
echo json_encode(array('success' => 1));
} else {
echo json_encode(array('success' => 0));
}
} elseif ($_REQUEST['acao'] == 2 && $_REQUEST['operacao'] == 2) {
if ($data->edit()) {
echo json_encode(array('success' => 1));
} else {
echo json_encode(array('success' => 0));
}
} elseif ($_REQUEST['acao'] == 3 && $_REQUEST['operacao'] == 2) {
if ($data->delete()) {
echo json_encode(array('success' => 1));
} else {
echo json_encode(array('success' => 0));
}
}
示例2: Banner
print_r($_FILES); exit;*/
$banner = new Banner();
$arrData = array();
$arrData['name'] = addslashes(ucwords($_POST['name']));
$arrData['details'] = addslashes($_POST['details']);
$arrData['status'] = addslashes($_POST['status']);
if (empty($_POST['id'])) {
$arrData['added_date'] = date('Y-m-d H:i:s');
$insert = $banner->add($arrData);
if ($insert) {
$cover = '';
if ($_FILES['image']['name'] != '') {
$cover = 'banner_' . $insert . '.jpg';
saveBannerImage($_FILES['image'], $insert, 'banner');
}
$_SESSION['insert_banner'] = 'added';
} else {
$_SESSION['insert_banner'] = 'insert_faild';
}
} else {
$arrData['id'] = $_POST['id'];
// $arrData['banner'] = 'banner_' . $_POST['id'] . '.jpg';
if ($_FILES['image']['name'] != '') {
$cover = 'banner_' . $arrData['id'] . '.jpg';
saveBannerImage($_FILES['image'], $arrData['id'], 'banner');
}
$update = $banner->edit($arrData);
$_SESSION['insert_banner'] = 'updated';
}
}
header('Location: banner.php?act=' . $_SESSION['insert_banner']);