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


PHP deleteItem函数代码示例

本文整理汇总了PHP中deleteItem函数的典型用法代码示例。如果您正苦于以下问题:PHP deleteItem函数的具体用法?PHP deleteItem怎么用?PHP deleteItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: processSavings

function processSavings()
{
    if (array_key_exists('media_item_id', $_POST)) {
        updateItem($_POST['media_item_id']);
    } else {
        if (array_key_exists('type', $_POST)) {
            saveNewItem();
        } else {
            if (array_key_exists('delete_id', $_GET)) {
                deleteItem($_GET['delete_id']);
            }
        }
    }
}
开发者ID:xanobius,项目名称:how2web,代码行数:14,代码来源:functions.php

示例2: modifyItem

function modifyItem($itemId, $quantity)
{
    global $errorMsg, $errors;
    if ($quantity > 0) {
        $item = new Item($itemId, $quantity);
        if ($item->quantity > $item->stock) {
            $errors[$itemId] = sprintf(_("No hay suficiente stock disponible (%s disponibles)"), $item->stock);
        } else {
            $cart = get_cart();
            $cart->addItem($item);
            update_cart($cart);
        }
    } else {
        deleteItem($itemId);
    }
}
开发者ID:dpecos,项目名称:npshop,代码行数:16,代码来源:cart.php

示例3: delete

/**
* Author : Jan Germann
* Datum : 02.05.2010
* Modul : menu
* Beschreibung : Löschen von Menüpunkten
*/
function delete()
{
    global $msg, $mysql;
    //Keine Menüpunkte vorhande? Dann Abbrechen mit Fehler!
    if (!mysql_result($mysql->query("SELECT count(*) FROM " . _PREFIX_ . "menu"), 0)) {
        $msg->error("Es sind keine Menüpunkte vorhanden.");
        return;
    }
    if (!isset($_POST['delete']) && !isset($_POST['confirm'])) {
        return showFormDelete();
    } elseif (isset($_POST['delete'])) {
        return showFormConfirm();
    } elseif (isset($_POST['confirm'])) {
        foreach ($_POST['id'] as $id) {
            deleteItem($id);
        }
        $msg->success("Menüpunkt wurde gelöscht");
    }
}
开发者ID:nubix,项目名称:cms,代码行数:25,代码来源:function.delete.php

示例4: microtime

<?php

$timeStart = microtime(true);
session_start();
if (empty($_SESSION)) {
    exit(header("Location: ../../index.php"));
}
require_once $_SESSION['File_Root'] . '/Kernel/Include.php';
require_once $_SESSION['File_Root'] . '/HTML/Header.php';
require_once 'Functions/SQL.php';
redirectToLogin($accountID, $linkRoot);
redirectToBattle($verifyBattle, $linkRoot);
hasAdmin($accountAccess);
$itemID = htmlspecialchars(addslashes($_POST['itemID']));
deleteItem($bdd, $itemID);
?>

<?php 
echo $aitem20;
?>

<br>
<form method="POST" action="index.php">
	<input class="btn btn-success" type="submit" value="Ok">
</form>
<br/>

<?php 
require_once $_SESSION['File_Root'] . '/HTML/Footer.php';
开发者ID:The-Nico26,项目名称:Caranille,代码行数:29,代码来源:Delete.php

示例5: updateObjectItems

