ZenCart_Documentation  1.5.0
http://www.collinsharper.com
C:/xampp/htdocs/zen-cart/admin/includes/modules/document_product/collect_info.php
Go to the documentation of this file.
00001 <?php
00009 if (!defined('IS_ADMIN_FLAG')) {
00010   die('Illegal Access');
00011 }
00012     $parameters = array('products_name' => '',
00013                        'products_description' => '',
00014                        'products_url' => '',
00015                        'products_id' => '',
00016                        'products_quantity' => '',
00017                        'products_model' => '',
00018                        'products_image' => '',
00019                        'products_price' => '',
00020                        'products_virtual' => DEFAULT_DOCUMENT_PRODUCT_PRODUCTS_VIRTUAL,
00021                        'products_weight' => '',
00022                        'products_date_added' => '',
00023                        'products_last_modified' => '',
00024                        'products_date_available' => '',
00025                        'products_status' => '',
00026                        'products_tax_class_id' => DEFAULT_DOCUMENT_PRODUCT_TAX_CLASS_ID,
00027                        'manufacturers_id' => '',
00028                        'products_quantity_order_min' => '',
00029                        'products_quantity_order_units' => '',
00030                        'products_priced_by_attribute' => '',
00031                        'product_is_free' => '',
00032                        'product_is_call' => '',
00033                        'products_quantity_mixed' => '',
00034                        'product_is_always_free_shipping' => DEFAULT_DOCUMENT_PRODUCT_PRODUCTS_IS_ALWAYS_FREE_SHIPPING,
00035                        'products_qty_box_status' => PRODUCTS_QTY_BOX_STATUS,
00036                        'products_quantity_order_max' => '0',
00037                        'products_sort_order' => '0',
00038                        'products_discount_type' => '0',
00039                        'products_discount_type_from' => '0',
00040                        'products_price_sorter' => '0',
00041                        'master_categories_id' => ''
00042                        );
00043 
00044     $pInfo = new objectInfo($parameters);
00045 
00046     if (isset($_GET['pID']) && empty($_POST)) {
00047       $product = $db->Execute("select pd.products_name, pd.products_description, pd.products_url,
00048                                       p.products_id, p.products_quantity, p.products_model,
00049                                       p.products_image, p.products_price, p.products_virtual, p.products_weight,
00050                                       p.products_date_added, p.products_last_modified,
00051                                       date_format(p.products_date_available, '%Y-%m-%d') as
00052                                       products_date_available, p.products_status, p.products_tax_class_id,
00053                                       p.manufacturers_id,
00054                                       p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
00055                                       p.product_is_free, p.product_is_call, p.products_quantity_mixed,
00056                                       p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max,
00057                                       p.products_sort_order,
00058                                       p.products_discount_type, p.products_discount_type_from,
00059                                       p.products_price_sorter, p.master_categories_id
00060                               from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
00061                               where p.products_id = '" . (int)$_GET['pID'] . "'
00062                               and p.products_id = pd.products_id
00063                               and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'");
00064 
00065       $pInfo->objectInfo($product->fields);
00066     } elseif (zen_not_null($_POST)) {
00067       $pInfo->objectInfo($_POST);
00068       $products_name = $_POST['products_name'];
00069       $products_description = $_POST['products_description'];
00070       $products_url = $_POST['products_url'];
00071     }
00072 
00073     $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));
00074     $manufacturers = $db->Execute("select manufacturers_id, manufacturers_name
00075                                    from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
00076     while (!$manufacturers->EOF) {
00077       $manufacturers_array[] = array('id' => $manufacturers->fields['manufacturers_id'],
00078                                      'text' => $manufacturers->fields['manufacturers_name']);
00079       $manufacturers->MoveNext();
00080     }
00081 
00082     $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
00083     $tax_class = $db->Execute("select tax_class_id, tax_class_title
00084                                      from " . TABLE_TAX_CLASS . " order by tax_class_title");
00085     while (!$tax_class->EOF) {
00086       $tax_class_array[] = array('id' => $tax_class->fields['tax_class_id'],
00087                                  'text' => $tax_class->fields['tax_class_title']);
00088       $tax_class->MoveNext();
00089     }
00090 
00091     $languages = zen_get_languages();
00092 
00093     if (!isset($pInfo->products_status)) $pInfo->products_status = '1';
00094     switch ($pInfo->products_status) {
00095       case '0': $in_status = false; $out_status = true; break;
00096       case '1':
00097       default: $in_status = true; $out_status = false;
00098         break;
00099     }
00100 // set to out of stock if categories_status is off and new product or existing products_status is off
00101     if (zen_get_categories_status($current_category_id) == '0' and $pInfo->products_status != '1') {
00102       $pInfo->products_status = 0;
00103       $in_status = false;
00104       $out_status = true;
00105     }
00106 
00107 // Virtual Products
00108     if (!isset($pInfo->products_virtual)) $pInfo->products_virtual = DEFAULT_DOCUMENT_PRODUCT_PRODUCTS_VIRTUAL;
00109     switch ($pInfo->products_virtual) {
00110       case '0': $is_virtual = false; $not_virtual = true; break;
00111       case '1': $is_virtual = true; $not_virtual = false; break;
00112       default: $is_virtual = false; $not_virtual = true;
00113     }
00114 // Always Free Shipping
00115     if (!isset($pInfo->product_is_always_free_shipping)) $pInfo->product_is_always_free_shipping = DEFAULT_DOCUMENT_PRODUCT_PRODUCTS_IS_ALWAYS_FREE_SHIPPING;
00116     switch ($pInfo->product_is_always_free_shipping) {
00117       case '0': $is_product_is_always_free_shipping = false; $not_product_is_always_free_shipping = true; $special_product_is_always_free_shipping = false; break;
00118       case '1': $is_product_is_always_free_shipping = true; $not_product_is_always_free_shipping = false; $special_product_is_always_free_shipping = false; break;
00119       case '2': $is_product_is_always_free_shipping = false; $not_product_is_always_free_shipping = false; $special_product_is_always_free_shipping = true; break;
00120       default: $is_product_is_always_free_shipping = false; $not_product_is_always_free_shipping = true; $special_product_is_always_free_shipping = false; break;
00121     }
00122 // products_qty_box_status shows
00123     if (!isset($pInfo->products_qty_box_status)) $pInfo->products_qty_box_status = PRODUCTS_QTY_BOX_STATUS;
00124     switch ($pInfo->products_qty_box_status) {
00125       case '0': $is_products_qty_box_status = false; $not_products_qty_box_status = true; break;
00126       case '1': $is_products_qty_box_status = true; $not_products_qty_box_status = false; break;
00127       default: $is_products_qty_box_status = true; $not_products_qty_box_status = false;
00128     }
00129 // Product is Priced by Attributes
00130     if (!isset($pInfo->products_priced_by_attribute)) $pInfo->products_priced_by_attribute = '0';
00131     switch ($pInfo->products_priced_by_attribute) {
00132       case '0': $is_products_priced_by_attribute = false; $not_products_priced_by_attribute = true; break;
00133       case '1': $is_products_priced_by_attribute = true; $not_products_priced_by_attribute = false; break;
00134       default: $is_products_priced_by_attribute = false; $not_products_priced_by_attribute = true;
00135     }
00136 // Product is Free
00137     if (!isset($pInfo->product_is_free)) $pInfo->product_is_free = '0';
00138     switch ($pInfo->product_is_free) {
00139       case '0': $in_product_is_free = false; $out_product_is_free = true; break;
00140       case '1': $in_product_is_free = true; $out_product_is_free = false; break;
00141       default: $in_product_is_free = false; $out_product_is_free = true;
00142     }
00143 // Product is Call for price
00144     if (!isset($pInfo->product_is_call)) $pInfo->product_is_call = '0';
00145     switch ($pInfo->product_is_call) {
00146       case '0': $in_product_is_call = false; $out_product_is_call = true; break;
00147       case '1': $in_product_is_call = true; $out_product_is_call = false; break;
00148       default: $in_product_is_call = false; $out_product_is_call = true;
00149     }
00150 // Products can be purchased with mixed attributes retail
00151     if (!isset($pInfo->products_quantity_mixed)) $pInfo->products_quantity_mixed = '0';
00152     switch ($pInfo->products_quantity_mixed) {
00153       case '0': $in_products_quantity_mixed = false; $out_products_quantity_mixed = true; break;
00154       case '1': $in_products_quantity_mixed = true; $out_products_quantity_mixed = false; break;
00155       default: $in_products_quantity_mixed = true; $out_products_quantity_mixed = false;
00156     }
00157 
00158 // set image overwrite
00159   $on_overwrite = true;
00160   $off_overwrite = false;
00161 // set image delete
00162   $on_image_delete = false;
00163   $off_image_delete = true;
00164 ?>
00165 <link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
00166 <script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
00167 <script language="javascript"><!--
00168   var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);
00169 //--></script>
00170 <script language="javascript"><!--
00171 var tax_rates = new Array();
00172 <?php
00173     for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) {
00174       if ($tax_class_array[$i]['id'] > 0) {
00175         echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . zen_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n";
00176       }
00177     }
00178 ?>
00179 
00180 function doRound(x, places) {
00181   return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
00182 }
00183 
00184 function getTaxRate() {
00185   var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex;
00186   var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value;
00187 
00188   if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {
00189     return tax_rates[parameterVal];
00190   } else {
00191     return 0;
00192   }
00193 }
00194 
00195 function updateGross() {
00196   var taxRate = getTaxRate();
00197   var grossValue = document.forms["new_product"].products_price.value;
00198 
00199   if (taxRate > 0) {
00200     grossValue = grossValue * ((taxRate / 100) + 1);
00201   }
00202 
00203   document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);
00204 }
00205 
00206 function updateNet() {
00207   var taxRate = getTaxRate();
00208   var netValue = document.forms["new_product"].products_price_gross.value;
00209 
00210   if (taxRate > 0) {
00211     netValue = netValue / ((taxRate / 100) + 1);
00212   }
00213 
00214   document.forms["new_product"].products_price.value = doRound(netValue, 4);
00215 }
00216 //--></script>
00217     <?php
00218 //  echo $type_admin_handler;
00219 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'] : '') . ( (isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : '') . ( (isset($_POST['search']) && !empty($_POST['search']) && empty($_GET['search'])) ? '&search=' . $_POST['search'] : ''), 'post', 'enctype="multipart/form-data"');
00220     ?>
00221     <table border="0" width="100%" cellspacing="0" cellpadding="2">
00222       <tr>
00223         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
00224           <tr>
00225             <td class="pageHeading"><?php echo sprintf(TEXT_NEW_PRODUCT, zen_output_generated_category_path($current_category_id)); ?></td>
00226             <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
00227           </tr>
00228         </table></td>
00229       </tr>
00230       <tr>
00231         <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00232       </tr>
00233       <tr>
00234         <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) . '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . ( (isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : '') . ( (isset($_POST['search']) && !empty($_POST['search']) && empty($_GET['search'])) ? '&search=' . $_POST['search'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
00235       </tr>
00236       <tr>
00237         <td><table border="0" cellspacing="0" cellpadding="2">
00238 <?php
00239 // show when product is linked
00240 if (zen_get_product_is_linked($_GET['pID']) == 'true' and $_GET['pID'] > 0) {
00241 ?>
00242           <tr>
00243             <td class="main"><?php echo TEXT_MASTER_CATEGORIES_ID; ?></td>
00244             <td class="main">
00245               <?php
00246                 // echo zen_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id);
00247                 echo zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_LINKED) . '&nbsp;&nbsp;';
00248                 echo zen_draw_pull_down_menu('master_category', zen_get_master_categories_pulldown($_GET['pID']), $pInfo->master_categories_id); ?>
00249             </td>
00250           </tr>
00251 <?php } else { ?>
00252           <tr>
00253             <td class="main"><?php echo TEXT_MASTER_CATEGORIES_ID; ?></td>
00254             <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'])); ?></td>
00255           </tr>
00256 <?php } ?>
00257           <tr>
00258             <td colspan="2" class="main"><?php echo TEXT_INFO_MASTER_CATEGORIES_ID; ?></td>
00259           </tr>
00260           <tr>
00261             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '100%', '2'); ?></td>
00262           </tr>
00263 <?php
00264 // hidden fields not changeable on products page
00265 echo zen_draw_hidden_field('master_categories_id', $pInfo->master_categories_id);
00266 echo zen_draw_hidden_field('products_discount_type', $pInfo->products_discount_type);
00267 echo zen_draw_hidden_field('products_discount_type_from', $pInfo->products_discount_type_from);
00268 echo zen_draw_hidden_field('products_price_sorter', $pInfo->products_price_sorter);
00269 ?>
00270           <tr>
00271             <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>
00272           </tr>
00273           <tr>
00274             <td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td>
00275             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_radio_field('products_status', '1', $in_status) . '&nbsp;' . TEXT_PRODUCT_AVAILABLE . '&nbsp;' . zen_draw_radio_field('products_status', '0', $out_status) . '&nbsp;' . TEXT_PRODUCT_NOT_AVAILABLE; ?></td>
00276           </tr>
00277           <tr>
00278             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00279           </tr>
00280           <tr>
00281             <td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br /><small>(YYYY-MM-DD)</small></td>
00282             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'; ?><script language="javascript">dateAvailable.writeControl(); dateAvailable.dateFormat="yyyy-MM-dd";</script></td>
00283           </tr>
00284           <tr>
00285             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00286           </tr>
00287           <tr>
00288             <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>
00289             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td>
00290           </tr>
00291           <tr>
00292             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00293           </tr>
00294 <?php
00295     for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
00296 ?>
00297           <tr>
00298             <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td>
00299             <td class="main"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . zen_draw_input_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : zen_get_products_name($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_PRODUCTS_DESCRIPTION, 'products_name')); ?></td>
00300           </tr>
00301 <?php
00302     }
00303 ?>
00304 
00305           <tr>
00306             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00307           </tr>
00308 
00309           <tr>
00310             <td class="main"><?php echo TEXT_PRODUCT_IS_FREE; ?></td>
00311             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_radio_field('product_is_free', '1', ($in_product_is_free==1)) . '&nbsp;' . TEXT_YES . '&nbsp;&nbsp;' . zen_draw_radio_field('product_is_free', '0', ($in_product_is_free==0)) . '&nbsp;' . TEXT_NO . ' ' . ($pInfo->product_is_free == 1 ? '<span class="errorText">' . TEXT_PRODUCTS_IS_FREE_EDIT . '</span>' : ''); ?></td>
00312           </tr>
00313           <tr>
00314             <td class="main"><?php echo TEXT_PRODUCT_IS_CALL; ?></td>
00315             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_radio_field('product_is_call', '1', ($in_product_is_call==1)) . '&nbsp;' . TEXT_YES . '&nbsp;&nbsp;' . zen_draw_radio_field('product_is_call', '0', ($in_product_is_call==0)) . '&nbsp;' . TEXT_NO . ' ' . ($pInfo->product_is_call == 1 ? '<span class="errorText">' . TEXT_PRODUCTS_IS_CALL_EDIT . '</span>' : ''); ?></td>
00316           </tr>
00317 
00318           <tr>
00319             <td class="main"><?php echo TEXT_PRODUCTS_PRICED_BY_ATTRIBUTES; ?></td>
00320             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_radio_field('products_priced_by_attribute', '1', $is_products_priced_by_attribute) . '&nbsp;' . TEXT_PRODUCT_IS_PRICED_BY_ATTRIBUTE . '&nbsp;&nbsp;' . zen_draw_radio_field('products_priced_by_attribute', '0', $not_products_priced_by_attribute) . '&nbsp;' . TEXT_PRODUCT_NOT_PRICED_BY_ATTRIBUTE . ' ' . ($pInfo->products_priced_by_attribute == 1 ? '<span class="errorText">' . TEXT_PRODUCTS_PRICED_BY_ATTRIBUTES_EDIT . '</span>' : ''); ?></td>
00321           </tr>
00322 
00323           <tr>
00324             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00325           </tr>
00326           <tr bgcolor="#ebebff">
00327             <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>
00328             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>
00329           </tr>
00330           <tr bgcolor="#ebebff">
00331             <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
00332             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td>
00333           </tr>
00334           <tr bgcolor="#ebebff">
00335             <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>
00336             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet()"'); ?></td>
00337           </tr>
00338           <tr>
00339             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00340           </tr>
00341           <tr>
00342             <td class="main"><?php echo TEXT_PRODUCTS_VIRTUAL; ?></td>
00343             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_radio_field('products_virtual', '1', $is_virtual) . '&nbsp;' . TEXT_PRODUCT_IS_VIRTUAL . '&nbsp;' . zen_draw_radio_field('products_virtual', '0', $not_virtual) . '&nbsp;' . TEXT_PRODUCT_NOT_VIRTUAL . ' ' . ($pInfo->products_virtual == 1 ? '<br /><span class="errorText">' . TEXT_VIRTUAL_EDIT . '</span>' : ''); ?></td>
00344           </tr>
00345 
00346           <tr>
00347             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00348           </tr>
00349           <tr>
00350             <td class="main" valign="top"><?php echo TEXT_PRODUCTS_IS_ALWAYS_FREE_SHIPPING; ?></td>
00351             <td class="main" valign="top"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_radio_field('product_is_always_free_shipping', '1', $is_product_is_always_free_shipping) . '&nbsp;' . TEXT_PRODUCT_IS_ALWAYS_FREE_SHIPPING . '&nbsp;' . zen_draw_radio_field('product_is_always_free_shipping', '0', $not_product_is_always_free_shipping) . '&nbsp;' . TEXT_PRODUCT_NOT_ALWAYS_FREE_SHIPPING  . '<br />' . zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_radio_field('product_is_always_free_shipping', '2', $special_product_is_always_free_shipping) . '&nbsp;' . TEXT_PRODUCT_SPECIAL_ALWAYS_FREE_SHIPPING . ' ' . ($pInfo->product_is_always_free_shipping == 1 ? '<br /><span class="errorText">' . TEXT_FREE_SHIPPING_EDIT . '</span>' : ''); ?></td>
00352           </tr>
00353 
00354           <tr>
00355             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00356           </tr>
00357           <tr>
00358             <td class="main"><?php echo TEXT_PRODUCTS_QTY_BOX_STATUS; ?></td>
00359             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_radio_field('products_qty_box_status', '1', $is_products_qty_box_status) . '&nbsp;' . TEXT_PRODUCTS_QTY_BOX_STATUS_ON . '&nbsp;' . zen_draw_radio_field('products_qty_box_status', '0', $not_products_qty_box_status) . '&nbsp;' . TEXT_PRODUCTS_QTY_BOX_STATUS_OFF . ' ' . ($pInfo->products_qty_box_status == 0 ? '<br /><span class="errorText">' . TEXT_PRODUCTS_QTY_BOX_STATUS_EDIT . '</span>' : ''); ?></td>
00360           </tr>
00361 
00362           <tr>
00363             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00364           </tr>
00365 
00366           <tr>
00367             <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY_MIN_RETAIL; ?></td>
00368             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_quantity_order_min', ($pInfo->products_quantity_order_min == 0 ? 1 : $pInfo->products_quantity_order_min)); ?></td>
00369           </tr>
00370 
00371           <tr>
00372             <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY_MAX_RETAIL; ?></td>
00373             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_quantity_order_max', $pInfo->products_quantity_order_max); ?>&nbsp;&nbsp;<?php echo TEXT_PRODUCTS_QUANTITY_MAX_RETAIL_EDIT; ?></td>
00374           </tr>
00375 
00376           <tr>
00377             <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY_UNITS_RETAIL; ?></td>
00378             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_quantity_order_units', ($pInfo->products_quantity_order_units == 0 ? 1 : $pInfo->products_quantity_order_units)); ?></td>
00379           </tr>
00380 
00381           <tr>
00382             <td class="main"><?php echo TEXT_PRODUCTS_MIXED; ?></td>
00383             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_radio_field('products_quantity_mixed', '1', $in_products_quantity_mixed) . '&nbsp;' . TEXT_YES . '&nbsp;&nbsp;' . zen_draw_radio_field('products_quantity_mixed', '0', $out_products_quantity_mixed) . '&nbsp;' . TEXT_NO; ?></td>
00384           </tr>
00385 
00386           <tr>
00387             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00388           </tr>
00389 
00390 <script language="javascript"><!--
00391 updateGross();
00392 //--></script>
00393 <?php
00394     for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
00395 ?>
00396           <tr>
00397             <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
00398             <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
00399               <tr>
00400                 <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']); ?>&nbsp;</td>
00401                 <td class="main" width="100%"><?php echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', htmlspecialchars((isset($products_description[$languages[$i]['id']])) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE)); //,'id="'.'products_description' . $languages[$i]['id'] . '"'); ?></td>
00402               </tr>
00403             </table></td>
00404           </tr>
00405 <?php
00406     }
00407 ?>
00408           <tr>
00409             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00410           </tr>
00411           <tr>
00412             <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td>
00413             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td>
00414           </tr>
00415           <tr>
00416             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00417           </tr>
00418           <tr>
00419             <td class="main"><?php echo TEXT_PRODUCTS_MODEL; ?></td>
00420             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_model', htmlspecialchars(stripslashes($pInfo->products_model), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_PRODUCTS, 'products_model')); ?></td>
00421           </tr>
00422           <tr>
00423             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00424           </tr>
00425 <?php
00426   $dir = @dir(DIR_FS_CATALOG_IMAGES);
00427   $dir_info[] = array('id' => '', 'text' => "Main Directory");
00428   while ($file = $dir->read()) {
00429     if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
00430       $dir_info[] = array('id' => $file . '/', 'text' => $file);
00431     }
00432   }
00433   $dir->close();
00434   sort($dir_info);
00435 
00436   $default_directory = substr( $pInfo->products_image, 0,strpos( $pInfo->products_image, '/')+1);
00437 ?>
00438 
00439           <tr>
00440             <td colspan="2"><?php echo zen_draw_separator('pixel_black.gif', '100%', '3'); ?></td>
00441           </tr>
00442 
00443           <tr>
00444             <td class="main" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
00445               <tr>
00446                 <td class="main"><?php echo TEXT_PRODUCTS_IMAGE; ?></td>
00447                 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_file_field('products_image') . '&nbsp;' . ($pInfo->products_image !='' ? TEXT_IMAGE_CURRENT . $pInfo->products_image : TEXT_IMAGE_CURRENT . '&nbsp;' . NONE) . zen_draw_hidden_field('products_previous_image', $pInfo->products_image); ?></td>
00448                 <td valign = "center" class="main"><?php echo TEXT_PRODUCTS_IMAGE_DIR; ?>&nbsp;<?php echo zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory); ?></td>
00449                                                   </tr>
00450               <tr>
00451                 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15'); ?></td>
00452                 <td class="main" valign="top"><?php echo TEXT_IMAGES_DELETE . ' ' . zen_draw_radio_field('image_delete', '0', $off_image_delete) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('image_delete', '1', $on_image_delete) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
00453                           </tr>
00454 
00455               <tr>
00456                 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15'); ?></td>
00457                 <td colspan="3" class="main" valign="top"><?php echo TEXT_IMAGES_OVERWRITE  . ' ' . zen_draw_radio_field('overwrite', '0', $off_overwrite) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('overwrite', '1', $on_overwrite) . '&nbsp;' . TABLE_HEADING_YES; ?>
00458                   <?php echo '<br />' . TEXT_PRODUCTS_IMAGE_MANUAL . '&nbsp;' . zen_draw_input_field('products_image_manual'); ?></td>
00459               </tr>
00460             </table></td>
00461           </tr>
00462 
00463           <tr>
00464             <td colspan="2"><?php echo zen_draw_separator('pixel_black.gif', '100%', '3'); ?></td>
00465           </tr>
00466 
00467 <?php
00468     for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
00469 ?>
00470           <tr>
00471             <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_URL . '<br /><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?></td>
00472             <td class="main"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . zen_draw_input_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(isset($products_url[$languages[$i]['id']]) ? $products_url[$languages[$i]['id']] : zen_get_products_url($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_PRODUCTS_DESCRIPTION, 'products_url')); ?></td>
00473           </tr>
00474 <?php
00475     }
00476 ?>
00477           <tr>
00478             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00479           </tr>
00480           <tr>
00481             <td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td>
00482             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_weight', $pInfo->products_weight); ?></td>
00483           </tr>
00484           <tr>
00485             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00486           </tr>
00487           <tr>
00488             <td class="main"><?php echo TEXT_PRODUCTS_SORT_ORDER; ?></td>
00489             <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_sort_order', $pInfo->products_sort_order); ?></td>
00490           </tr>
00491         </table></td>
00492       </tr>
00493       <tr>
00494         <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
00495       </tr>
00496       <tr>
00497         <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'))) . ( (isset($_GET['search']) && !empty($_GET['search'])) ? zen_draw_hidden_field('search', $_GET['search']) : '') . ( (isset($_POST['search']) && !empty($_POST['search']) && empty($_GET['search'])) ? zen_draw_hidden_field('search', $_POST['search']) : '') . zen_image_submit('button_preview.gif', IMAGE_PREVIEW) . '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . ( (isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : '') . ( (isset($_POST['search']) && !empty($_POST['search']) && empty($_GET['search'])) ? '&search=' . $_POST['search'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
00498       </tr>
00499     </table></form>
 All Data Structures Namespaces Files Functions Variables Enumerations