コード例 #1
0
ファイル: classes_orders.php プロジェクト: Apxe/Rubin_final
    function GetOrderInfo($orderid,$line=null)
    {
        global $par;
        
        $orderarr = Array();
        
        if($line==null)
        {
            $sql = "SELECT * FROM $par->orderstable WHERE `id`=$orderid";
            $res = mysql_query($sql);
            $line = mysql_fetch_array($res,MYSQL_ASSOC);
        }
        $orderarr['orderid'] = $line['id'];
        $orderarr['date'] = $line['date'];
        $orderarr['allsum'] = $line['allsum'];
	    $orderarr['orderstatus'] = GetStatusName($line['orderstatus']);
        $orderarr['products'] = Array();
        $orderarr['userid'] = $line['userid'];
        $orderarr['email'] = $line['email'];
        $orderarr['phone'] = $line['phone'];
        $orderarr['name'] = $line['name'];
        $orderarr['address'] = $line['address'];        
        
                    $kk=0;
                    $orderstr = $line['orderstr'];
                    $oarr = explode(':',$orderstr);
                    //Debug($oarr);
                    for($i=1;$i<count($oarr)-1;$i++)
                    {
                        $s = $oarr[$i];
                        $sarr = explode(';',$s);
                        $key = $sarr[0];
                        $value = $sarr[1];
			            $oldprice = $sarr[2];
                        
                        if($value>0)
                        {
                            $oneproduct = Array();

            			    $kk++;

            			    $product = GetProductInfo($key);
            			    $product['_order_price'] = $oldprice;
            			    $product['_order_value'] = $value;
                            //Debug($product);

            			    $orderarr['products'][] = $product;
                        }
                        
                    }
	//Debug($orderarr);
	return $orderarr;
    }
コード例 #2
0
/**
 * 获取某条产品问答信息标签
 *
 * @version        $Id: getquestion.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2013, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getquestion(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|,typeid|,row|8,productid|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $productid = isset($refObj->Fields['id']) ? $refObj->Fields['id'] : $productid;
    $typeid = isset($refObj->Fields['typeid']) ? $refObj->Fields['typeid'] : 0;
    $where = $typeid == 0 ? '' : "and typeid={$typeid}";
    $typenamelist = array('1' => 'lines', '2' => 'hotels', '3' => 'cars', '4' => 'raider', '5' => 'spots', '6' => 'photos');
    //if($postid==''||$typeid=='')return;//如果文章id为空则返回
    $revalue = '';
    if (!empty($productid)) {
        $sql = "select * from #@__question where replycontent is not null and productid='{$productid}' {$where} order by replytime desc limit 0,{$row} ";
        //查询单个
    } else {
        $sql = "select * from #@__question where  replycontent is not null {$where} order by replytime desc limit 0,{$row}";
        //查询全部
    }
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        if ($row['questype'] == 0) {
            $productinfo = GetProductInfo($row['typeid'], $row['productid']);
            $row['productname'] = $productinfo['title'];
            $row['producturl'] = $productinfo['url'];
        } else {
            $row['productname'] = $row['title'];
        }
        $row['nickname'] = empty($row['nickname']) ? '匿名' : $row['nickname'];
        foreach ($ctp->CTags as $tagid => $ctag) {
            $row['replycontent'] = preg_replace('/<p>(.*)<\\/p>/', '$1', $row['replycontent']);
            //替换到P标签
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
コード例 #3
0
ファイル: cabinet_orders.php プロジェクト: Apxe/Rubin_final
                                    $parentline = mysql_fetch_array($restmp,MYSQL_ASSOC);
                            }
                            
                            
                            $sqltmp = "SELECT * FROM $par->fotorobjtable WHERE reportid=".$parentline['id']."  AND hide=0 ORDER BY prior LIMIT 0,1";
                            $restmp = mysql_query($sqltmp);
                            if($linetmp = mysql_fetch_array($restmp,MYSQL_ASSOC))
                            {
                                if(is_file('fotos/object_sm'.$linetmp['id'].'.jpg'))
                                {
                                    $fname = 'fotos/object_sm'.$linetmp['id'].'.jpg';
                                }
                                    
                            }
							
							$product = GetProductInfo($key);
							$fname = $product['fname'];

                            if($fname!='')
                            {
				$addstr = GetAddStr(74,68,$fname);
				$fname = '/'.$fname;
                            }
			    
			    $myurl = GetSeoUrl('tovar',$line1['id'],$line1);

				if($kk!=1) echo '
				<tr>
					<td colspan="4" height="20" valign="middle">
					<div style="height:1px;font-size:1px;background:#ededed;overflow:hidden;"></div>
					</td>
コード例 #4
0
ファイル: template.action.php プロジェクト: GeoPvN/mspy
        }
        mysql_query("DELETE FROM tmp_shabloni\r\n\t\t\t\t\t");
        break;
    case 'disable':
        $group_id = $_REQUEST['id'];
        $delete = mysql_fetch_assoc(mysql_query("SELECT   `name`\r\n\t\t\t\t\t\t\t\t\t\t     \tFROM   `shabloni`\r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE   `id` = {$group_id}"));
        $delete_row = $delete['name'];
        DisableGroup($delete_row);
        break;
    case 'disable_prod':
        $id_del_prod = $_REQUEST['id_del_prod'];
        mysql_query("DELETE FROM shabloni\r\n                     WHERE `id` = '{$id_del_prod}';");
        break;
    case 'get_product_info':
        $name = $_REQUEST[name];
        $res = GetProductInfo($name);
        if (!$res) {
            $error = 'პროდუქტი ვერ მოიძებნა!';
        } else {
            $data = array('genre' => $res['genre'], 'category' => $res['category'], 'description' => $res['description'], 'price' => $res['price'], 'id' => $res['id']);
        }
        break;
    default:
        $error = 'Action is Null';
}
$data['error'] = $error;
echo json_encode($data);
/* ******************************
 *	Workers Functions
 * ******************************
 */