function updateObjectItems()
{
    if (isset($_REQUEST['Save'])) {
        # parameters check
        assertStringArg('name', false);
        assertUIntArg('type', true);
        assertStringArg('key_', false);
        assertUIntArg('value_type', true);
        $delay_flexStr = '';
        foreach ($_REQUEST['delay_flex'] as $delay_flex) {
            $delay_flexStr .= $delay_flex['delay'] . '/' . $delay_flex['period'] . ';';
        }
        $item = array('itemid' => $_REQUEST['item_id'], 'objectid' => $_REQUEST['objectid'], 'hostid' => $_REQUEST['hostid'], 'name' => $_REQUEST['name'], 'description' => $_REQUEST['description'], 'key_' => $_REQUEST['key_'], 'interfaceid' => $_REQUEST['interfaceid'], 'delay' => isset($_REQUEST['delay']) ? $_REQUEST['delay'] : 0, 'history' => isset($_REQUEST['history']) ? $_REQUEST['history'] : 90, 'status' => isset($_REQUEST['status']) ? $_REQUEST['status'] : 0, 'type' => isset($_REQUEST['type']) ? $_REQUEST['type'] : null, 'snmp_community' => $_REQUEST['snmp_community'], 'snmp_oid' => $_REQUEST['snmp_oid'], 'value_type' => isset($_REQUEST['value_type']) ? $_REQUEST['value_type'] : 0, 'trapper_hosts' => $_REQUEST['trapper_hosts'], 'port' => isset($_REQUEST['port']) ? $_REQUEST['port'] : null, 'units' => $_REQUEST['units'], 'multiplier' => isset($_REQUEST['multiplier']) ? $_REQUEST['multiplier'] : 0, 'delta' => isset($_REQUEST['delta']) ? $_REQUEST['delta'] : 0, 'snmpv3_contextname' => $_REQUEST['snmpv3_contextname'], 'snmpv3_securityname' => $_REQUEST['snmpv3_securityname'], 'snmpv3_securitylevel' => isset($_REQUEST['snmpv3_securitylevel']) ? $_REQUEST['snmpv3_securitylevel'] : 0, 'snmpv3_authprotocol' => isset($_REQUEST['snmpv3_authprotocol']) ? $_REQUEST['snmpv3_authprotocol'] : 0, 'snmpv3_authpassphrase' => $_REQUEST['snmpv3_authpassphrase'], 'snmpv3_privprotocol' => isset($_REQUEST['snmpv3_privprotocol']) ? $_REQUEST['snmpv3_privprotocol'] : 0, 'snmpv3_privpassphrase' => $_REQUEST['snmpv3_privpassphrase'], 'formula' => isset($_REQUEST['formula']) ? $_REQUEST['formula'] : 0, 'trends' => isset($_REQUEST['trends']) ? $_REQUEST['trends'] : 365, 'logtimefmt' => $_REQUEST['logtimefmt'], 'delay_flex' => $delay_flexStr, 'authtype' => isset($_REQUEST['authtype']) ? $_REQUEST['authtype'] : 0, 'username' => $_REQUEST['username'], 'password' => $_REQUEST['password'], 'publickey' => $_REQUEST['publickey'], 'privatekey' => $_REQUEST['privatekey'], 'params' => $_REQUEST['params'], 'ipmi_sensor' => $_REQUEST['ipmi_sensor'], 'data_type' => isset($_REQUEST['data_type']) ? $_REQUEST['data_type'] : 0, 'inventory_link' => isset($_REQUEST['inventory_link']) ? $_REQUEST['inventory_link'] : 0);
        if ($item['itemid'] < 0) {
            # add zabbix item
            $response = addItem($item);
            # if failed, return
            if (isset($response['error'])) {
                showError('Adding zabbix item is failed. Error message:' . $response['error']);
                return;
            }
            # insert item information into DB
            $item['itemid'] = $response['result']['itemids'][0];
            usePreparedInsertBlade('item_information', $item);
            $_REQUEST['item_id'] = $item['itemid'];
            showSuccess('added item ' . $_REQUEST['name'] . '.');
        } else {
            # update zabbix item
            unset($item['objectid']);
            unset($item['hostid']);
            $response = updateItem($item);
            if (isset($response['error'])) {
                showError('Updating zabbix item is failed. Error message:' . $response['error']);
                return buildRedirectURL(NULL, NULL, $_REQUEST);
            }
            # update item information in DB
            $item_id = $item['itemid'];
            unset($item['itemid']);
            usePreparedUpdateBlade('item_information', $item, array('itemid' => $item_id));
            showSuccess('updated item ' . $_REQUEST['name'] . '.');
        }
    } else {
        if (isset($_REQUEST['Delete'])) {
            $item_id = $_REQUEST['item_id'];
            if ($item_id > 0) {
                # delete zabbix item
                $response = deleteItem($item_id);
                if (isset($response['error'])) {
                    showError('Deleting zabbix item is failed. Error message:' . $response['error']);
                }
                # delete item information from DB
                usePreparedDeleteBlade('item_information', array('itemid' => $item_id));
                showSuccess('deleted item ' . $_REQUEST['name'] . '.');
                $_REQUEST['tab'] = 'default';
            }
        } else {
            return buildRedirectURL(NULL, NULL, $_REQUEST);
        }
    }
    $left_params = array('page', 'tab', 'op', 'objectid', 'item_id');
    foreach ($_REQUEST as $key => $value) {
        if (!in_array($key, $left_params)) {
            unset($_REQUEST[$key]);
        }
    }
    return buildRedirectURL(NULL, NULL, $_REQUEST);
}
开发者ID:micromachine,项目名称:RackTables-ZABBIX-bridge,代码行数:67,代码来源:ophandlers.php

