本文整理匯總了PHP中Banner::clear方法的典型用法代碼示例。如果您正苦於以下問題:PHP Banner::clear方法的具體用法?PHP Banner::clear怎麽用?PHP Banner::clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Banner
的用法示例。
在下文中一共展示了Banner::clear方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
/**
* 刪除圖片
*/
function image_delete()
{
$imgid = get_post_value('imgid');
$category = get_post_value('id');
$field = array('status' => '50000');
$m = new Banner();
$m->clear();
$m->setTable('vcb_banner_images');
$m->setField($field);
$m->setWhere('image_id', '=', $imgid);
$m->update();
//返回
echo '操作成功,<a href="update?id=' . $category . '" >返回</a><br>';
}
示例2: auditQuit
/**
* 取消審核
* @access public
*/
function auditQuit()
{
$id = get_post_value('bulletin_id');
$status = get_post_value('status');
//隻可修改審核狀態
if (!in_array($status, array('10000', '30000'))) {
echo '<br>數據不可修改.<a href="index">返回</a><br>';
return;
}
if ($this->verify($status)) {
echo '<br>數據不可修改.<a href="index">返回</a><br>';
return;
}
$field = array('status' => $status == '30000' ? '10000' : '');
$m = new Banner();
$m->clear();
$m->setField($field);
///設置更新字段及值,(鍵值數組)
$m->setTable('vcb_bulletin');
//設置表名
$m->setWhere('bulletin_id', '=', $id);
//設置Where條件
$m->update();
//返回
header("Location:index");
}
示例3: Index
function Index()
{
//echo "session=";
// print_r($_SESSION);
// echo "<br>cookie=";
// print_r($_COOKIE);
if (isset($_SESSION['username']) && !empty($_SESSION['username'])) {
//檢測session
$this->assign('username', $_SESSION['username']);
} else {
if (!empty($_COOKIE["username"])) {
//檢測cookie
$userCookie = $_COOKIE["username"];
$this->assign('username', $userCookie);
} else {
//遊客登陸
$tourists_id = Login::getTouristsId();
if ($tourists_id == null) {
Login::setTouristsId();
}
//
}
}
//else結束
//
$c = new Category();
$category_1 = $c->getCategory_1_id();
$this->assign('category_1', $category_1);
$f = new Floor();
$floor_1 = $f->getFloor_1_id();
$this->assign('floor_1', $floor_1);
//
$m = new Category();
$num = count($m->getCategory_1_id()) * 10000;
$category_2_all = $this->get_category_2();
$this->assign('category_2_all', $category_2_all);
//var_dump($category_2_all);
//echo $num1."<br>";
$category_3_all = $this->get_category_3();
//echo "oh:".$num2."<br>";
//$this->assign('category_3_'.$i."_".$j.$k, $category_3_1[$k]);
//var_dump($category_3_all);
$this->assign('category_3_all', $category_3_all);
//$a=new Banner();
$floor_2_all = $this->get_floor_2();
$floor_3_all = $this->get_floor_3();
$this->assign('floor_2_all', $floor_2_all);
$this->assign('floor_3_all', $floor_3_all);
//********************************
$type = get_post_value('type');
$language = get_post_value('language');
$key = get_post_value('key');
$field = array('category_id', 'type', 'title', 'created', 'start_time', 'end_time', 'status', 'language');
$m = new Banner();
$m->clear();
$m->setField($field);
$m->setTable('vcb_banner_categor');
//$m->setWhere('status', '!=', '60000');//暫不設置
if ($type != '') {
$m->setWhere('type', '=', $type);
}
if ($language != '') {
$m->setWhere('language', '=', $language);
}
if ($key != '') {
$m->setWhere('title', 'LIKE', '%' . $key . '%');
}
$m->setOrderBy('type');
$data = $m->select();
//狀態標題 在每一條數據後加上4個數據
$count = count($data);
for ($i = 0; $i < $count; $i++) {
$data[$i]['status_cn'] = $m->getStatus('cn', $data[$i]['status']);
$data[$i]['status_th'] = $m->getStatus('th', $data[$i]['status']);
//$data[$i]['type'] = $m->getTypeCaption($data[$i]['type']);//返回位置對應描述
$data[$i]['dataInformation'] = $m->getImage($data[$i]['category_id']);
}
//print_r($data);
$this->assign('dataOfBanner', $data);
}
示例4: verify_ads
private function verify_ads($status = '10000')
{
$id = get_post_value('id');
//echo $id;
$m = new Banner();
$m->clear();
$m->setTable('vcb_index_banner2');
$m->setWhere('banner_id', '=', $id);
$m->setWhere('status', '=', $status);
$data = $m->getFieldValue('COUNT(*)');
return $data > 0 ? false : true;
}
示例5: verify
/**
* 判斷是否可修改
* @access private
* @return true|false
*/
private function verify($status = '10000')
{
$id = get_post_value('id');
$m = new Banner();
$m->clear();
$m->setTable('vcb_banner_categor');
$m->setWhere('category_id', '=', $id);
$m->setWhere('status', '=', $status);
$data = $m->getFieldValue('COUNT(*)');
return $data > 0 ? false : true;
}