[ Index ] |
|
Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1 |
1 <?php 2 /** 3 * @package admin 4 * @copyright Copyright 2003-2006 Zen Cart Development Team 5 * @copyright Portions Copyright 2003 osCommerce 6 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 7 * @version $Id: collect_info.php 4804 2006-10-21 16:19:59Z ajeh $ 8 */ 9 if (!defined('IS_ADMIN_FLAG')) { 10 die('Illegal Access'); 11 } 12 $parameters = array('products_name' => '', 13 'products_description' => '', 14 'products_url' => '', 15 'products_id' => '', 16 'products_quantity' => '', 17 'products_model' => '', 18 'products_image' => '', 19 'products_price' => '', 20 'products_virtual' => DEFAULT_PRODUCT_PRODUCTS_VIRTUAL, 21 'products_weight' => '', 22 'products_date_added' => '', 23 'products_last_modified' => '', 24 'products_date_available' => '', 25 'products_status' => '', 26 'products_tax_class_id' => DEFAULT_PRODUCT_TAX_CLASS_ID, 27 'manufacturers_id' => '', 28 'products_quantity_order_min' => '', 29 'products_quantity_order_units' => '', 30 'products_priced_by_attribute' => '', 31 'product_is_free' => '', 32 'product_is_call' => '', 33 'products_quantity_mixed' => '', 34 'product_is_always_free_shipping' => DEFAULT_PRODUCT_PRODUCTS_IS_ALWAYS_FREE_SHIPPING, 35 'products_qty_box_status' => PRODUCTS_QTY_BOX_STATUS, 36 'products_quantity_order_max' => '0', 37 'products_sort_order' => '0', 38 'products_discount_type' => '0', 39 'products_discount_type_from' => '0', 40 'products_price_sorter' => '0', 41 'master_categories_id' => '' 42 ); 43 44 $pInfo = new objectInfo($parameters); 45 46 if (isset($_GET['pID']) && empty($_POST)) { 47 $product = $db->Execute("select pd.products_name, pd.products_description, pd.products_url, 48 p.products_id, p.products_quantity, p.products_model, 49 p.products_image, p.products_price, p.products_virtual, p.products_weight, 50 p.products_date_added, p.products_last_modified, 51 date_format(p.products_date_available, '%Y-%m-%d') as 52 products_date_available, p.products_status, p.products_tax_class_id, 53 p.manufacturers_id, 54 p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute, 55 p.product_is_free, p.product_is_call, p.products_quantity_mixed, 56 p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max, 57 p.products_sort_order, 58 p.products_discount_type, p.products_discount_type_from, 59 p.products_price_sorter, p.master_categories_id 60 from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd 61 where p.products_id = '" . (int)$_GET['pID'] . "' 62 and p.products_id = pd.products_id 63 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'"); 64 65 $pInfo->objectInfo($product->fields); 66 } elseif (zen_not_null($_POST)) { 67 $pInfo->objectInfo($_POST); 68 $products_name = $_POST['products_name']; 69 $products_description = $_POST['products_description']; 70 $products_url = $_POST['products_url']; 71 } 72 73 $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE)); 74 $manufacturers = $db->Execute("select manufacturers_id, manufacturers_name 75 from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); 76 while (!$manufacturers->EOF) { 77 $manufacturers_array[] = array('id' => $manufacturers->fields['manufacturers_id'], 78 'text' => $manufacturers->fields['manufacturers_name']); 79 $manufacturers->MoveNext(); 80 } 81 82 $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE)); 83 $tax_class = $db->Execute("select tax_class_id, tax_class_title 84 from " . TABLE_TAX_CLASS . " order by tax_class_title"); 85 while (!$tax_class->EOF) { 86 $tax_class_array[] = array('id' => $tax_class->fields['tax_class_id'], 87 'text' => $tax_class->fields['tax_class_title']); 88 $tax_class->MoveNext(); 89 } 90 91 $languages = zen_get_languages(); 92 93 if (!isset($pInfo->products_status)) $pInfo->products_status = '1'; 94 switch ($pInfo->products_status) { 95 case '0': $in_status = false; $out_status = true; break; 96 case '1': 97 default: $in_status = true; $out_status = false; 98 break; 99 } 100 // set to out of stock if categories_status is off and new product or existing products_status is off 101 if (zen_get_categories_status($current_category_id) == '0' and $pInfo->products_status != '1') { 102 $pInfo->products_status = 0; 103 $in_status = false; 104 $out_status = true; 105 } 106 107 // Virtual Products 108 if (!isset($pInfo->products_virtual)) $pInfo->products_virtual = PRODUCTS_VIRTUAL_DEFAULT; 109 switch ($pInfo->products_virtual) { 110 case '0': $is_virtual = false; $not_virtual = true; break; 111 case '1': $is_virtual = true; $not_virtual = false; break; 112 default: $is_virtual = false; $not_virtual = true; 113 } 114 // Always Free Shipping 115 if (!isset($pInfo->product_is_always_free_shipping)) $pInfo->product_is_always_free_shipping = DEFAULT_PRODUCT_PRODUCTS_IS_ALWAYS_FREE_SHIPPING; 116 switch ($pInfo->product_is_always_free_shipping) { 117 case '0': $is_product_is_always_free_shipping = false; $not_product_is_always_free_shipping = true; $special_product_is_always_free_shipping = false; break; 118 case '1': $is_product_is_always_free_shipping = true; $not_product_is_always_free_shipping = false; $special_product_is_always_free_shipping = false; break; 119 case '2': $is_product_is_always_free_shipping = false; $not_product_is_always_free_shipping = false; $special_product_is_always_free_shipping = true; break; 120 default: $is_product_is_always_free_shipping = false; $not_product_is_always_free_shipping = true; $special_product_is_always_free_shipping = false; 121 } 122 // products_qty_box_status shows 123 if (!isset($pInfo->products_qty_box_status)) $pInfo->products_qty_box_status = PRODUCTS_QTY_BOX_STATUS; 124 switch ($pInfo->products_qty_box_status) { 125 case '0': $is_products_qty_box_status = false; $not_products_qty_box_status = true; break; 126 case '1': $is_products_qty_box_status = true; $not_products_qty_box_status = false; break; 127 default: $is_products_qty_box_status = true; $not_products_qty_box_status = false; 128 } 129 // Product is Priced by Attributes 130 if (!isset($pInfo->products_priced_by_attribute)) $pInfo->products_priced_by_attribute = '0'; 131 switch ($pInfo->products_priced_by_attribute) { 132 case '0': $is_products_priced_by_attribute = false; $not_products_priced_by_attribute = true; break; 133 case '1': $is_products_priced_by_attribute = true; $not_products_priced_by_attribute = false; break; 134 default: $is_products_priced_by_attribute = false; $not_products_priced_by_attribute = true; 135 } 136 // Product is Free 137 if (!isset($pInfo->product_is_free)) $pInfo->product_is_free = '0'; 138 switch ($pInfo->product_is_free) { 139 case '0': $in_product_is_free = false; $out_product_is_free = true; break; 140 case '1': $in_product_is_free = true; $out_product_is_free = false; break; 141 default: $in_product_is_free = false; $out_product_is_free = true; 142 } 143 // Product is Call for price 144 if (!isset($pInfo->product_is_call)) $pInfo->product_is_call = '0'; 145 switch ($pInfo->product_is_call) { 146 case '0': $in_product_is_call = false; $out_product_is_call = true; break; 147 case '1': $in_product_is_call = true; $out_product_is_call = false; break; 148 default: $in_product_is_call = false; $out_product_is_call = true; 149 } 150 // Products can be purchased with mixed attributes retail 151 if (!isset($pInfo->products_quantity_mixed)) $pInfo->products_quantity_mixed = '0'; 152 switch ($pInfo->products_quantity_mixed) { 153 case '0': $in_products_quantity_mixed = false; $out_products_quantity_mixed = true; break; 154 case '1': $in_products_quantity_mixed = true; $out_products_quantity_mixed = false; break; 155 default: $in_products_quantity_mixed = true; $out_products_quantity_mixed = false; 156 } 157 158 // set image overwrite 159 $on_overwrite = true; 160 $off_overwrite = false; 161 // set image delete 162 $on_image_delete = false; 163 $off_image_delete = true; 164 ?> 165 <link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css"> 166 <script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script> 167 <script language="javascript"><!-- 168 var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE); 169 //--></script> 170 <script language="javascript"><!-- 171 var tax_rates = new Array(); 172 <?php 173 for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) { 174 if ($tax_class_array[$i]['id'] > 0) { 175 echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . zen_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n"; 176 } 177 } 178 ?> 179 180 function doRound(x, places) { 181 return Math.round(x * Math.pow(10, places)) / Math.pow(10, places); 182 } 183 184 function getTaxRate() { 185 var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex; 186 var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value; 187 188 if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) { 189 return tax_rates[parameterVal]; 190 } else { 191 return 0; 192 } 193 } 194 195 function updateGross() { 196 var taxRate = getTaxRate(); 197 var grossValue = document.forms["new_product"].products_price.value; 198 199 if (taxRate > 0) { 200 grossValue = grossValue * ((taxRate / 100) + 1); 201 } 202 203 document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4); 204 } 205 206 function updateNet() { 207 var taxRate = getTaxRate(); 208 var netValue = document.forms["new_product"].products_price_gross.value; 209 210 if (taxRate > 0) { 211 netValue = netValue / ((taxRate / 100) + 1); 212 } 213 214 document.forms["new_product"].products_price.value = doRound(netValue, 4); 215 } 216 //--></script> 217 <?php 218 // echo $type_admin_handler; 219 echo zen_draw_form('new_product', $type_admin_handler , 'cPath=' . $cPath . (isset($_GET['product_type']) ? '&product_type=' . $_GET['product_type'] : '') . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=new_product_preview' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'post', 'enctype="multipart/form-data"'); ?> 220 221 <table border="0" width="100%" cellspacing="0" cellpadding="2"> 222 <tr> 223 <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> 224 <tr> 225 <td class="pageHeading"><?php echo sprintf(TEXT_NEW_PRODUCT, zen_output_generated_category_path($current_category_id)); ?></td> 226 <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> 227 </tr> 228 </table></td> 229 </tr> 230 <tr> 231 <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 232 </tr> 233 <tr> 234 <td class="main" align="right"><?php echo zen_draw_hidden_field('products_date_added', (zen_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . zen_image_submit('button_preview.gif', IMAGE_PREVIEW) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td> 235 </tr> 236 <tr> 237 <td><table border="0" cellspacing="0" cellpadding="2"> 238 <?php 239 // show when product is linked 240 if (zen_get_product_is_linked($_GET['pID']) == 'true' and $_GET['pID'] > 0) { 241 ?> 242 <tr> 243 <td class="main"><?php echo TEXT_MASTER_CATEGORIES_ID; ?></td> 244 <td class="main"> 245 <?php 246 // echo zen_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id); 247 echo zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_LINKED) . ' '; 248 echo zen_draw_pull_down_menu('master_category', zen_get_master_categories_pulldown($_GET['pID']), $pInfo->master_categories_id); ?> 249 </td> 250 </tr> 251 <?php } else { ?> 252 <tr> 253 <td class="main"><?php echo TEXT_MASTER_CATEGORIES_ID; ?></td> 254 <td class="main"><?php echo TEXT_INFO_ID . ($_GET['pID'] > 0 ? $pInfo->master_categories_id . ' ' . zen_get_category_name($pInfo->master_categories_id, $_SESSION['languages_id']) : $current_category_id . ' ' . zen_get_category_name($current_category_id, $_SESSION['languages_id'])); ?> 255 </tr> 256 <?php } ?> 257 <tr> 258 <td colspan="2" class="main"><?php echo TEXT_INFO_MASTER_CATEGORIES_ID; ?></td> 259 </tr> 260 <tr> 261 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '100%', '2'); ?></td> 262 </tr> 263 <?php 264 // hidden fields not changeable on products page 265 echo zen_draw_hidden_field('master_categories_id', $pInfo->master_categories_id); 266 echo zen_draw_hidden_field('products_discount_type', $pInfo->products_discount_type); 267 echo zen_draw_hidden_field('products_discount_type_from', $pInfo->products_discount_type_from); 268 echo zen_draw_hidden_field('products_price_sorter', $pInfo->products_price_sorter); 269 ?> 270 <tr> 271 <td colspan="2" class="main" align="center"><?php echo (zen_get_categories_status($current_category_id) == '0' ? TEXT_CATEGORIES_STATUS_INFO_OFF : '') . ($out_status == true ? ' ' . TEXT_PRODUCTS_STATUS_INFO_OFF : ''); ?></td> 272 <tr> 273 <tr> 274 <td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td> 275 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('products_status', '1', $in_status) . ' ' . TEXT_PRODUCT_AVAILABLE . ' ' . zen_draw_radio_field('products_status', '0', $out_status) . ' ' . TEXT_PRODUCT_NOT_AVAILABLE; ?></td> 276 </tr> 277 <tr> 278 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 279 </tr> 280 <tr> 281 <td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br /><small>(YYYY-MM-DD)</small></td> 282 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' '; ?><script language="javascript">dateAvailable.writeControl(); dateAvailable.dateFormat="yyyy-MM-dd";</script></td> 283 </tr> 284 <tr> 285 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 286 </tr> 287 <tr> 288 <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td> 289 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td> 290 </tr> 291 <tr> 292 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 293 </tr> 294 <?php 295 for ($i=0, $n=sizeof($languages); $i<$n; $i++) { 296 ?> 297 <tr> 298 <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td> 299 <td class="main"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . zen_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : zen_get_products_name($pInfo->products_id, $languages[$i]['id'])), zen_set_field_length(TABLE_PRODUCTS_DESCRIPTION, 'products_name')); ?></td> 300 </tr> 301 <?php 302 } 303 ?> 304 305 <tr> 306 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 307 </tr> 308 309 <tr> 310 <td class="main"><?php echo TEXT_PRODUCT_IS_FREE; ?></td> 311 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('product_is_free', '1', ($in_product_is_free==1)) . ' ' . TEXT_YES . ' ' . zen_draw_radio_field('product_is_free', '0', ($in_product_is_free==0)) . ' ' . TEXT_NO . ' ' . ($pInfo->product_is_free == 1 ? '<span class="errorText">' . TEXT_PRODUCTS_IS_FREE_EDIT . '</span>' : ''); ?></td> 312 </tr> 313 <tr> 314 <td class="main"><?php echo TEXT_PRODUCT_IS_CALL; ?></td> 315 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('product_is_call', '1', ($in_product_is_call==1)) . ' ' . TEXT_YES . ' ' . zen_draw_radio_field('product_is_call', '0', ($in_product_is_call==0)) . ' ' . TEXT_NO . ' ' . ($pInfo->product_is_call == 1 ? '<span class="errorText">' . TEXT_PRODUCTS_IS_CALL_EDIT . '</span>' : ''); ?></td> 316 </tr> 317 318 <tr> 319 <td class="main"><?php echo TEXT_PRODUCTS_PRICED_BY_ATTRIBUTES; ?></td> 320 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('products_priced_by_attribute', '1', $is_products_priced_by_attribute) . ' ' . TEXT_PRODUCT_IS_PRICED_BY_ATTRIBUTE . ' ' . zen_draw_radio_field('products_priced_by_attribute', '0', $not_products_priced_by_attribute) . ' ' . TEXT_PRODUCT_NOT_PRICED_BY_ATTRIBUTE . ' ' . ($pInfo->products_priced_by_attribute == 1 ? '<span class="errorText">' . TEXT_PRODUCTS_PRICED_BY_ATTRIBUTES_EDIT . '</span>' : ''); ?></td> 321 </tr> 322 323 <tr> 324 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 325 </tr> 326 <tr bgcolor="#ebebff"> 327 <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td> 328 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td> 329 </tr> 330 <tr bgcolor="#ebebff"> 331 <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td> 332 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td> 333 </tr> 334 <tr bgcolor="#ebebff"> 335 <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td> 336 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet()"'); ?></td> 337 </tr> 338 <tr> 339 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 340 </tr> 341 <tr> 342 <td class="main"><?php echo TEXT_PRODUCTS_VIRTUAL; ?></td> 343 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('products_virtual', '1', $is_virtual) . ' ' . TEXT_PRODUCT_IS_VIRTUAL . ' ' . zen_draw_radio_field('products_virtual', '0', $not_virtual) . ' ' . TEXT_PRODUCT_NOT_VIRTUAL . ' ' . ($pInfo->products_virtual == 1 ? '<br /><span class="errorText">' . TEXT_VIRTUAL_EDIT . '</span>' : ''); ?></td> 344 </tr> 345 346 <tr> 347 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 348 </tr> 349 <tr> 350 <td class="main" valign="top"><?php echo TEXT_PRODUCTS_IS_ALWAYS_FREE_SHIPPING; ?></td> 351 <td class="main" valign="top"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('product_is_always_free_shipping', '1', $is_product_is_always_free_shipping) . ' ' . TEXT_PRODUCT_IS_ALWAYS_FREE_SHIPPING . ' ' . zen_draw_radio_field('product_is_always_free_shipping', '0', $not_product_is_always_free_shipping) . ' ' . TEXT_PRODUCT_NOT_ALWAYS_FREE_SHIPPING . '<br />' . zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('product_is_always_free_shipping', '2', $special_product_is_always_free_shipping) . ' ' . TEXT_PRODUCT_SPECIAL_ALWAYS_FREE_SHIPPING . ' ' . ($pInfo->product_is_always_free_shipping == 1 ? '<br /><span class="errorText">' . TEXT_FREE_SHIPPING_EDIT . '</span>' : ''); ?></td> 352 </tr> 353 354 <tr> 355 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 356 </tr> 357 <tr> 358 <td class="main"><?php echo TEXT_PRODUCTS_QTY_BOX_STATUS; ?></td> 359 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('products_qty_box_status', '1', $is_products_qty_box_status) . ' ' . TEXT_PRODUCTS_QTY_BOX_STATUS_ON . ' ' . zen_draw_radio_field('products_qty_box_status', '0', $not_products_qty_box_status) . ' ' . TEXT_PRODUCTS_QTY_BOX_STATUS_OFF . ' ' . ($pInfo->products_qty_box_status == 0 ? '<br /><span class="errorText">' . TEXT_PRODUCTS_QTY_BOX_STATUS_EDIT . '</span>' : ''); ?></td> 360 </tr> 361 362 <tr> 363 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 364 </tr> 365 366 <tr> 367 <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY_MIN_RETAIL; ?></td> 368 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_quantity_order_min', ($pInfo->products_quantity_order_min == 0 ? 1 : $pInfo->products_quantity_order_min)); ?></td> 369 </tr> 370 371 <tr> 372 <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY_MAX_RETAIL; ?></td> 373 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_quantity_order_max', $pInfo->products_quantity_order_max); ?> <?php echo TEXT_PRODUCTS_QUANTITY_MAX_RETAIL_EDIT; ?></td> 374 </tr> 375 376 <tr> 377 <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY_UNITS_RETAIL; ?></td> 378 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_quantity_order_units', ($pInfo->products_quantity_order_units == 0 ? 1 : $pInfo->products_quantity_order_units)); ?></td> 379 </tr> 380 381 <tr> 382 <td class="main"><?php echo TEXT_PRODUCTS_MIXED; ?></td> 383 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('products_quantity_mixed', '1', $in_products_quantity_mixed) . ' ' . TEXT_YES . ' ' . zen_draw_radio_field('products_quantity_mixed', '0', $out_products_quantity_mixed) . ' ' . TEXT_NO; ?></td> 384 </tr> 385 386 <tr> 387 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 388 </tr> 389 390 <script language="javascript"><!-- 391 updateGross(); 392 //--></script> 393 <?php 394 for ($i=0, $n=sizeof($languages); $i<$n; $i++) { 395 ?> 396 <tr> 397 <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td> 398 <td colspan="2"><table border="0" cellspacing="0" cellpadding="0"> 399 <tr> 400 <td class="main" width="25" valign="top"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td> 401 <td class="main" width="100%"> 402 <?php if ($_SESSION['html_editor_preference_status']=="FCKEDITOR") { 403 $oFCKeditor = new FCKeditor('products_description[' . $languages[$i]['id'] . ']') ; 404 $oFCKeditor->Value = (isset($products_description[$languages[$i]['id']])) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id']) ; 405 $oFCKeditor->Width = '99%' ; 406 $oFCKeditor->Height = '350' ; 407 // $oFCKeditor->Config['ToolbarLocation'] = 'Out:xToolbar' ; 408 // $oFCKeditor->Create() ; 409 $output = $oFCKeditor->CreateHtml() ; echo $output; 410 } else { // using HTMLAREA or just raw "source" 411 412 echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', (isset($products_description[$languages[$i]['id']])) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id'])); //,'id="'.'products_description' . $languages[$i]['id'] . '"'); 413 } ?> 414 </td> 415 </tr> 416 </table></td> 417 </tr> 418 <?php 419 } 420 ?> 421 <tr> 422 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 423 </tr> 424 <tr> 425 <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td> 426 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td> 427 </tr> 428 <tr> 429 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 430 </tr> 431 <tr> 432 <td class="main"><?php echo TEXT_PRODUCTS_MODEL; ?></td> 433 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_model', $pInfo->products_model, zen_set_field_length(TABLE_PRODUCTS, 'products_model')); ?></td> 434 </tr> 435 <tr> 436 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 437 </tr> 438 <?php 439 $dir = @dir(DIR_FS_CATALOG_IMAGES); 440 $dir_info[] = array('id' => '', 'text' => "Main Directory"); 441 while ($file = $dir->read()) { 442 if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") { 443 $dir_info[] = array('id' => $file . '/', 'text' => $file); 444 } 445 } 446 sort($dir_info); 447 448 $default_directory = substr( $pInfo->products_image, 0,strpos( $pInfo->products_image, '/')+1); 449 ?> 450 451 <tr> 452 <td colspan="2"><?php echo zen_draw_separator('pixel_black.gif', '100%', '3'); ?></td> 453 </tr> 454 455 <tr> 456 <td class="main" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 457 <tr> 458 <td class="main"><?php echo TEXT_PRODUCTS_IMAGE; ?></td> 459 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_file_field('products_image') . ' ' . ($pInfo->products_image !='' ? TEXT_IMAGE_CURRENT . $pInfo->products_image : TEXT_IMAGE_CURRENT . ' ' . NONE) . zen_draw_hidden_field('products_previous_image', $pInfo->products_image); ?></td> 460 <td valign = "center" class="main"><?php echo TEXT_PRODUCTS_IMAGE_DIR; ?> <?php echo zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory); ?></td> 461 </tr> 462 <tr> 463 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15'); ?></td> 464 <td class="main" valign="top"><?php echo TEXT_IMAGES_DELETE . ' ' . zen_draw_radio_field('image_delete', '0', $off_image_delete) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('image_delete', '1', $on_image_delete) . ' ' . TABLE_HEADING_YES; ?></td> 465 </tr> 466 467 <tr> 468 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15'); ?></td> 469 <td colspan="3" class="main" valign="top"><?php echo TEXT_IMAGES_OVERWRITE . ' ' . zen_draw_radio_field('overwrite', '0', $off_overwrite) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('overwrite', '1', $on_overwrite) . ' ' . TABLE_HEADING_YES; ?> 470 <?php echo '<br />' . TEXT_PRODUCTS_IMAGE_MANUAL . ' ' . zen_draw_input_field('products_image_manual'); ?></td> 471 </tr> 472 </table></td> 473 </tr> 474 475 <tr> 476 <td colspan="2"><?php echo zen_draw_separator('pixel_black.gif', '100%', '3'); ?></td> 477 </tr> 478 479 <?php 480 for ($i=0, $n=sizeof($languages); $i<$n; $i++) { 481 ?> 482 <tr> 483 <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_URL . '<br /><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?></td> 484 <td class="main"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . zen_draw_input_field('products_url[' . $languages[$i]['id'] . ']', (isset($products_url[$languages[$i]['id']]) ? $products_url[$languages[$i]['id']] : zen_get_products_url($pInfo->products_id, $languages[$i]['id'])), zen_set_field_length(TABLE_PRODUCTS_DESCRIPTION, 'products_url')); ?></td> 485 </tr> 486 <?php 487 } 488 ?> 489 <tr> 490 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 491 </tr> 492 <tr> 493 <td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td> 494 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_weight', $pInfo->products_weight); ?></td> 495 </tr> 496 <tr> 497 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 498 </tr> 499 <tr> 500 <td class="main"><?php echo TEXT_PRODUCTS_SORT_ORDER; ?></td> 501 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_sort_order', $pInfo->products_sort_order); ?></td> 502 </tr> 503 </table></td> 504 </tr> 505 <tr> 506 <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 507 </tr> 508 <tr> 509 <td class="main" align="right"><?php echo zen_draw_hidden_field('products_date_added', (zen_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . zen_image_submit('button_preview.gif', IMAGE_PREVIEW) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td> 510 </tr> 511 </table></form>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 16:45:43 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |