예제 #1
0
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']);
            }
        }
    }
}
예제 #2
0
파일: cart.php 프로젝트: dpecos/npshop
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);
    }
}
예제 #3
0
/**
* 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");
    }
}
예제 #4
0
<?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';
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);
}
예제 #6
0
$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();
예제 #7
0
/**
 * 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();
    }
}
예제 #8
0
    $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("");
예제 #9
0
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']);
        }
    }
}
     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();
 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("参数有误");
     }
 }
예제 #12
0
<?php

/**
 * Delete message
 */
session_start();
include '../functions.php';
deleteItem("messages");
header('location: index.php');
exit;
예제 #13
0
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;
            }
        }
    }
$_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;
예제 #15
0
<?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");
예제 #16
0
파일: Gbase.php 프로젝트: natureday1/Life
/**
 * Main logic to handle deleting an item.
 * @return void
 */
function handleDelete()
{
    try {
        deleteItem();
        showMainMenu('Recipe deleted.', $_POST['token']);
    } catch (Zend_Gdata_App_Exception $e) {
        showMainMenu('Recipe deletion failed: ' . $e->getMessage(), $_POST['token']);
    }
}
예제 #17
0
function deleteQuestionOptions($quizId, $sectionId, $questionId)
{
    $tableNames = array('quiz_objectiveoptions');
    $affectedRows = array();
    return deleteItem($tableNames, "`page_modulecomponentid` = '{$quizId}' AND `quiz_sectionid` = '{$sectionId}' AND `quiz_questionid` = '{$questionId}'", $affectedRows);
}
    $response = Unirest\Request::put($connectHost . '/v1/me/items/' . $itemId, $requestHeaders, json_encode($request_body));
    if ($response->code == 200) {
        error_log('Successfully updated item:');
        error_log(json_encode($response->body, JSON_PRETTY_PRINT));
        return $response->body;
    } else {
        error_log('Item update failed');
        return NULL;
    }
}
# Deletes the Malted Milkshake item.
function deleteItem($itemId)
{
    global $accessToken, $connectHost, $requestHeaders;
    $response = Unirest\Request::delete($connectHost . '/v1/me/items/' . $itemId, $requestHeaders);
    if ($response->code == 200) {
        error_log('Successfully deleted item');
        return $response->body;
    } else {
        error_log('Item deletion failed');
        return NULL;
    }
}
$myItem = createItem();
# Update and delete the item only if it was successfully created
if ($myItem) {
    updateItem($myItem->id);
    deleteItem($myItem->id);
} else {
    error_log("Aborting");
}
예제 #19
0
        savePositions((int) bx_get('id'));
        break;
    case 'loadEditForm' == $sAction:
        header('Content-Type: text/html; charset=utf-8');
        showEditForm((int) bx_get('id'), (int) bx_get('area'));
        break;
    case 'dummy' == $sAction:
        echo 'Dummy!';
        break;
    case true == bx_get('action-save'):
    case 'Save' == $sAction:
        saveItem((int) bx_get('area'), $_POST);
        break;
    case true == bx_get('action-delete'):
    case 'Delete' == $sAction:
        deleteItem((int) bx_get('id'), (int) bx_get('area'));
        break;
}
function createNewBlock()
{
    $oFields = new BxDolPFM(1);
    $iNewID = $oFields->createNewBlock();
    header('Content-Type:text/javascript');
    echo '{"id":' . $iNewID . '}';
}
function createNewItem()
{
    $oFields = new BxDolPFM(1);
    $iNewID = $oFields->createNewField();
    header('Content-Type:text/javascript');
    echo '{"id":' . $iNewID . '}';
<?php

/** * Copyright 2013 Microsoft Corporation 
 *  
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * http://www.apache.org/licenses/LICENSE-2.0 
 *  
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 */
include_once 'taskmodel.php';
$id = $_GET['id'];
deleteItem($id);
header('Location: index.php');
         $aVis[] = 'non';
     }
     if ((int) $_POST['Visible_memb']) {
         $aVis[] = 'memb';
     }
     if (isset($_POST['Url']) and isset($_POST['Num'])) {
         $aItem['Content'] = $_POST['Url'] . '#' . (int) $_POST['Num'];
     }
     $aItem['Visible'] = implode(',', $aVis);
     $res = saveItem($id, $aItem);
     updateLangFile($_POST['Caption'], $_POST['LangCaption']);
     echo $res;
     exit;
 case 'delete_item':
     $id = (int) $_GET['id'];
     echo deleteItem($id);
     exit;
 case 'save_orders':
     $sTop = $_GET['top'];
     $aCustom = $_GET['custom'];
     saveOrders($sTop, $aCustom);
     echo 'OK';
     exit;
 case 'reset':
     $res = execSqlFile("{$site['url_admin']}builders_dfl/{$sTableName}.sql");
     if ($res) {
         header("Location:{$_SERVER['PHP_SELF']}");
     } else {
         echo 'Sorry, some error occurred';
     }
     exit;
