' .
'' .
'' .
'' .
'' .
'' .
'' .
'' .
'ΝΌΚΎ | ' .
' ' .
'' .
'' . TEXT_NEWS_LEGEND_STATUS_OFF . ' | ' .
'' . TEXT_NEWS_LEGEND_STATUS_ON . ' | ' .
'' . TEXT_NEWS_LEGEND_EDIT . ' | ' .
'' . TEXT_NEWS_LEGEND_DELETE . ' | ' .
'' . TEXT_NEWS_LEGEND_INFO . ' | ' .
' ' .
'' .
'' . 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_edit.gif', ICON_EDIT) . ' | ' .
'' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . ' | ' .
'' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' | ' .
' ' .
' ' .
' | ' .
' ' .
'' .
'' . zen_draw_separator('pixel_trans.gif', '1', '10') . ' | ' .
' ' .
'' .
'' .
'' .
'' .
'' . HEADING_TITLE . ' | ' .
'' . zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . ' | ' .
' ' .
' ' .
' | ' .
' ' .
'' .
'' .
'' .
'' .
'' .
'' .
'' .
'' . TABLE_HEADING_AUTHOR . ' | ' .
'' . TABLE_HEADING_EMAIL . ' | ' .
'' . TABLE_HEADING_STATUS . ' | ' .
'' . TABLE_HEADING_ACTION . ' | ' .
' ';
$authors_array = array(
array(
'id' => '',
'text' => TEXT_PLEASE_SELECT,
),
);
$authors_query_raw = "select * from " . TABLE_NEWS_AUTHORS . " order by authors_id";
$authors_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $authors_query_raw, $authors_query_numrows);
$authors = $db->Execute($authors_query_raw);
while (!$authors->EOF) {
if (($_GET['aID'] != $authors->fields['authors_id']) && ($_GET['action'] == 'delete')) {
$authors_array[] = array(
'id' => $authors->fields['authors_id'],
'text' => $authors->fields['author_name'],
);
}
if (((!$_GET['aID']) || (@$_GET['aID'] == $authors->fields['authors_id'])) && (!$aInfo) && (substr($_GET['action'], 0, 3) != 'new')) {
$authors_articles = $db->Execute("select count(*) as articles_count from " . TABLE_NEWS_ARTICLES . " where authors_id = '" . (int)$authors->fields['authors_id'] . "'");
$authors->fields = array_merge($authors->fields, $authors_articles->fields);
$aInfo = new objectInfo($authors->fields);
}
if ( (is_object($aInfo)) && ($authors->fields['authors_id'] == $aInfo->authors_id) ) {
echo '';
} else {
echo ' ';
}
echo
'' . $authors->fields['author_name'] . ' | ' .
'<' . $authors->fields['author_email'] . '> | ' .
'';
if ($authors->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) . '';
}
echo
' | ' .
'' .
'' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . ' ' .
'' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . ' ';
if ( (is_object($aInfo)) && ($authors->fields['authors_id'] == $aInfo->authors_id) ) {
echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif') . ' ';
} else {
echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' ';
}
echo
' | ' .
' ';
$authors->MoveNext();
}
echo
'' .
'' .
'' .
'' .
'' . $authors_split->display_count($authors_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_AUTHORS) . ' | ' .
'' . $authors_split->display_links($authors_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']) . ' | ' .
' ' .
' ' .
' | ' .
' ';
if ($_GET['action'] != 'new') {
echo
'' .
'' . zen_image_button('button_insert.gif', IMAGE_INSERT) . ' | ' .
' ';
}
echo
' ' .
' | ';
$heading = array();
$contents = array();
switch ($_GET['action']) {
case 'new':
$heading[] = array('text' => '' . TEXT_HEADING_NEW_AUTHOR . '');
$contents = array('form' => zen_draw_form('new_author', FILENAME_NEWS_AUTHORS, 'page=' . $_GET['page'] . '&aID=' . $aInfo->authors_id . '&query=add_author&action=new', 'post', 'enctype="multipart/form-data"'));
$contents[] = array('text' => TEXT_NEW_INTRO);
$contents[] = array('text' => ' ' . TEXT_AUTHOR_NAME . ' ' . zen_draw_input_field('author_name', (($author_name) ? $author_name : '')));
$contents[] = array('text' => TEXT_AUTHOR_EMAIL . ' ' . zen_draw_input_field('author_email', (($author_email) ? $author_email : '')));
$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_AUTHOR . '');
$contents = array('form' => zen_draw_form('edit_author', FILENAME_NEWS_AUTHORS, 'page=' . $_GET['page'] . '&aID=' . $aInfo->authors_id . '&query=update_author&action=edit', 'post', 'enctype="multipart/form-data"'));
$contents[] = array('text' => TEXT_EDIT_INTRO);
$contents[] = array('text' => ' ' . TEXT_AUTHOR_NAME . ' ' . zen_draw_input_field('author_name', (($author_name) ? $author_name : $aInfo->author_name)));
$contents[] = array('text' => TEXT_AUTHOR_EMAIL . ' ' . zen_draw_input_field('author_email', (($author_email) ? $author_email : $aInfo->author_email)));
$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_AUTHOR . '');
$contents = array('form' => zen_draw_form('delete_author', FILENAME_NEWS_AUTHORS, 'page=' . $_GET['page'] . '&aID=' . $aInfo->authors_id . '&query=delete_author&action=delete'));
$contents[] = array('text' => TEXT_DELETE_INTRO);
$contents[] = array('text' => ' ' . $aInfo->author_name . '');
if ($aInfo->articles_count > 0) {
$contents[] = array('text' => zen_draw_hidden_field('has_articles', '1') . ' ' . sprintf(TEXT_DELETE_ARTICLES_PRODUCTS, $aInfo->articles_count) . ' ' . zen_draw_radio_field('delete_articles', '1') . ' ' . TEXT_DELETE_ARTICLES . ' ' . zen_draw_radio_field('delete_articles', '0', true) . TEXT_REASSIGN_ARTICLES . ' ' . zen_draw_pull_down_menu('new_authors_id', $authors_array, (($new_authors_id) ? $new_authors_id : '')));
} else {
$contents[] = array('text' => zen_draw_hidden_field('has_articles', '0'));
}
$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($aInfo)) {
$heading[] = array('text' => '' . $aInfo->author_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_NO_OF_ARTICLES . ' ' . $aInfo->articles_count);
}
break;
}
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
$box = new box;
echo '' . $box->infoBox($heading, $contents) . ' | ';
}
echo
' ' .
' ' .
' | ' .
' ' .
' ' .
' | ' .
'' .
'
' .
'