當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ItemManager::getItemsForOrder方法代碼示例

本文整理匯總了PHP中ItemManager::getItemsForOrder方法的典型用法代碼示例。如果您正苦於以下問題:PHP ItemManager::getItemsForOrder方法的具體用法?PHP ItemManager::getItemsForOrder怎麽用?PHP ItemManager::getItemsForOrder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ItemManager的用法示例。


在下文中一共展示了ItemManager::getItemsForOrder方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: service

 public function service()
 {
     $item_id = intval($this->secure($_REQUEST['item_id']));
     $itemManager = new ItemManager($this->config, $this->args);
     $itemsForOrder = $itemManager->getItemsForOrder($item_id, $this->getUserId(), $this->getUserLevel(), true);
     $header = array("Content-type: multipart/form-data");
     /* $filePath = IMAGE_ROOT_DIR . "/items/" . $item_id . "_1_800_800.jpg";
         $post = array('file' => '@' . $filePath, "size" => filesize($filePath), "name" => $item_id . "_1_800_800.jpg");
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, 'http://www.list.am/img/upload.php');
         curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
         $result = curl_exec($ch);
         curl_close($ch);
        */
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
     curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0');
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_POSTFIELDS, array('price' => $itemManager->exchangeFromUsdToAMD($itemsForOrder->getCustomerItemPrice()), 'location' => $this->getCmsVar('listam_post_location_id'), 'your_email' => $this->getCmsVar('listam_post_email'), 'password' => $this->getCmsVar('listam_account_password'), 'phone_numbers' => $this->getCmsVar('listam_post_phone_number_1'), 'phone_numbers__2' => $this->getCmsVar('listam_post_phone_number_2'), 'title' => 'New ' . substr($itemsForOrder->getDisplayName(), 0, 75) . ' Warranty ' . $itemsForOrder->getWarranty() . ' Months', 'agree' => 1, '_form_confirm' => 1, 'verification_numberetoken' => 'S1ZOxa9+DvSOVrtE5fP9K0WlK6241Q2XQ+UL3em9AW0=', 'verification_number' => '75183', 'currency' => '0', 'ad_type' => '0', '_form_action' => 'Post', 'post_form_visited' => '1', 'ufiles[]' => $item_id . "_1_800_800.jpg", 'description' => substr($itemsForOrder->getDisplayName() . '<br><br>' . $itemsForOrder->getFullDescription(), 0, 16383)));
     curl_setopt($ch, CURLOPT_URL, 'http://www.list.am/add/8');
     $result = curl_exec($ch);
     var_dump($result);
     exit;
     curl_close($ch);
     //$captchaImgSrcStartPos = strpos($result, '<img')+10;
     //$captchaImgSrcEndPos = strpos($result, '"', $captchaImgSrcStartPos + 1);
     //echo substr($result, $captchaImgSrcStartPos, $captchaImgSrcEndPos-$captchaImgSrcStartPos);
     if (strpos($result, 'Հայտարարությունը ավելացված է') !== false) {
         $this->ok();
     } else {
         $this->error();
     }
 }
開發者ID:pars5555,項目名稱:pcstore,代碼行數:35,代碼來源:PostItemToListamAction.class.php


注:本文中的ItemManager::getItemsForOrder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。