Changeset 27743 for extensions/MyPiwiShop/include
- Timestamp:
- Mar 12, 2014, 11:28:47 PM (11 years ago)
- Location:
- extensions/MyPiwiShop/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/MyPiwiShop/include/functions.inc.php
r27568 r27743 1 1 <?php 2 2 defined('MPS_PATH') or die('Hacking attempt!'); 3 4 /**5 *prefilte calcul6 **/7 function filter_sets_image_format($ratios)8 {9 $res = array();10 11 $query = '12 SELECT id, width, height13 FROM '.IMAGES_TABLE.'14 ;';15 16 $result = pwg_query($query);17 if (pwg_db_num_rows($result))18 {19 while ($row = pwg_db_fetch_assoc($result))20 {21 if ($row['width']>0 && $row['height']>0)22 {23 $ratio = floor($row['width'] / $row['height'] * 100) / 100;24 25 if(($ratio > $ratios[0] && $ratio < $ratios[1]) || ($ratio > $ratios[2] && $ratio < $ratios[3]))26 {27 $res[] = $row['id'];28 }29 }30 }31 }32 return $res;33 }34 3 35 4 /** -
extensions/MyPiwiShop/include/public_events.inc.php
r27568 r27743 1 1 <?php 2 2 defined('MPS_PATH') or die('Hacking attempt!'); 3 4 5 6 3 7 4 /* … … 100 97 ORDER BY `order` 101 98 ;'; 102 103 99 $result = pwg_query($query); 104 100 $num_rows = pwg_db_num_rows($result); 105 106 107 if ($num_rows != 0) 108 { 101 if ($num_rows != 0){ 109 102 while($row = pwg_db_fetch_assoc($result)){ 110 103 $product[$row['product']] = $row['product'].' '. $row['price'].' '. $config['currency']; 111 112 104 $price[] = $row['price']; 113 } 114 105 } 115 106 116 107 117 108 $query='SELECT pi.product_id, po.product_id, p.price, p.product, o.name, o.type, o.requi, o.order, po.opt_id, ov.val 118 109 FROM '.MPS_PROD_IMG_TABLE.' AS pi 119 LEFT JOIN '.MPS_PRODUCT_TABLE.' A sp ON p.id = pi.product_id110 LEFT JOIN '.MPS_PRODUCT_TABLE.' AS p ON p.id = pi.product_id 120 111 LEFT JOIN '.MPS_PROD_OPT_TABLE.' AS po ON po.product_id = p.id 121 112 LEFT JOIN '.MPS_OPTION_TABLE.' AS o ON o.id = po.opt_id … … 123 114 WHERE image_id = '.$image_id .' 124 115 AND po.opt_id IS NOT NULL 125 ORDER BY o.order116 ;'; 126 117 127 ;'; 128 $result = pwg_query($query); 118 $result = pwg_query($query); 129 119 while($row = pwg_db_fetch_assoc($result)){ 130 120 {
Note: See TracChangeset
for help on using the changeset viewer.