当前位置: 首页>>代码示例>>PHP>>正文


PHP Item::delete_item方法代码示例

本文整理汇总了PHP中Item::delete_item方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::delete_item方法的具体用法?PHP Item::delete_item怎么用?PHP Item::delete_item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Item的用法示例。


在下文中一共展示了Item::delete_item方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: on_submit

 function on_submit()
 {
     $ids = isset($_POST['chk_id']) ? $_POST['chk_id'] : array();
     if (count($ids) > 0) {
         for ($i = 0; $i < count($ids); $i++) {
             Item::delete_item($ids[$i]);
         }
         Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'id', 'lock_die_all', 'hd_ac')));
     }
 }
开发者ID:hqd276,项目名称:bigs,代码行数:10,代码来源:item_list.php

示例2: delete_multi

 function delete_multi($item_array)
 {
     if ($item_array && is_array($item_array)) {
         $censor = Url::get('censor', 2);
         foreach ($item_array as $key => $item_id) {
             if ($item_id) {
                 if ($censor == -1 && User::have_permit(ADMIN_DEL_ITEM)) {
                     Item::delete_item_physical($item_id);
                 } else {
                     Item::delete_item($item_id);
                 }
             }
         }
     }
     Url::redirect_url(Url::build_all(array('selected_ids', 'cmd', 'id', 'product_item')));
 }
开发者ID:duynhan07,项目名称:elink,代码行数:16,代码来源:ManageItem.php

示例3: fn_del_item

    function fn_del_item()
    {
        $id = (int) Url::get('id', 0);
        if (!User::is_login()) {
            echo "not_login";
            exit;
        }
        if ($id > 0) {
            $item = Item::get_item($id);
            $item_memcache = $item;
            if (!User::have_permit(ADMIN_ITEM) && !User::have_cat_permit($item['category_id'])) {
                if ($item['user_id'] != User::id() || User::is_block()) {
                    echo "not_perm";
                    exit;
                }
            }
            $reason_del = EClassApi::getParam("reason_del");
            Item::delete_item($id);
            DB::query("UPDATE account SET total_transaction = total_transaction-1 WHERE id=" . $item["user_id"]);
            if ((User::have_permit(ADMIN_ITEM) || User::have_cat_permit($item['category_id'])) && $reason_del) {
                //$receiver_user = DB::select('account', 'id = ' . $item["user_id"]);
                $title_pm = 'Thông báo xóa tin từ EClass';
                /*hoặc [url=http://blog.chonmon.vn/2008/09/22/huong-dan-cac-chuc-nang-cua-enbac.html]hướng dẫn[/url]*/
                /*  $content_pm = 'Tin đăng \"' . $item['name'] . '\" của bạn đã bị xóa với lý do: ' . $reason_del . '
                
                				Đề nghị bạn tham khảo [url=http://blog.chonmon.vn/2008/10/14/quy-che-dang-tin-tren-enbaccom.html]Quy định đăng tin[/url]  trên blog.chonmon.vn
                				
                				Ban quản trị Én bạc.
                				
                				Vui lòng không trả lời tin nhắn này!';*/
                $content_pm = 'Tin đăng "' . $item['name'] . '" của bạn đã bị xóa với lý do: ' . $reason_del . '

				Đề nghị bạn tham khảo <a href="http://blog.chonmon.vn/2008/10/14/quy-che-dang-tin-tren-enbaccom.html">Quy định đăng tin</a>  trên blog.chonmon.vn
				<br/>
				Ban quản trị Én bạc.
				<br/>
				Vui lòng không trả lời tin nhắn này!';
                if (User::$current->data['signature']) {
                    $content_pm .= '<br /><hr /><br />Mọi thắc mắc vui lòng liên hệ theo số ĐT: 04.39743410 - Số máy lẻ: ' . User::$current->data['signature'];
                }
                $receiver_user = User::getUser($item["user_id"]);
                $receiver_user = $receiver_user['id'];
                EClassApi::Send_pm(User::id(), User::user_name(), $receiver_user, $title_pm, $content_pm, true);
                //EClassApi::sendNotification($receiver_user,$title_pm,$content_pm);
                $item_array = array('item_id' => $id, 'user_id' => User::id(), 'user_name' => User::user_name(), 'lock_time' => TIME_NOW, 'type' => 1, 'reason_lock' => $reason_del);
                DB::insert('item_lock', $item_array);
            }
            echo "success";
            exit;
        } else {
            echo "unsuccess";
            exit;
        }
    }
开发者ID:hqd276,项目名称:bigs,代码行数:54,代码来源:ajax_item.ajax.php

