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


PHP common::CustomQuery方法代码示例

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


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

示例1: Paginator

        if ($orderBy[1] == 'asc') {
            $order = '&sortOrder=CurrentPriceHighest';
        } else {
            $order = '&sortOrder=PricePlusShippingLowest';
        }
    }
    if ($orderBy[0] == 'time') {
        if ($orderBy[1] == 'asc') {
            $order = '&sortOrder=EndTimeSoonest';
        } else {
            $order = '&sortOrder=StartTimeNewest';
        }
    }
    $orderfield = '<input type="hidden" name="sort" value="' . $orderBy[0] . '~' . $orderBy[1] . '">';
    $apicall .= $order;
}
// Load the call and capture the document returned by eBay API
$resp = simplexml_load_file($apicall);
$pages = new Paginator();
$pages->items_total = $resp->paginationOutput->totalEntries;
$pages->default_ipp = 25;
$pages->paginate();
$Make = $common->CustomQuery("SELECT * FROM `attribute_option_value` WHERE `attribute_id` = '2' ORDER BY `sort_order`");
/*$ebayid = $common->CustomQuery("Select count(*) as total from ebay_car ".$where);
$item = mysql_fetch_object($ebayid);
$pages = new Paginator; 
$pages->items_total = $item->total;
$pages->default_ipp=15;
$pages->paginate();
$resp = $common->CustomQuery("Select * from ebay_car ".$where." ".$order." ".$pages->limit);
$Make = $common->CustomQuery("SELECT Make From ebay_car GROUP BY Make order by Make ASC");*/
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:announces_code_old6_7_12.php

示例2: common

<?php

include_once "conf/config.inc.php";
$common = new common();
$common->CustomQuery("delete FROM `ebay_car` where FROM_UNIXTIME(endtimestamp,'%Y-%m-%d') < CURDATE()-interval 3 month limit 100");
echo 'yes';
die;
开发者ID:pankajsinghjarial,项目名称:SYLC,代码行数:7,代码来源:cron.php

示例3: trim

    if (trim($_POST['password']) != trim($_POST['confirm_password'])) {
        $error++;
        $error_msg = "Mot de passe ne correspondent pas.";
    }
    if (trim($_POST['email']) != $_SESSION['User']['email']) {
        $wherecondition = "email='" . trim($_POST['email']) . "'";
        $usercount = $common->numberOfRows("users", $wherecondition);
        if ($usercount > 0) {
            $error++;
            $error_msg = "Cet e-mail est déjà enregistré.";
        }
    }
    if ($error == 0) {
        $updateQuery = "UPDATE users SET\n\t\t\t\t\t\tname \t= '" . trim($_POST['name']) . "',\n\t\t\t\t\t\taddress = '" . trim($_POST['address']) . "',\n\t\t\t\t\t\tpostal_code = '" . trim($_POST['postal_code']) . "',\n\t\t\t\t\t\tcity = '" . trim($_POST['city']) . "',\n\t\t\t\t\t\tphone_number = '" . trim($_POST['phone_number']) . "',\n\t\t\t\t\t\tsec_phone_number = '" . trim($_POST['sec_phone_number']) . "',\n\t\t\t\t\t\temail = '" . trim($_POST['email']) . "'";
        if (trim($_POST['password']) != "") {
            $updateQuery .= ", password \t\t= '" . base64_encode(trim($_POST['password'])) . "',\n\t\t\t\t\t\t\t original_pswd \t= '" . base64_encode(trim($_POST['password'])) . "'";
        }
        $updateQuery .= " WHERE id = '" . $_SESSION['User']['id'] . "'";
        $ok = $common->CustomQuery($updateQuery);
        if ($ok === true) {
            $_SESSION['User']['name'] = trim($_POST['name']);
            $_SESSION['User']['email'] = trim($_POST['email']);
            $error_msg = '<span class="success_msg">User profile updated successfully.</span>';
            extract($_POST);
        } else {
            $error_msg = '<span class="error_msg">Database Problem!Please Try Again.</span>';
        }
    } else {
        $error_msg = '<span class="error_msg">' . $error_msg . '</span>';
    }
}
开发者ID:pankajsinghjarial,项目名称:SYLC-NEWSITE,代码行数:31,代码来源:edit_account_code.php

示例4: fetchEbayCar

