source: extensions/MyPiwiShop/admin/MyPiwiShopBatchUnit.php @ 27744

Last change on this file since 27744 was 27743, checked in by Miklfe, 10 years ago

Version de lancement

File size: 1.2 KB
Line 
1<?php
2defined('MPS_PATH') or die('Hacking attempt!');
3/*      *
4*** submit change
5**/     
6       
7if(isset($_POST['imgid']))
8        {
9        $imgid = $_POST['imgid'];
10        $imgen = array($imgid);
11        if (!isset($_POST['productcheck'])) {
12                deletThis_image_Allproduct($imgid);
13        }
14        else{   
15
16        $product_id = $_POST['productcheck'];
17        add_product_Thisimage($product_id, $imgen);
18  }
19}       
20       
21
22global $template, $element_ids;
23 
24 $query='SELECT * FROM '.MPS_PRODUCT_TABLE.' ORDER BY `order`;';
25  $result = pwg_query($query);
26  $products = array();
27 
28  while($row = pwg_db_fetch_assoc($result)){
29  $products[]= $row;
30  }
31
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
42  WHERE id IN ('.implode(',', $element_ids).')
43  ;';
44  $result = pwg_query($query);
45  $productcheck = array();
46 
47  while($row = pwg_db_fetch_assoc($result)){
48        $productcheck[] = $row;
49  }
50               
51 
52        $template->assign(array(
53        'mps_products'     => $products,
54        'mps_conf'                 => $config,
55        'mps_productcheck' => $productcheck,
56        ));
57
58
59       
60       
Note: See TracBrowser for help on using the repository browser.