本文整理汇总了PHP中Item::get_item方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::get_item方法的具体用法?PHP Item::get_item怎么用?PHP Item::get_item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item::get_item方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_item_physical
static function delete_item_physical($id)
{
$item = Item::get_item($id);
if ($item && (User::is_admin() || $item['user_id'] == User::id())) {
// xoa comment
DB::update('item_image', array("item_id" => 0), "item_id={$id} AND root_id=0");
//Cập nhật các ảnh gốc
DB::delete('item_image', "item_id={$id} AND root_id>0");
//Xoá các ảnh ko fải ảnh gốc
DB::delete('item', 'id=' . $id);
//Loại item khỏi Memcache
Item::get_item($id, 1);
}
}
示例2: ItemRelate
function ItemRelate($row)
{
Module::Module($row);
if (Item::$id == -1) {
Item::$id = (int) Url::get('id', 0);
Item::$item = Item::get_item(Item::$id);
}
AZLib::checkItem();
if (Item::$item) {
if (Item::$item['display']) {
require_once 'forms/ItemRelate.php';
$this->add_form(new ItemRelateForm());
}
}
}
示例3: ItemDetail
function ItemDetail($row)
{
Module::Module($row);
require_once 'core/se.php';
if (Item::$id == -1) {
Item::$id = (int) Url::get('id', 0);
Item::$item = Item::get_item(Item::$id);
}
AZLib::checkItem();
if (Item::$item) {
if (Item::$item['display']) {
if (REWRITE_ON) {
//tuannk add 2010.07.28 fix redirect 301 với các url link sai
$nice_name1 = '';
if (Item::$item['category_id'] && isset(CGlobal::$allCategories[Item::$item['category_id']]) && CGlobal::$allCategories[Item::$item['category_id']]) {
$nice_name1 = CGlobal::$allCategories[Item::$item['category_id']]['nice_name'];
}
$url_detail = WEB_DIR . $nice_name1 . "/p" . Item::$item['id'] . "/" . AZLib::safe_title(Item::$item['name']) . ".html";
if ($nice_name1 != '' && strpos($_SERVER['REQUEST_URI'], $url_detail) !== 0) {
Url::redirect_url($url_detail, 301);
}
}
CGlobal::$website_title = Item::$item['name'];
CGlobal::$website_title .= ' - ' . AZLib::titlePath(Item::$item['category_id']);
if (Item::$item['status'] == 2) {
if (User::have_permit(ADMIN_ITEM)) {
CGlobal::$website_title = 'Tin đang ẩn';
} else {
Item::$item['display'] = 0;
}
}
Item::update_read_count();
}
}
require_once 'forms/ItemDetail.php';
$this->add_form(new ItemDetailForm());
}
示例4: draw
function draw()
{
global $display;
AZLib::getCats();
$this->beginForm();
$item = Item::get_item($this->booking_vip['item_id']);
if (!$item || $item && $item['status'] == -1) {
$this->setFormError("item_id", "Tin không tồn tại!");
} else {
$display->add('item_name', stripslashes($item['name']));
$display->add('item_link', Url::build('item_detail', array('id' => $item['id'], 'ebname' => AZLib::safe_title($item['name']))));
}
$top_catid = $item['level_1_catid'];
$cat_id = $item['category_id'];
$display->add('msg', $this->showFormErrorMessages(1));
$display->add('item_id', $this->booking_vip['item_id']);
if ($this->booking_vip['top_cat']) {
$display->add('category', 1);
} else {
if ($this->booking_vip['cat_id']) {
$display->add('category', 2);
}
}
$display->add('num_contract', $this->booking_vip['num_contract']);
$display->add('top_cat_name', CGlobal::$allCategories[$top_catid]['name']);
$display->add('cat_name', CGlobal::$allCategories[$cat_id]['name']);
$display->add('note', stripslashes(Url::get("note", $this->booking_vip['note'])));
$display->add('time_start', Url::get("time_start", date('d-m-Y', $this->booking_vip['time_start'])));
if ($this->booking_vip['time_end']) {
$display->add('time_end', Url::get("time_end", date('d-m-Y', $this->booking_vip['time_end'])));
} else {
$display->add('time_end', Url::get("time_end", ''));
}
$display->output('EditBookingVip');
$this->endForm();
}
示例5: ManageBookingVip
function ManageBookingVip($row)
{
Module::Module($row);
if (User::have_permit(ADMIN_VIP_ITEM) || User::have_permit(ADMICRO_BOOKING_VIP)) {
$cmd = Url::get('cmd');
switch ($cmd) {
case '':
require_once 'forms/ManageBookingVip.php';
$this->add_form(new ManageBookingVipForm());
break;
case 'add':
require_once 'forms/AddBookingVip.php';
$this->add_form(new AddBookingVipForm());
break;
case 'active':
if (User::have_permit(ADMIN_VIP_ITEM)) {
$id = (int) Url::get("id", 0);
if ($id) {
$booking_vip = DB::select("bookings_vip", "id={$id}");
}
$booking_vip['top_cat'] != 0 ? $cat_id = $booking_vip['top_cat'] : ($cat_id = $booking_vip['cat_id']);
$item_vip = DB::select_all('item_vip', "(catid = {$cat_id} OR level_1_catid = {$cat_id}) AND status = 1");
$i = 0;
$sa = $booking_vip['time_start'];
$ea = $booking_vip['time_end'];
foreach ($item_vip as $itemv) {
if ($sa > $itemv['time_start'] && $sa < $itemv['time_end']) {
$i++;
} elseif ($ea > $itemv['time_start'] && $ea < $itemv['time_end']) {
$i++;
} elseif ($sa < $itemv['time_start'] && $ea > $itemv['time_end']) {
$i++;
}
}
$priority = 1;
$arrItemVip = array('item_id' => $booking_vip['item_id'], 'note' => "Add từ bảng booking vip cho [{$booking_vip['user_add']}]", 'time_start' => $booking_vip['time_start'], 'time_end' => $booking_vip['time_end'], 'time_add' => TIME_NOW, 'user_add' => User::user_name(), 'time_modify' => TIME_NOW, 'user_modify' => User::user_name(), 'catid' => $booking_vip['cat_id'], 'level_1_catid' => $booking_vip['top_cat'], 'num_contract' => $booking_vip['num_contract'], 'priority' => $priority);
//insert
$idVip = DB::insert("item_vip", $arrItemVip);
if ($idVip) {
$item_id = $booking_vip['item_id'];
$item = Item::get_item($item_id);
if ($booking_vip['time_start'] >= TIME_NOW || $booking_vip['time_end'] <= TIME_NOW) {
$priority = 0;
}
DB::update("item", array("sticky" => $priority), "id={$item_id}");
if (MEMCACHE_ON) {
$item['sticky'] = $priority;
AZMemcache::do_put("item:{$item_id}", $item);
AZMemcache::do_remove("id_vip:{$item['category_id']}");
AZMemcache::do_remove("id_vip:{$item['level_1_catid']}");
}
}
//update status
DB::update('bookings_vip', array("status" => 1, "time_update_status" => TIME_NOW, "user_update_status" => User::user_name()), "id={$id}");
}
Url::redirect_current();
break;
case 'update_status':
if (User::have_permit(ADMIN_VIP_ITEM)) {
$id = (int) Url::get("id", 0);
DB::update('bookings_vip', array("status" => 1, "time_update_status" => TIME_NOW, "user_update_status" => User::user_name()), "id={$id}");
}
Url::redirect_current();
break;
case 'edit':
require_once 'forms/EditBookingVip.php';
$this->add_form(new EditBookingVipForm());
break;
case 'delete':
$id = (int) Url::get("id", 0);
$booking_vip = array();
if ($id) {
$booking_vip = DB::select("bookings_vip", "id={$id}");
}
if ($booking_vip && $booking_vip['status'] != 1) {
if (User::user_name() == $booking_vip['user_add'] || User::have_permit(ADMIN_VIP_ITEM)) {
DB::update('bookings_vip', array("status" => -1, "time_del" => TIME_NOW, "user_del" => User::user_name()), "id={$id}");
}
}
Url::redirect_current();
break;
default:
Url::redirect_current();
break;
}
} else {
Url::access_denied();
}
}
示例6: show_log_up_item
function show_log_up_item()
{
$item_id = (int) Url::get('item_id', 0);
if ($item_id > 0 && User::is_login() && !User::is_block()) {
$log_ups = array();
$item = Item::get_item($item_id);
if ($item) {
if (User::id() == $item['user_id']) {
global $display;
$re = DB::query("SELECT * FROM up_item_log WHERE item_id={$item_id} ORDER BY id DESC LIMIT 200");
if ($re) {
$stt = 1;
while ($log_up = mysql_fetch_assoc($re)) {
$log_up['stt'] = $stt++;
$log_up['up_time'] = date('d.m.Y H\\hi:s', $log_up['up_time']);
if ($log_up['up_id']) {
$log_up['type'] = '<font color=green><b>Up tự động</b></font>';
} else {
$log_up['type'] = 'Thành viên up';
}
$arr = explode(' ', $log_up['run_order']);
$log_up['run_order'] = $arr[0];
if ($log_up['status'] == 0) {
$log_up['status'] = '<font color="orange">Chưa kích hoạt</font>';
} elseif ($log_up['status'] == 1) {
$log_up['status'] = '<font color="green">Hoạt động</font>';
} elseif ($log_up['status'] == 2) {
$log_up['status'] = '<font color="brown">Hết lượt up</font>';
} elseif ($log_up['status'] == 3) {
$log_up['status'] = '<span title="Tạm ngừng do tin bị xoá hoặc kiểm duyệt"><font color="red">Tạm ngừng</font></span>';
}
$log_up['del_link'] = Url::build_current(array('cmd' => 'del_log', 'log_id' => $log_up['id']));
$log_up['href'] = '?page=item_detail&id=' . $log_up['item_id'];
$log_up['item_c_time'] = '';
$log_up['item_up_time'] = '';
$log_ups[] = $log_up;
}
}
if ($log_ups) {
$display->add('item_id', $item['id']);
$display->add('item_name', $item['name']);
$display->add('post_time', date('H\\hi d.m.Y', $item['created_time']));
$display->add('up_time', date('H\\hi d.m.Y', $item['up_time']));
$display->add('item_url', Url::build('item_detail', array('id' => $item['id'], 'ebname' => AZLib::safe_title($item['name']))));
$display->add('log_ups', $log_ups);
$display->output('UpTinLog', false, 'Personal');
System::halt();
}
}
}
}
echo 'no_log';
exit;
}
示例7: mark_label
function mark_label()
{
$user_id = (int) Url::get('user_id');
$item_id = (int) Url::get('item_id');
$check_ids = Url::get('check_ids');
$uncheck_ids = Url::get('uncheck_ids');
if (!User::is_login() || !$user_id) {
echo "not_login";
exit;
}
if (!$item_id || !$user_id || !User::is_admin() && (User::is_block() || User::id() != $user_id)) {
echo "not_permit";
exit;
}
$user = User::getUser($user_id);
$item = Item::get_item($item_id);
if (!$user || !$item || $item && $item['user_id'] != $user_id) {
echo "not_permit";
exit;
}
if ($uncheck_ids != '') {
DB::delete("label_item", "user_id={$user_id} AND label_id IN({$uncheck_ids}) AND item_id = {$item_id}");
}
if ($check_ids != '') {
$label_id_arr = explode(',', $check_ids);
$label_id_arr = $label_id_arr ? array_unique($label_id_arr) : $label_id_arr;
if ($label_id_arr) {
$insert_sql = '';
foreach ($label_id_arr as $label_id) {
$insert_sql .= ($insert_sql != '' ? ',' : '') . "({$label_id},{$item_id},{$user_id},'{$user['user_name']}')";
}
if ($insert_sql != '') {
$insert_sql = "REPLACE INTO label_item (label_id, item_id, user_id, user_name) VALUES {$insert_sql}";
DB::query($insert_sql);
}
}
}
echo "success";
exit;
}
示例8: rate_item
function rate_item()
{
if (User::is_login()) {
$item_id = Url::get('id', 0);
$num_stars = Url::get('num_stars', 0);
$type = Url::get('type', 0);
$user_id = User::id();
if ($type != 0 && $type != 1 && $type != 2) {
$type = 0;
}
if ($item_id && $user_id) {
$item = Item::get_item($item_id);
if ($item && $item['status'] == 1 && (User::have_permit(ADMIN_ITEM) || !DB::select("item_rating", "type=" + $type + " AND user_id=" . $user_id . " AND item_id=" . $item_id))) {
$rank = ($item['rank'] * $item['rate_num'] + $num_stars) / ($item['rate_num'] + 1);
if ($type == 0) {
$f_rank = ($item['f_rank'] * $item['f_rate_num'] + $num_stars) / ($item['f_rate_num'] + 1);
$update_sql = "f_rank= {$f_rank}, f_rate_num=f_rate_num+1";
} elseif ($type == 1) {
$d_rank = ($item['d_rank'] * $item['d_rate_num'] + $num_stars) / ($item['d_rate_num'] + 1);
$update_sql = "d_rank= '{$d_rank}', d_rate_num=d_rate_num+1";
} else {
$u_rank = ($item['u_rank'] * $item['u_rate_num'] + $num_stars) / ($item['u_rate_num'] + 1);
$update_sql = "u_rank= '{$u_rank}', u_rate_num=u_rate_num+1";
}
if (!User::have_permit(ADMIN_ITEM)) {
DB::insert("item_rating", array('user_id' => $user_id, 'item_id' => $item_id, 'rank' => $num_stars, 'type' => $type, 'time' => TIME_NOW));
}
DB::query("UPDATE item SET `rank`= '" . $rank . "', `rate_num`=rate_num+1, " . $update_sql . " WHERE id=" . $item_id);
Item::get_item($item_id, 1);
}
exit;
}
} else {
echo 'not_login';
exit;
}
echo 'no_perm';
exit;
}
示例9: ManageItem
function ManageItem($row)
{
if (User::have_permit(array(ADMIN_ITEM, ADMIN_DEL_ITEM))) {
Module::Module($row);
$cmd = Url::get('cmd');
switch ($cmd) {
case 'delete':
$id = (int) Url::get('id', 0);
if ($id) {
$item = Item::get_item($id);
Item::delete_item($id);
}
Url::redirect_url(Url::build_all(array('selected_ids', 'cmd', 'id', 'product_item')));
break;
case 'del_cache':
$id = (int) Url::get('id', 0);
if ($id) {
Item::get_item($id, 1);
}
Url::redirect_url(Url::build_all(array('selected_ids', 'cmd', 'id', 'product_item')));
break;
case 'del_forever':
if (User::have_permit(ADMIN_DEL_ITEM)) {
$id = (int) Url::get('id', 0);
if ($id) {
Item::delete_item_physical($id);
}
}
Url::redirect_url(Url::build_all(array('selected_ids', 'cmd', 'id', 'product_item')));
break;
case 'show':
case 're_post':
$id = (int) Url::get('id', 0);
if ($id) {
if (MEMCACHE_ON) {
$item_memcache = Item::get_item($id);
$item_memcache['status'] = 1;
$item_memcache['modify_user_name'] = User::user_name();
$item_memcache['modify_time'] = TIME_NOW;
AZMemcache::do_put("item:{$id}", $item_memcache);
}
DB::update('item', array('status' => 1, 'modify_user_name' => User::user_name(), 'modify_time' => TIME_NOW), 'id=' . $id);
}
Url::redirect_url(Url::build_all(array('selected_ids', 'cmd', 'id', 'product_item')));
break;
case 'hide':
$id = (int) Url::get('id', 0);
if ($id) {
if (MEMCACHE_ON) {
$item_memcache = Item::get_item($id);
$item_memcache['status'] = 2;
$item_memcache['modify_user_name'] = User::user_name();
$item_memcache['modify_time'] = TIME_NOW;
AZMemcache::do_put("item:{$id}", $item_memcache);
}
DB::update('item', array('status' => 2, 'modify_user_name' => User::user_name(), 'modify_time' => TIME_NOW), 'id=' . $id);
}
Url::redirect_url(Url::build_all(array('selected_ids', 'cmd', 'id', 'product_item')));
break;
default:
require_once 'forms/ManageItem.php';
$this->add_form(new ManageItemForm());
break;
}
} else {
Url::redirect('sign_in');
}
}
示例10: Build
function Build($row)
{
Module::Module($row);
##################################################################################################
$build_catids = @CGlobal::$configs['BuildCatIDs']['conf_val'];
if ($build_catids != '') {
$arr = explode(',', $build_catids);
$build_catids = '';
$last = 0;
if ($arr) {
foreach ($arr as $catid) {
if (isset(CGlobal::$allCategories[$catid]) && CGlobal::$allCategories[$catid]['status'] != 'HIDE') {
$build_catids .= ($build_catids != '' ? ',' : '') . $catid;
Build::$cats[$catid] = array('id' => $catid, 'name' => CGlobal::$allCategories[$catid]['name'], 'recomend' => str_replace(chr(13) . chr(10), "<br />", CGlobal::$allCategories[$catid]['recomend']), 'img' => AZLib::getImageThumb("category/{$catid}.gif", 40, 40, 0, 0), 'item_id' => 0, 'item_name' => '', 'item_url' => '', 'item_price' => '', 'item_warranty' => '', 'list_brief' => '');
if ($last) {
Build::$cats[$last]['next_id'] = $catid;
}
$last = $catid;
}
}
}
}
self::$bcatid = (int) Url::get('bcatid');
if (self::$bcatid) {
if (isset(Build::$cats[self::$bcatid])) {
self::$bcat = Build::$cats[self::$bcatid];
} else {
Url::redirect_current(array('mode'));
}
} else {
self::$bcat = reset(Build::$cats);
if (self::$bcat) {
self::$bcatid = (int) self::$bcat['id'];
}
}
##################################################################################################
$item_ids = '';
$build_ids = isset($_SESSION['build_ids']) ? $_SESSION['build_ids'] : '';
$build_price = 0;
if ($build_ids != '') {
$items = array();
$re = DB::query("SELECT * FROM item WHERE id IN(" . $build_ids . ") AND status=1 AND price>0 AND quantity>0 ORDER BY find_in_set(category_id,'" . $build_catids . "')");
if ($re) {
while ($item = mysql_fetch_assoc($re)) {
if (isset(Build::$cats[$item['category_id']]) && Build::$cats[$item['category_id']]['item_id'] == 0) {
Build::$price += $item['price'];
$item_ids .= ($item_ids != '' ? ',' : '') . $item['id'];
if (isset(CGlobal::$allCategories[$item['category_id']])) {
$item_url = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
} else {
$item_url = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
}
if ($item['list_brief'] == '') {
$item['list_brief'] = $item['brief'];
}
$item['list_brief'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $item['list_brief']);
$item['list_brief'] = str_replace(array("'", "\""), array("", " "), $item['list_brief']);
$item['list_brief'] = AZLib::word_limit($item['list_brief'], 50, '');
Build::$items[$item['id']] = $item;
Build::$cats[$item['category_id']]['item_id'] = $item['id'];
Build::$cats[$item['category_id']]['item_name'] = $item['name'];
Build::$cats[$item['category_id']]['item_url'] = $item_url;
Build::$cats[$item['category_id']]['item_price'] = number_format($item['price'], 0, ',', '.') . " VNĐ";
Build::$cats[$item['category_id']]['item_warranty'] = $item['warranty'];
Build::$cats[$item['category_id']]['list_brief'] = $item['list_brief'];
}
}
}
}
$item_id = (int) Url::get('item_id');
$bcatid = (int) Url::get('bcatid');
if ($item_id && $bcatid) {
$item = Item::get_item($item_id);
if ($item && $item['status'] == 1 && $item['price'] > 0 && $item['quantity'] > 0 && isset(Build::$cats[$item['category_id']])) {
if (!isset(Build::$items[$item['id']])) {
if (Build::$cats[$item['category_id']]['item_id'] > 0) {
unset(Build::$items[Build::$cats[$item['category_id']]['item_id']]);
}
Build::$items[$item['id']] = $item;
//$item_ids .= ($item_ids!='' ? ',' : '') . $item['id'];
$item_ids = implode(',', array_keys(Build::$items));
$_SESSION['build_ids'] = "{$item_ids}";
$last = 0;
foreach (array_keys(Build::$cats) as $catid) {
if ($last == self::$bcatid) {
Url::redirect_current(array('mode', 'bcatid' => $catid), '#select_item');
}
$last = $catid;
}
}
}
Url::redirect_current(array('mode', 'bcatid'));
}
$_SESSION['build_ids'] = "{$item_ids}";
$cmd = Url::get('cmd');
switch ($cmd) {
case 'success':
require_once 'forms/BuildSuccess.php';
$this->add_form(new BuildSuccessForm());
break;
//.........这里部分代码省略.........
示例11: invalid_item
function invalid_item()
{
if (!User::is_login()) {
echo "not_login";
exit;
} else {
$item_id = (int) Url::get('id');
$item_type = (int) Url::get('type', 2);
if ($item_id) {
$item = Item::get_item($item_id);
$item_memcache = $item;
} else {
$item = array();
}
if ($item && (User::have_permit(ADMIN_ITEM) || User::have_cat_permit($item['category_id']))) {
$type = 2;
} elseif (!User::have_permit(ADMIN_ITEM) && User::is_low_mod()) {
$type = 3;
}
if (!User::have_permit(ADMIN_ITEM) && User::is_low_mod() && DB::count('bad_content', 'id_item =' . $item_id . ' AND type = 3 AND user_id = ' . User::id())) {
echo "dup_invalid";
exit;
}
$reason = EClassApi::getParam('reason');
if (User::is_low_mod() && !$reason) {
echo "empty";
exit;
}
$reason = $reason ? $reason : "Tin đang bị kiểm duyệt";
$arr_data = array('type' => $type, 'id_item' => $item_id, 'user_id' => User::id(), 'user_name' => User::user_name(), 'reason' => $reason, 'time_post' => TIME_NOW);
if (!User::have_permit(ADMIN_ITEM) && User::is_low_mod() && DB::insert('bad_content', $arr_data)) {
echo "success_invalid";
exit;
}
if ($item && (User::have_permit(ADMIN_ITEM) || User::have_cat_permit($item['category_id'])) && DB::insert('bad_content', $arr_data)) {
EClassApi::getCats();
$link_help = 'http://help.chonmon.vn/index.php/Trang_%C4%91%E1%BA%A7u';
/*if (CGlobal::$allCategories[$item['category_id']]['link_help']){
$link_help = CGlobal::$allCategories[$item['category_id']]['link_help'];
}
elseif (isset(CGlobal::$allCategories[$item['category_id']]['parent_id']) && CGlobal::$allCategories[CGlobal::$allCategories[$item['category_id']]['parent_id']]['link_help'])
{
$link_help = CGlobal::$allCategories[CGlobal::$allCategories[$item['category_id']]['parent_id']]['link_help'];
}*/
switch ($item['level_1_category_id']) {
case "30":
case "1":
case "31":
case "107":
case "78":
case "51":
//$link_help = 'http://help.chonmon.vn/index.php/Quy_%C4%91%E1%BB%8Bnh_ki%E1%BB%83m_duy%E1%BB%87t_tin_m%E1%BB%A5c_Th%E1%BB%9Di_trang_Nam/_N%E1%BB%AF%2C_Teen%2C_M%E1%BA%B9_v%C3%A0_b%C3%A9%2C_Gi%C3%A0y_d%C3%A9p_n%E1%BB%AF%2C_M%E1%BB%B9_ph%E1%BA%A9m_trang_s%E1%BB%A9c';
$link_help = 'http://blog.chonmon.vn/2010/12/07/quy-dinh-kiem-duyet-tin-muc-thoi-trang-nam-nu-teen-do-made-in-vnme-va-be-giay-dep-nu-my-pham-trang-suc.html';
break;
case "451":
case "105":
case "592":
case "447":
case "100":
//$link_help = 'http://help.chonmon.vn/index.php/Quy_%C4%91%E1%BB%8Bnh_ki%E1%BB%83m_duy%E1%BB%87t_tin_m%E1%BB%A5c_N%E1%BB%99i_th%E1%BA%A5t_gia_%C4%91%C3%ACnh/_V%C4%83n_ph%C3%B2ng%2C_%C4%90%E1%BB%93_d%C3%B9ng_b%E1%BA%BFp%2C_V%E1%BA%ADt_li%E1%BB%87u_x%C3%A2y_d%E1%BB%B1ng%2C_Ph%C3%B2ng_t%E1%BA%AFm_v%C3%A0_v%E1%BB%87_sinh';
$link_help = 'http://blog.chonmon.vn/2010/12/07/quy-dinh-kiem-duyet-tin-muc-noi-that-gia-dinhvan-phong-do-dung-bep-vat-lieu-xay-dung-phong-tam-ve-sinh.html';
break;
case "83":
case "541":
//$link_help = 'http://help.chonmon.vn/index.php/Quy_%C4%91%E1%BB%8Bnh_ki%E1%BB%83m_duy%E1%BB%87t_tin_m%E1%BB%A5c_%C4%90i%E1%BB%87n_tho%E1%BA%A1i%2C_Ch%E1%BB%A3_sim';
$link_help = 'http://blog.chonmon.vn/2010/10/07/quy-dinh-kiem-duyet-tin-muc-dien-thoai-cho-sim.html';
break;
case "104":
//$link_help = 'http://help.chonmon.vn/index.php/Quy_%C4%91%E1%BB%8Bnh_ki%E1%BB%83m_duy%E1%BB%87t_tin_m%E1%BB%A5c_H%C3%A0ng_hi%E1%BB%87u';
$link_help = 'http://blog.chonmon.vn/2010/12/07/quy-dinh-kiem-duyet-tin-muc-hang-hieu.html';
break;
case "331":
case "332":
case "335":
case "337":
//$link_help = 'http://help.chonmon.vn/index.php/Quy_%C4%91%E1%BB%8Bnh_ki%E1%BB%83m_duy%E1%BB%87t_tin_m%E1%BB%A5c_%C3%94_t%C3%B4';
$link_help = 'http://blog.chonmon.vn/2010/12/07/quy-dinh-kiem-duyet-muc-o-to.html';
break;
case "79":
//$link_help = 'http://help.chonmon.vn/index.php/Quy_%C4%91%E1%BB%8Bnh_ki%E1%BB%83m_duy%E1%BB%87t_tin_m%E1%BB%A5c_%C4%90i%E1%BB%87n_m%C3%A1y';
$link_help = 'http://blog.chonmon.vn/2010/06/07/quy-dinh-kiem-duyet-tin-muc-dien-may-dien-tu-am-thanh-dien-thoai-cho-sim-laptop-va-may-tinh-ky-thuat-so-thiet-bi-vp-va-may-cong-nghiep.html';
break;
case "103":
case "579":
case "571":
$link_help = 'http://blog.chonmon.vn/2010/06/07/quy-dinh-kiem-duyet-muc-nha-dat.html';
break;
case "514":
case "521":
$link_help = 'http://blog.chonmon.vn/2010/12/07/quy-dinh-kiem-duyet-tin-muc-dich-vu-dv-lam-dep-dv-dien-may.html';
break;
case "109":
case "101":
$link_help = 'http://blog.chonmon.vn/2010/12/07/quy-dinh-kiem-duyet-tin-muc-tong-hop-di-cho-online.html';
break;
}
DB::query("DELETE FROM bad_content WHERE type = 3 AND id_item = " . $item_id);
DB::query("UPDATE item SET status = " . $item_type . " , valid_time=" . TIME_NOW . ', valid_user="' . User::user_name() . '" WHERE id = ' . $item_id);
if (SORL_FILTER_ON) {
$solr = new Solr_Search();
//.........这里部分代码省略.........
示例12: on_submit
function on_submit()
{
$item_id = (int) Url::get("item_id", 0);
$category = (int) Url::get("category", 0);
$num_contract = Url::get("num_contract", '');
$time_s = Url::get("time_start", '');
$time_e = Url::get("time_end", '');
if ($item_id <= 0) {
$this->setFormError('item_id', 'Bạn chưa nhập vào ID tin!');
return;
}
$item = Item::get_item($item_id);
if (!$item || $item && $item['status'] == -1) {
$this->setFormError('item_id', 'Tin bạn nhập vào không tồn tại!');
return;
}
if (!$this->errNum) {
$time_start = 0;
if ($time_s != '') {
$arr = explode('-', $time_s);
if (count($arr) == 3) {
$time_start = mktime(0, 0, 0, $arr[1], $arr[0], $arr[2]);
}
}
if (!$time_start) {
$time_start = mktime(0, 0, 0, date('m', TIME_NOW), date('d', TIME_NOW), date('Y', TIME_NOW));
}
$time_end = 0;
if ($time_e != '') {
$arr = explode('-', $time_e);
if (count($arr) == 3) {
$time_end = mktime(23, 59, 59, $arr[1], $arr[0], $arr[2]);
}
}
if (!$time_end) {
$this->setFormError('time_end', 'Bạn chưa nhập vào thời gian kết thúc!');
return;
}
if ($time_end < $time_start) {
$this->setFormError('time_end', 'Thời gian kết thúc phải lớn hơn thời gian bắt đầu!');
return;
}
// xac dinh xem co hien thi o danh muc cha khong
$top_cat = 0;
$cat_id = 0;
if ($category == 1) {
$top_cat = $item['level_1_catid'];
} else {
if ($category == 2) {
$cat_id = $item['category_id'];
}
}
$id = DB::insert("bookings_vip", array('item_id' => $item_id, 'cat_id' => $cat_id, 'top_cat' => $top_cat, 'note' => AZLib::getParam('note'), 'time_start' => $time_start, 'time_end' => $time_end, 'time_add' => TIME_NOW, 'user_add' => User::user_name(), 'time_edit' => TIME_NOW, 'user_edit' => User::user_name(), 'num_contract' => $num_contract));
if ($id) {
$content_email = "Có tin vip mới, id={$id}";
$email_managa_vip = 'longphamthanh@vccorp.vn';
if (System::sendEBEmail($email_managa_vip, 'Có booking vip mới', $content_email)) {
// DB::update('bookings_vip', array('note' => 'Gửi mail thành công'), "id=$id");
}
}
Url::redirect_current();
}
}
示例13: display_feedback
function display_feedback()
{
global $display;
$show_all = Url::get('show_all', 0);
Item::$id = (int) Url::get('id', 0);
Item::$item = Item::get_item(Item::$id);
if (Item::$item) {
if (!isset(Item::$item['display'])) {
Item::$item['display'] = 1;
if (isset(Item::$item['id'])) {
//Check trạng thái tin và quyền thao tác:
if (Item::$item['status'] != 1) {
//Tin không được kiểm duyệt
//Nếu tin chưa được kiểm duyệt ,chỉ admin hoặc chủ tin được xem!
if (Item::$item['status'] == 2) {
if (User::id() != Item::$item['user_id'] && !User::have_permit(ADMIN_ITEM) && !User::have_cat_permit(Item::$item['category_id'])) {
Item::$item['display'] = 0;
}
} else {
//Nếu tin ở trạng thái xóa
if (Item::$item['status'] == -1) {
if (!User::have_permit(ADMIN_ITEM)) {
Item::$item['display'] = 0;
//Url::access_denied();
}
}
}
//Nếu tin bị ẩn ,chỉ admin được xem!
if (Item::$item['status'] == 0) {
if (!User::is_admin()) {
Item::$item['display'] = 0;
//Url::access_denied();
}
}
}
}
}
if (Item::$item['display']) {
if ($show_all) {
$this->get_all_comment();
} else {
if (StaticCache::notExistCache('fb_' . Item::$id, 0)) {
StaticCache::startCache();
$this->get_all_comment();
StaticCache::endCache();
}
}
}
}
}
示例14: fn_del_item_reason
function fn_del_item_reason()
{
if (!User::is_login()) {
echo "not_login";
exit;
}
if (!User::have_permit(ADMIN_ITEM) && !User::is_mod()) {
echo "no_perm";
exit;
}
$id = (int) Url::get('id', 0);
if ($id) {
$item = Item::get_item($id);
$item_memcache = $item;
} else {
$item = array();
}
if ($item && (User::have_permit(ADMIN_ITEM) || User::have_cat_permit($item['category_id']))) {
Item::delete_item($id);
AZLib::del_reason_mod($id);
echo $id;
exit;
} else {
echo "no_perm";
exit;
}
echo "unsuccess";
exit;
}
示例15: finish_edit_item_id
function finish_edit_item_id()
{
$json = array('error' => '');
if (!User::is_login()) {
$json['error'] = "not_login";
echo json_encode($json);
exit;
}
if (User::is_block()) {
$json['error'] = "no_permission";
echo json_encode($json);
exit;
}
$user = User::$current->data;
$item_id = Url::get('item_id', 0);
$bidding_id = Url::get('bidding_id', 0);
if ($item_id) {
$item = Item::get_item($item_id);
}
if ($item) {
//Check trạng thái tin và quyền thao tác:
if ($item['status'] != 1) {
if (in_array($item['status'], array(0, 2, 3, 5))) {
$data['error'] = 'item_invalid';
echo json_encode($data);
exit;
} elseif ($item['status'] == -1 && !User::have_permit(ADMIN_ITEM)) {
//Nếu tin ở trạng thái xóa
$json['error'] = "item_not_exist";
echo json_encode($json);
exit;
}
} else {
$bidding_info = DB::select('bidding', "id={$bidding_id}");
if ($user['id'] != $bidding_info['user_id']) {
$json['error'] = "wrong_user";
echo json_encode($json);
exit;
}
if ($item['category_id'] != $bidding_info['cat_id']) {
$json['error'] = "wrong_item_id";
echo json_encode($json);
exit;
}
}
if (DB::query("UPDATE bidding SET item_id = {$item_id} WHERE id={$bidding_id}")) {
$json['error'] = "success";
echo json_encode($json);
exit;
} else {
$json['error'] = "error_update";
echo json_encode($json);
exit;
}
} else {
$json['error'] = "item_not_exist";
echo json_encode($json);
exit;
}
}