示例4: UserAdmin

 function UserAdmin($row)
 {
     define('BAN_NICK_DATE', 7);
     CGlobal::$website_title = 'Quản lý thành viên';
     Module::Module($row);
     if (User::have_permit(ADMIN_USER)) {
         switch (Url::get('cmd')) {
             case 'lockdie':
                 //Khoá vĩnh viễn
                 $id = (int) Url::get('id', 0);
                 if ($id) {
                     $user = User::getUser($id);
                     if ($user) {
                         DB::update('user', array('block_time' => -1), 'id=' . $id);
                         DB::insert('user_lock', array('time' => TIME_NOW, 'user_id' => $id, 'user_name' => $user['user_name'], 'type' => 3, 'admin_id' => User::id(), 'admin_name' => User::user_name()));
                         User::getUser($id, 0, 1);
                     }
                 }
                 Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'cmd', 'id', 'lock_die_all', 'hd_ac')));
                 break;
             case 'delete':
                 Item::delete_item(Url::get('id'));
                 Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'cmd', 'id', 'lock_die_all', 'hd_ac'), "cmd=item_list"));
                 break;
             case 'del_cache':
                 $id = (int) Url::get('id', 0);
                 if ($id) {
                     User::getUser($id, 0, 1);
                 }
                 Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'cmd', 'id', 'lock_die_all', 'hd_ac')));
                 break;
             case 'del_avatar':
                 $user = DB::select('user', (int) Url::get('id'));
                 if ($user) {
                     if ($user['avatar_url']) {
                         AZLib::ftp_image_delete_file($user['avatar_url'], $user['img_server']);
                         DB::update('user', array('avatar_url' => '', 'img_server' => 0), 'id=' . $user['id']);
                         User::getUser($user['id'], 0, 1);
                     }
                 }
                 Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'cmd', 'id', 'lock_die_all', 'hd_ac')));
                 break;
             case 'item_list':
                 require_once 'forms/item_list.php';
                 $this->add_form(new ItemListForm());
                 break;
             case 'user_log':
                 require_once 'forms/user_log.php';
                 $this->add_form(new UserLogForm());
                 break;
             case 'detail':
                 require_once 'forms/UserDetail.php';
                 $this->add_form(new UserDetailForm());
                 break;
             case 'add':
                 require_once 'forms/UserAdd.php';
                 $this->add_form(new UserAddForm());
                 break;
             case 'edit':
                 require_once 'forms/UserEdit.php';
                 $this->add_form(new UserEditForm());
                 break;
             default:
                 require_once 'forms/UserAdmin.php';
                 $this->add_form(new ListUserAdminForm());
                 break;
         }
     } else {
         Url::access_denied();
     }
 }
开发者ID:duynhan07,项目名称:elink,代码行数:71,代码来源:class.php

示例5: 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');
     }
 }
开发者ID:duynhan07,项目名称:elink,代码行数:68,代码来源:class.php

示例6: api

 protected function api()
 {
     header('Content-Type: application/json');
     try {
         if (empty($_REQUEST['method'])) {
             throw new Exception('No method specified');
         }
         switch ($_REQUEST['method']) {
             case 'add-row':
                 $this->add_row();
                 break;
             case 'delete-row':
                 $this->delete_row();
                 break;
             case 'delete-item':
                 if (empty($_REQUEST['item'])) {
                     throw new Exception('No item specified');
                 }
                 $item = new Item($_REQUEST['item']);
                 $item->delete_item();
                 die(json_encode(array('msg' => 'Deleted item', 'code' => 0)));
                 return;
             default:
                 throw new Exception('Invalid method specified');
         }
     } catch (Exception $e) {
         header('HTTP/1.0 500 Internal Server Error');
         $error = array('msg' => $e->getMessage(), 'code' => $e->getCode(), 'error' => true);
         echo json_encode($error);
         die;
     }
 }
开发者ID:rmccue,项目名称:Numbat,代码行数:32,代码来源:admin.php

示例7: fn_item_del_admin

 function fn_item_del_admin()
 {
     if (!User::is_login()) {
         echo "not_login";
         exit;
     }
     $item_id = (int) Url::get('item_id');
     if ($item_id) {
         $item = Item::get_item($item_id);
     } else {
         $item = array();
     }
     if ($item && (User::have_permit(ADMIN_ITEM) || User::have_cat_permit($item['category_id']))) {
         Item::delete_item($item_id);
         echo "success";
         exit;
     } else {
         echo "no_perm";
         exit;
     }
 }
开发者ID:hqd276,项目名称:bigs,代码行数:21,代码来源:ajax_admin.ajax.php

示例8: 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;
 }
开发者ID:duynhan07,项目名称:elink,代码行数:29,代码来源:ajax_admin.ajax.php


注:本文中的Item::delete_item方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。