Changeset 27743 for extensions/MyPiwiShop/admin/MyPiwiShopBatchUnit.php
- Timestamp:
- Mar 12, 2014, 11:28:47 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/MyPiwiShop/admin/MyPiwiShopBatchUnit.php
r27568 r27743 20 20 21 21 22 global $template, $ conf, $page, $element_ids;22 global $template, $element_ids; 23 23 24 25 $query='SELECT * FROM '.MPS_CONF_TABLE.';'; 26 $result = pwg_query($query); 24 $query='SELECT * FROM '.MPS_PRODUCT_TABLE.' ORDER BY `order`;'; 25 $result = pwg_query($query); 26 $products = array(); 27 27 28 while($row = pwg_db_fetch_assoc($result)){ 28 $config = $row;29 $products[]= $row; 29 30 } 30 31 31 $query=' 32 SELECT id 33 FROM '.IMAGES_TABLE.' 32 $query='SELECT * FROM '.MPS_CONF_TABLE.';'; 33 $result = pwg_query($query); 34 while($row = pwg_db_fetch_assoc($result)){ 35 $config = $row ; 36 } 37 38 $query=' 39 SELECT i.id, pi.image_id, pi.product_id 40 FROM '.IMAGES_TABLE.' AS i 41 LEFT JOIN '.MPS_PROD_IMG_TABLE.' AS pi ON pi.image_id = i.id 34 42 WHERE id IN ('.implode(',', $element_ids).') 43 ;'; 44 $result = pwg_query($query); 45 $productcheck = array(); 35 46 36 ;'; 37 $productImg = array(); 38 $result = pwg_query($query); 39 while($row1 = pwg_db_fetch_assoc($result)){ 40 41 $query=' 42 SELECT * 43 FROM '.MPS_PROD_IMG_TABLE.' AS pit 44 JOIN '.MPS_PRODUCT_TABLE.' AS t ON t.id = pit.product_id 45 WHERE image_id = '.$row1['id'].' 46 ;'; 47 $re = pwg_query($query); 48 $prod = array(); 49 $prodid = array(); 50 $productCheck = array(); 51 while($row = pwg_db_fetch_assoc($re)){ 52 $prod = array("id" =>$row['id'], 53 "product" =>$row['product'], 54 "noteAdmin" =>$row['noteAdmin'], 55 "price" =>$row['price'], 56 ); 57 $productCheck[]=$prod; 58 59 $prodid[] = $row['id']; 60 for($i=0;$i<count($productCheck);$i++){ 61 $productCheck[$i]['check'] = 'true'; 62 } 63 } 64 65 $query = ' 66 SELECT * 67 FROM '.MPS_PRODUCT_TABLE.' 68 ;'; 69 70 $resu = pwg_query($query); 71 $product = array(); 72 while($row2 = pwg_db_fetch_assoc($resu)){ 73 74 if (!in_array($row2['id'], $prodid)) { 75 $product[]= $row2; 76 } 77 } 78 for($i=0;$i<count($product);$i++){ 79 $product[$i]['check'] = 'false'; 80 } 81 82 $productimg = array_merge($productCheck, $product); 83 84 $productImg[$row1['id']] = $productimg; 47 while($row = pwg_db_fetch_assoc($result)){ 48 $productcheck[] = $row; 85 49 } 50 51 86 52 $template->assign(array( 87 'mps_conf' => $config, 88 'mps_productcheck' => $productImg, 53 'mps_products' => $products, 54 'mps_conf' => $config, 55 'mps_productcheck' => $productcheck, 89 56 )); 90 57
Note: See TracChangeset
for help on using the changeset viewer.