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


PHP saveItem函数代码示例

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


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

示例1: aa_admin_import_page

function aa_admin_import_page()
{
    global $keyword, ${$selectedSearchIndex}, $itempage;
    $appid = get_option('dbaa_amazon_appid');
    $coutryCode = get_option('dbaa_amazon_coutnrycode');
    $secretKey = get_option('dbaa_amazon_secretkey');
    $associatetag = get_option('dbaa_amazon_associatetag');
    if ($appid == '' || $coutryCode == '' || $secretKey == '') {
        echo '<H2>Bitte gehen Sie zu den Einstellungen und geben Sie Ihre Daten zur Kommunikation mit der Amazon Api ein.</H2>';
    } else {
        $defaultOptions = array('AssociateTag' => $associatetag, 'ResponseGroup' => 'Small, OfferFull, ItemAttributes, Images, Variations');
        $amazon = new Zend_clicks_Service_Amazon($appid, $coutryCode, $secretKey);
        $itemResults = array();
        if ($_REQUEST['action'] == 'search' && !empty($_POST['keyword']) && empty($_POST['asin'])) {
            $keyword = $_POST['keyword'];
            $selectedSearchIndex = $_POST['searchIndex'];
            $itempage = 1;
            $options = array('SearchIndex' => $selectedSearchIndex, 'Keywords' => $keyword, 'ItemPage' => $itempage);
            $options = array_merge($options, $defaultOptions);
            $itemResults = $amazon->itemSearch($options);
        } elseif ($_REQUEST['action'] == 'search' && empty($_POST['keyword']) && !empty($_POST['asin'])) {
            $asin = $_POST['asin'];
            $selectedSearchIndex = $_POST['searchIndex'];
            $itemResults = $amazon->itemLookup($asin, $defaultOptions);
        } elseif ($_REQUEST['action'] == 'back' && !empty($_POST['itempage']) || $_REQUEST['action'] == 'next' && !empty($_POST['itempage'])) {
            $keyword = $_POST['keyword'];
            $selectedSearchIndex = $_POST['searchIndex'];
            $itempage = $_POST['itempage'];
            $options = array('SearchIndex' => $selectedSearchIndex, 'Keywords' => $keyword, 'ItemPage' => $itempage);
            $options = array_merge($options, $defaultOptions);
            $itemResults = $amazon->itemSearch($options);
        } elseif ($_REQUEST['action'] == 'save' && !empty($_POST['title'])) {
            if (saveItem($_POST)) {
                echo '<div class="updated"><p><strong>Produkt erfolgreich importiert</strong></p></div>';
            }
        }
        echo '<h2>Produkte importieren</h2>';
        searchItem($keyword, $asin, $selectedSearchIndex, $itempage);
        // Suchformular einblenden;
        foreach ($itemResults as $result) {
            formatResult($result);
        }
    }
}
开发者ID:harz87,项目名称:Amazon-Affialiate,代码行数:44,代码来源:aa_import.php

示例2: saveList

 public function saveList($list)
 {
     if ($list->id > 0) {
         //Update or delete
         if ($list->isDeleted == 1) {
             $this->dbAdapter->deleteList($list);
             $list = null;
         } else {
             $this->dbAdapter->updateList($list);
         }
     } else {
         //Insert
         $list->id = $this->dbAdapter->addList($list);
     }
     if ($list != null) {
         foreach ($list->items as $item) {
             saveItem($item);
         }
     }
     return $list;
 }
开发者ID:Jokerwolf,项目名称:todolist_server,代码行数:21,代码来源:Home.php

