|
|
|
|
Execute($product_types_query_raw);
while (!$product_types->EOF) {
if ((!isset($_GET['ptID']) || (isset($_GET['ptID']) && ($_GET['ptID'] == $product_types->fields['type_id']))) && !isset($ptInfo) && (substr($action, 0, 3) != 'new')) {
$product_type_products = $db->Execute("select count(*) as products_count
from " . TABLE_PRODUCTS . "
where products_type = '" . (int)$product_types->fields['type_id'] . "'");
$ptInfo_array = array_merge($product_types->fields, $product_type_products->fields);
$ptInfo = new objectInfo($ptInfo_array);
}
if (isset($ptInfo) && is_object($ptInfo) && ($product_types->fields['type_id'] == $ptInfo->type_id)) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
?>
fields['type_name']; ?> |
fields['allow_add_to_cart']; ?> |
fields['type_id'] == $ptInfo->type_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> |
MoveNext();
}
?>
display_count($product_types_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCT_TYPES); ?> |
display_links($product_types_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?> |
|
|
'' . TEXT_HEADING_NEW_PRODUCT_TYPE . '');
$contents = array('form' => zen_draw_form('new_product_type', FILENAME_PRODUCT_TYPES, 'action=insert', 'post', 'enctype="multipart/form-data"'));
$contents[] = array('text' => TEXT_NEW_INTRO);
break;
case 'edit':
$heading[] = array('text' => '' . TEXT_HEADING_EDIT_PRODUCT_TYPE . ' :: ' . $ptInfo->type_name . '');
$contents = array('form' => zen_draw_form('product_types', FILENAME_PRODUCT_TYPES, 'page=' . $_GET['page'] . '&ptID=' . $ptInfo->type_id . '&action=save', 'post', 'enctype="multipart/form-data"'));
$contents[] = array('text' => TEXT_EDIT_INTRO);
$contents[] = array('text' => ' ' . TEXT_PRODUCT_TYPES_NAME . ' ' . zen_draw_input_field('type_name', $ptInfo->type_name, zen_set_field_length(TABLE_PRODUCT_TYPES, 'type_name')));
$contents[] = array('text' => ' ' . TEXT_PRODUCT_TYPES_IMAGE . ' ' . zen_draw_file_field('default_image') . ' ' . $ptInfo->default_image);
$dir = @dir(DIR_FS_CATALOG_IMAGES);
$dir_info[] = array('id' => '', 'text' => "Main Directory");
while ($file = $dir->read()) {
if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
$dir_info[] = array('id' => $file . '/', 'text' => $file);
}
}
$dir->close();
$default_directory = substr( $ptInfo->default_image, 0,strpos( $ptInfo->default_image, '/')+1);
$contents[] = array('text' => ' ' . TEXT_PRODUCTS_IMAGE_DIR . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory));
$contents[] = array('text' => ' ' . zen_info_image($ptInfo->default_image, $ptInfo->type_name));
$contents[] = array('text' => ' ' . TEXT_PRODUCT_TYPES_HANDLER . ' ' . zen_draw_input_field('handler', $ptInfo->type_handler, zen_set_field_length(TABLE_PRODUCT_TYPES, 'type_handler')));
$contents[] = array('text' => ' ' . TEXT_PRODUCT_TYPES_ALLOW_ADD_CART . ' ' . zen_draw_checkbox_field('catalog_add_to_cart', $ptInfo->allow_add_to_cart, ($ptInfo->allow_add_to_cart == 'Y' ? true : false)));
$sql = "select type_id, type_name from " . TABLE_PRODUCT_TYPES;
$product_type_list = $db->Execute($sql);
while (!$product_type_list->EOF) {
$product_type_array[] = array('text' => $product_type_list->fields['type_name'], 'id' => $product_type_list->fields['type_id']);
$product_type_list->MoveNext();
}
$contents[] = array('text' => ' ' . TEXT_MASTER_TYPE . zen_draw_pull_down_menu('master_type', $product_type_array, $ptInfo->type_master_type));
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'delete':
$heading[] = array('text' => '' . TEXT_HEADING_DELETE_PRODUCT_TYPE . '');
$contents = array('form' => zen_draw_form('manufacturers', FILENAME_PRODUCT_TYPES, 'page=' . $_GET['page'] . '&ptID=' . $ptInfo->type_id . '&action=deleteconfirm'));
$contents[] = array('text' => TEXT_DELETE_INTRO);
$contents[] = array('text' => ' ' . $ptInfo->type_name . '');
$contents[] = array('text' => ' ' . zen_draw_checkbox_field('delete_image', '', true) . ' ' . TEXT_DELETE_IMAGE);
if ($ptInfo->products_count > 0) {
$contents[] = array('text' => ' ' . zen_draw_checkbox_field('delete_products') . ' ' . TEXT_DELETE_PRODUCTS);
$contents[] = array('text' => ' ' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $ptInfo->products_count));
}
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
default:
if (isset($ptInfo) && is_object($ptInfo)) {
$heading[] = array('text' => '' . $ptInfo->type_name . '');
// remove delete for now to avoid issues
// $contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . ' ' . zen_image_button('button_delete.gif', IMAGE_DELETE) . ' ' . zen_image_button('button_layout.gif', IMAGE_LAYOUT) . '' );
$contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . ' ' . zen_image_button('button_layout.gif', IMAGE_LAYOUT) . '' );
$contents[] = array('text' => ' ' . TEXT_DATE_ADDED . ' ' . zen_date_short($ptInfo->date_added));
if (zen_not_null($ptInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . zen_date_short($ptInfo->last_modified));
$contents[] = array('text' => ' ' . zen_info_image($ptInfo->manufacturers_image, $ptInfo->manufacturers_name));
$contents[] = array('text' => ' ' . TEXT_PRODUCTS . ' ' . $ptInfo->products_count);
}
break;
}
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
echo ' ' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|
|