function fetchEbayCar($itemId, $action)
{
    $common = new common();
    $version = 773;
    $devid = "e872f3d0-8bee-4784-b631-f0c6e0468c21";
    $appid = "Planetwe-4831-4322-a03c-57a0a2d3aafb";
    $certid = "574bc5e0-889c-431c-b3aa-918f19b83e0e";
    $siteid = 0;
    $callname = "GetItem";
    $xml = '<?xml version="1.0" encoding="utf-8"?>
				<GetItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
					<RequesterCredentials>
						<eBayAuthToken>AgAAAA**AQAAAA**aAAAAA**GsfITw**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6AFkYekC5iHogidj6x9nY+seQ**An0BAA**AAMAAA**PpioAZjw8mCxVt0pqkk749Yb5v0gTCgKSXUcQedT6MhtnDSO4CL2CwtOzOzMn4uwDGr3LIzawpsA/RkBeXpTInV/CITheT3XCyPh5t1O9OMgQy1fAvA6oHmfSjZtXUeEevdvnGRMnOz7gVZ13M6ZCRcReMQotcUkJ+UXqLxogoUrgmtVG3SE8+5mbAYnTmr/nwV3h+l5t3AxVVCr1d795tDXkyqpkXkZ+YY6xnDyg7UUTH3iXQxLPTB2CsmjIaU3wtbSfjQ+0Ep0mTsxKm7Wna2YEidRq9CBP71ynlVIO+iyOHg1Q6kfn6NWZHX1Oynzl6FXR1M2PpeT92xaVtAmg19JI1opydhdbD+CvwpSnrozmrUV57FsL+KyXVOI40JjbMfJFqHbJYZIQXVI+OgV2LxYmo4rv14tR5WiveTsZi482uXf0oL8OLn1hBQ4gN3ANlD2iv48VZjkIL7G/rmnGIvAd982DrujhB4kR8n0f3LcZKBPlCXrTTFnwNdaq/UHSNa4WjO0F0KwieNIDZ3+yqvF69r8ygHfb2zfiIHxDKED9vcv6KK6mcJgkwOKRF4MPZyV4sRZqjrLrOd/L3KVEVTy6MpkRC8P+n+YXuJ8sSXtZz9qTDIrv9SyJutvZs9Xy2Kk21dj39QWOnYxQiJ18pFLsg9In9O2it6+B3PPIqfUoUVE6G2LgVfpf7bnlleurBqemkKPftyN9Ml1b30OQBcM/T5Djcep6ffgsSrP7XnFojKCS811V5e1I0YzN9Xc</eBayAuthToken>
					</RequesterCredentials>
					<DetailLevel>ReturnAll</DetailLevel>
					<IncludeItemSpecifics>true</IncludeItemSpecifics>
					<ItemID>' . $itemId . '</ItemID>
				</GetItemRequest>​';
    $ch = curl_init("https://api.ebay.com/ws/api.dll?siteid={$siteid}");
    $headers = array('X-EBAY-API-COMPATIBILITY-LEVEL: ' . $version, 'X-EBAY-API-DEV-NAME: ' . $devid, 'X-EBAY-API-APP-NAME: ' . $appid, 'X-EBAY-API-CERT-NAME: ' . $certid, 'X-EBAY-API-CALL-NAME: ' . $callname, 'X-EBAY-API-SITEID: ' . $siteid);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
    $output = curl_exec($ch);
    curl_close($ch);
    $res = simplexml_load_string($output);
    $item = $res->Item;
    $gallery = array();
    foreach ($item->PictureDetails->PictureURL as $val) {
        $gallery[] = (string) $val;
    }
    $gallerystr = implode("**", $gallery);
    $ConditionDisplayName = (string) $item->ConditionDisplayName;
    $description = (string) $item->Description;
    $specs = array();
    foreach ($item->ItemSpecifics->NameValueList as $arr) {
        $valus = array();
        foreach ($arr->Value as $val) {
            $temp = (string) $val;
            $valus[] = $temp;
        }
        $values = implode(",", $valus);
        $key = (string) $arr->Name;
        $specs[$key] = $values;
    }
    $std_equips = array();
    foreach ($specs as $keys => $data) {
        $std_equips[] = $keys . "^" . $data;
    }
    $std_equip = implode("~", $std_equips);
    $postalCode = (string) $item->PostalCode;
    $location = (string) $item->Location;
    $country = (string) $item->Country;
    $timeLeft = (string) $item->TimeLeft;
    if ((int) $item->BuyItNowPrice == 0) {
        $buyItNowAvailable = 0;
        $buyItNowPrice = (double) $item->SellingStatus->ConvertedCurrentPrice;
    } else {
        $buyItNowAvailable = 1;
        $buyItNowPrice = (double) $item->BuyItNowPrice;
    }
    $vin = (string) $item->VIN;
    $endTimes = (string) $item->ListingDetails->EndTime;
    $listingType = (string) $item->ListingType;
    $title = (string) $item->Title . " " . (string) $item->SubTitle;
    $datArray = array("itemId" => $itemId, "galleryURL" => mysql_escape_string($gallerystr), "postalCode" => $postalCode, "location" => $location, "country" => $country, "endTime" => $timeLeft, "buyItNowPrice" => $buyItNowPrice, "listingType" => $listingType, "buyItNowAvailable" => $buyItNowAvailable, "ConditionDisplayName" => $ConditionDisplayName, "title" => mysql_escape_string($title), "description" => base64_encode($description), "stdequip" => mysql_escape_string($std_equip), "vin" => $vin, "Year" => $specs['Year'], "Make" => $specs['Make'], "Model" => $specs['Model'], "Mileage" => $specs['Mileage'], "endson" => $endTimes, "endtimestamp" => strtotime($endTimes));
    if ($action == "update") {
        $common->update("ebay_car", $datArray, " itemId = " . $itemId);
    } elseif ($action == "save") {
        $common->save("ebay_car", $datArray);
    }
    return $common->CustomQuery("Select * from ebay_car where itemId = " . $itemId);
}
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:75,代码来源:ebay_code-13-11-2013.php