示例6: array

$result = NULL;
$reports = array();
if (isset($_GET['id'])) {
    $result = getItem(sanitize($_GET['id']));
}
if (isset($_GET['save'])) {
    XSRFdefender('update_menu');
    if ($_POST['update']) {
        $result = updateMenuItem($reports);
    } else {
        $result = addItem($reports);
    }
}
if (isset($_GET['del'])) {
    XSRFdefender('delete_menu');
    deleteItem($reports);
}
printAdminHeader('menu', is_array($result) && $result['id'] ? gettext('edit') : gettext('add'));
?>
<link rel="stylesheet" href="../zenpage/zenpage.css" type="text/css" />
<?php 
$menuset = checkChosenMenuset();
?>
</head>
<body>
	<?php 
printLogoAndLinks();
?>
	<div id="main">
		<?php 
printTabs();
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:menu_tab_edit.php

示例7: processPageLoad

/**
 * Processes loading of this sample code through a web browser.  Uses AuthSub
 * authentication and outputs a list of a user's base items if succesfully 
 * authenticated.
 *
 * @return void
 */
function processPageLoad()
{
    global $_SESSION, $_GET;
    if (!isset($_SESSION['sessionToken']) && !isset($_GET['token'])) {
        requestUserLogin('Please login to your Google Account.');
    } else {
        startHTML();
        $client = getAuthSubHttpClient();
        $itemUrl = insertItem($client, false);
        updateItem($client, $itemUrl, false);
        listAllMyItems($client);
        deleteItem($client, $itemUrl, true);
        querySnippetFeed();
        endHTML();
    }
}
开发者ID:automatweb,项目名称:automatweb_dev,代码行数:23,代码来源:Gbase.php

示例8: array

    $resp = array("status" => "fail", "reason" => "please send an action");
    echo json_encode($resp);
    return;
}
if (!isset($userId)) {
    $resp = array("status" => "fail", "reason" => "no user id");
    echo json_encode($resp);
    return;
}
switch ($action) {
    case "add":
        $resp = addItem($inputArr);
        echo json_encode($resp);
        break;
    case "remove":
        $resp = deleteItem($itemId);
        echo json_encode($resp);
        break;
    case "get":
        $resp = getItems($photoId);
        echo json_encode($resp);
        break;
    default:
        $resp = array("status" => "fail", "reason" => "please send a valid action");
        echo json_encode($resp);
        break;
}
/* debug */
//$resp = addItem(array("name"=>"mike idea", "brand"=>"Ralph Lauren"));
//$resp = deleteItem('');
//$resp = getItems("");
开发者ID:jahanzaibbahadur,项目名称:marknadlean-chat,代码行数:31,代码来源:index.php

示例9: deletePurchasedItems

function deletePurchasedItems($orderid)
{
    session_start();
    $user = $_SESSION['userid'];
    if ($orderid) {
        $summary = db_getOrderItems($orderid);
        foreach ($summary as $s) {
            $item = db_getItem($s->itemid);
            $prefix = "i-";
            if ($item->type == "PACKAGE") {
                $prefix = "p-";
            }
            $_SESSION[$user . 'cart'] = deleteItem($prefix . "" . $item->id, $_SESSION[$user . 'cart']);
        }
    }
}
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:16,代码来源:checkout.php

