|
ZenCart_Documentation
1.5.0
http://www.collinsharper.com
|
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_PRODUCT_MUSIC_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_PRODUCT_MUSIC_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_PRODUCT_MUSIC_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 pe.artists_id, pe.record_company_id,pe.music_genre_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 " . TABLE_PRODUCT_MUSIC_EXTRA . " pe 00062 where p.products_id = '" . (int)$_GET['pID'] . "' 00063 and p.products_id = pd.products_id and p.products_id = pe.products_id 00064 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'"); 00065 00066 $pInfo->objectInfo($product->fields); 00067 } elseif (zen_not_null($_POST)) { 00068 $pInfo->objectInfo($_POST); 00069 $products_name = $_POST['products_name']; 00070 $products_description = $_POST['products_description']; 00071 $products_url = $_POST['products_url']; 00072 } 00073 00074 $artists_array = array(array('id' => '', 'text' => TEXT_NONE)); 00075 $artists = $db->Execute("select artists_id, artists_name 00076 from " . TABLE_RECORD_ARTISTS . " order by artists_name"); 00077 while (!$artists->EOF) { 00078 $artists_array[] = array('id' => $artists->fields['artists_id'], 00079 'text' => $artists->fields['artists_name']); 00080 $artists->MoveNext(); 00081 } 00082 00083 $record_company_array = array(array('id' => '', 'text' => TEXT_NONE)); 00084 $record_company = $db->Execute("select record_company_id, record_company_name 00085 from " . TABLE_RECORD_COMPANY . " order by record_company_name"); 00086 while (!$record_company->EOF) { 00087 $record_company_array[] = array('id' => $record_company->fields['record_company_id'], 00088 'text' => $record_company->fields['record_company_name']); 00089 $record_company->MoveNext(); 00090 } 00091 00092 $music_genre_array = array(array('id' => '', 'text' => TEXT_NONE)); 00093 $music_genre = $db->Execute("select music_genre_id, music_genre_name 00094 from " . TABLE_MUSIC_GENRE . " order by music_genre_name"); 00095 while (!$music_genre->EOF) { 00096 $music_genre_array[] = array('id' => $music_genre->fields['music_genre_id'], 00097 'text' => $music_genre->fields['music_genre_name']); 00098 $music_genre->MoveNext(); 00099 } 00100 00101 $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE)); 00102 $tax_class = $db->Execute("select tax_class_id, tax_class_title 00103 from " . TABLE_TAX_CLASS . " order by tax_class_title"); 00104 while (!$tax_class->EOF) { 00105 $tax_class_array[] = array('id' => $tax_class->fields['tax_class_id'], 00106 'text' => $tax_class->fields['tax_class_title']); 00107 $tax_class->MoveNext(); 00108 } 00109 00110 $languages = zen_get_languages(); 00111 00112 if (!isset($pInfo->products_status)) $pInfo->products_status = '1'; 00113 switch ($pInfo->products_status) { 00114 case '0': $in_status = false; $out_status = true; break; 00115 case '1': 00116 default: $in_status = true; $out_status = false; 00117 break; 00118 } 00119 // set to out of stock if categories_status is off and new product or existing products_status is off 00120 if (zen_get_categories_status($current_category_id) == '0' and $pInfo->products_status != '1') { 00121 $pInfo->products_status = 0; 00122 $in_status = false; 00123 $out_status = true; 00124 } 00125 00126 // Virtual Products 00127 if (!isset($pInfo->products_virtual)) $pInfo->products_virtual = DEFAULT_PRODUCT_MUSIC_PRODUCTS_VIRTUAL; 00128 switch ($pInfo->products_virtual) { 00129 case '0': $is_virtual = false; $not_virtual = true; break; 00130 case '1': $is_virtual = true; $not_virtual = false; break; 00131 default: $is_virtual = false; $not_virtual = true; 00132 } 00133 // Always Free Shipping 00134 if (!isset($pInfo->product_is_always_free_shipping)) $pInfo->product_is_always_free_shipping = DEFAULT_PRODUCT_MUSIC_PRODUCTS_IS_ALWAYS_FREE_SHIPPING; 00135 switch ($pInfo->product_is_always_free_shipping) { 00136 case '0': $is_product_is_always_free_shipping = false; $not_product_is_always_free_shipping = true; $special_product_is_always_free_shipping = false; break; 00137 case '1': $is_product_is_always_free_shipping = true; $not_product_is_always_free_shipping = false; $special_product_is_always_free_shipping = false; break; 00138 case '2': $is_product_is_always_free_shipping = false; $not_product_is_always_free_shipping = false; $special_product_is_always_free_shipping = true; break; 00139 default: $is_product_is_always_free_shipping = false; $not_product_is_always_free_shipping = true;$special_product_is_always_free_shipping = false; break; 00140 } 00141 // products_qty_box_status shows 00142 if (!isset($pInfo->products_qty_box_status)) $pInfo->products_qty_box_status = PRODUCTS_QTY_BOX_STATUS; 00143 switch ($pInfo->products_qty_box_status) { 00144 case '0': $is_products_qty_box_status = false; $not_products_qty_box_status = true; break; 00145 case '1': $is_products_qty_box_status = true; $not_products_qty_box_status = false; break; 00146 default: $is_products_qty_box_status = true; $not_products_qty_box_status = false; 00147 } 00148 // Product is Priced by Attributes 00149 if (!isset($pInfo->products_priced_by_attribute)) $pInfo->products_priced_by_attribute = '0'; 00150 switch ($pInfo->products_priced_by_attribute) { 00151 case '0': $is_products_priced_by_attribute = false; $not_products_priced_by_attribute = true; break; 00152 case '1': $is_products_priced_by_attribute = true; $not_products_priced_by_attribute = false; break; 00153 default: $is_products_priced_by_attribute = false; $not_products_priced_by_attribute = true; 00154 } 00155 // Product is Free 00156 if (!isset($pInfo->product_is_free)) $pInfo->product_is_free = '0'; 00157 switch ($pInfo->product_is_free) { 00158 case '0': $in_product_is_free = false; $out_product_is_free = true; break; 00159 case '1': $in_product_is_free = true; $out_product_is_free = false; break; 00160 default: $in_product_is_free = false; $out_product_is_free = true; 00161 } 00162 // Product is Call for price 00163 if (!isset($pInfo->product_is_call)) $pInfo->product_is_call = '0'; 00164 switch ($pInfo->product_is_call) { 00165 case '0': $in_product_is_call = false; $out_product_is_call = true; break; 00166 case '1': $in_product_is_call = true; $out_product_is_call = false; break; 00167 default: $in_product_is_call = false; $out_product_is_call = true; 00168 } 00169 // Products can be purchased with mixed attributes retail 00170 if (!isset($pInfo->products_quantity_mixed)) $pInfo->products_quantity_mixed = '0'; 00171 switch ($pInfo->products_quantity_mixed) { 00172 case '0': $in_products_quantity_mixed = false; $out_products_quantity_mixed = true; break; 00173 case '1': $in_products_quantity_mixed = true; $out_products_quantity_mixed = false; break; 00174 default: $in_products_quantity_mixed = true; $out_products_quantity_mixed = false; 00175 } 00176 00177 // set image overwrite 00178 $on_overwrite = true; 00179 $off_overwrite = false; 00180 // set image delete 00181 $on_image_delete = false; 00182 $off_image_delete = true; 00183 ?> 00184 <link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css"> 00185 <script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script> 00186 <script language="javascript"><!-- 00187 var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE); 00188 //--></script> 00189 <script language="javascript"><!-- 00190 var tax_rates = new Array(); 00191 <?php 00192 for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) { 00193 if ($tax_class_array[$i]['id'] > 0) { 00194 echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . zen_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n"; 00195 } 00196 } 00197 ?> 00198 00199 function doRound(x, places) { 00200 return Math.round(x * Math.pow(10, places)) / Math.pow(10, places); 00201 } 00202 00203 function getTaxRate() { 00204 var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex; 00205 var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value; 00206 00207 if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) { 00208 return tax_rates[parameterVal]; 00209 } else { 00210 return 0; 00211 } 00212 } 00213 00214 function updateGross() { 00215 var taxRate = getTaxRate(); 00216 var grossValue = document.forms["new_product"].products_price.value; 00217 00218 if (taxRate > 0) { 00219 grossValue = grossValue * ((taxRate / 100) + 1); 00220 } 00221 00222 document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4); 00223 } 00224 00225 function updateNet() { 00226 var taxRate = getTaxRate(); 00227 var netValue = document.forms["new_product"].products_price_gross.value; 00228 00229 if (taxRate > 0) { 00230 netValue = netValue / ((taxRate / 100) + 1); 00231 } 00232 00233 document.forms["new_product"].products_price.value = doRound(netValue, 4); 00234 } 00235 //--></script> 00236 <?php 00237 // echo $type_admin_handler; 00238 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"'); 00239 ?> 00240 <table border="0" width="100%" cellspacing="0" cellpadding="2"> 00241 <tr> 00242 <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> 00243 <tr> 00244 <td class="pageHeading"><?php echo sprintf(TEXT_NEW_PRODUCT, zen_output_generated_category_path($current_category_id)); ?></td> 00245 <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> 00246 </tr> 00247 </table></td> 00248 </tr> 00249 <tr> 00250 <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00251 </tr> 00252 <tr> 00253 <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'] : '') . ( (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> 00254 </tr> 00255 <tr> 00256 <td><table border="0" cellspacing="0" cellpadding="2"> 00257 <?php 00258 // show when product is linked 00259 if (zen_get_product_is_linked($_GET['pID']) == 'true' and $_GET['pID'] > 0) { 00260 ?> 00261 <tr> 00262 <td class="main"><?php echo TEXT_MASTER_CATEGORIES_ID; ?></td> 00263 <td class="main"> 00264 <?php 00265 // echo zen_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id); 00266 echo zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_LINKED) . ' '; 00267 echo zen_draw_pull_down_menu('master_category', zen_get_master_categories_pulldown($_GET['pID']), $pInfo->master_categories_id); ?> 00268 </td> 00269 </tr> 00270 <?php } else { ?> 00271 <tr> 00272 <td class="main"><?php echo TEXT_MASTER_CATEGORIES_ID; ?></td> 00273 <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> 00274 </tr> 00275 <?php } ?> 00276 <tr> 00277 <td colspan="2" class="main"><?php echo TEXT_INFO_MASTER_CATEGORIES_ID; ?></td> 00278 </tr> 00279 <tr> 00280 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '100%', '2'); ?></td> 00281 </tr> 00282 <?php 00283 // hidden fields not changeable on products page 00284 echo zen_draw_hidden_field('master_categories_id', $pInfo->master_categories_id); 00285 echo zen_draw_hidden_field('products_discount_type', $pInfo->products_discount_type); 00286 echo zen_draw_hidden_field('products_discount_type_from', $pInfo->products_discount_type_from); 00287 echo zen_draw_hidden_field('products_price_sorter', $pInfo->products_price_sorter); 00288 ?> 00289 <tr> 00290 <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> 00291 </tr> 00292 <tr> 00293 <td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td> 00294 <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> 00295 </tr> 00296 <tr> 00297 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00298 </tr> 00299 <tr> 00300 <td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br /><small>(YYYY-MM-DD)</small></td> 00301 <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> 00302 </tr> 00303 <tr> 00304 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00305 </tr> 00306 <tr> 00307 <td class="main"><?php echo TEXT_PRODUCTS_RECORD_ARTIST; ?></td> 00308 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_pull_down_menu('artists_id', $artists_array, $pInfo->artists_id); ?></td> 00309 </tr> 00310 <tr> 00311 <td class="main"><?php echo TEXT_PRODUCTS_RECORD_COMPANY; ?></td> 00312 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_pull_down_menu('record_company_id', $record_company_array, $pInfo->record_company_id); ?></td> 00313 </tr> 00314 <tr> 00315 <td class="main"><?php echo TEXT_PRODUCTS_MUSIC_GENRE; ?></td> 00316 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_pull_down_menu('music_genre_id', $music_genre_array, $pInfo->music_genre_id); ?></td> 00317 </tr> 00318 <tr> 00319 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00320 </tr> 00321 <?php 00322 for ($i=0, $n=sizeof($languages); $i<$n; $i++) { 00323 ?> 00324 <tr> 00325 <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td> 00326 <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'] . ']', 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> 00327 </tr> 00328 <?php 00329 } 00330 ?> 00331 00332 <tr> 00333 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00334 </tr> 00335 00336 <tr> 00337 <td class="main"><?php echo TEXT_PRODUCT_IS_FREE; ?></td> 00338 <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> 00339 </tr> 00340 <tr> 00341 <td class="main"><?php echo TEXT_PRODUCT_IS_CALL; ?></td> 00342 <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> 00343 </tr> 00344 00345 <tr> 00346 <td class="main"><?php echo TEXT_PRODUCTS_PRICED_BY_ATTRIBUTES; ?></td> 00347 <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> 00348 </tr> 00349 00350 <tr> 00351 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00352 </tr> 00353 <tr bgcolor="#ebebff"> 00354 <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td> 00355 <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> 00356 </tr> 00357 <tr bgcolor="#ebebff"> 00358 <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td> 00359 <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> 00360 </tr> 00361 <tr bgcolor="#ebebff"> 00362 <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td> 00363 <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> 00364 </tr> 00365 <tr> 00366 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00367 </tr> 00368 <tr> 00369 <td class="main"><?php echo TEXT_PRODUCTS_VIRTUAL; ?></td> 00370 <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> 00371 </tr> 00372 00373 <tr> 00374 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00375 </tr> 00376 <tr> 00377 <td class="main" valign="top"><?php echo TEXT_PRODUCTS_IS_ALWAYS_FREE_SHIPPING; ?></td> 00378 <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> 00379 </tr> 00380 00381 <tr> 00382 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00383 </tr> 00384 <tr> 00385 <td class="main"><?php echo TEXT_PRODUCTS_QTY_BOX_STATUS; ?></td> 00386 <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> 00387 </tr> 00388 00389 <tr> 00390 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00391 </tr> 00392 00393 <tr> 00394 <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY_MIN_RETAIL; ?></td> 00395 <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> 00396 </tr> 00397 00398 <tr> 00399 <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY_MAX_RETAIL; ?></td> 00400 <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> 00401 </tr> 00402 00403 <tr> 00404 <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY_UNITS_RETAIL; ?></td> 00405 <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> 00406 </tr> 00407 00408 <tr> 00409 <td class="main"><?php echo TEXT_PRODUCTS_MIXED; ?></td> 00410 <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> 00411 </tr> 00412 00413 <tr> 00414 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00415 </tr> 00416 00417 <script language="javascript"><!-- 00418 updateGross(); 00419 //--></script> 00420 <?php 00421 for ($i=0, $n=sizeof($languages); $i<$n; $i++) { 00422 ?> 00423 <tr> 00424 <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td> 00425 <td colspan="2"><table border="0" cellspacing="0" cellpadding="0"> 00426 <tr> 00427 <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> 00428 <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> 00429 </tr> 00430 </table></td> 00431 </tr> 00432 <?php 00433 } 00434 ?> 00435 <tr> 00436 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00437 </tr> 00438 <tr> 00439 <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td> 00440 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td> 00441 </tr> 00442 <tr> 00443 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00444 </tr> 00445 <tr> 00446 <td class="main"><?php echo TEXT_PRODUCTS_MODEL; ?></td> 00447 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_model', htmlspecialchars(stripslashes($pInfo->products_model), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_PRODUCTS, 'products_model')); ?></td> 00448 </tr> 00449 <tr> 00450 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00451 </tr> 00452 <?php 00453 $dir = @dir(DIR_FS_CATALOG_IMAGES); 00454 $dir_info[] = array('id' => '', 'text' => "Main Directory"); 00455 while ($file = $dir->read()) { 00456 if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") { 00457 $dir_info[] = array('id' => $file . '/', 'text' => $file); 00458 } 00459 } 00460 $dir->close(); 00461 sort($dir_info); 00462 00463 $default_directory = substr( $pInfo->products_image, 0,strpos( $pInfo->products_image, '/')+1); 00464 ?> 00465 00466 <tr> 00467 <td colspan="2"><?php echo zen_draw_separator('pixel_black.gif', '100%', '3'); ?></td> 00468 </tr> 00469 00470 <tr> 00471 <td class="main" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 00472 <tr> 00473 <td class="main"><?php echo TEXT_PRODUCTS_IMAGE; ?></td> 00474 <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> 00475 <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> 00476 </tr> 00477 <tr> 00478 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15'); ?></td> 00479 <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> 00480 </tr> 00481 00482 <tr> 00483 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15'); ?></td> 00484 <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; ?> 00485 <?php echo '<br />' . TEXT_PRODUCTS_IMAGE_MANUAL . ' ' . zen_draw_input_field('products_image_manual'); ?></td> 00486 </tr> 00487 </table></td> 00488 </tr> 00489 00490 <tr> 00491 <td colspan="2"><?php echo zen_draw_separator('pixel_black.gif', '100%', '3'); ?></td> 00492 </tr> 00493 00494 <tr> 00495 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00496 </tr> 00497 <tr> 00498 <td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td> 00499 <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_weight', $pInfo->products_weight); ?></td> 00500 </tr> 00501 <tr> 00502 <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00503 </tr> 00504 <tr> 00505 <td class="main"><?php echo TEXT_PRODUCTS_SORT_ORDER; ?></td> 00506 <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> 00507 </tr> 00508 </table></td> 00509 </tr> 00510 <tr> 00511 <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 00512 </tr> 00513 <tr> 00514 <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) . ' <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> 00515 </tr> 00516 </table></form>