' . zen_get_geo_zone_name($_GET['zone']) . ''; ?> |
|
|
|
|
|
Execute($zones_query_raw);
$check_count=1;
if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS) {
while (!$check_page->EOF) {
if ($check_page->fields['association_id'] == $_GET['sID']) {
break;
}
$check_count++;
$check_page->MoveNext();
}
$_GET['spage'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS) !=0 ? .5 : 0)),0);
} else {
$_GET['spage'] = 1;
}
}
$rows = 0;
// $zones_query_raw = "select a.association_id, a.zone_country_id, c.countries_name, a.zone_id, a.geo_zone_id, a.last_modified, a.date_added, z.zone_name from (" . TABLE_ZONES_TO_GEO_ZONES . " a left join " . TABLE_COUNTRIES . " c on a.zone_country_id = c.countries_id left join " . TABLE_ZONES . " z on a.zone_id = z.zone_id) where a.geo_zone_id = " . $_GET['zID'] . " order by association_id";
$zones_query_raw = "select a.association_id, a.zone_country_id, c.countries_name, a.zone_id, a.geo_zone_id, a.last_modified, a.date_added, z.zone_name from (" . TABLE_ZONES_TO_GEO_ZONES . " a left join " . TABLE_COUNTRIES . " c on a.zone_country_id = c.countries_id left join " . TABLE_ZONES . " z on a.zone_id = z.zone_id) where a.geo_zone_id = " . $_GET['zID'] . " order by c.countries_name, association_id";
$zones_split = new splitPageResults($_GET['spage'], MAX_DISPLAY_SEARCH_RESULTS, $zones_query_raw, $zones_query_numrows);
$zones = $db->Execute($zones_query_raw);
while (!$zones->EOF) {
$rows++;
if ((!isset($_GET['sID']) || (isset($_GET['sID']) && ($_GET['sID'] == $zones->fields['association_id']))) && !isset($sInfo) && (substr($action, 0, 3) != 'new')) {
$sInfo = new objectInfo($zones->fields);
}
if (isset($sInfo) && is_object($sInfo) && ($zones->fields['association_id'] == $sInfo->association_id)) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
?>
fields['countries_name']) ? $zones->fields['countries_name'] : TEXT_ALL_COUNTRIES); ?> |
fields['zone_id']) ? $zones->fields['zone_name'] : PLEASE_SELECT); ?> |
fields['association_id'] == $sInfo->association_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($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['spage'], TEXT_DISPLAY_NUMBER_OF_COUNTRIES); ?> |
display_links($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['spage'], 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list', 'spage'); ?> |
|
' . zen_image_button('button_back.gif', IMAGE_BACK) . ' ' . zen_image_button('button_insert.gif', IMAGE_INSERT) . ''; ?> |
|
|
|
|
Execute($zones_query_raw);
$check_count=1;
if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS) {
while (!$check_page->EOF) {
if ($check_page->fields['geo_zone_id'] == $_GET['zID']) {
break;
}
$check_count++;
$check_page->MoveNext();
}
$_GET['zpage'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS) !=0 ? .5 : 0)),0);
} else {
$_GET['zpage'] = 1;
}
}
$zones_query_raw = "select geo_zone_id, geo_zone_name, geo_zone_description, last_modified, date_added from " . TABLE_GEO_ZONES . " order by geo_zone_name";
$zones_split = new splitPageResults($_GET['zpage'], MAX_DISPLAY_SEARCH_RESULTS, $zones_query_raw, $zones_query_numrows);
$zones = $db->Execute($zones_query_raw);
while (!$zones->EOF) {
$num_zones = $db->Execute("select count(*) as num_zones
from " . TABLE_ZONES_TO_GEO_ZONES . "
where geo_zone_id = '" . (int)$zones->fields['geo_zone_id'] . "'
group by geo_zone_id");
if ($num_zones->fields['num_zones'] > 0) {
$zones->fields['num_zones'] = $num_zones->fields['num_zones'];
} else {
$zones->fields['num_zones'] = 0;
}
$num_tax_rates = $db->Execute("select count(*) as num_tax_rates
from " . TABLE_TAX_RATES . "
where tax_zone_id = '" . (int)$zones->fields['geo_zone_id'] . "'
group by tax_zone_id");
if ($num_tax_rates->fields['num_tax_rates'] > 0) {
$zones->fields['num_tax_rates'] = $num_tax_rates->fields['num_tax_rates'];
} else {
$zones->fields['num_tax_rates'] = 0;
}
if ((!isset($_GET['zID']) || (isset($_GET['zID']) && ($_GET['zID'] == $zones->fields['geo_zone_id']))) && !isset($zInfo) && (substr($action, 0, 3) != 'new')) {
$zInfo = new objectInfo($zones->fields);
}
if (isset($zInfo) && is_object($zInfo) && ($zones->fields['geo_zone_id'] == $zInfo->geo_zone_id)) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
?>
fields['geo_zone_id'] . '&action=list') . '">' . zen_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . ' ' . $zones->fields['geo_zone_name']; ?> |
fields['geo_zone_description']; ?> |
fields['num_tax_rates'] && $zones->fields['num_zones']) {
echo zen_image(DIR_WS_IMAGES . 'icon_status_green.gif');
} elseif ($zones->fields['num_zones']) {
echo zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif');
} else {
echo zen_image(DIR_WS_IMAGES . 'icon_status_red.gif');
}
?> |
fields['geo_zone_id'] == $zInfo->geo_zone_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($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['zpage'], TEXT_DISPLAY_NUMBER_OF_TAX_ZONES); ?> |
display_links($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['zpage'], '', 'zpage'); ?> |
|
geo_zone_id . '&action=new_zone') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . ''; ?> |
|
'' . TEXT_INFO_HEADING_NEW_SUB_ZONE . '');
$contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] . '&' : '') . 'saction=insert_sub'));
$contents[] = array('text' => TEXT_INFO_NEW_SUB_ZONE_INTRO);
$contents[] = array('text' => ' ' . TEXT_INFO_COUNTRY . ' ' . zen_draw_pull_down_menu('zone_country_id', zen_get_countries(TEXT_ALL_COUNTRIES), '', 'onChange="update_zone(this.form);"'));
$contents[] = array('text' => ' ' . TEXT_INFO_COUNTRY_ZONE . ' ' . zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down()));
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'edit':
$heading[] = array('text' => '' . TEXT_INFO_HEADING_EDIT_SUB_ZONE . '');
$contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=save_sub'));
$contents[] = array('text' => TEXT_INFO_EDIT_SUB_ZONE_INTRO);
$contents[] = array('text' => ' ' . TEXT_INFO_COUNTRY . ' ' . zen_draw_pull_down_menu('zone_country_id', zen_get_countries(TEXT_ALL_COUNTRIES), $sInfo->zone_country_id, 'onChange="update_zone(this.form);"'));
$contents[] = array('text' => ' ' . TEXT_INFO_COUNTRY_ZONE . ' ' . zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($sInfo->zone_country_id), $sInfo->zone_id));
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'delete':
$heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_SUB_ZONE . '');
$contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=deleteconfirm_sub'));
$contents[] = array('text' => TEXT_INFO_DELETE_SUB_ZONE_INTRO);
$contents[] = array('text' => ' ' . $sInfo->countries_name . '');
$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($sInfo) && is_object($sInfo)) {
$heading[] = array('text' => '' . $sInfo->countries_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_INFO_DATE_ADDED . ' ' . zen_date_short($sInfo->date_added));
if (zen_not_null($sInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($sInfo->last_modified));
}
break;
}
} else {
switch ($action) {
case 'new_zone':
$heading[] = array('text' => '' . TEXT_INFO_HEADING_NEW_ZONE . '');
$contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=insert_zone'));
$contents[] = array('text' => TEXT_INFO_NEW_ZONE_INTRO);
$contents[] = array('text' => ' ' . TEXT_INFO_ZONE_NAME . ' ' . zen_draw_input_field('geo_zone_name', '', zen_set_field_length(TABLE_GEO_ZONES, 'geo_zone_name')));
$contents[] = array('text' => ' ' . TEXT_INFO_ZONE_DESCRIPTION . ' ' . zen_draw_input_field('geo_zone_description', '', zen_set_field_length(TABLE_GEO_ZONES, 'geo_zone_description')));
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'edit_zone':
$heading[] = array('text' => '' . TEXT_INFO_HEADING_EDIT_ZONE . '');
$contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=save_zone'));
$contents[] = array('text' => TEXT_INFO_EDIT_ZONE_INTRO);
$contents[] = array('text' => ' ' . TEXT_INFO_ZONE_NAME . ' ' . zen_draw_input_field('geo_zone_name', $zInfo->geo_zone_name, zen_set_field_length(TABLE_GEO_ZONES, 'geo_zone_name')));
$contents[] = array('text' => ' ' . TEXT_INFO_ZONE_DESCRIPTION . ' ' . zen_draw_input_field('geo_zone_description', $zInfo->geo_zone_description, zen_set_field_length(TABLE_GEO_ZONES, 'geo_zone_description')));
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'delete_zone':
$heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_ZONE . '');
$contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=deleteconfirm_zone'));
$contents[] = array('text' => TEXT_INFO_DELETE_ZONE_INTRO);
$contents[] = array('text' => ' ' . $zInfo->geo_zone_name . '');
$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($zInfo) && is_object($zInfo)) {
$heading[] = array('text' => '' . $zInfo->geo_zone_name . '');
$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_details.gif', IMAGE_DETAILS) . '');
$contents[] = array('align' => 'center', 'text' => ($zInfo->num_tax_rates > 0 ? '' . zen_image_button('button_tax_rates.gif', IMAGE_TAX_RATES) . '' : ''));
$contents[] = array('text' => ' ' . TEXT_INFO_NUMBER_ZONES . ' ' . $zInfo->num_zones);
$contents[] = array('text' => ' ' . TEXT_INFO_NUMBER_TAX_RATES . ' ' . $zInfo->num_tax_rates);
$contents[] = array('text' => ' ' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($zInfo->date_added));
if (zen_not_null($zInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($zInfo->last_modified));
$contents[] = array('text' => ' ' . TEXT_INFO_ZONE_DESCRIPTION . ' ' . $zInfo->geo_zone_description);
}
break;
}
}
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
echo ' ' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|
|