|
|
' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ' ' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON); ?> |
' . zen_image(DIR_WS_IMAGES . 'icon_blue_on.gif', IMAGE_ICON_BANNER_ON_SSL_ON) . ' ' . zen_image(DIR_WS_IMAGES . 'icon_blue_off.gif', IMAGE_ICON_BANNER_ON_SSL_OFF); ?> |
' . zen_image(DIR_WS_IMAGES . 'icon_orange_on.gif', IMAGE_ICON_BANNER_OPEN_NEW_WINDOWS_ON) . ' ' . zen_image(DIR_WS_IMAGES . 'icon_orange_off.gif', IMAGE_ICON_BANNER_OPEN_NEW_WINDOWS_OFF); ?> |
|
'',
'date_scheduled' => '',
'banners_title' => '',
'banners_url' => '',
'banners_group' => '',
'banners_image' => '',
'banners_html_text' => '',
'expires_impressions' => '',
'banners_open_new_windows' => '',
'banners_on_ssl' => '');
$bInfo = new objectInfo($parameters);
if (isset($_GET['bID'])) {
$form_action = 'update';
$bID = zen_db_prepare_input($_GET['bID']);
$banner = $db->Execute("select banners_title, banners_url, banners_image, banners_group,
banners_html_text, status,
date_format(date_scheduled, '%d/%m/%Y') as date_scheduled,
date_format(expires_date, '%d/%m/%Y') as expires_date,
expires_impressions, date_status_change, banners_open_new_windows, banners_on_ssl, banners_sort_order
from " . TABLE_BANNERS . "
where banners_id = '" . (int)$bID . "'");
$bInfo->objectInfo($banner->fields);
} elseif (zen_not_null($_POST)) {
$bInfo->objectInfo($_POST);
}
if (!isset($bInfo->status)) $bInfo->status = '1';
switch ($bInfo->status) {
case '0': $is_status = false; $not_status = true; break;
case '1': $is_status = true; $not_status = false; break;
default: $is_status = true; $not_status = false; break;
}
if (!isset($bInfo->banners_open_new_windows)) $bInfo->banners_open_new_windows = '1';
switch ($bInfo->banners_open_new_windows) {
case '0': $is_banners_open_new_windows = false; $not_banners_open_new_windows = true; break;
case '1': $is_banners_open_new_windows = true; $not_banners_open_new_windows = false; break;
default: $is_banners_open_new_windows = true; $not_banners_open_new_windows = false; break;
}
if (!isset($bInfo->banners_on_ssl)) $bInfo->banners_on_ssl = '1';
switch ($bInfo->banners_on_ssl) {
case '0': $is_banners_on_ssl = false; $not_banners_on_ssl = true; break;
case '1': $is_banners_on_ssl = true; $not_banners_on_ssl = false; break;
default: $is_banners_on_ssl = true; $not_banners_on_ssl = false; break;
}
$groups_array = array();
$groups = $db->Execute("select distinct banners_group
from " . TABLE_BANNERS . "
order by banners_group");
while (!$groups->EOF) {
$groups_array[] = array('id' => $groups->fields['banners_group'], 'text' => $groups->fields['banners_group']);
$groups->MoveNext();
}
?>
|
|
' . TEXT_INFO_BANNER_STATUS; ?> |
|
|
' . TEXT_INFO_BANNER_OPEN_NEW_WINDOWS; ?> |
|
|
' . TEXT_INFO_BANNER_ON_SSL; ?> |
|
|
banners_title, zen_set_field_length(TABLE_BANNERS, 'banners_title'), true); ?> |
|
banners_url, zen_set_field_length(TABLE_BANNERS, 'banners_url')); ?> |
|
banners_group) . TEXT_BANNERS_NEW_GROUP . ' ' . zen_draw_input_field('new_banners_group', '', '', ((sizeof($groups_array) > 0) ? false : true)); ?> |
|
|
' . DIR_FS_CATALOG_IMAGES . zen_draw_input_field('banners_image_local', (isset($bInfo->banners_image) ? $bInfo->banners_image : ''), zen_set_field_length(TABLE_BANNERS, 'banners_image')); ?> |
|
|
|
|
|
|
' . zen_draw_textarea_field('banners_html_text', 'soft', '60', '5', $bInfo->banners_html_text); ?> |
|
|
' . zen_draw_input_field('banners_sort_order', $bInfo->banners_sort_order, zen_set_field_length(TABLE_BANNERS, 'banners_sort_order'), false); ?> |
|
(dd/mm/yyyy) |
|
|
(dd/mm/yyyy) |
' . zen_draw_input_field('expires_impressions', $bInfo->expires_impressions, 'maxlength="7" size="7"') . ' ' . TEXT_BANNERS_IMPRESSIONS; ?> |
|
|
' . TEXT_BANNERS_INSERT_NOTE . ' ' . TEXT_BANNERS_EXPIRCY_NOTE . ' ' . TEXT_BANNERS_SCHEDULE_NOTE; ?> |
' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?> |
|
|
|
|
|
|
|
|
|
Execute($banners_query_raw);
$check_count=1;
if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS) {
while (!$check_page->EOF) {
if ($check_page->fields['banners_id'] == $_GET['bID']) {
break;
}
$check_count++;
$check_page->MoveNext();
}
$_GET['page'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS) !=0 ? .5 : 0)),0);
} else {
$_GET['page'] = 1;
}
}
$banners_query_raw = "select banners_id, banners_title, banners_image, banners_group, status, expires_date, expires_impressions, date_status_change, date_scheduled, date_added, banners_open_new_windows, banners_on_ssl, banners_sort_order from " . TABLE_BANNERS . " order by banners_title, banners_group";
$banners_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $banners_query_raw, $banners_query_numrows);
$banners = $db->Execute($banners_query_raw);
while (!$banners->EOF) {
$info = $db->Execute("select sum(banners_shown) as banners_shown,
sum(banners_clicked) as banners_clicked
from " . TABLE_BANNERS_HISTORY . "
where banners_id = '" . (int)$banners->fields['banners_id'] . "'");
if ((!isset($_GET['bID']) || (isset($_GET['bID']) && ($_GET['bID'] == $banners->fields['banners_id']))) && !isset($bInfo) && (substr($action, 0, 3) != 'new')) {
$bInfo_array = array_merge($banners->fields, $info->fields);
$bInfo = new objectInfo($bInfo_array);
}
$banners_shown = ($info->fields['banners_shown'] != '') ? $info->fields['banners_shown'] : '0';
$banners_clicked = ($info->fields['banners_clicked'] != '') ? $info->fields['banners_clicked'] : '0';
if (isset($bInfo) && is_object($bInfo) && ($banners->fields['banners_id'] == $bInfo->banners_id)) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
?>
fields['banners_id'] . '\')">' . zen_image(DIR_WS_IMAGES . 'icon_popup.gif', 'View Banner') . ' ' . $banners->fields['banners_title']; ?> |
fields['banners_group']; ?> |
|
fields['status'] == '1') {
echo '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '';
} else {
echo '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '';
}
?>
|
fields['banners_open_new_windows'] == '1') {
echo '' . zen_image(DIR_WS_IMAGES . 'icon_orange_on.gif', IMAGE_ICON_BANNER_OPEN_NEW_WINDOWS_ON) . '';
} else {
echo '' . zen_image(DIR_WS_IMAGES . 'icon_orange_off.gif', IMAGE_ICON_BANNER_OPEN_NEW_WINDOWS_OFF) . '';
}
?>
|
fields['banners_on_ssl'] == '1') {
echo '' . zen_image(DIR_WS_IMAGES . 'icon_blue_on.gif', IMAGE_ICON_BANNER_ON_SSL_ON) . '';
} else {
echo '' . zen_image(DIR_WS_IMAGES . 'icon_blue_off.gif', IMAGE_ICON_BANNER_ON_SSL_OFF) . '';
}
?>
|
fields['banners_sort_order']; ?> |
fields['banners_id']) . '">' . zen_image(DIR_WS_ICONS . 'statistics.gif', ICON_STATISTICS) . ' '; if (isset($bInfo) && is_object($bInfo) && ($banners->fields['banners_id'] == $bInfo->banners_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($banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_BANNERS); ?> |
display_links($banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?> |
' . zen_image_button('button_new_banner.gif', IMAGE_NEW_BANNER) . ''; ?> |
|
|
'' . $bInfo->banners_title . '');
$contents = array('form' => zen_draw_form('banners', FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=deleteconfirm'));
$contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
$contents[] = array('text' => ' ' . $bInfo->banners_title . '');
if ($bInfo->banners_image) $contents[] = array('text' => ' ' . zen_draw_checkbox_field('delete_image', 'on', true) . ' ' . TEXT_INFO_DELETE_IMAGE);
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
default:
if (is_object($bInfo)) {
$heading[] = array('text' => '' . $bInfo->banners_title . '');
$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_BANNERS_DATE_ADDED . ' ' . zen_date_short($bInfo->date_added));
if ( (function_exists('imagecreate')) && ($dir_ok) && ($banner_extension) ) {
$banner_id = $bInfo->banners_id;
$days = '3';
include(DIR_WS_INCLUDES . 'graphs/banner_infobox.php');
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banner_id . '.' . $banner_extension));
} else {
include(DIR_WS_FUNCTIONS . 'html_graphs.php');
$contents[] = array('align' => 'center', 'text' => ' ' . zen_banner_graph_infoBox($bInfo->banners_id, '3'));
}
$contents[] = array('text' => zen_image(DIR_WS_IMAGES . 'graph_hbar_blue.gif', 'Blue', '5', '5') . ' ' . TEXT_BANNERS_BANNER_VIEWS . ' ' . zen_image(DIR_WS_IMAGES . 'graph_hbar_red.gif', 'Red', '5', '5') . ' ' . TEXT_BANNERS_BANNER_CLICKS);
if ($bInfo->date_scheduled) $contents[] = array('text' => ' ' . sprintf(TEXT_BANNERS_SCHEDULED_AT_DATE, zen_date_short($bInfo->date_scheduled)));
if ($bInfo->expires_date) {
$contents[] = array('text' => ' ' . sprintf(TEXT_BANNERS_EXPIRES_AT_DATE, zen_date_short($bInfo->expires_date)));
} elseif ($bInfo->expires_impressions) {
$contents[] = array('text' => ' ' . sprintf(TEXT_BANNERS_EXPIRES_AT_IMPRESSIONS, $bInfo->expires_impressions));
}
if ($bInfo->date_status_change) $contents[] = array('text' => ' ' . sprintf(TEXT_BANNERS_STATUS_CHANGE, zen_date_short($bInfo->date_status_change)));
}
break;
}
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
echo ' ' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|
|