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


PHP Products::GetPhotoById方法代码示例

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


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

示例1: GetWaitingList

 public function GetWaitingList($id_user)
 {
     $sql = "SELECT wl.id_product, p.art, p.name, p.translit , p.img_1,\r\n\t\t\tp.price_opt, p.price_mopt, p.old_price_opt, p.visible\r\n\t\t\tFROM " . _DB_PREFIX_ . "waiting_list AS wl\r\n\t\t\tLEFT JOIN " . _DB_PREFIX_ . "product AS p\r\n\t\t\t\tON wl.id_product = p.id_product\r\n\t\t\tWHERE wl.id_user = '" . $id_user . "'\r\n\t\t\tORDER BY wl.id_product";
     if (!($arr = $this->db->GetArray($sql))) {
         return false;
     }
     foreach ($arr as &$value) {
         $Products = new Products();
         $value['images'] = $Products->GetPhotoById($value['id_product']);
     }
     return $arr;
 }
开发者ID:Arikito,项目名称:webking.xt,代码行数:12,代码来源:customers_c.php

示例2: Segmentation

				$Segmentation = new Segmentation();
				echo json_encode($Segmentation->GetSegmentation($_POST['type']));
				break;
			case 'UpdateDemandChart':
				echo json_encode($Products->UpdateDemandChart($_POST, true));
				break;
			case 'AddPhotoProduct':
				$echo = 'error';
				if(isset($_POST['id_category'])){
					$_POST['categories_ids'][] = $_POST['id_category'];
					unset($_POST['id_category']);
				}
				if($id_product = $Products->AddPhotoProduct($_POST)){
					$Products->SetFieldsByID($id_product);
					$product = $Products->fields;
					$images = $Products->GetPhotoById($id_product, true);
					$videos = $Products->GetVideoById($id_product);
					$echo = '<div class="prodListItem">
						<div class="prodInfo">
							<div class="nameProd">
								<label>Название:</label>
								<span>'.$product['name'].'</span>
							</div>
							<div class="createData">
								<label>Добавлен:</label>
								<span>'.$product['create_date'].'</span>
							</div>
						</div>
						<div class="actions">
							<a href="/adm/productedit/'.$product['id_product'].'" class="icon-font btn-m-blue" target="_blank" title="Редактировать">e</a>
							<a href="'.Link::Product($product['translit']).'" class="icon-font btn-m-green" target="_blank" title="Посмотреть на сайте">v</a>
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:ajaxproducts.php

示例3: AND

if (isset($_GET['limit']) && $_GET['limit'] != 'all' || !isset($_GET['limit'])) {
    if (isset($_POST['page_nbr']) && is_numeric($_POST['page_nbr'])) {
        $_GET['page_id'] = $_POST['page_nbr'];
    }
    $cnt = $Products->GetProductsCntSupCab($arr, $params);
    $tpl->Assign('cnt', $cnt);
    $GLOBALS['paginator_html'] = G::NeedfulPages($cnt);
    $limit = ' LIMIT ' . $GLOBALS['Start'] . ',' . $GLOBALS['Limit_db'];
} else {
    $GLOBALS['Limit_db'] = 0;
    $limit = '';
}
// ---------Информация о поставщике
$Supplier->fields['active_products_cnt'] = $Products->GetProductsCntSupCab(array('a.id_supplier' => $id_supplier, 'a.active' => 1, 'p.visible' => 1), ' AND a.product_limit > 0 AND (a.price_mopt_otpusk > 0 OR a.price_opt_otpusk > 0)');
$Supplier->fields['all_products_cnt'] = $Products->GetProductsCntSupCab($arr);
$Supplier->fields['moderation_products_cnt'] = count($Products->GetProductsOnModeration($id_supplier));
$check_sum = $Supplier->GetCheckSumSupplierProducts($id_supplier);
$tpl->Assign('check_sum', $check_sum);
$tpl->Assign('supplier', $Supplier->fields);
$Products->SetProductsList1($id_supplier, $order, $limit, $arr, $params);
$products = $Products->list;
if ($products) {
    foreach ($products as &$p) {
        $p['images'] = $Products->GetPhotoById($p['id_product']);
    }
}
$tpl->Assign('list', $products);
$parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_assortment.tpl'));
if ($parsed_res['issuccess'] === true) {
    $tpl_center .= $parsed_res['html'];
}
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:assortment.php

示例4: GetDataForAct

 public function GetDataForAct()
 {
     $sql = "SELECT p.id_product, p.name, p.art, a.active, p.img_1, p.img_2, p.img_3, p.descr,\r\n\t\t\tp.inbox_qty, p.min_mopt_qty, p.qty_control, p.weight, p.height, p.width,\r\n\t\t\tp.length, p.coefficient_volume, p.volume, a.product_limit, a.price_opt_otpusk,\r\n\t\t\ta.price_opt_recommend, a.price_mopt_otpusk, a.price_mopt_recommend,\r\n\t\t\ta.price_mopt_otpusk_usd, a.price_opt_otpusk_usd, a.inusd,\r\n\t\t\t(SELECT MIN(assort.price_mopt_otpusk)\r\n\t\t\tFROM " . _DB_PREFIX_ . "assortiment AS assort\r\n\t\t\tLEFT JOIN " . _DB_PREFIX_ . "calendar_supplier AS cs ON (cs.id_supplier = assort.id_supplier AND cs.date = (CURDATE() + INTERVAL 2 DAY))\r\n\t\t\tWHERE cs.work_day = 1\r\n\t\t\tAND assort.active = 1\r\n\t\t\tAND assort.id_product = p.id_product\r\n\t\t\tAND price_mopt_otpusk > 0\r\n\t\t\tGROUP BY assort.id_product) AS min_mopt_price,\r\n\t\t\t(SELECT MIN(assort.price_opt_otpusk)\r\n\t\t\tFROM " . _DB_PREFIX_ . "assortiment AS assort\r\n\t\t\tLEFT JOIN " . _DB_PREFIX_ . "calendar_supplier AS cs ON (cs.id_supplier = assort.id_supplier AND cs.date = (CURDATE() + INTERVAL 2 DAY))\r\n\t\t\tWHERE cs.work_day = 1\r\n\t\t\tAND assort.active = 1\r\n\t\t\tAND assort.id_product = p.id_product\r\n\t\t\tAND price_opt_otpusk > 0\r\n\t\t\tGROUP BY assort.id_product) AS min_opt_price,\r\n\t\t\t(SELECT u.unit_xt\r\n\t\t\tFROM " . _DB_PREFIX_ . "units AS u\r\n\t\t\tWHERE p.id_unit = u.id) AS unit\r\n\t\t\tFROM " . _DB_PREFIX_ . "assortiment AS a LEFT JOIN " . _DB_PREFIX_ . "product AS p ON p.id_product = a.id_product\r\n\t\t\tWHERE a.id_supplier = " . $this->fields['id_user'] . "\r\n\t\t\tORDER BY a.inusd, p.name";
     $arr = $this->db->GetArray($sql);
     foreach ($arr as &$product) {
         $Products = new Products();
         $product['images'] = $Products->GetPhotoById($product['id_product']);
     }
     return $arr;
 }
开发者ID:Arikito,项目名称:webking.xt,代码行数:10,代码来源:suppliers_c.php

示例5: array

         return $str;
     }
     $where_arr['cp.id_category'] = $id_category;
     if (!_acl::isAdmin()) {
         $where_arr['p.visible'] = 1;
     }
     $params = array('group_by' => 'a.id_product', 'ajax' => true, 'rel_search' => null);
     if (isset($_COOKIE['sorting'])) {
         $sort = json_decode($_COOKIE['sorting'], true);
         $sorting = $sort['products'];
         $params['order_by'] = $sorting['value'];
     }
     $Products->SetProductsList($where_arr, ' LIMIT ' . ($_POST['skipped_products'] + $_POST['shown_products']) . ', 30', $params);
     if ($Products->list) {
         foreach ($Products->list as &$p) {
             $p['images'] = $Products->GetPhotoById($p['id_product']);
         }
     }
     $tpl->Assign('list', $Products->list);
     $i = $_POST['shown_products'] + 1;
     $products_list = $tpl->Parse($GLOBALS['PATH_tpl_global'] . 'products_list.tpl');
     echo $products_list;
     break;
 case "getproductscount":
     $id_category = isset($_POST['id_category']) ? $_POST['id_category'] : null;
     $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db);
     function selectAll($dbtree, $id_category = null, $str = array())
     {
         $subcats = $dbtree->GetSubCats($id_category, array('id_category', 'category_level', 'category_img', 'name', 'translit', 'art', 'pid', 'visible'));
         if ($id_category != 0) {
             $str[] = $id_category;
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:products.php

示例6: unset

     }
 }
 // Выбор доступных городов, если у пользователя была сохранена область
 if (isset($saved['city'])) {
     $cities_list = $Cities->SetFieldsByInput($saved['city']['region']);
     if (!$Deliveryservice->SetFieldsByInput($saved['city']['name'], $saved['city']['region'])) {
         unset($deliverymethods_list[3]);
     }
     $Deliveryservice->SetListByRegion($saved['city']['names_regions']);
     $deliveryservices_list = $Deliveryservice->list;
     $Delivery->SetFieldsByInput($saved['city']['shipping_comp'], $saved['city']['name'], $saved['city']['region']);
     $deliverydepartments_list = $Delivery->list;
 }
 if (isset($_SESSION['cart']['id_gift'])) {
     $Products->SetFieldsById($_SESSION['cart']['id_gift']);
     $Products->fields['images'] = $Products->GetPhotoById($Products->fields['id_product']);
     $tpl->Assign('gift', $Products->fields);
 }
 /* output data */
 $tpl->Assign('customer', $customer);
 $tpl->Assign('regions_list', $regions_list);
 $tpl->Assign('deliverymethods_list', $deliverymethods_list);
 $tpl->Assign('cities_list', $cities_list);
 $tpl->Assign('deliveryservices_list', $deliveryservices_list);
 $tpl->Assign('deliverydepartments_list', $deliverydepartments_list);
 $tpl->Assign('managers_list', $managers_list);
 $tpl->Assign('saved', $saved);
 $tpl->Assign('personal_discount', isset($_SESSION['cart']) && isset($_SESSION['cart']['personal_discount']) ? $_SESSION['cart']['personal_discount'] : 1);
 /* Действия */
 if (isset($GLOBALS['Rewrite']) && is_numeric($GLOBALS['Rewrite'])) {
     if (isset($_POST['add_order'])) {
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:cart.php

示例7: array

	$where_arr = array('cp.id_category'=>$_GET['id_category']);
	$params = array(
		'group_by' => 'a.id_product',
		'order_by' => $sorting['value'],
		'ajax' => true,
		'rel_search' => null
	);

	if(isset($_GET['action'])){
		switch($_GET['action']){
			case "getmoreproducts":
				$Products->SetProductsList($where_arr, ' LIMIT '.($_GET['skipped_products']+$_GET['shown_products']).', 30', $params);
				$list = $Products->list;
				$i = $_GET['shown_products']+1;
				foreach($list AS $item){
					$item['images'] = $Products->GetPhotoById($item['id_product']);
					($item['price_mopt'] > 0 && $item['min_mopt_qty'] > 0)? $mopt_available = TRUE : $mopt_available = FALSE;?>
					<section class="product product_<?=$item['id_product']?> animate">
						<div class="content animate bg-white brdrds">
							<div class="thumbnail">
								<a href="/product/<?=$item['id_product']?>/<?=$item['translit']?>/">
									<?if(!empty($item['images'])){?>
										<img alt="<?=htmlspecialchars(G::CropString($item['name']))?>" class="lazy" src="/images/nofoto.png" data-original="<?=G::GetImageUrl($item['images'][0]['src'], 'thumb')?>"/>
										<noscript>
											<img alt="<?=htmlspecialchars(G::CropString($item['name']))?>" src="<?=G::GetImageUrl($item['images'][0]['src'], 'thumb')?>"/>
										</noscript>
									<?}else{?>
										<img alt="<?=htmlspecialchars(G::CropString($item['name']))?>" class="lazy" src="/images/nofoto.png" data-original="<?=G::GetImageUrl($item['img_1'], 'medium')?>"/>
										<noscript>
											<img alt="<?=htmlspecialchars(G::CropString($item['name']))?>" src="<?=G::GetImageUrl($item['img_1'], 'medium')?>"/>
										</noscript>
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:ajaxcat.php

示例8: isset

         $Products->DelFromAssort($_POST['id_product'], isset($_POST['id_supplier']) ? $_POST['id_supplier'] : $_SESSION['member']['id_user']);
         $arr['id_product'] = $_POST['id_product'];
         echo json_encode($arr);
     }
     break;
 case 'GetPreview':
     $id_product = $_POST['id_product'];
     $Products->SetFieldsById($id_product);
     unset($parsed_res);
     if (isset($_SESSION['member'])) {
         $User->SetUser($_SESSION['member']);
     }
     $tpl->Assign('User', $User->fields['name']);
     $product = $Products->fields;
     $product['specifications'] = $Products->GetSpecificationList($id_product);
     $product['images'] = $Products->GetPhotoById($id_product);
     $product['videos'] = $Products->GetVideoById($id_product);
     $tpl->Assign('product', $product);
     echo $tpl->Parse($GLOBALS['PATH_tpl_global'] . 'preview.tpl');
     break;
 case 'add_favorite':
     // Добавление Избранного товара
     if (!G::IsLogged()) {
         $data['answer'] = 'login';
     } elseif (isset($_SESSION['member']['favorites']) && in_array($_POST['id_product'], $_SESSION['member']['favorites'])) {
         $data['answer'] = 'already';
     } else {
         if ($_SESSION['member']['gid'] == _ACL_CUSTOMER_) {
             $Customer->AddFavorite($User->fields['id_user'], $_POST['id_product']);
             $_SESSION['member']['favorites'][] = $_POST['id_product'];
             $data['fav_count'] = count($_SESSION['member']['favorites']);
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:product.php

示例9: Products

<?php

$Products = new Products();
$dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db);
if (isset($_GET['savedprices']) == true) {
    $price_list = $Products->GetPricelistById($_GET['selected-array']);
    $i = 0;
    if ($_GET['photo'] == 4) {
        foreach ($price_list as $k => &$l) {
            if (!isset($name)) {
                $name = $l['price_name'];
            }
            $image = $Products->GetPhotoById($l['id_product']);
            $list1[] = array('id_product' => $l['id_product'], 'art' => $l['art'], 'img_1' => $l['img_1'], 'image' => $image[0]['src'], 'name' => $l['name'], 'note' => $l['note'], 'min_mopt_qty' => $l['min_mopt_qty'], 'inbox_qty' => $l['inbox_qty'], 'price_mopt' => $l['price_mopt'], 'price_opt' => $l['price_opt'], 'units' => $l['units'], 'opt_correction_set' => $l['opt_correction_set'], 'mopt_correction_set' => $l['mopt_correction_set']);
        }
        $list = $list1;
    } else {
        foreach ($price_list as $k => &$l) {
            if (!isset($name)) {
                $name = $l['price_name'];
            }
            $image = $Products->GetPhotoById($l['id_product']);
            $list1[$l['id_category']]['name'] = $l['cat_name'];
            $list1[$l['id_category']]['products'][] = array('id_product' => $l['id_product'], 'art' => $l['art'], 'img_1' => $l['img_1'], 'image' => $image[0]['src'], 'name' => $l['name'], 'note' => $l['note'], 'min_mopt_qty' => $l['min_mopt_qty'], 'inbox_qty' => $l['inbox_qty'], 'price_mopt' => $l['price_mopt'], 'price_opt' => $l['price_opt'], 'units' => $l['units'], 'opt_correction_set' => $l['opt_correction_set'], 'mopt_correction_set' => $l['mopt_correction_set']);
            $i++;
        }
        $fields = array('id_category', 'name', 'pid', 'category_level');
        $var1 = $dbtree->GetCategories($fields, 1);
        foreach ($var1 as $v1) {
            $list[$v1['id_category']] = $v1;
            foreach ($dbtree->GetSubCats($v1['id_category'], $fields) as &$v2) {
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:pricelist.php

示例10: header

$tpl->Assign('last_article', $Products->GetLastArticle());
//Дубликат товара
if (isset($_POST['smb_duplicate'])) {
    if ($id = $Products->DuplicateProduct($_POST)) {
        header('Location: ' . $GLOBALS['URL_base'] . 'adm/productedit/' . $id);
    } else {
        $tpl->Assign('msg', 'Товар не добавлен.');
        $tpl->Assign('errm', $errm);
    }
}
$tpl->Assign('suppliers_info', $Products->GetSuppliersInfoForProduct($id_product));
//Получение списка сегментаций прикрепленных к тоавру
$tpl->Assign('segmentations', $segmentation->GetSegmentationsForProduct($id_product));
//Заполнение массива POST
$video = $Products->GetVideoById($id_product);
$photo = $Products->GetPhotoById($id_product, 'all');
$_POST['id_product'] = 0;
$prod_fields = $Products->fields;
$prod_fields['video'] = $video;
$prod_fields['images'] = $photo;
foreach ($prod_fields as $k => $v) {
    if (!isset($_POST['smb']) || !isset($_POST[$k])) {
        $_POST[$k] = $v;
    }
}
$tpl->Assign('h1', $_POST['name']);
$parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_product_ae.tpl'));
$ii = count($GLOBALS['IERA_LINKS']);
$GLOBALS['IERA_LINKS'][$ii]['title'] = "Каталог";
$GLOBALS['IERA_LINKS'][$ii++]['url'] = $GLOBALS['URL_base'] . 'adm/cat/';
if (isset($category['id_category'])) {
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:productedit.php


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