|
|
|
|
Execute($admins_query_raw);
while (!$admins->EOF) {
if ((!isset($_GET['adminID']) || (isset($_GET['adminID']) && ($_GET['adminID'] == $admins->fields['admin_id']))) && !isset($adminInfo) && (substr($action, 0, 3) != 'new')) {
$adminInfo = new objectInfo($admins->fields);
}
if (isset($adminInfo) && is_object($adminInfo) && ($admins->fields['admin_id'] == $adminInfo->admin_id)) {
echo '' . "\n";
} else {
echo ' ' . "\n";
}
?>
fields['admin_id']; ?> |
fields['admin_name']; ?> |
fields['admin_email']; ?> |
fields['admin_id'] . '&action=edit') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . ''; ?>
fields['admin_id'] . '&action=delete') . '">' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . ''; ?>
fields['admin_id'] . '&action=resetpassword') . '">' . zen_image(DIR_WS_IMAGES . 'icon_reset.gif', ICON_RESET) . ''; ?>
|
MoveNext();
}
?>
display_count($admins_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_ADMINS); ?> |
display_links($admins_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?> |
|
admin_id . '&action=new') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . '';
?>
|
|
'' . TEXT_HEADING_NEW_ADMIN . '');
$contents = array('form' => zen_draw_form('new_admin', FILENAME_ADMIN, 'action=insert', 'post', 'enctype="multipart/form-data"'));
$contents[] = array('text' => TEXT_NEW_INTRO);
$contents[] = array('text' => ' ' . TEXT_ADMINS_NAME . ' ' . zen_draw_input_field('admin_name', '', zen_set_field_length(TABLE_ADMIN, 'admin_name', $max=30)) );
$contents[] = array('text' => ' ' . TEXT_ADMINS_EMAIL . ' ' . zen_draw_input_field('admin_email', '', zen_set_field_length(TABLE_ADMIN, 'admin_email', $max=30)) );
$contents[] = array('text' => ' ' . TEXT_ADMINS_PASSWORD . ' ' . zen_draw_password_field('password_new', '', zen_set_field_length(TABLE_ADMIN, 'admin_pass', $max=20)) );
$contents[] = array('text' => ' ' . TEXT_ADMINS_CONFIRM_PASSWORD . ' ' . zen_draw_password_field('password_confirmation', '', zen_set_field_length(TABLE_ADMIN, 'admin_pass', $max=20)) );
$contents[] = array('text' => zen_draw_hidden_field('admin_level', '1') );
$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_ADMIN . '');
$contents = array('form' => zen_draw_form('edit_admin', FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id . '&action=save', 'post', 'enctype="multipart/form-data"'));
$contents[] = array('text' => TEXT_EDIT_INTRO);
$contents[] = array('text' => ' ' . $adminInfo->admin_id . ' - ' . $adminInfo->admin_name . '');
$contents[] = array('text' => ' ' . TEXT_ADMINS_NAME . ' ' . zen_draw_input_field('admin_name', $adminInfo->admin_name, zen_set_field_length(TABLE_ADMIN, 'admin_name', $max=30)) );
$contents[] = array('text' => ' ' . TEXT_ADMINS_EMAIL . ' ' . zen_draw_input_field('admin_email', $adminInfo->admin_email, zen_set_field_length(TABLE_ADMIN, 'admin_email', $max=30)) );
$admin_current = $db->Execute("select admin_level from " . TABLE_ADMIN . " where admin_id='" . $_SESSION['admin_id'] . "'");
/*
if ($admin_current->fields['admin_level'] == '1') {
$contents[] = array('text' => ' ' . TEXT_ADMIN_LEVEL_INSTRUCTIONS);
$contents[] = array(
'text' => '' . TEXT_ADMINS_LEVEL . ' ' . zen_draw_input_field('admin_level', $adminInfo->admin_level, zen_set_field_length(TABLE_ADMIN, 'admin_level'))
);
*/
$demo_status= zen_get_configuration_key_value('ADMIN_DEMO');
switch ($demo_status) {
case '0': $on_status = false; $off_status = true; break;
case '1': $on_status = true; $off_status = false; break;
default: $on_status = false; $off_status = true; break;
}
if ($on_status == true) {
$contents[] = array('text' => ' ' . TEXT_ADMIN_DEMO);
$contents[] = array('text' => '' . TEXT_DEMO_STATUS . ' ' . zen_draw_radio_field('demo_status', '1', $on_status) . ' ' . TEXT_DEMO_ON . ' ' . zen_draw_radio_field('demo_status', '0', $off_status) . ' ' . TEXT_DEMO_OFF);
} else {
$contents[] = array('text' => zen_draw_hidden_field('demo_status', 0) );
}
$contents[] = array('align' => 'center',
'text' => ' ' . zen_image_submit('button_save.gif', IMAGE_SAVE) . '' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
//-------------------------------------------------------------------------------------------------------------------------
case 'resetpassword':
$heading[] = array('text' => '' . TEXT_HEADING_RESET_PASSWORD . '');
$contents = array('form' => zen_draw_form('reset_password', FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id . '&action=reset',
'post', 'enctype="multipart/form-data"') . zen_draw_hidden_field('admin_name', $adminInfo->admin_name) . zen_draw_hidden_field('admin_email', $adminInfo->admin_email) . zen_draw_hidden_field('admin_level', $adminInfo->admin_level));
$contents[] = array('text' => TEXT_EDIT_INTRO);
$contents[] = array('text' => ' ' . $adminInfo->admin_id . ' - ' . $adminInfo->admin_name . '');
$contents[] = array('text' => ' ' . TEXT_ADMINS_PASSWORD . ' ' . zen_draw_password_field('password_new', '', zen_set_field_length(TABLE_ADMIN, 'admin_pass', $max=25)) );
$contents[] = array('text' => ' ' . TEXT_ADMINS_CONFIRM_PASSWORD . ' ' . zen_draw_password_field('password_confirmation', '', zen_set_field_length(TABLE_ADMIN, 'admin_pass', $max=25)) );
$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_ADMIN . '');
$contents = array('form' => zen_draw_form('delete_admin', FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id . '&action=deleteconfirm'));
$contents[] = array('text' => TEXT_DELETE_INTRO);
$contents[] = array('text' => ' ' . $adminInfo->admin_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($adminInfo) && is_object($adminInfo)) {
$heading[] = array('text' => '' . $adminInfo->admin_name . '');
$contents[] = array('align' => 'center',
'text' => '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '' . zen_image_button('button_reset_pwd.gif', IMAGE_RESET) . '' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '');
}
break;
//-------------------------------------------------------------------------------------------------------------------------
} // end switch action
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
echo '' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|