示例3: db_affected_rows

     $sResponce = db_affected_rows();
     break;
 case 'save_item':
     $id = (int) $_POST['id'];
     if (!$id) {
         $sResponce = echoMenuEditMsg('Error', 'red');
     } else {
         $aItemFields = array('Name', 'Caption', 'Link', 'Target', 'Icon', 'Script');
         $aItem = array();
         foreach ($aItemFields as $field) {
             $aItem[$field] = isset($_POST[$field]) ? $_POST[$field] : null;
         }
         if (!$aItem['Icon']) {
             $aItem['Icon'] = 'member_menu_default.png';
         }
         $res = saveItem($id, $aItem, $sMenuSection);
         updateLangFile($_POST['Caption'], $_POST['LangCaption']);
         $res['message'] = MsgBox($res['message']);
         $oJson = new Services_JSON();
         echo $oJson->encode($res);
         exit;
     }
     break;
 case 'delete_item':
     $id = (int) $_POST['id'];
     if (!$id) {
         $sResponce = 'Item ID is not specified';
     } else {
         $aItem = db_arr("SELECT `Deletable` FROM `sys_menu_member` WHERE `ID` = {$id}");
         if (!$aItem) {
             $sResponce = 'Item not found';
开发者ID:noormcs,项目名称:studoro,代码行数:31,代码来源:member_menu_compose.php

示例4: array

     }
     $aItemFields = array('Name', 'Caption', 'Icon', 'Link', 'Script', 'Target');
     $aItem = array();
     foreach ($aItemFields as $field) {
         $aItem[$field] = isset($_POST[$field]) ? $_POST[$field] : null;
     }
     $aVis = array();
     if ((int) $_POST['Visible_non']) {
         $aVis[] = 'non';
     }
     if ((int) $_POST['Visible_memb']) {
         $aVis[] = 'memb';
     }
     $aItem['Visible'] = implode(',', $aVis);
     $aItem['Target'] = $_POST['Target'] == '_blank' ? '_blank' : '';
     $aResult = saveItem($id, $aItem);
     updateLangFile($_POST['Caption'], $_POST['LangCaption']);
     $aResult['message'] = MsgBox($aResult['message']);
     echo json_encode($aResult);
     exit;
     break;
 case 'delete_item':
     $id = (int) $_POST['id'];
     if (!$id) {
         $sResponce = 'Item ID is not specified';
     } else {
         $aItem = db_arr("SELECT `Deletable` FROM `" . $oMenu->sDbTable . "` WHERE `ID` = {$id}");
         if (!$aItem) {
             $sResponce = 'Item not found';
         } else {
             if (!(int) $aItem['Deletable']) {
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:31,代码来源:service_menu_compose.php

示例5: array

     $aItem = array();
     foreach ($aItemFields as $field) {
         $aItem[$field] = $_POST[$field];
     }
     $aVis = array();
     if ((int) $_POST['Visible_non']) {
         $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");
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:31,代码来源:pageComposer.php

示例6: createNewItem

    case 'createNewItem' == $sAction:
        createNewItem();
        break;
    case 'savePositions' == $sAction:
        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()
{
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:31,代码来源:fields.parse.php

示例7: createNewItem

        break;
    case 'createNewItem':
        createNewItem();
        break;
    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()
{
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:31,代码来源:fields.parse.php

示例8: switch

    $section = $_REQUEST['section'];
    $subsection = $_REQUEST['subsection'];
    $shelfset = $_REQUEST['shelfset'];
    $shelf = $_REQUEST['shelf'];
    $location = $_REQUEST['location'];
    switch ($_REQUEST['ajax']) {
        case 'get':
            $output = lookupItem($store, $section, $subsection, $shelfset, $shelf, $location);
            echo json_encode($output);
            break;
        case 'set':
            if (!isset($_REQUEST['upc']) || !is_numeric($_REQUEST['upc'])) {
                echo json_encode(array('errors' => 'invalid request'));
                return;
            }
            saveItem($store, $section, $subsection, $shelfset, $shelf, $location, $_REQUEST['upc']);
            $output = lookupItem($store, $section, $subsection, $shelfset, $shelf, $location + 1);
            echo json_encode($output);
            break;
        case 'default':
            echo json_encode(array('errors' => 'invalid request'));
            break;
    }
    return;
}
function lookupItem($store, $sec, $subsec, $sh_set, $shelf, $loc)
{
    global $FANNIE_OP_DB;
    $dbc = FannieDB::get($FANNIE_OP_DB);
    $q = $dbc->prepare_statement("SELECT l.upc,p.description FROM prodPhysicalLocation AS l\n        " . DTrans::joinProducts('l') . "\n        WHERE l.store_id=? AND section=? AND subsection=?\n        AND shelf_set=? AND shelf=? AND location=?");
    $args = array($store, $sec, $subsec, $sh_set, $shelf, $loc);
开发者ID:phpsmith,项目名称:IS4C,代码行数:31,代码来源:index.php

示例9: onEndTag

function onEndTag($parser, $name)
{
    global $currTag, $item, $itemsCount, $abort, $channelID, $channel, $image;
    if ($name == 'ITEM') {
        saveItem($item);
        ++$itemsCount;
        $item = null;
    } elseif ($name == 'IMAGE') {
        if (is_array($channel)) {
            $channel['image'] = $image;
        }
        $image = false;
    } elseif ($name == 'RSS') {
        if (!$abort) {
            cf\execQuery("UPDATE cf_rss_channel SET added_count=:count WHERE id=:id", array('id' => $channelID, 'count' => $itemsCount));
        }
    }
    $currTag = null;
}
开发者ID:sd-studio,项目名称:or,代码行数:19,代码来源:rss.php

示例10: isset

$task = isset($_POST["task"]) ? $_POST["task"] : (isset($_GET["task"]) ? $_GET["task"] : "");
switch ($task) {
    case "selectAll":
        selectAll();
    case "save":
        save();
    case "delete":
        delete();
    case "copy":
        copyBylaw();
        //------------------------------
    //------------------------------
    case "selectAllItems":
        selectAllItems();
    case "saveItem":
        saveItem();
    case "deleteItem":
        deleteItem();
}
function selectAll()
{
    $where = "1=1";
    $where .= dataReader::makeOrder();
    $temp = management_extra_bylaw::GetAll($where);
    echo dataReader::getJsonData($temp, count($temp), $_GET["callback"]);
    die;
}
function save()
{
    $obj = new management_extra_bylaw();
    PdoDataAccess::FillObjectByJsonData($obj, $_POST["record"]);
开发者ID:jafarkhani,项目名称:rtfund,代码行数:31,代码来源:management_extra_bylaw.data.php

示例11: analyzeItem

function analyzeItem($html, $yhd_cid)
{
    $pattern = '/<img width="200" height="200".*?"(http:\\/\\/.*?)".*?alt="(.*?)"\\/>/';
    if (preg_match($pattern, $html, $reg)) {
        $imgSrc = $reg[1];
        $title = $reg[2];
    }
    $pattern = '/<a class="search_prod_img".*?pmId="(\\d+)".*?href="(.*?)" /';
    if (preg_match($pattern, $html, $reg)) {
        $yhdNumIID = $reg[1];
        $link = $reg[2];
    }
    saveItem($yhdNumIID, $title, $imgSrc, $link);
    saveCategory($yhdNumIID, $yhd_cid);
}
开发者ID:setimouse,项目名称:be-shop-pc,代码行数:15,代码来源:yhditem.script.php


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