Changeset 27743 for extensions/MyPiwiShop/admin
- Timestamp:
- Mar 12, 2014, 11:28:47 PM (11 years ago)
- Location:
- extensions/MyPiwiShop/admin
- Files:
-
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/MyPiwiShop/admin/MyPiwiShopBatch.php
r27568 r27743 2 2 defined('MPS_PATH') or die('Hacking attempt!'); 3 3 4 global $template , $conf;4 global $template; 5 5 6 $query='SELECT * FROM '.MPS_PRODUCT_TABLE.' ;';6 $query='SELECT * FROM '.MPS_PRODUCT_TABLE.' ORDER BY `order`;'; 7 7 $result = pwg_query($query); 8 8 $product = array(); -
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 -
extensions/MyPiwiShop/admin/config.php
r27568 r27743 38 38 $tpruniq = $_POST['tpruniq']; 39 39 40 41 42 43 40 $query='UPDATE '.MPS_CONF_TABLE.' 44 41 SET PPid = \''.$PPid.'\',currency = \''.$currency.'\',ship = \''.$ship.'\',comm = \''.$comm.'\' ,tprmulti = \''.$tprmulti.'\',tpruniq = \''.$tpruniq.'\' 45 42 WHERE id=1;'; 46 @$res=pwg_query($query);47 if($res ==1)43 $result=pwg_query($query); 44 if($result==1) 48 45 $page['infos']=l10n('Your configuration settings are saved'); 49 46 else 50 47 $page['errors']=l10n('Error'); 48 49 } 51 50 52 51 $query='SELECT * FROM '.MPS_CONF_TABLE.';'; … … 56 55 } 57 56 58 $template->assign(array(59 'mps_conf' => $config60 ));61 }62 63 57 64 58 65 59 $template->assign(array( 66 60 'mps_currency' => $select_options_currency, 61 'mps_conf' => $config 67 62 )); 68 63 -
extensions/MyPiwiShop/admin/home.php
r27568 r27743 12 12 13 13 $template->assign(array( 14 'mps_conf' => $config,15 'INTRO_CONTENT' => load_language('intro.html', MPS_PATH, array('return'=>true)),14 'mps_conf' => $config, 15 'INTRO_CONTENT' => load_language('intro.html', MPS_PATH, array('return'=>true)), 16 16 )); 17 17 -
extensions/MyPiwiShop/admin/options.php
r27568 r27743 1 1 <?php 2 2 defined('MPS_PATH') or die('Hacking attempt!'); 3 3 4 4 5 $select_type_opt=array( … … 34 35 35 36 $order = array(); 36 $query ='SELECT * FROM '.MPS_ PRODUCT_TABLE.';';37 $query ='SELECT * FROM '.MPS_OPTION_TABLE.';'; 37 38 $result = pwg_query($query); 38 39 while($row = pwg_db_fetch_assoc($result)){ -
extensions/MyPiwiShop/admin/product.php
r27568 r27743 1 1 <?php 2 2 defined('MPS_PATH') or die('Hacking attempt!'); 3 3 4 4 5 if(isset($_POST['check'])){ … … 118 119 } 119 120 } 120 //_________________________________________________________________ 121 121 122 $select_type_opt=array( 122 123 'select' =>'select', … … 129 130 if (isset($_POST['option_add'])) 130 131 { 132 $order = array(); 133 $query ='SELECT * FROM '.MPS_OPTION_TABLE.';'; 134 $result = pwg_query($query); 135 while($row = pwg_db_fetch_assoc($result)){ 136 $order[] = $row['order']; 137 } 138 139 if (count($order) == 0) { 140 $order = 1; 141 }else{ 142 $order = max($order)+1; 143 } 131 144 132 145 $name = $_POST['name']; … … 141 154 142 155 143 $query='INSERT into '.MPS_OPTION_TABLE.' ( name,type,titre,requi)144 values (\''.$name.'\',\''.$type.'\',\''.$title.'\',\''.$requi.'\' );';156 $query='INSERT into '.MPS_OPTION_TABLE.' (`name`,`type`,`titre`,`requi`,`order`) 157 values (\''.$name.'\',\''.$type.'\',\''.$title.'\',\''.$requi.'\',\''.$order.'\');'; 145 158 146 159 pwg_query($query); … … 157 170 } 158 171 159 echo('<div><div id="idlastopt" >'.$select_id.'</div></div>');172 echo('<div><div id="idlastopt" data-idlo="'.$select_id.'"></div></div>'); 160 173 161 174 } 162 //_____________________________________________________________________163 175 164 176 $query='SELECT * FROM '.MPS_PRODUCT_TABLE.' ORDER BY `order`;'; -
extensions/MyPiwiShop/admin/template/MyPiwiShopBatchUnit.tpl
r27568 r27743 19 19 20 20 21 {foreach from=$mps_productcheck key=key item=products name=product}22 {if $key == $imgid}23 21 <br></br> 24 22 … … 39 37 </tread> 40 38 <tbody> 41 {foreach from=$ products item=product name=product}39 {foreach from=$mps_products item=product name=product} 42 40 <tr class="{if $smarty.foreach.product.index is odd}row1{else}row2{/if}"> 43 <td><input type="checkbox" name="productcheck[]" value={$product.id} {if $product.check == 'true'}checked{/if}></td> 41 <td><input type="checkbox" name="productcheck[]" value={$product.id} 42 {foreach from=$mps_productcheck item=prodcheck name=prodcheck} {if $prodcheck.id == $imgid && $prodcheck.product_id == $product.id}checked{/if}{/foreach}></td> 44 43 <td>{$product.product} </td> 45 44 <td>{$product.noteAdmin}</td> … … 67 66 </div> 68 67 69 {/if}70 {/foreach} -
extensions/MyPiwiShop/admin/template/options.tpl
r27589 r27743 235 235 236 236 $('#ChangeOrder').click(function() { 237 var $pos = $(document).scrollTop(), 238 $pos = $pos + 100; 239 $('#change_Order .add_content').css('top',$pos) 237 240 $("#change_Order").fadeIn( 238 241 ); -
extensions/MyPiwiShop/admin/template/product.tpl
r27589 r27743 22 22 23 23 $('#AddProd').click(function() { 24 $('.add_ content').css('top','100px')24 $('.add_wrap').css('top','100px') 25 25 $('.Tadd').show(); 26 26 $('#Add_product').fadeIn(); … … 197 197 198 198 $('#ChangeOrder').click(function() { 199 var $pos = $(document).scrollTop(), 200 $pos = $pos + 100; 201 202 $('#change_Order .add_content').css('top',$pos) 199 203 $("#change_Order").fadeIn( 200 204 ); … … 224 228 }); 225 229 226 $( '.addVal').click(function(){230 $(document).on('click','.addVal',function(){ 227 231 $('.valeur').append($('<div/>').addClass('val').append($val)); 228 232 ;return false; … … 239 243 } 240 244 } 245 return false 246 }); 247 248 $(document).on('click','#close_addoption',function() { 249 $('#sub_add_product').show(); 250 $('#add_option_prod input[type=text]').attr('value',''); 251 $('.val').remove(); 252 $('.valeur').append($('<div/>').addClass('val').append($val)); 253 $('select#optType option').each(function(){ 254 $(this).removeAttr('selected'); 255 }); 256 $('#add_option_prod').hide().html($add_opt); 241 257 return false 242 258 }); … … 261 277 data: $(this).serialize(), 262 278 success: function(html){ 263 var $idlo = $(html).find('#idlastopt').text(); 264 console.debug($idlo); 279 var $idlo = $(html).find('#idlastopt').data('idlo'); 265 280 $('#opt select').append($('<option />').attr({'value':$idlo,'selected':'selected'}).text($optecour)); 266 281 $('.chzn-select').trigger("chosen:updated"); … … 285 300 286 301 <div id="prodvar" class="titrePage" data-product='{$mps_product|@json_encode}'> 302 <ul class="HelpActions"> 303 <li> 304 <a title="Aide" onclick="popuphelp(this.href); return false;" href="admin/popuphelp.php?page=cat_options"> 305 <img alt="(?)" src="admin/themes/clear/icon/help.png"> 306 </a> 307 </li> 308 </ul> 287 309 <h2>{'Products'|@translate}</h2> 288 310 </div> … … 345 367 <div id="add_option_prod" style="display:none"> 346 368 <div> 369 <span id="close_addoption" class="close_box_add"></span> 347 370 348 371 <form id="addopt_form" method="post" name="add_opt" action="">
Note: See TracChangeset
for help on using the changeset viewer.