コード例 #5
0
ファイル: tovar_logic.php プロジェクト: Apxe/Rubin_final
    {

        // Если нет в сессии Последних просмотренных товаров
        if (!empty($_SESSION['reviewed'])){
            if(!in_array($id, $_SESSION["reviewed"]))
                $_SESSION['reviewed'][] = $id;
        }
        else
            $_SESSION['reviewed'][] = $id;

        // Вытаскиваем информацию о товаре
        $sql = "SELECT * FROM $par->objectstable WHERE id=$id AND hide=0";
        $res = mysql_query($sql);
        if ($line = mysql_fetch_array($res,MYSQL_ASSOC))
        {
            $_logic['product']  = LangProcess(GetProductInfo($line['id'],$line,Array('allfotos'=>true)));
        }

        // Формируем массив просмотренных товаров
        if (!empty($_SESSION['reviewed'])){
            foreach ($_SESSION['reviewed'] as $key => $reviewed_id) {
                $sql = "SELECT * FROM $par->objectstable WHERE id=$reviewed_id AND hide=0";
                $res = mysql_query($sql);
                $line = mysql_fetch_array($res,MYSQL_ASSOC);
                $parent = $line['id'];
                    $sql2 = "SELECT * FROM $par->fotorobjtable WHERE `reportid`=$parent ORDER by prior";
                    $res2 = mysql_query($sql2);
                    $line2 = mysql_fetch_array($res2,MYSQL_ASSOC);
                $img = img_check("products/product_",$line2['id']);
                $url = GetSeoUrl('tovar',$line['id'],$line);
                $line = LangProcess($line);
コード例 #6
0
	Process description...
*/
$counter = 0;
while (true) {
    $aminfos = AmazonInfo::where('dirty', 1)->take(MAX_SKUS_PER_REQUESTS)->get();
    /*
    	We don't have to process...
    */
    if (count($aminfos) == 0) {
        break;
    }
    $isbns = [];
    foreach ($aminfos as $aminfo) {
        array_push($isbns, $aminfo->isbn);
    }
    $prdInfos = GetProductInfo($isbns);
    $len = count($prdInfos["ItemLookupResponse"]["Items"]["Item"]);
    $i = 0;
    foreach ($aminfos as $aminfo) {
        if ($i >= $len) {
            $aminfo->dirty = -1;
            $aminfo->save();
            continue;
        }
        $succeed = 0;
        if (isset($prdInfos["ItemLookupResponse"]["Items"]["Item"][$i]["EditorialReviews"]["EditorialReview"]["Content"])) {
            $aminfo->description = $prdInfos["ItemLookupResponse"]["Items"]["Item"][$i]["EditorialReviews"]["EditorialReview"]["Content"];
            $succeed++;
        }
        if (isset($prdInfos["ItemLookupResponse"]["Items"]["Item"][$i]["DetailPageURL"])) {
            $aminfo->url = $prdInfos["ItemLookupResponse"]["Items"]["Item"][$i]["DetailPageURL"];
コード例 #7
0
<?php

require_once 'vendor/autoload.php';
require_once 'config.php';
require 'functions/amazon_lookup.php';
require_once 'functions/general_functions.php';
require 'functions/mws_lookup.php';
echo json_encode(GetProductInfo(array('0393337014', '0807007455')));
// print_r(get_category_by_sku('PR-PB-LN-07382148760'));
/*
	print_r(get_detail_by_skus(array(
'PR-PB-LN-07382148760',
'PB-LN-0062241354',
'HCP-PB-LN-0007497415',
'RH-PS-HC-LN-1616149744',
'WW-HC-LN-0871403366'
)));
*/
?>