예제 #22
0
<?php

/**
 * Delete user
 */
session_start();
include '../functions.php';
deleteItem("users");
header('location: index.php');
exit;
예제 #23
0
 /**
  * REMOVE the specified resource from storage.
  *(if the model allows soft-deletes)
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function trash($id)
 {
     $item = Item::find($id);
     if ($item) {
         $plan_id = $item->plan_id;
         $plan = Plan::find($plan_id);
     } else {
         flashError('Error! Item with ID "' . $id . '" not found! (F:trash)');
         return \Redirect::back();
     }
     // check user rights (teachers and leaders can edit items of their own plan)
     if (!checkRights($plan)) {
         return redirect()->back();
     }
     // get item and delete it
     $item = deleteItem($id);
     if ($item) {
         // notify event listener that an item was updated
         event(new CspotItemUpdated($item));
         // back to full plan view
         //flash('Item deleted.');
         return \Redirect::route('plans.edit', $plan_id);
     }
     flashError('Error! Problem trying to delete item with ID "' . $id . '"');
     return \Redirect::back();
 }
예제 #24
0
$m = $_GET['method'];
if ($m == 'update') {
    $offset = $_GET['pg'];
    $myIndex = rawurldecode($_GET['idx']);
    $newJI = rawurldecode($_GET['ji']);
    $newDF = rawurldecode($_GET['df']);
    $newDS = rawurldecode($_GET['ds']);
    $newCT = rawurldecode($_GET['ct']);
    $newSM = rawurldecode($_GET['sm']);
    $newCO = rawurldecode($_GET['co']);
    $newTY = rawurldecode($_GET['ty']);
    updateItem($offset, $myIndex, $newJI, $newDF, $newDS, $newCT, $newSM, $newCO, $newTY);
} elseif ($m == "remove") {
    $myPage = rawurldecode($_GET['pg']);
    $myIndex = rawurldecode($_GET['idx']);
    deleteItem($myIndex);
}
function deleteItem($myIndex)
{
    global $link, $thisTable;
    //Old method, deleted actual row
    //$query2 = "DELETE FROM `$thisTable` WHERE ID = $myIndex";
    //New method, just set 'Active' Col to 0
    $query2 = "UPDATE `{$thisTable}` SET Active = '0' WHERE ID = {$myIndex}";
    $result2 = mysql_query($query2, $link);
    if (!result2) {
        $message = 'Invalid query: ' . mysql_error() . "\n";
        $message .= 'Whole query: ' . $query1;
        die($message);
    }
    include 'printTable.php';
예제 #25
0
<?php

$timeStart = microtime(true);
session_start();
ob_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);
$inventoryID = htmlspecialchars(addslashes($_POST['inventoryID']));
$itemID = htmlspecialchars(addslashes($_POST['itemID']));
$parchment = newItem($bdd, $itemID);
$parchmentHP = $parchment->getHP();
$parchmentMP = $parchment->getMP();
$parchmentStrength = $parchment->getStrength();
$parchmentMagic = $parchment->getMagic();
$parchmentAgility = $parchment->getAgility();
$parchmentDefense = $parchment->getDefense();
$parchmentWisdom = $parchment->getSagesse();
addStats($bdd, $parchmentHP, $parchmentMP, $parchmentStrength, $parchmentMagic, $parchmentAgility, $parchmentDefense, $parchmentWisdom, $characterID);
deleteItem($bdd, $itemID, $characterID);
updateStats($bdd, $characterID);
updateAllStats($bdd, $characterID);
exit(header("Location: {$linkRoot}/Modules/Inventory/index.php"));
require_once $_SESSION['File_Root'] . '/HTML/Footer.php';
예제 #26
0
        if ($cart) {
            $cart .= ',' . $prefix . $id;
        } else {
            $cart = $prefix . $id;
        }
        $_SESSION[$user . 'cart'] = $cart;
    }
    echo true;
} else {
    if ($action == "delete") {
        if (isset($_POST['id'])) {
            $id = $_POST['id'];
        } else {
            $id = "";
        }
        $cart = deleteItem($id, $cart);
        $_SESSION[$user . 'cart'] = $cart;
    } else {
        if ($action == "update") {
            if ($cart) {
                $newcart = '';
                foreach ($_POST as $key => $value) {
                    if (stristr($key, 'qty')) {
                        $id = str_replace('qty', '', $key);
                        $items = $newcart != '' ? explode(',', $newcart) : explode(',', $cart);
                        $newcart = '';
                        foreach ($items as $item) {
                            if ($id != $item) {
                                if ($newcart != '') {
                                    $newcart .= ',' . $item;
                                } else {
예제 #27
0
<?php

if (isset($_GET['id'])) {
    ?>
	<!-- EDITING ITEM -->
	<div class="content">	
		<div class="content-header">
			<h4><a href="?p=admin">Main Menu</a> / <a href="?p=admin&sub=shop">Shop Items</a> / Edit</h4>
		</div> <!-- .content-header -->				
		<div class="main-content">
			<?php 
    if (isset($_POST['action'])) {
        if ($_POST['action'] == 'edit') {
            if (isset($_POST['delete'])) {
                deleteItem();
            } else {
                editItem();
            }
        }
    }
    ?>
			<form method="POST" action="?p=admin&sub=shop&id=<?php 
    echo $_GET['id'];
    ?>
" class="form label-inline">
			<input type="hidden" name="action" value="edit">
			<?php 
    $edit_info = $DB->selectRow("SELECT * FROM `mw_shop_items` WHERE `id`='" . $_GET['id'] . "'");
    ?>
			
			<!-- Item Number -->
    case 'savePositions':
        savePositions((int) $_REQUEST['id']);
        break;
    case 'loadEditForm':
        showEditForm((int) $_REQUEST['id'], (int) $_REQUEST['area']);
        break;
    case 'dummy':
        echo 'Dummy!';
        break;
    case 'Save':
        //save item
        saveItem((int) $_POST['area'], $_POST);
        break;
    case 'Delete':
        //delete item
        deleteItem((int) $_POST['id'], (int) $_POST['area']);
        break;
}
function createNewBlock()
{
    $oFields = new BxDolPFM(1);
    $iNewID = $oFields->createNewBlock();
    header('Content-Type:text/javascript');
    echo '{id:' . $iNewID . '}';
}
function createNewItem()
{
    $oFields = new BxDolPFM(1);
    $iNewID = $oFields->createNewField();
    header('Content-Type:text/javascript');
    echo '{id:' . $iNewID . '}';
예제 #29
0
                }
            }
            print "</p><br />";
            giveAlternative($table, $delete, $attributeid);
        }
    }
    return 1;
}
if (isset($delete)) {
    deleteItem($table, $id, $delete);
} elseif (isset($deleteall)) {
    $count = 0;
    $errcount = 0;
    $res = Sql_Query("select id from {$table}");
    while ($row = Sql_Fetch_Row($res)) {
        if (deleteItem($table, $id, $row[0])) {
            $count++;
        } else {
            $errcount++;
            if ($errcount > 10) {
                print "* Too many errors, quitting<br /><br /><br />\n";
                break;
            }
        }
    }
}
if (isset($action) && $action == "new") {
    // ??
    ?>

  <p>add new <? echo $data["name"] ?>, one per line<br />
예제 #30
0
<?php

require_once "inc/db.php";
require_once "inc/functions.php";
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $sql = "DELETE FROM info, cast USING info, cast WHERE info.id=cast.info_id AND cast.info_id=" . $id;
    deleteItem($db, $sql);
    header("Location: index.php");
} else {
    header("Location: index.php");
    exit;
}