示例10: showSites

     showSites($option);
     break;
 case 'site_edit':
     editSites(true);
     break;
 case 'site_add':
     editSites(false);
     break;
 case 'site_publish':
     publishItem('#__community_acl_sites', $cid, 1);
     break;
 case 'site_unpublish':
     publishItem('#__community_acl_sites', $cid, 0);
     break;
 case 'site_delete':
     deleteItem('#__community_acl_sites', $cid);
     break;
 case 'apply_sites':
 case 'save_sites':
     saveSites();
     break;
 case 'check_db':
     cacl_check_db();
     break;
 case 'set_main':
     setMainSite($cid[0]);
     break;
     ##-- CONFIG ----------------
 ##-- CONFIG ----------------
 case 'config':
     showConfig();
开发者ID:vincethecoder,项目名称:community_acl,代码行数:31,代码来源:admin.community_acl.php

示例11: deleteSize

 public function deleteSize()
 {
     $db = M("ItemSize");
     $model = "ItemSize";
     $id = I("get.id", 0, "intval");
     if ($id > 0) {
         if (deleteItem($model, $id)) {
             $this->success("删除成功");
         } else {
             $this->error("删除失败");
         }
     } else {
         $this->error("参数有误");
     }
 }
开发者ID:xuweicun,项目名称:babycare,代码行数:15,代码来源:BestforbabyController.class.php

示例12: session_start

<?php

/**
 * Delete message
 */
session_start();
include '../functions.php';
deleteItem("messages");
header('location: index.php');
exit;
开发者ID:erwindgreef,项目名称:ivikproject,代码行数:10,代码来源:delete.php

示例13: header

include 'functions/accountFunctions.php';
include 'functions/productFunctions.php';
if (!is_array($_SESSION['UserSession'])) {
    header("Location:signin.php?checkErr=nLI");
    /*redirects and prompts the user to sign in if they already haven't, then once signed
    		in it will redirect them again back to here*/
}
if (!is_array($_SESSION['checkout'])) {
    header("Location:basket.php");
}
$itemId = $_GET['itemId'];
$remove = $_GET['remove'];
$update = $_GET['u'];
$q = $_GET['quant'];
if ($remove == 1) {
    deleteItem($itemId);
}
if ($update == 1) {
    preg_match('/^[0-9]{1,2}$/', $q, $result);
    // validation
    if ($result == 0 || $q == 0) {
        header("Location:checkoutItems.php");
    } else {
        $itemsInBask = count($_SESSION['basket']);
        for ($i = 0; $i < $itemsInBask; $i++) {
            if ($itemId == $_SESSION['basket'][$i]['itemId']) {
                $_SESSION['basket'][$i]['quantity'] = $q;
                break;
            }
        }
    }
开发者ID:simon-barton,项目名称:MajorProject,代码行数:31,代码来源:checkoutItems.php

示例14: htmlspecialchars_adv

$_page['header'] = "Photos PostModeration";
$_page['header_text'] = "Unapproved profile photos";
if (isset($_GET['media'])) {
    $sType = htmlspecialchars_adv($_GET['media']);
}
if (isset($_GET['status'])) {
    $sStatus = htmlspecialchars_adv($_GET['status']);
}
if (isset($_GET['iUser'])) {
    $iUser = htmlspecialchars_adv($_GET['iUser']);
}
if (isset($_POST['check']) && is_array($_POST['check'])) {
    foreach ($_POST['check'] as $iKey => $iVal) {
        switch (true) {
            case isset($_POST['Delete']):
                deleteItem((int) $iVal);
                break;
            case isset($_POST['Approve']):
                approveItem((int) $iVal);
                break;
        }
    }
}
TopCodeAdmin();
ContentBlockHead("Profile media");
echo getPostModMediaPage($sType, $sStatus, $iUser);
ContentBlockFoot();
BottomCode();
function getPostModMediaPage($sType = 'photo', $sStatus = 'passive', $iUser = 0)
{
    global $dir;
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:31,代码来源:post_mod_media.php

示例15: header

<?php

header("Location:cart_page.php");
//header("Location:cart_page.php");
include "cart_add.php";
//include "cart_page.php";
//echo "sb";
echo $_POST["Username"];
echo $_POST["Item_Name"];
if (deleteItem($_POST["Username"], $_POST["Item_Name"])) {
    echo "successful delete";
}
header("Location:cart_page.php");
开发者ID:bbterry,项目名称:RUHungry,代码行数:13,代码来源:cart_delete.php


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