示例5: common

<?php

include_once "../conf/config.inc.php";
$common = new common();
$timenow = mktime();
$expireid = $common->CustomQuery("SELECT * FROM `ebay_car` where endtimestamp < " . $timenow);
while ($expire = mysql_fetch_object($expireid)) {
    $common->delete('contact', " car_id={$expire->car_id}");
    $common->delete('ebay_car', " car_id={$expire->car_id}");
}
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:10,代码来源:sync.php

示例6: search

$attribute = $_POST['attr'];
$manufac = $_POST['manufact'];
$classname = $_POST["class"];
if ($classname == "") {
    $classname = "customStyleSelectBox";
}
$search = new search();
$com = new common();
if ($attribute == "manufacturer") {
    $dataArray = array("{$attribute}" => $value);
    $carid = $search->attributeSearch($dataArray, "");
    $set = implode(",", $carid);
    $returnvalue = '<select class="' . $classname . '" id="model" name="model" onchange="ajaxcall(this.value,\'model\',\'year\',' . $value . ')">';
    $returnvalue .= "<option value=''>Modèles</option>";
    //echo "Select DISTINCT(value) from car_varchar where attribute_id = '4' and FIND_IN_SET(car_id, '".$set."') order by value";
    $year = $com->CustomQuery("Select DISTINCT(value) from car_varchar where attribute_id = '4' and FIND_IN_SET(car_id, '" . $set . "') order by value");
    while ($yrow = mysql_fetch_object($year)) {
        $returnvalue .= "<option value='" . $yrow->value . "'>" . $yrow->value . "</option>";
    }
    $returnvalue .= '</select>';
    echo $returnvalue;
}
if ($attribute == "model") {
    $dataArray = array("{$attribute}" => $value, "manufacturer" => $manufac);
    $carid = $search->attributeSearch($dataArray, "");
    $set = implode(",", $carid);
    $returnvalue = '<select class="' . $classname . '" name="madeYear" id="madeYear">';
    $returnvalue .= "<option value=''>Année</option>";
    //echo "Select value from car_int where attribute_id = '1' and FIND_IN_SET(car_id, '".$set."')";
    $year = $com->CustomQuery("Select DISTINCT(value) from car_int where attribute_id = '1' and FIND_IN_SET(car_id, '" . $set . "') order by value");
    while ($yrow = mysql_fetch_object($year)) {
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:ajax.php

示例7: search

<!---********************** carosul 2 **********************-->
<?php 
extract($_POST);
extract($_GET);
include_once "functions/ebay_functions.php";
$search = new search();
$common = new common();
$carids = array();
$ebayidExists = array();
$ebayids = $common->CustomQuery("Select itemid from product_banner order by id asc");
while ($row = mysql_fetch_object($ebayids)) {
    $carids[] = $row->itemid;
}
$no_exists_carids = $ebayidExists = array();
$ebayids = $common->CustomQuery("Select itemId from ebay_car where itemId in (" . implode(",", $carids) . ")");
while ($row = mysql_fetch_object($ebayids)) {
    $ebayidExists[] = $row->itemId;
}
$no_exists_carids = array_diff($carids, $ebayidExists);
foreach ($no_exists_carids as $insertid) {
    $ebayid = fetchEbayCar($insertid, "save");
}
$ebayid = $common->CustomQuery("Select * from ebay_car where itemId in (" . implode(",", $carids) . ")");
$item = '';
if (mysql_num_rows($ebayid) > 0) {
    ?>
<section class="carousel-2 wow fadeInDown" data-wow-duration="2s" data-wow-delay=".5s">
  <div class="container">
    <div class="row">
      <div class="col-md-12">
        <h1>Les annonces de voitures americaines les plus vues:</h1>
开发者ID:pankajsinghjarial,项目名称:SYLC-NEWSITE,代码行数:31,代码来源:mostview.php

示例8: common

 * Description : This Code is used to Manage Home Page Rotating Banner
 */
extract($_GET);
extract($_POST);
$obj_setting = new common();
$obj = new validation();
/*Fetch real facts section content*/
$ebayidExists = array();
$ebayids = $common->CustomQuery("Select itemid from product_banner order by id asc");
while ($row = mysql_fetch_object($ebayids)) {
    $ebayidExists[] = $row->itemid;
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $error = '';
    /*validation for fields*/
    $obj->add_fields($carid, 'req', 'Please Enter Content');
    $obj->add_fields($carid, 'num', 'Please Enter Numeric value');
    $obj->add_fields($carid, 'uniquearray', 'Please Enter Unique value');
    $error = $obj->validate();
    if ($error) {
        $errorMsg = "<font color='#FF0000' family='verdana' size=2>{$error}</font>";
    } else {
        /*save banner car ids*/
        $terms = $obj_setting->CustomQuery("UPDATE product_banner  SET `itemid` = CASE `ID`\n\t\t\tWHEN '1' THEN '{$carid['0']}'\n\t\t\tWHEN '2' THEN '{$carid['1']}'\n\t\t\tWHEN '3' THEN '{$carid['2']}'\n\t\t\tWHEN '4' THEN '{$carid['3']}'\n\t\t\tWHEN '5' THEN '{$carid['4']}'\n\t\t\tWHEN '6' THEN '{$carid['5']}'\n\t\t\tWHEN '7' THEN '{$carid['6']}'\n\t\t\tWHEN '8' THEN '{$carid['7']}'\n\t\t\tWHEN '9' THEN '{$carid['8']}'\n\t\t\tWHEN '10' THEN '{$carid['9']}'\n\t\t\tEND\n\t\t\tWHERE `ID` between 1 and 10");
        $_SESSION['success_msg'] = 'Successfully Saved';
        echo '<script>location.href="' . DEFAULT_URL . '/superadmin/home/product_banner.php";</script>';
        exit;
    }
} else {
    $carid = $ebayidExists;
}
开发者ID:pankajsinghjarial,项目名称:SYLC-NEWSITE,代码行数:31,代码来源:product_banner_code.php

示例9: common

$common = new common();
if (trim($_POST['email']) != "") {
    if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) {
        $error++;
        $error_msg = "S'il vous plaît fournir une adresse email valide";
    }
    if (strlen(trim($_POST['password'])) < 6) {
        $error++;
        $error_msg = "Mot de passe doit être au minimum de 6 caractères.";
    }
    if (trim($_POST['password']) != trim($_POST['confirm_password'])) {
        $error++;
        $error_msg = "Mot de passe ne correspondent pas.";
    }
    if ($_POST['cgv'] != 1) {
        $error++;
        $error_msg = "Vous n'êtes pas d'accord avec la politique d'entreprise. S'il vous plaît accepter politique .";
    }
    $wherecondition = "email='" . trim($_POST['email']) . "'";
    $usercount = $common->numberOfRows("users", $wherecondition);
    if ($usercount > 0) {
        $error++;
        $error_msg = "Cet e-mail est déjà enregistré.";
    }
    if ($error == 0) {
        $dob = trim($_POST['birthday_year']) . "-" . trim($_POST['birthday_month']) . "-" . trim($_POST['birthday_day']);
        $insertQuery = "INSERT INTO users (prefix,firstname,name,dob,address,postal_code,city,country,phone_number,sec_phone_number,email,password,original_pswd,created)\n\t\tVALUES ('" . trim($_POST['prefix']) . "','" . trim($_POST['firstname']) . "','" . trim($_POST['name']) . "','" . $dob . "','" . trim($_POST['address']) . "','" . trim($_POST['postal_code']) . "','" . trim($_POST['city']) . "','" . trim($_POST['country']) . "','" . trim($_POST['phone_number']) . "','" . trim($_POST['sec_phone_number']) . "','" . trim($_POST['email']) . "','" . base64_encode(trim($_POST['password'])) . "','" . base64_encode(trim($_POST['confirm_password'])) . "',now())";
        $manf = $common->CustomQuery($insertQuery);
        $error_msg = "User created successfully.";
    }
}
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:create_account_code.php

示例10: common

<?php

extract($_POST);
extract($_GET);
$common = new common();
$emailQuery = $common->CustomQuery("select * from admins where id = 1");
$toemail = mysql_fetch_object($emailQuery);
if ($submit_form != '' && $submit_form == "submitted" && $website == "") {
    $obj = new validation();
    $error = '';
    $obj->add_fields($fname, 'req', 'S\'il vous plaît Entrez le Nom');
    $obj->add_fields($email, 'req', "S'il vous plaît Entrez l'adresse e-mail");
    $obj->add_fields($email, 'email', "S'il vous plaît Entrez l'adresse e-mail valide");
    $obj->add_fields($phone, 'req', "S'il vous plaît Entrez numéro de téléphone");
    $obj->add_fields($phone, 'phone,us', "S'il vous plaît Entrez votre numéro de téléphone valide");
    /*if($phone != ''){
            	$obj->add_fields($phone, 'phone,us', "S'il vous plaît Entrez votre numéro de téléphone valide");
      }*/
    $obj->add_fields($massage, 'req', "S'il vous plaît Entrez votre message");
    $obj->add_fields($massage, 'min=2', "Message doit être d'au moins 2 caractères");
    // $obj->add_fields($_POST['6_letters_code'], 'req', 'Please Enter Captcha Code');
    //$obj->add_fields($message, 'max=100', 'Message should not be more than 100 characters long');
    $error = $obj->validate();
    if ($error) {
        $errorMsg = "<font color='#FF0000' family='verdana' size=2>" . $error . "</font>";
        $_SESSION['msg'] = $errorMsg;
    } else {
        $massage = htmlspecialchars_decode(htmlspecialchars($massage, ENT_NOQUOTES, "UTF-8"));
        $massage = str_replace("\\'", "'", $massage);
        $heading = $subject = "Contactez-nous reuest";
        //send my mail
开发者ID:pankajsinghjarial,项目名称:SYLC,代码行数:31,代码来源:contact_code.php

示例11: common

} else {
    $pages->default_ipp = $limit;
}
$eu = $limit * ($page - 1);
$obj_setting = new common();
$obj_search = new search();
if (isset($_GET['field']) and $_GET['field'] != '') {
    $field = $_GET['field'];
} else {
    $field = 'car_id';
}
if (isset($_GET['orderBy']) and $_GET['orderBy'] != '') {
    $orderby = $_GET['orderBy'];
} else {
    $orderby = 'ASC';
}
$where = "";
if (isset($searched) && $searched != '') {
    $where .= " WHERE title LIKE '%" . $searched . "%' OR Make LIKE '%" . $searched . "%' OR Model LIKE '%" . $searched . "%' OR Year LIKE '%" . $searched . "%'";
}
$ebayid = $common->CustomQuery("Select count(*) as total from ebay_car " . $where);
$item = mysql_fetch_object($ebayid);
$pages->items_total = $item->total;
if (isset($limit_combo) && $limit_combo != '') {
    $pages->default_ipp = $limit_combo;
} else {
    $pages->default_ipp = 25;
}
$pages->paginate();
$total_rows = $item->total;
$resp = $common->CustomQuery("Select * from ebay_car " . $where . " Order BY endson ASC " . $pages->limit);
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:from_ebay_code_old.php

示例12: common

<?php

extract($_POST);
extract($_GET);
$common = new common();
if ($parent_id) {
    $terms = $common->CustomQuery("Select mainpage.* from pages as mainpage left join pages as parentCat on (mainpage.page_cat = parentCat.id) where mainpage.slug = '{$page_id}' AND parentCat.slug = '{$parent_id}'");
} else {
    $terms = $common->CustomQuery("Select * from pages where slug = '{$page_id}' and page_cat = 0");
}
$terms = mysql_fetch_object($terms);
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:11,代码来源:page_code.php

示例13: common

<div class="middle_two_right_announces">
    <div id="craftysyntax_1">
        <script type="text/javascript" src="/~httpsylc/live-chat/livehelp_js.php?eo=0&amp;relative=Y&amp;department=1&amp;serversession=1&amp;pingtimes=10&amp;dynamic=Y&amp;creditline=L"></script>
    </div>
    <div class="add_area">
    <?php 
$common = new common();
$slide = $common->CustomQuery("Select * from banner where publish = 1 and type = 5 order by rand()");
while ($image = mysql_fetch_object($slide)) {
    ?>

        <?php 
    if ($image->website != "") {
        ?>
            <a href="<?php 
        echo $image->website;
        ?>
" target="_blank"> 
        <?php 
    }
    ?>
            <img src="<?php 
    echo DEFAULT_URL;
    ?>
/images/banner/<?php 
    echo $image->image;
    ?>
" alt="Banner" />
        <?php 
    if ($image->website != "") {
        ?>
开发者ID:pankajsinghjarial,项目名称:SYLC-NEWSITE,代码行数:31,代码来源:staticsidebar.php

示例14: common

<?php

extract($_POST);
extract($_GET);
$common = new common();
$faq = $common->CustomQuery("Select * from faq where publish = 1");
$faqhead = $common->CustomQuery("Select * from pages where id = 46");
$faqtext = mysql_fetch_object($faqhead);
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:8,代码来源:faq_code.php

示例15: fetchEbayCar

function fetchEbayCar($itemId, $action)
{
    $common = new common();
    // crated by us
    //$version = 773;
    //$devid = "e872f3d0-8bee-4784-b631-f0c6e0468c21";
    //$appid = "Planetwe-4831-4322-a03c-57a0a2d3aafb";
    //$certid = "574bc5e0-889c-431c-b3aa-918f19b83e0e";
    //$siteid =0;
    //$callname = "GetItem";
    //$accesToken = "AgAAAA**AQAAAA**aAAAAA**4gqXUg**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6AGkISjAJWBpg6dj6x9nY+seQ**An0BAA**AAMAAA**5D3c3AfScHkf+mmuQBsiuSAHvJ5dvb5KeUGyfX43IK6P4wjRzo5Rj7MxubzlEB+QmPf+nrkYAUU8V0nczpqvYaFl8orKRmqEdXKW0JqUE72CHfNIeNkcE7usMZZ9g97D9Be4yfDdAILBxTOEh4TdV4U3YD19Gfq1aSalXtSnLNndWFKS3j4vO4yBcZImdPkoNgCj7gtwidbz8l6zv+EHBUIRXqoEMP6gAZIY2JLjGq1T/u96NqQj7UKyzwoCvAsmUWL/0JTieQXuKqlM5sFdwKdEUAJzgaiK93ghP2aLFde3Rxqgh5sijGeT+f2KIKODYO9PILnRsiEKFyamt5OPLRmPfFeKBAv9kYoj0plLHbeeEBMP+F6QdwHrnK8pq/xMMm1K71JpjN1hoI3MbrFzNLNh/6b8NTHjlbYqjn8e6TJ2j8CyQe8XaiB4BlI4aBdJXW2ikxaWtBP7SAHTSmTFKk7t7xNP3Ti+BAAr1Uc+kyMBLs7o2m5vvJxz6bj/fxgcoUAv+GNt5/PtuuB60o4x9bG1WWp50+zZsqBlLCEwBxDKhbZ49jJRNc8nbM9xUcaupLxVTxUwbqoPpWB2i/dZuA+7xxfB0AyCTzFU9xPpZUIoEfCUcSFtZ0euub2w9jET4imzeJCc41sE3Qo/wB2AubK5oMn6wJXTsvu2sHRQgIsM/vJOweg6uLIZ15gb6Pn7JD+trob9IzCXoSwK/ytCdDOWfT589Fg7tw6A4pK31eMUjIwaYuH+l1SoItIBWBLV";
    //Details provided by client
    $version = 849;
    $devid = "E69WP8Z16P996R8H2K1EWU7LC2F4P4";
    $appid = "francois-1656-442d-bf2d-37b84676c2fb";
    $certid = "2f56d2cd-9d4b-45a5-8945-67c432f53d29";
    $siteid = 0;
    $callname = "GetItem";
    //$accesToken = "AgAAAA**AQAAAA**aAAAAA**It2lUg**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wJlIOhCJWCpQ6dj6x9nY+seQ**fzgAAA**AAMAAA**HO7Ff5QcNtBiD9NvWdD1xP+4GLKHGfpUP+SwT+cDf4AnxrGLcjv2DHcPivAGLK06agYWzcX4jpuhunP+WbdU5Uw8T8S1fBdsV2pwuCVTG1a2lMz2zHSgqvhQ+CLS3eBqZ9APg/gg/HVG8PBhJa147C4OtSAoJb0Q1CNM9Fmi4iHoX91KM14b6g9LhOUpIH1ODtlpkiwQhA+ZBe8lyxZzgNgVL1NpaWBv6Z5WRBgdQmGRh5OUxhteTOp0iDG5pzVA7isLCfQyBf41mcrdMAWrNBlyGGVSIWjk82M4kHYbd7uRA9w+cr+YUkC2J8f2T3DuoRqxBDShUnlm9rn+PYYqYJjn5c+DIz6GMMVnrgURZd/8HHu5jbGCGnEgnTIvcP64zdUSzzMV9i6XE32Mw2Wse0qVVPEMYRPwkGAejvBh5NlwpSYaTHw4ePmGV5oKYma/Qoyxa0CxsZ6YFIgKI2RVsjUJBihixnfQU7JUcjwwMtJ1oVfyjmT7aDX5CGkwR9LfGyJQWAYDler441lRFw8Ci7D87h1H6sd2SY2Szy5HsWuNTwOl8IHgio6Yw1acpZSAUDJ8jhWV8pKITBq0oJvQX7VF8DjjYNN+zp4329U89yfH1kjaS79a5TJgBSUMU9UDZi2HilDzEaPLJJcZr8DctxoZrEsh1fozvlvwbAehRQcsHnBqTCVGWme47BY9Ia5eTipFlSYDo7Sl8V0gUQeiEOtca+f0sR6qvb85sW5EYDWuWXCaS4YR+taT9L5OxO25";
    $accesToken = "AgAAAA**AQAAAA**aAAAAA**fqSbVQ**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6AGkISjAJWBpg6dj6x9nY+seQ**An0BAA**AAMAAA**F5lNYkkTF5+eh9ORJHXXaAi0kOFTeYMNzeVxybYeVyTcvJWc8bn4auZqxUK25zO8gqfChFLU1b3UbRcgJmhoQcVqb0L7rmNpFctACptDN7zUw+iv9ZLeePmxUFivtc5KUtPa7XLYKF4khJc7l5MWBwtzGC7+QKPWNRBoccYnpz5X6n7KHymsf1sH00toTpSczFBzQGFQcP65pyioz45/QQ//8f90jOyFXs60nR0RGHItNnwjjfQy/J2U6AhXSorLl3jOhqJhMErkNrmzkv9hjTYlpVoWhlJWGz93O5YKzneDW3h/pgikw7taeC63EUNCMHqM5eP16e+o2iOUFJ+AhvN0t4joK8/7JLuhUggOJLDQFvp9T5wzRMSmhhPobmI/ABfN0EgxFbiNb/9hDelf9HotFt2MvCsoupqVzat3Kz+hGWlovE+qieoKrQOzSi8Rzm/DTNBEequJtPd7MOSX/boW0Y/Hl0hnyzPoszj6wCepHtSilZrLHL0RO3+9ocSmmTJKgi038+oIJS4wC81YP0bTBReu3HHM9/cb5b457JJZ0TSo/mX9Mv+tPfrsWmzo4huyXspp3KdjeaTOvn+IzfiOekrE3JDRi7aPUFgY00A/gpQTkT1bgabdIm9V86zJVXvRDJXfa7vp2nCaA2BuQzJF2RLIoW6CYDnOV7oLJsYRo7QKRaCY6S8rDmiJTgrd99zZSusNYldBCJuFAj4g0abmEmiJr2aCKEtL5wFb9UDNWM7v0J2IELjzAf+p0dF1";
    $xml = '<?xml version="1.0" encoding="utf-8"?>
				<GetItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
					<RequesterCredentials>
						<eBayAuthToken>' . $accesToken . '</eBayAuthToken>
					</RequesterCredentials>
					<DetailLevel>ReturnAll</DetailLevel>
					<IncludeItemSpecifics>true</IncludeItemSpecifics>
					<ItemID>' . $itemId . '</ItemID>
				</GetItemRequest>​';
    $ch = curl_init("https://api.ebay.com/ws/api.dll?siteid={$siteid}");
    $headers = array('X-EBAY-API-COMPATIBILITY-LEVEL: ' . $version, 'X-EBAY-API-DEV-NAME: ' . $devid, 'X-EBAY-API-APP-NAME: ' . $appid, 'X-EBAY-API-CERT-NAME: ' . $certid, 'X-EBAY-API-CALL-NAME: ' . $callname, 'X-EBAY-API-SITEID: ' . $siteid);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
    $output = curl_exec($ch);
    //echo "<pre>";print_r($output);die;
    curl_close($ch);
    $res = simplexml_load_string($output);
    $item = $res->Item;
    $gallery = array();
    foreach ($item->PictureDetails->PictureURL as $val) {
        $gallery[] = (string) $val;
    }
    $gallerystr = implode("**", $gallery);
    $ConditionDisplayName = (string) $item->ConditionDisplayName;
    $description = (string) $item->Description;
    $specs = array();
    foreach ($item->ItemSpecifics->NameValueList as $arr) {
        $valus = array();
        foreach ($arr->Value as $val) {
            $temp = (string) $val;
            $valus[] = $temp;
        }
        $values = implode(",", $valus);
        $key = (string) $arr->Name;
        $specs[$key] = $values;
    }
    $std_equips = array();
    foreach ($specs as $keys => $data) {
        $std_equips[] = $keys . "^" . $data;
    }
    $std_equip = implode("~", $std_equips);
    $postalCode = (string) $item->PostalCode;
    $location = (string) $item->Location;
    $country = (string) $item->Country;
    $timeLeft = (string) $item->TimeLeft;
    if ((int) $item->BuyItNowPrice == 0) {
        $buyItNowAvailable = 0;
        $buyItNowPrice = (double) $item->SellingStatus->ConvertedCurrentPrice;
    } else {
        $buyItNowAvailable = 1;
        $buyItNowPrice = (double) $item->BuyItNowPrice;
    }
    $vin = (string) $item->VIN;
    $endTimes = (string) $item->ListingDetails->EndTime;
    $listingType = (string) $item->ListingType;
    $title = (string) $item->Title . " " . (string) $item->SubTitle;
    $itemData = (array) $item;
    if (!empty($itemData)) {
        $datArray = array("itemId" => $itemId, "galleryURL" => mysql_escape_string($gallerystr), "postalCode" => $postalCode, "location" => $location, "country" => $country, "endTime" => $timeLeft, "buyItNowPrice" => $buyItNowPrice, "listingType" => $listingType, "buyItNowAvailable" => $buyItNowAvailable, "ConditionDisplayName" => $ConditionDisplayName, "title" => mysql_escape_string($title), "description" => base64_encode($description), "stdequip" => mysql_escape_string($std_equip), "vin" => $vin, "Year" => $specs['Year'], "Make" => $specs['Make'], "Model" => $specs['Model'], "Mileage" => $specs['Mileage'], "endson" => $endTimes, "endtimestamp" => strtotime($endTimes));
        if ($action == "update") {
            $common->update("ebay_car", $datArray, " itemId = " . $itemId);
        } elseif ($action == "save") {
            $common->save("ebay_car", $datArray);
        }
    }
    return $common->CustomQuery("Select * from ebay_car where itemId = " . $itemId);
}
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:90,代码来源:ebay_functions.php


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