function search_form() { global $day, $month, $year, $phpc_script, $month_names, $sort_options, $order_options; $day_sequence = create_sequence(1, 31); $month_sequence = create_sequence(1, 12); $year_sequence = create_sequence(1970, 2037); $html_table = tag('table', attributes('class="phpc-main"'), tag('caption', _('Search')), tag('tfoot', tag('tr', tag('td', attributes('colspan="2"'), create_submit(_('Submit'))))), tag('tr', tag('td', _('Phrase') . ': '), tag('td', tag('input', attributes('type="text"', 'name="searchstring"', 'size="32"')), create_hidden('action', 'search'))), tag('tr', tag('td', _('From') . ': '), tag('td', create_select('sday', $day_sequence, $day), create_select('smonth', $month_names, $month), create_select('syear', $year_sequence, $year))), tag('tr', tag('td', _('To') . ': '), tag('td', create_select('eday', $day_sequence, $day), create_select('emonth', $month_names, $month), create_select('eyear', $year_sequence, $year))), tag('tr', tag('td', _('Sort By') . ': '), tag('td', create_select('sort', $sort_options, false))), tag('tr', tag('td', _('Order') . ': '), tag('td', create_select('order', $order_options, false)))); return tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), $html_table); }
function login_form() { global $vars, $phpc_script; $submit_data = tag('td', attributes('colspan="2"'), create_hidden('action', 'login'), create_submit(__('Log in'))); if (!empty($vars['lasturl'])) { $submit_data->prepend(create_hidden('lasturl', escape_entities(urlencode($vars['lasturl'])))); } return tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('table', tag('caption', __('Log in')), tag('thead', tag('tr', tag('th', attributes('colspan="2"'), __('You must have cookies enabled to login.')))), tag('tfoot', tag('tr', $submit_data)), tag('tbody', tag('tr', tag('th', __('Username')), tag('td', create_text('username'))), tag('tr', tag('th', __('Password')), tag('td', create_password('password')))))); }
function display_form() { global $phpc_script, $phpc_token; $tbody = tag('tbody'); foreach (get_config_options() as $element) { $text = $element[1]; $input = create_config_input($element); $tbody->add(tag('tr', tag('th', $text), tag('td', $input))); } return tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('table', attributes("class=\"phpc-container\""), tag('caption', __('Create Calendar')), tag('tfoot', tag('tr', tag('td', attributes('colspan="2"'), create_hidden('phpc_token', $phpc_token), create_hidden('action', 'calendar_form'), create_hidden('submit_form', 'submit_form'), create_submit(__('Submit'))))), $tbody)); }
function config_form() { global $phpc_script, $phpc_user_tz, $phpc_user_lang, $phpc_token; $tz_input = create_multi_select('timezone', get_timezone_list(), $phpc_user_tz); $languages = array("" => __("Default")); foreach (get_languages() as $lang) { $languages[$lang] = $lang; } $lang_input = create_select('language', $languages, $phpc_user_lang); $form = tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('table', attributes("class=\"phpc-container\""), tag('caption', __('Settings')), tag('tfoot', tag('tr', tag('td', attributes('colspan="2"'), create_hidden('phpc_token', $phpc_token), create_hidden('action', 'settings'), create_hidden('phpc_submit', 'settings'), create_submit(__('Submit'))))), tag('tbody', tag('tr', tag('th', __('Timezone')), tag('td', $tz_input)), tag('tr', tag('th', __('Language')), tag('td', $lang_input))))); return tag('div', attrs('id="phpc-config"'), $form); }
function display_form() { global $phpc_script, $phpc_token, $phpcdb; $groups = array(); foreach ($phpcdb->get_groups() as $group) { $groups[$group['gid']] = $group['name']; } $size = sizeof($groups); if ($size > 6) { $size = 6; } return tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('table', attributes("class=\"phpc-container\""), tag('caption', __('Create User')), tag('tfoot', tag('tr', tag('td', attributes('colspan="2"'), create_hidden('phpc_token', $phpc_token), create_hidden('action', 'user_create'), create_hidden('submit_form', 'submit_form'), create_submit(__('Submit'))))), tag('tbody', tag('tr', tag('th', __('User Name')), tag('td', create_text('user_name'))), tag('tr', tag('th', __('Password')), tag('td', create_password('password1'))), tag('tr', tag('th', __('Confirm Password')), tag('td', create_password('password2'))), tag('tr', tag('th', __('Make Admin')), tag('td', create_checkbox('make_admin', '1', false, __('Admin')))), tag('tr', tag('th', __('Groups')), tag('td', create_select('groups[]', $groups, false, attrs('multiple', "size=\"{$size}\""))))))); }
function display_form() { global $phpc_script, $phpc_token, $phpcdb, $vars, $phpc_cal; $groups = array(); foreach ($phpc_cal->get_groups() as $group) { $groups[$group['gid']] = $group['name']; } $size = sizeof($groups); if ($size > 6) { $size = 6; } $user = $phpcdb->get_user($vars["uid"]); $user_groups = array(); foreach ($user->get_groups() as $group) { $user_groups[] = $group['gid']; } return tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('div', attributes("class=\"phpc-container\""), tag('h2', __('Edit User Groups')), tag('div', create_select('groups[]', $groups, $user_groups, attrs('multiple', "size=\"{$size}\""))), tag('div', create_hidden('phpc_token', $phpc_token), create_hidden('uid', $vars['uid']), create_hidden('action', 'user_groups'), create_hidden('submit_form', 'submit_form'), create_submit(__('Submit'))))); }
function login_form() { global $vars, $phpc_script, $day, $year, $month; $lastaction = empty($vars['lastaction']) ? '' : $vars['lastaction']; $submit_data = tag('td', attributes('colspan="2"'), create_hidden('action', 'login'), create_submit(_('Log in'))); if (!empty($vars['lastaction'])) { $submit_data->prepend(create_hidden('lastaction', $vars['lastaction'])); } if (!empty($vars['day'])) { $submit_data->prepend(create_hidden('day', $day)); } if (!empty($vars['month'])) { $submit_data->prepend(create_hidden('month', $month)); } if (!empty($vars['year'])) { $submit_data->prepend(create_hidden('year', $year)); } return tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('table', attributes('class="phpc-main"'), tag('caption', _('Log in')), tag('thead', tag('tr', tag('th', attributes('colspan="2"'), _('You must have cookies enabled to login.')))), tag('tfoot', tag('tr', $submit_data)), tag('tbody', tag('tr', tag('th', _('Username') . ':'), tag('td', create_text('username'))), tag('tr', tag('th', _('Password') . ':'), tag('td', create_password('password')))))); }
function display_day() { global $phpcid, $phpc_cal, $phpc_user, $phpc_script, $phpcdb, $day, $month, $year; $monthname = month_name($month); $results = $phpcdb->get_occurrences_by_date($phpcid, $year, $month, $day); $today_epoch = mktime(0, 0, 0, $month, $day, $year); $have_events = false; $html_table = tag('table', attributes('class="phpc-main"'), tag('caption', "{$day} {$monthname} {$year}"), tag('thead', tag('tr', tag('th', __('Title')), tag('th', __('Time')), tag('th', __('Description'))))); if ($phpc_cal->can_modify()) { $html_table->add(tag('tfoot', tag('tr', tag('td', attributes('colspan="4"'), create_hidden('action', 'event_delete'), create_hidden('day', $day), create_hidden('month', $month), create_hidden('year', $year), create_submit(__('Delete Selected')))))); } $html_body = tag('tbody'); while ($row = $results->fetch_assoc()) { $event = new PhpcOccurrence($row); if (!$event->can_read()) { continue; } $have_events = true; $eid = $event->get_eid(); $oid = $event->get_oid(); $html_subject = tag('td'); if ($event->can_modify()) { $html_subject->add(create_checkbox('eid[]', $eid)); } $html_subject->add(create_occurrence_link(tag('strong', $event->get_subject()), 'display_event', $oid)); if ($event->can_modify()) { $html_subject->add(" ("); $html_subject->add(create_event_link(__('Modify'), 'event_form', $eid)); $html_subject->add(')'); } $html_body->add(tag('tr', $html_subject, tag('td', $event->get_time_span_string()), tag('td', $event->get_desc()))); } $html_table->add($html_body); if ($phpc_cal->can_modify()) { $output = tag('form', attributes("action=\"{$phpc_script}\""), $html_table); } else { $output = $html_table; } if (!$have_events) { $output = tag('h2', __('No events on this day.')); } return tag('', create_day_menu(), $output); }
function config_form() { global $phpc_script, $phpc_user_tz, $phpc_user_lang, $phpc_token, $phpcdb, $phpc_user; $tz_input = create_multi_select('timezone', get_timezone_list(), $phpc_user_tz); $languages = array("" => __("Default")); foreach (get_languages() as $lang) { $languages[$lang] = $lang; } $lang_input = create_select('language', $languages, $phpc_user_lang); $calendars = array("" => __("None")); foreach ($phpcdb->get_calendars() as $calendar) { $calendars[$calendar->get_cid()] = $calendar->get_title(); } $default_input = create_select('default_cid', $calendars, $phpc_user->get_default_cid()); $table = tag('table', attrs('class="phpc-form"')); if (is_user()) { $table->add(tag('tr', tag('th', __('Default Calendar')), tag('td', $default_input))); } $table->add(tag('tr', tag('th', __('Timezone')), tag('td', $tz_input))); $table->add(tag('tr', tag('th', __('Language')), tag('td', $lang_input))); $form = tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('div', attrs('class="phpc-sub-title"'), __('Settings')), $table, create_hidden('phpc_token', $phpc_token), create_hidden('action', 'user_settings_submit'), create_submit(__('Submit'))); return tag('div', attrs('id="phpc-config"'), $form); }
function user_list() { global $phpc_script, $phpcid, $phpcdb, $vars; $users = $phpcdb->get_users_with_permissions($phpcid); $tbody = tag('tbody'); foreach ($users as $user) { $phpc_user = new PhpcUser($user); $group_list = array(); foreach ($phpc_user->get_groups() as $group) { if ($group['cid'] == $phpcid) { $group_list[] = $group['name']; } } $groups = implode(', ', $group_list); $tbody->add(tag('tr', tag('th', $user['username'], create_hidden('uid[]', $user['uid'])), tag('td', create_checkbox("read{$user['uid']}", "1", !empty($user['read']), __('Read'))), tag('td', create_checkbox("write{$user['uid']}", "1", !empty($user['write']), __('Write'))), tag('td', create_checkbox("readonly{$user['uid']}", "1", !empty($user['readonly']), __('Read-only'))), tag('td', create_checkbox("modify{$user['uid']}", "1", !empty($user['modify']), __('Modify'))), tag('td', create_checkbox("admin{$user['uid']}", "1", !empty($user['calendar_admin']), __('Admin'))), tag('td', $groups), tag('td', create_action_link(__("Edit Groups"), "user_groups", array("uid" => $user["uid"]))))); } $hidden_div = tag('div', create_hidden('action', 'user_permissions_submit')); if (isset($vars['phpcid'])) { $hidden_div->add(create_hidden('phpcid', $vars['phpcid'])); } $form = tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), $hidden_div, tag('table', attributes("class=\"phpc-container\""), tag('caption', __('User Permissions')), tag('tfoot', tag('tr', tag('td', attributes('colspan="8"'), create_submit(__('Submit'))))), tag('thead', tag('tr', tag('th', __('User Name')), tag('th', __('Read')), tag('th', __('Write')), tag('th', __('Can Create Read-Only')), tag('th', __('Modify')), tag('th', __('Admin')), tag('th', __('Groups')), tag('th', __('Edit Groups')))), $tbody)); return tag('div', attrs('id="phpc-users"'), $form); }
<?php $sector =& $player->getSector(); $template->assign('PageTopic', 'Place a Bounty'); require_once get_file_loc('menu.inc'); if ($sector->hasHQ()) { create_hq_menu(); } else { create_ug_menu(); } $container = create_container('skeleton.php', 'bounty_place_confirm.php'); transfer('LocationID'); $PHP_OUTPUT .= create_echo_form($container); $PHP_OUTPUT .= 'Select the player you want to add the bounty to<br />'; $PHP_OUTPUT .= '<select name="player_id" size="1" id="InputFields">'; $PHP_OUTPUT .= '<option value="0">[Please Select]</option>'; $db->query('SELECT player_id, player_name FROM player JOIN account USING(account_id) WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND account_id != ' . $db->escapeNumber($player->getAccountID()) . ' ORDER BY player_name'); while ($db->nextRecord()) { $PHP_OUTPUT .= '<option value="' . $db->getInt('player_id') . '">' . $db->getField('player_name') . '</option>'; } $PHP_OUTPUT .= '</select>'; $PHP_OUTPUT .= '<br /><br />'; $PHP_OUTPUT .= 'Enter the amount you wish to place on this player<br />'; $PHP_OUTPUT .= '<table class="standardnobord"><tr><td>Credits:</td><td><input type="number" name="amount" maxlength="10" size="10" id="InputFields"></td></tr>'; $PHP_OUTPUT .= '<tr><td>Smr Credits:</td><td><input type="number" name="smrcredits" maxlength="10" size="10" id="InputFields"></td></tr></table>'; $PHP_OUTPUT .= '<br /><br />'; $PHP_OUTPUT .= create_submit('Place');
$amount = $db->getInt('message_id') + 1; } else { $amount = 1; } $wall = $_REQUEST['wall']; if (isset($wall)) { $db->query('INSERT INTO bar_wall (sector_id, game_id, message_id, message, time) VALUES (' . $db->escapeNumber($sector->getSectorID()) . ', ' . $db->escapeNumber($player->getGameID()) . ', ' . $db->escapeNumber($amount) . ', ' . $db->escapeString($wall) . ' , ' . $db->escapeNumber(TIME) . ')'); } $db->query('SELECT * FROM bar_wall WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND sector_id = ' . $db->escapeNumber($player->getSectorID()) . ' ORDER BY time DESC'); if ($db->getNumRows()) { $PHP_OUTPUT .= '<table class="standard">'; $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<th align="center">Time written</th>'; $PHP_OUTPUT .= '<th align="center">Message</th>'; $PHP_OUTPUT .= '</tr>'; while ($db->nextRecord()) { $time = $db->getInt('time'); $message_on_wall = $db->getField('message'); $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td align="center"><b> ' . date(DATE_FULL_SHORT, $time) . ' </b></td>'; $PHP_OUTPUT .= '<td align="center"><b>' . $message_on_wall . '</b></td>'; $PHP_OUTPUT .= '</tr>'; } $PHP_OUTPUT .= '</table>'; } $template->assign('PageTopic', 'Write on the wall'); $PHP_OUTPUT .= '<br />'; $PHP_OUTPUT .= create_echo_form(create_container('skeleton.php', 'bar_read_wall.php')); $PHP_OUTPUT .= '<textarea spellcheck="true" name="wall" id="InputFieldsText"></textarea><br /><br />'; $PHP_OUTPUT .= create_submit('Write it'); $PHP_OUTPUT .= '</form>';
$GOODS =& Globals::getGoods(); foreach ($GOODS as $goodID => $good) { if (!$ship->hasCargo($goodID) && !$planet->hasStockpile($goodID)) { continue; } if (!$present) { $present = true; $PHP_OUTPUT = ""; } $container = create_container('planet_stockpile_processing.php'); $container['good_id'] = $goodID; $PHP_OUTPUT .= create_echo_form($container); $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td class="left"><img src="' . $good['ImageLink'] . '" width="13" height="16" title="' . $good['Name'] . '" alt=""></td>'; $PHP_OUTPUT .= '<td>' . $good['Name'] . '</td>'; $PHP_OUTPUT .= '<td align="center">' . $ship->getCargo($goodID) . '</td>'; $PHP_OUTPUT .= '<td align="center">' . $planet->getStockpile($goodID) . '</td>'; $PHP_OUTPUT .= '<td align="center"><input type="number" name="amount" value="' . $ship->getCargo($goodID) . '" id="InputFields" size="4" class="center"/></td>'; $PHP_OUTPUT .= '<td>'; $PHP_OUTPUT .= create_submit('Ship'); $PHP_OUTPUT .= ' '; $PHP_OUTPUT .= create_submit('Planet'); $PHP_OUTPUT .= '</td>'; $PHP_OUTPUT .= '</tr>'; $PHP_OUTPUT .= '</form>'; } if ($present) { $PHP_OUTPUT = $table . $PHP_OUTPUT; $PHP_OUTPUT .= '</table>'; $PHP_OUTPUT .= '</p>'; }
<?php $raceName = Globals::getRaceName($var['race_id']); $template->assign('PageTopic', 'Send message to ruling council of the ' . $raceName); require_once get_file_loc('menu.inc'); create_message_menu(); $PHP_OUTPUT .= '<p>'; $container = create_container('council_send_message_processing.php'); transfer('race_id'); $PHP_OUTPUT .= create_echo_form($container); $PHP_OUTPUT .= '<p><small><b>From:</b> ' . $player->getPlayerName() . ' (' . $player->getPlayerID() . ')<br />'; $PHP_OUTPUT .= '<b>To:</b> Ruling Council of ' . $raceName . '</small></p>'; $PHP_OUTPUT .= '<textarea spellcheck="true" name="message" id="InputFields"></textarea><br /><br />'; $PHP_OUTPUT .= create_submit('Send message'); $PHP_OUTPUT .= '</form>'; $PHP_OUTPUT .= '</p>';
<?php $template->assign('PageTopic', 'Warning'); $PHP_OUTPUT .= '<p>As you approach the warp you notice a warning beacon nearby. The beacon sends an automated message to your ship.</p>'; $PHP_OUTPUT .= '<p>"Your racial government cannot protect low-ranking traders in the galaxy you are about to enter. In this area you will be vulnerable to attack by high-ranked ships. It is not recommended that you enter this area at your current status."</p>'; $container = create_container('sector_' . $var['method'] . '_processing.php', ''); transfer('target_page'); transfer('target_sector'); $PHP_OUTPUT .= 'Are you sure you want to leave the newbie galaxy?'; $PHP_OUTPUT .= create_echo_form($container); // for jump we need a 'to' field $PHP_OUTPUT .= '<input type="hidden" name="to" value="' . $var['target_sector'] . '">'; $PHP_OUTPUT .= create_submit('Yes'); $PHP_OUTPUT .= ' '; $PHP_OUTPUT .= create_submit('No'); $PHP_OUTPUT .= '</form>';
$PHP_OUTPUT .= '<td>' . $db2->getField('account_id') . '</td>'; $PHP_OUTPUT .= '<td>' . $db2->getField('login') . '</td>'; $PHP_OUTPUT .= '<td' . ($db2->getBoolean('validated') ? '' : ' style="text-decoration:line-through;"') . '>' . $db2->getField('email') . ' (' . ($db2->getBoolean('validated') ? 'Valid' : 'Invalid') . ')</td>'; $PHP_OUTPUT .= '<td align="center"><input type="checkbox" name="disable_account[]" value="' . $curr_account_id . '"'; // check if this guy is maybe already disabled $db3->query('SELECT * FROM account_is_closed WHERE account_id = ' . $db->escapeNumber($curr_account_id)); if ($isDisabled) { $PHP_OUTPUT .= ' checked'; } else { if ($action == 'Select All') { $PHP_OUTPUT .= ' checked'; } } $PHP_OUTPUT .= '></td>'; $PHP_OUTPUT .= '</tr>'; } $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td colspan="3"> </td>'; $PHP_OUTPUT .= '</tr>'; } $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td colspan="2"> </td>'; $PHP_OUTPUT .= '<td align="center">'; $PHP_OUTPUT .= create_submit('Disable'); $PHP_OUTPUT .= '</td>'; $PHP_OUTPUT .= '</tr>'; $PHP_OUTPUT .= '</table>'; $PHP_OUTPUT .= '</form>'; } else { $PHP_OUTPUT .= 'No double passwords!'; }
$a = 1; foreach ($names as $echoed) { if ($a > 1) { $PHP_OUTPUT .= ','; } $PHP_OUTPUT .= $echoed; $a++; } $PHP_OUTPUT .= '</td><td><input type=checkbox name=same_ip[] value=' . $id . '></td><td>'; $db2->query('SELECT * FROM account_exceptions WHERE account_id = ' . $db2->escapeNumber($id)); if ($db2->nextRecord()) { $ex = $db2->getField('reason'); $PHP_OUTPUT .= $ex; } else { $PHP_OUTPUT .= ' '; } $PHP_OUTPUT .= '</td>'; $db2->query('SELECT * FROM account_is_closed JOIN closing_reason USING(reason_id) WHERE account_id = ' . $db2->escapeNumber($id)); if ($db2->nextRecord()) { $close_reason = $db2->getField('reason'); } $PHP_OUTPUT .= '<td>' . $close_reason . '</td>'; $PHP_OUTPUT .= '</tr>'; $close_reason = ' '; $last_ip = $ip; $last_id = $id; } $PHP_OUTPUT .= '</table>'; $PHP_OUTPUT .= create_submit('Disable Accounts'); $PHP_OUTPUT .= '<input type=hidden name=first value="first"></form></center>'; }
$PHP_OUTPUT .= '<th align="center">Take</th>'; $PHP_OUTPUT .= '</tr>'; $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td align="center">Mines</td>'; $PHP_OUTPUT .= '<td align="center">' . $ship->getMines() . '</td>'; $PHP_OUTPUT .= '<td align="center">' . $forces->getMines() . '</td>'; $PHP_OUTPUT .= '<td align="center"><input type="number" name="drop_mines" min="0" max="50" value="0" id="InputFields" style="width:100px;" class="center"></td>'; $PHP_OUTPUT .= '<td align="center"><input type="number" name="take_mines" min="0" max="50" value="0" id="InputFields" style="width:100px;" class="center"></td>'; $PHP_OUTPUT .= '</tr>'; $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td align="center">Combat Drones</td>'; $PHP_OUTPUT .= '<td align="center">' . $ship->getCDs() . '</td>'; $PHP_OUTPUT .= '<td align="center">' . $forces->getCDs() . '</td>'; $PHP_OUTPUT .= '<td align="center"><input type="number" name="drop_combat_drones" min="0" max="50" value="0" id="InputFields" style="width:100px;" class="center"></td>'; $PHP_OUTPUT .= '<td align="center"><input type="number" name="take_combat_drones" min="0" max="50" value="0" id="InputFields" style="width:100px;" class="center"></td>'; $PHP_OUTPUT .= '</tr>'; $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td align="center">Scout Drones</td>'; $PHP_OUTPUT .= '<td align="center">' . $ship->getSDs() . '</td>'; $PHP_OUTPUT .= '<td align="center">' . $forces->getSDs() . '</td>'; $PHP_OUTPUT .= '<td align="center"><input type="number" name="drop_scout_drones" min="0" max="50" value="0" id="InputFields" style="width:100px;" class="center"></td>'; $PHP_OUTPUT .= '<td align="center"><input type="number" name="take_scout_drones" min="0" max="50" value="0" id="InputFields" style="width:100px;" class="center"></td>'; $PHP_OUTPUT .= '</tr>'; $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td align="center" colspan="3"> </td>'; $PHP_OUTPUT .= '<td align="center" colspan="2">'; $PHP_OUTPUT .= create_submit('Drop/Take'); $PHP_OUTPUT .= '</td>'; $PHP_OUTPUT .= '</tr>'; $PHP_OUTPUT .= '</table>'; $PHP_OUTPUT .= '</form>';
while ($db->nextRecord()) { $galaxies[$db->getField('id')] = $db->getField('name'); } $container = array(); $container['url'] = 'universe_create_warps_processing.php'; $container['game_id'] = $var['game_id']; $PHP_OUTPUT .= create_echo_form($container); $PHP_OUTPUT .= '<p> </p>'; $PHP_OUTPUT .= '<p><table cellpadding="5" border="0">'; $PHP_OUTPUT .= '<tr><td></td>'; foreach ($galaxies as $galaxy_id => $galaxy_name) { $PHP_OUTPUT .= '<th>' . $galaxy_name . '</th>'; } $PHP_OUTPUT .= '</tr>'; foreach ($galaxies as $galaxy_id_1 => $galaxy_name) { $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td align="right">' . $galaxy_name . '</td>'; foreach ($galaxies as $galaxy_id_2 => $galaxy_name) { if ($galaxy_id_1 <= $galaxy_id_2) { $PHP_OUTPUT .= '<td> </td>'; } else { $PHP_OUTPUT .= '<td align="center"><input type="checkbox" name="warp[' . $galaxy_id_1 . '][' . $galaxy_id_2 . ']"></td>'; } } $PHP_OUTPUT .= '</tr>'; } $PHP_OUTPUT .= '</table></p>'; $PHP_OUTPUT .= create_submit('Next >>'); $PHP_OUTPUT .= ' '; $PHP_OUTPUT .= create_submit('Skip >>'); $PHP_OUTPUT .= '</form>';
$container['id'] = $appliee->getAccountID(); $PHP_OUTPUT .= create_link($container, '<span class="yellow">' . $appliee->getPlayerName() . '</span>'); $PHP_OUTPUT .= ' who has '; if ($db->getField('written_before') == 'YES') { $PHP_OUTPUT .= 'written for some kind of a newspaper before.'; } else { $PHP_OUTPUT .= 'not written for a newspaper before.'; } $PHP_OUTPUT .= '<br />'; } $PHP_OUTPUT .= '<br /><br />'; if (isset($var['id'])) { $db->query('SELECT * FROM galactic_post_applications WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND account_id = ' . $db->escapeNumber($var['id'])); $db->nextRecord(); $desc = stripslashes($db->getField('description')); $applie =& SmrPlayer::getPlayer($var['id'], $player->getGameID()); $PHP_OUTPUT .= 'Name : ' . $applie->getPlayerName() . '<br />'; $PHP_OUTPUT .= 'Have you written for some kind of newspaper before? ' . $db->getField('written_before'); $PHP_OUTPUT .= '<br />'; $PHP_OUTPUT .= 'How many articles are you willing to write per week? ' . $db->getField('articles_per_day'); $PHP_OUTPUT .= '<br />'; $PHP_OUTPUT .= 'What do you want to tell the editor?<br /><br />' . $desc; $container = array(); $container['url'] = 'galactic_post_application_answer.php'; transfer('id'); $PHP_OUTPUT .= create_echo_form($container); $PHP_OUTPUT .= '<br /><br />'; $PHP_OUTPUT .= create_submit('Accept'); $PHP_OUTPUT .= create_submit('Reject'); $PHP_OUTPUT .= '</form>'; }
create_galactic_post_menu(); $container = array(); $container['url'] = 'skeleton.php'; $container['body'] = 'galactic_post_view_members.php'; if ($action == 'Remove') { $db->query('DELETE FROM galactic_post_writer WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND account_id = ' . $db->escapeNumber($var['id'])); } $db->query('SELECT * FROM galactic_post_writer WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND account_id != ' . $db->escapeNumber($player->getAccountID())); if ($db->getNumRows()) { $PHP_OUTPUT .= create_table(); $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<th align="center">Player Name</th>'; $PHP_OUTPUT .= '<th align="center">Last Wrote</th>'; $PHP_OUTPUT .= '<th align="center">Options</th>'; $PHP_OUTPUT .= '</tr>'; while ($db->nextRecord()) { $curr_writter =& SmrPlayer::getPlayer($db->getField('account_id'), $player->getGameID()); $time = $db->getField('last_wrote'); $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td align="center">' . $curr_writter->getPlayerName() . '</td>'; $PHP_OUTPUT .= '<td align="center"> ' . date(DATE_FULL_SHORT, $time) . '</td>'; $container['id'] = $curr_writter->getAccountID(); $PHP_OUTPUT .= create_echo_form($container); $PHP_OUTPUT .= '<td>'; $PHP_OUTPUT .= create_submit('Remove'); $PHP_OUTPUT .= '</td>'; $PHP_OUTPUT .= '</tr>'; $PHP_OUTPUT .= '</form>'; } $PHP_OUTPUT .= '</table>'; }
$planet =& $player->getSectorPlanet(); $template->assign('PageTopic', 'Planet : ' . $planet->getName() . ' [Sector #' . $player->getSectorID() . ']'); require_once get_file_loc('menu.inc'); create_planet_menu($planet); $PHP_OUTPUT .= '<p>'; if (!$planet->hasOwner()) { $PHP_OUTPUT .= 'The planet is unclaimed.'; $PHP_OUTPUT .= create_echo_form(create_container('planet_ownership_processing.php', '')); $PHP_OUTPUT .= create_submit('Take Ownership'); $PHP_OUTPUT .= '</form>'; } else { if ($planet->getOwnerID() != $player->getAccountID()) { $PHP_OUTPUT .= 'You can claim the planet when you enter the correct password.'; $PHP_OUTPUT .= create_echo_form(create_container('planet_ownership_processing.php', '')); $PHP_OUTPUT .= '<input type="text" name="password" id="InputFields"> '; $PHP_OUTPUT .= create_submit('Take Ownership'); $PHP_OUTPUT .= '</form>'; } else { $PHP_OUTPUT .= 'You can set a password for that planet.'; $PHP_OUTPUT .= create_echo_form(create_container('planet_ownership_processing.php', '')); $PHP_OUTPUT .= '<input type="text" name="password" value="' . htmlspecialchars($planet->getPassword()) . '" id="InputFields"> '; $PHP_OUTPUT .= create_submit('Set Password'); $PHP_OUTPUT .= '</form>'; $PHP_OUTPUT .= 'You can rename the planet.'; $PHP_OUTPUT .= create_echo_form(create_container('planet_ownership_processing.php', '')); $PHP_OUTPUT .= '<input type="text" name="name" value="' . htmlspecialchars($planet->getName()) . '" id="InputFields"> '; $PHP_OUTPUT .= create_submit('Rename'); $PHP_OUTPUT .= '</form>'; } } $PHP_OUTPUT .= '</p>';
$PHP_OUTPUT .= '<br />'; $container['body'] = 'games_previous_detail.php'; $PHP_OUTPUT .= create_echo_form($container); $PHP_OUTPUT .= create_submit('Top Mined Sectors'); $PHP_OUTPUT .= '<br />'; $PHP_OUTPUT .= create_submit('Sectors with most Forces'); $PHP_OUTPUT .= '<br />'; $PHP_OUTPUT .= create_submit('Top Killing Sectors'); $PHP_OUTPUT .= '<br />'; $PHP_OUTPUT .= create_submit('Top Planets'); $PHP_OUTPUT .= '<br />'; $PHP_OUTPUT .= create_submit('Top Alliance Experience'); $PHP_OUTPUT .= '<br />'; $PHP_OUTPUT .= create_submit('Top Alliance Kills'); $PHP_OUTPUT .= '<br />'; $PHP_OUTPUT .= create_submit('Top Alliance Deaths'); $PHP_OUTPUT .= '</form>'; $PHP_OUTPUT .= '<br />'; } else { if ($action == 'Top Mined Sectors') { $sql = 'mines'; $from = 'sector'; $dis = 'Mines'; } elseif ($action == 'Sectors with most Forces') { $sql = 'mines + combat + scouts'; $from = 'sector'; $dis = 'Forces'; } elseif ($action == 'Top Killing Sectors') { $sql = 'kills'; $from = 'sector'; $dis = 'Kills';
function event_form() { global $vars, $day, $month, $year, $db, $config, $phpc_script, $month_names, $event_types; if (isset($vars['id'])) { // modifying $id = $vars['id']; $title = sprintf(_('Editing Event #%d'), $id); $row = get_event_by_id($id); $subject = htmlspecialchars(stripslashes($row['subject'])); $desc = htmlspecialchars(stripslashes($row['description'])); $year = $row['year']; $month = $row['month']; $day = $row['day']; $hour = date('H', strtotime($row['starttime'])); $minute = date('i', strtotime($row['starttime'])); $end_year = $row['end_year']; $end_month = $row['end_month']; $end_day = $row['end_day']; $durmin = $row['duration'] % 60; $durhr = floor($row['duration'] / 60); if (!$config['hours_24']) { if ($hour > 12) { $pm = true; $hour = $hour - 12; } elseif ($hour == 12) { $pm = true; } else { $pm = false; } } $typeofevent = $row['eventtype']; $multiday = $year != $end_year || $month != $end_month || $day != $end_day; } else { // case "add": $title = _('Adding event to calendar'); $subject = ''; $desc = ''; if ($day == date('j') && $month == date('n') && $year == date('Y')) { if ($config['hours_24']) { $hour = date('G'); } else { $hour = date('g'); if (date('a') == 'pm') { $pm = true; } else { $pm = false; } } } else { $hour = 6; $pm = true; } $minute = 0; $end_day = $day; $end_month = $month; $end_year = $year; $durhr = 1; $durmin = 0; $typeofevent = 1; $multiday = false; } if ($config['hours_24']) { $hour_sequence = create_sequence(0, 23); } else { $hour_sequence = create_sequence(1, 12); } $minute_sequence = create_sequence(0, 59, 5, 'minute_pad'); $year_sequence = create_sequence(1970, 2037); $html_time = tag('td', create_select('hour', $hour_sequence, $hour), tag('b', ':'), create_select('minute', $minute_sequence, $minute)); if (!$config['hours_24']) { if ($pm) { $value = 1; } else { $value = 0; } $html_time->add(create_select('pm', array(_('AM'), _('PM')), $value)); } if (isset($id)) { $input = create_hidden('id', $id); } else { $input = ''; } $attributes = attributes('class="phpc-main"'); $day_of_month_sequence = create_sequence(1, 31); return tag('form', attributes("action=\"{$phpc_script}\""), tag('table', $attributes, tag('caption', $title), tag('tfoot', tag('tr', tag('td', attributes('colspan="2"'), $input, create_submit(_("Submit Event")), create_hidden('action', 'event_submit')))), tag('tbody', tag('tr', tag('th', _('Date of event')), tag('td', create_select('day', $day_of_month_sequence, $day), create_select('month', $month_names, $month), create_select('year', $year_sequence, $year))), tag('tr', tag('th', _('Multiple day event')), tag('td', create_checkbox('multiday', '1', $multiday))), tag('tr', tag('th', _('End date (Multiple day events only)')), tag('td', create_select('endday', $day_of_month_sequence, $end_day), create_select('endmonth', $month_names, $end_month), create_select('endyear', $year_sequence, $end_year))), tag('tr', tag('th', _('Event type')), tag('td', create_select('typeofevent', $event_types, $typeofevent))), tag('tr', tag('th', _('Time')), $html_time), tag('tr', tag('th', _('Duration')), tag('td', create_select('durationhour', create_sequence(0, 23), $durhr), _('hour(s)') . "\n", create_select('durationmin', $minute_sequence, $durmin), _('minutes') . "\n")), tag('tr', tag('th', _('Subject') . ' (' . $config['subject_max'] . ' ' . _('chars max') . ')'), tag('td', tag('input', attributes('type="text"', "size=\"{$config['subject_max']}\"", "maxlength=\"{$config['subject_max']}\"", 'name="subject"', "value=\"{$subject}\"")))), tag('tr', tag('th', _('Description')), tag('td', tag('textarea', attributes('rows="5"', 'cols="50"', 'name="description"'), $desc)))))); }
$amount = $db->getInt('message_id') + 1; } else { $amount = 1; } $gossip_tell = $_REQUEST['gossip_tell']; if (isset($gossip_tell)) { $db->query('INSERT INTO bar_tender (game_id, message_id, message) VALUES (' . $db->escapeNumber($player->getGameID()) . ', ' . $db->escapeNumber($amount) . ', ' . $db->escapeString($gossip_tell) . ' )'); } $db->query('SELECT * FROM bar_tender WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY rand() LIMIT 1'); if ($db->nextRecord()) { $PHP_OUTPUT .= 'I heard '; $message = $db->getField('message'); $PHP_OUTPUT .= $message . '<br /><br />'; $PHP_OUTPUT .= 'Got anything else to tell me?<br />'; } else { $PHP_OUTPUT .= 'I havent heard anything recently...got anything to tell me?<br /><br />'; } $PHP_OUTPUT .= create_echo_form(create_container('skeleton.php', 'bar_talk_bartender.php')); $PHP_OUTPUT .= '<input type="text" name="gossip_tell" size="30" id="InputFields">'; $PHP_OUTPUT .= create_submit('Tell him'); $PHP_OUTPUT .= '</form><br />'; $PHP_OUTPUT .= 'What else can I do for ya?'; $PHP_OUTPUT .= '<br /><br />'; $PHP_OUTPUT .= create_echo_form(create_container('skeleton.php', 'bar_buy_drink_processing.php')); $PHP_OUTPUT .= create_submit('Buy a drink ($10)'); $PHP_OUTPUT .= '<br />'; $PHP_OUTPUT .= create_submit('Buy some water ($10)'); $PHP_OUTPUT .= '</form><br />'; $PHP_OUTPUT .= create_echo_form(create_container('skeleton.php', 'bar_talk_bartender.php')); $PHP_OUTPUT .= create_submit('Talk to bartender'); $PHP_OUTPUT .= '</form>';
$PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<th align=center>Game ID</th>'; $PHP_OUTPUT .= '<th align=center>Sender ID</th>'; $PHP_OUTPUT .= '<th align=center>Bad text</th>'; $PHP_OUTPUT .= '<th align=center>Ignore</th>'; $PHP_OUTPUT .= '</tr>'; } //lets echo this message $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td align=center>' . $db2->getField('game_id') . '</td>'; $PHP_OUTPUT .= '<td align=center>' . $db2->getField('sender_id') . '</td>'; $array = array(); $array[] = ucfirst($word); $array[] = strtoupper($word); $array[] = strtolower($word); $bad = str_replace($array, '<b><span class="red">' . $word . '</span></b>', $db->escapeString($bad)); $PHP_OUTPUT .= '<td align=center>' . $bad . '</td>'; $PHP_OUTPUT .= '<td align=center><input type=checkbox name=personal[] value=' . $msg_id . '></td>'; $PHP_OUTPUT .= '</tr>'; //update count $count += 1; } } if ($count == 0) { $PHP_OUTPUT .= 'No harmful messages found in personal messages</form><br />'; } else { $PHP_OUTPUT .= '</table>'; $PHP_OUTPUT .= '<a name=button2>'; $PHP_OUTPUT .= create_submit('Add To Exception Table'); $PHP_OUTPUT .= '</a></form>'; }
} elseif ($out || $out2) { $PHP_OUTPUT .= ' class="red"'; } elseif ($id == $player->getAllianceID() || $curr_id == $player->getAllianceID()) { $PHP_OUTPUT .= ' class="bold"'; } $PHP_OUTPUT .= '>'; $PHP_OUTPUT .= '0'; } } $PHP_OUTPUT .= '</td>'; } $PHP_OUTPUT .= '</tr>'; } $PHP_OUTPUT .= '</table>'; $PHP_OUTPUT .= '<br />'; $PHP_OUTPUT .= create_submit('Show'); $PHP_OUTPUT .= '</form>'; $PHP_OUTPUT .= '</div>'; if (isset($var['alliance_id'])) { $PHP_OUTPUT .= '<table align="center"><tr><td width="45%" align="center" valign="top">'; $main_alliance =& SmrAlliance::getAlliance($var['alliance_id'], $player->getGameID()); $db->query('SELECT * FROM alliance_vs_alliance WHERE alliance_id_1 = ' . $db->escapeNumber($var['alliance_id']) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY kills DESC'); if ($db->getNumRows() > 0) { $PHP_OUTPUT .= '<div align="center">Kills for ' . $main_alliance->getAllianceName(); $PHP_OUTPUT .= '<table class="standard"><tr><th align=center>Alliance Name</th>'; $PHP_OUTPUT .= '<th align="center">Amount</th></tr>'; while ($db->nextRecord()) { $kills = $db->getField('kills'); $id = $db->getField('alliance_id_2');
function display_day($day, $month, $year) { global $db, $config, $phpc_script; $tablename = date('Fy', mktime(0, 0, 0, $month, 1, $year)); $monthname = month_name($month); $result = get_events_by_date($day, $month, $year); $today_epoch = mktime(0, 0, 0, $month, $day, $year); if ($row = $result->FetchRow()) { $html_table = tag('table', attributes('class="phpc-main"'), tag('caption', "{$day} {$monthname} {$year}"), tag('thead', tag('tr', tag('th', _('Title')), tag('th', _('Time')), tag('th', _('Duration')), tag('th', _('Description'))))); if (is_user() || $config['anon_permission'] >= 2) { $html_table->add(tag('tfoot', tag('tr', tag('td', attributes('colspan="4"'), create_hidden('action', 'event_delete'), create_hidden('day', $day), create_hidden('month', $month), create_hidden('year', $year), create_submit(_('Delete Selected')))))); } $html_body = tag('tbody'); for (; $row; $row = $result->FetchRow()) { $subject = htmlspecialchars(strip_tags(stripslashes($row['subject']))); if (empty($subject)) { $subject = _('(No subject)'); } $desc = parse_desc($row['description']); $time_str = formatted_time_string($row['starttime'], $row['eventtype']); $dur_str = get_duration($row['duration'], $row['eventtype']); $html_subject = tag('td', attributes('class="phpc-list"')); if (check_user($row['uid']) || $config['anon_permission'] >= 2) { $html_subject->add(create_checkbox('id', $row['id'])); } $html_subject->add(create_id_link(tag('strong', $subject), 'display', $row['id'])); if (check_user($row['uid']) || $config['anon_permission'] >= 2) { $html_subject->add(' ('); $html_subject->add(create_id_link(_('Modify'), 'event_form', $row['id'])); $html_subject->add(')'); } $html_body->add(tag('tr', $html_subject, tag('td', attributes('class="phpc-list"'), $time_str), tag('td', attributes('class="phpc-list"'), $dur_str), tag('td', attributes('class="phpc-list"'), $desc))); } $html_table->add($html_body); if (is_user() || $config['anon_permission'] >= 2) { $output = tag('form', attributes("action=\"{$phpc_script}\""), $html_table); } else { $output = $html_table; } } else { $output = tag('h2', _('No events on this day.')); } return $output; }
ORDER BY location_type_id'); while ($db->nextRecord()) { // get the name for this race // HACK! cut ' HQ' from location name! $race_name = substr($db->getField('location_name'), 0, -3); // get race id for this race $db2->query('SELECT race_id FROM race WHERE race_name = ' . $db->escapeString($race_name) . ' LIMIT 1'); if ($db2->nextRecord()) { $race_id = $db2->getField('race_id'); } else { create_error('Couldn\'t find the ' . $race_name . ' in database!'); } if (in_array($race_id, $only)) { continue; } $only[] = $race_id; // hack for the user mrspock if ($player_name == 'MrSpock' && $race_name == 'Salvene') { $selected = ' selected="selected"'; } else { $selected = ''; } $PHP_OUTPUT .= '<option value="' . $race_id . '"' . $selected . '>' . $race_name . '</option>'; } $PHP_OUTPUT .= '</select><br><br><br>'; $PHP_OUTPUT .= '</p>'; $PHP_OUTPUT .= create_submit('Next >>'); $PHP_OUTPUT .= ' '; //PAGE if ($player_name != 'MrSpock') $PHP_OUTPUT .= create_submit('End >>'); $PHP_OUTPUT .= '</form>';
} } else { $PHP_OUTPUT .= 'Data Error 1: ' . $match . ' does not exist!<br />'; $continue = 'next'; $names[] = $login_name; } } } //end while (continue) $PHP_OUTPUT .= '</td>'; $account_wanted = $db->getField('account_id'); $PHP_OUTPUT .= '<td align=center><input type="text" name="exception[' . $account_wanted . ']" value="no_reason" size="30" id="InputFields"></td>'; $PHP_OUTPUT .= '<td align="center"><input type="checkbox" name="account_id[]" value="' . $account_wanted . '"></td>'; $PHP_OUTPUT .= '</tr>'; } else { $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td align="center" rowspan="7">' . $name . ' doesn\'t exist</td>'; $PHP_OUTPUT .= '</tr>'; } } //end foreach $PHP_OUTPUT .= '<tr>'; $PHP_OUTPUT .= '<td align="center" rowspan=4>'; $PHP_OUTPUT .= create_submit('Reopen and add to exceptions'); $PHP_OUTPUT .= '</td>'; $PHP_OUTPUT .= '<td align="center" rowspan=3>'; $PHP_OUTPUT .= create_submit('Reopen without exception'); $PHP_OUTPUT .= '</td></tr>'; $PHP_OUTPUT .= '</table>'; } //end else