|
|
|
|
|
Execute($groups_query_raw);
while (!$groups->EOF) {
if ((!isset($_GET['gID']) || (isset($_GET['gID']) && ($_GET['gID'] == $groups->fields['group_id']))) && !isset($gInfo) && (substr($action, 0, 3) != 'new')) {
$group_customers = $db->Execute("select count(*) as customer_count from " . TABLE_CUSTOMERS .
" where customers_group_pricing = '" . (int)$groups->fields['group_id'] . "'");
$gInfo_array = array_merge($groups->fields, $group_customers->fields);
$gInfo = new objectInfo($gInfo_array);
}
if (isset($gInfo) && is_object($gInfo) && ($groups->fields['group_id'] == $gInfo->group_id)) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
?>
fields['group_id']; ?> |
fields['group_name']; ?> |
fields['group_percentage']; ?> |
fields['group_id'] . '&action=edit') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . ''; ?>
fields['group_id'] . '&action=delete') . '">' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . ''; ?>
fields['group_id'] == $gInfo->group_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($groups_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRICING_GROUPS); ?> |
display_links($groups_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?> |
|
group_id . '&action=new') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . ''; ?> |
|
'' . TEXT_HEADING_NEW_PRICING_GROUP . '');
$contents = array('form' => zen_draw_form('group_pricing', FILENAME_GROUP_PRICING, 'action=insert', 'post'));
$contents[] = array('text' => TEXT_NEW_INTRO);
$contents[] = array('text' => ' ' . TEXT_GROUP_PRICING_NAME . ' ' . zen_draw_input_field('group_name', '', zen_set_field_length(TABLE_GROUP_PRICING, 'group_name')));
$contents[] = array('text' => ' ' . TEXT_GROUP_PRICING_AMOUNT . ' ' . zen_draw_input_field('group_percentage', ''));
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'edit':
$heading[] = array('text' => '' . TEXT_HEADING_EDIT_PRICING_GROUP . '');
$contents = array('form' => zen_draw_form('group_pricing', FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $gInfo->group_id . '&action=save', 'post'));
$contents[] = array('text' => TEXT_EDIT_INTRO);
$contents[] = array('text' => ' ' . TEXT_GROUP_PRICING_NAME . ' ' . zen_draw_input_field('group_name', $gInfo->group_name, zen_set_field_length(TABLE_GROUP_PRICING, 'group_name')));
$contents[] = array('text' => ' ' . TEXT_GROUP_PRICING_AMOUNT . ' ' . zen_draw_input_field('group_percentage', $gInfo->group_percentage));
$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_PRICING_GROUP . '');
$contents = array('form' => zen_draw_form('group_pricing', FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $gInfo->group_id . '&action=deleteconfirm'));
$contents[] = array('text' => TEXT_DELETE_INTRO);
$contents[] = array('text' => ' ' . $gInfo->group_name . '');
if ($gInfo->customer_count > 0) {
$contents[] = array('text' => ' ' . zen_draw_checkbox_field('delete_customers') . ' ' . TEXT_DELETE_PRICING_GROUP);
$contents[] = array('text' => ' ' . sprintf(TEXT_DELETE_WARNING_GROUP_MEMBERS, $gInfo->customer_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($gInfo) && is_object($gInfo)) {
$heading[] = array('text' => '' . $gInfo->group_name . '');
$contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . ' ' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '');
$contents[] = array('text' => ' ' . TEXT_DATE_ADDED . ' ' . zen_date_short($gInfo->date_added));
if (zen_not_null($gInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . zen_date_short($gInfo->last_modified));
$contents[] = array('text' => ' ' . TEXT_CUSTOMERS . ' ' . $gInfo->customer_count);
}
break;
}
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
echo ' ' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|
|