Esempio n. 1
0
function validate_form($fields)
{
    $errors = false;
    foreach ($fields as $key => $value) {
        if (empty($value)) {
            echo $key . " Required" . "<br />";
            array_push($errors, $key);
            $errors = true;
        }
    }
    if ($errors) {
        echo 'create form';
        create_form();
    } else {
        $recipient = '*****@*****.**';
        $subject = 'Site Submission';
        $headers = "MIME-Version: 1.0" . "\r\n";
        $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
        $body = $GLOBALS['report'];
        if (mail($recipient, $subject, $body)) {
            success();
        }
    }
}
Esempio n. 2
0
    $container = create_container('alliance_treaties_processing.php', '');
    $container['alliance_id'] = $alliance->getAllianceID();
    $container['alliance_id_1'] = $db->getField('alliance_id_1');
    $container['aa'] = $db->getField('aa_access');
    $container['alliance_name'] = $temp[$db->getField('alliance_id_1')];
    $container['accept'] = true;
    $PHP_OUTPUT .= create_button($container, 'Accept');
    $container['accept'] = false;
    $PHP_OUTPUT .= '&nbsp;';
    $PHP_OUTPUT .= create_button($container, 'Reject');
    $PHP_OUTPUT .= '<br /><br />';
}
$template->assign('PageTopic', 'Offer A Treaty');
$PHP_OUTPUT .= 'Select the alliance you wish to offer a treaty.<br /><small>Note: Treaties require 24 hours to be canceled once in effect</small><br />';
$container = create_container('skeleton.php', 'alliance_treaties_processing.php');
$container['alliance_id'] = $alliance->getAllianceID();
$form = create_form($container, 'Send the Offer');
$PHP_OUTPUT .= $form['form'];
$PHP_OUTPUT .= '<select name="proposedAlliance" id="InputFields">';
foreach ($temp as $allId => $allName) {
    $PHP_OUTPUT .= '<option value="' . $allId . '">' . $allName . '</option>';
}
$PHP_OUTPUT .= '</select';
$PHP_OUTPUT .= '<br />Choose the treaty terms<br />';
$PHP_OUTPUT .= create_table();
foreach ($types as $checkName => $displayInfo) {
    $PHP_OUTPUT .= '<tr><td>' . $displayInfo[0] . '<br /><small>' . $displayInfo[1] . '</small></td><td><input type="checkbox" name="' . $checkName . '"></td></tr>';
}
$PHP_OUTPUT .= '<tr><td colspan="2">';
$PHP_OUTPUT .= $form['submit'];
$PHP_OUTPUT .= '</td></tr></table></form></div>';
Esempio n. 3
0
                <a href="editpics.php?album={$CLEAN['album']}" class="admin_menu">{$lang_modifyalb_php['edit_files']}</a>
                &nbsp;&nbsp;-&nbsp;&nbsp;
                <a href="index.php?cat={$ALBUM_DATA['category']}" class="admin_menu">{$lang_modifyalb_php['parent_category']}</a>
                &nbsp;&nbsp;-&nbsp;&nbsp;
                <a href="thumbnails.php?album={$CLEAN['album']}" class="admin_menu">{$lang_modifyalb_php['thumbnail_view']}</a>
            </td>
            <td class="tableh2" align="right">
            {$album_lb}
            </td>
        </tr>
        <form method="post" name="modifyalbum" id="cpgform" action="db_input.php">
        <input type="hidden" name="event" value="album_update" />
        <input type="hidden" name="aid" value="{$CLEAN['album']}" />

EOT;
create_form($data);
echo <<<EOT
<tr>
        <td colspan="2" align="left" class="tablef">
EOT;
if (GALLERY_ADMIN_MODE) {
    printf($lang_modifyalb_php['notice1'], '<a href="groupmgr.php">', '</a>');
} else {
    printf($lang_modifyalb_php['notice1'], '', '');
}
echo <<<EOT
        </td>
</tr>
<tr>
        <td colspan="2" align="center" class="tablef">
        <input type="submit" class="button" value="{$lang_modifyalb_php['update']}" />
Esempio n. 4
0
                    }
                }
            }
        }
        pageheader($lang_minicms['minicms']);
        msg_box($lang_minicms['minicms'], $lang_minicms['page_success'], $lang_common['continue'], 'index.php');
    }
    pagefooter();
    exit;
}
pageheader($lang_minicms['minicms']);
$signature = 'Coppermine Photo Gallery ' . COPPERMINE_VERSION . ' (' . COPPERMINE_VERSION_STATUS . ')';
//echo "<form action=\"$PHP_SELF\" method=\"post\">";
echo "<form action=\"" . $CPG_PHP_SELF . '?file=minicms/cms_config' . "\" method=\"post\">";
starttable('100%', "{$lang_minicms['minicms']} - {$signature}", 2);
create_form($lang_minicms_config);
echo '</table></td></tr>';
echo <<<EOT
                <tr>
                        <td align="left" class="tablef">
                            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                <tr>
                                    <td width="67%" align="center">
                                        <input type="submit" class="button" name="update_config" value="{$lang_common['continue']}" />
                                &nbsp;&nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                </tr>
EOT;
<html>
<head>
    <title>XML demo 3: RSS News Viewer</title>
	<link rel="stylesheet" type="text/css" href="css/baseA.css" />	      
</head>
<body>
  <?php 
$feeds = array('http://rss.nytimes.com/services/xml/rss/nyt/Space.xml', 'http://www.usa.gov/rss/updates.xml', 'http://www.nasa.gov/rss/dyn/image_of_the_day.rss', 'http://cscilab.bc.edu/~csinsider/?feed=rss2', 'http://www.newyorker.com/feed/humor');
print_r($_GET);
?>
  <h1>RSS Feeds</h1>
  <?php 
create_form($feeds, "feed");
if (isset($_GET['getfeed'])) {
    handle_form($_GET['feed']);
}
?>
  </body>
</html>
<?php 
function handle_form($myfeed)
{
    $rss = simplexml_load_file($myfeed);
    $title = $rss->channel->title;
    echo "<h1>{$title}</h1>";
    # I would like to do this:
    #     foreach ($rss->channel->item as $item) {
    # or this:
    #     foreach ($rss->item as $item) {
    # but which one depends on the rss version in use.
    $items = $rss->channel->item;
Esempio n. 6
0
    $PHP_OUTPUT .= $form['form'];
    $PHP_OUTPUT .= '<table class="standard"><tr><th>Option</th><th>Name</th><th>Game ID</th>';
    while ($db->nextRecord()) {
        $row = $db->getRow();
        $PHP_OUTPUT .= '<tr>';
        $PHP_OUTPUT .= '<td class="center shrink"><input type="checkbox" name="entry_ids[]" value="' . $row['entry_id'] . '"></td>';
        $PHP_OUTPUT .= '<td>' . $row['player_name'] . '</td>';
        $PHP_OUTPUT .= '<td>' . $row['game_id'] . '</td>';
        $PHP_OUTPUT .= '</tr>';
    }
    $PHP_OUTPUT .= '</table><br />';
    $PHP_OUTPUT .= $form['submit'];
    $PHP_OUTPUT .= '</form><br />';
} else {
    $PHP_OUTPUT .= 'You are currently accepting all communications.<br />';
}
$PHP_OUTPUT .= '<br /><h2>Blacklist Player</h2><br />';
$container = array();
$container['url'] = 'message_blacklist_add.php';
$form = create_form($container, 'Blacklist');
$PHP_OUTPUT .= $form['form'];
$PHP_OUTPUT .= '
<table cellspacing="0" cellpadding="0" class="nobord nohpad">
	<tr>
		<td class="top">Name:&nbsp;</td>
		<td class="mb"><input type="text" name="PlayerName" size="30"></td>
	</tr>
</table><br />
';
$PHP_OUTPUT .= $form['submit'];
$PHP_OUTPUT .= '</form>';
Esempio n. 7
0
    while ($db->nextRecord()) {
        $row = $db->getRow();
        $PHP_OUTPUT .= '<tr>';
        $PHP_OUTPUT .= '<td class="center shrink"><input type="checkbox" name="word_ids[]" value="' . $row['word_id'] . '"></td>';
        $PHP_OUTPUT .= '<td>' . $row['word_value'] . '</td>';
        $PHP_OUTPUT .= '<td>' . $row['word_replacement'] . '</td>';
        $PHP_OUTPUT .= '</tr>';
    }
    $PHP_OUTPUT .= '</table><br />';
    $PHP_OUTPUT .= $form['submit'];
    $PHP_OUTPUT .= '</form><br />';
}
$PHP_OUTPUT .= '<h2>Add Word To Filter</h2><br />';
$container = array();
$container['url'] = 'word_filter_add.php';
$form = create_form($container, 'Add');
$PHP_OUTPUT .= $form['form'];
$PHP_OUTPUT .= '
<table cellspacing="0" cellpadding="0" class="nobord nohpad">
	<tr>
		<td class="top">Word:&nbsp;</td>
		<td class="mb"><input type="text" name="Word" size="30"></td>
	</tr>
	<tr>
		<td class="top">Replacement:&nbsp;</td>
		<td class="mb"><input type="text" name="WordReplacement" size="30"></td>
	</tr>
</table><br />
';
$PHP_OUTPUT .= $form['submit'];
$PHP_OUTPUT .= '</form>';
Esempio n. 8
0
<?php

$template->assign('PageTopic', 'Create Alliance');
$container = create_container('alliance_create_processing.php');
$form = create_form($container, 'Create');
$PHP_OUTPUT .= $form['form'];
$PHP_OUTPUT .= '
<table cellspacing="0" cellpadding="0" class="nobord nohpad">
	<tr>
		<td class="top">Name:</td>
		<td><input type="text" name="name" size="30"></td>
	</tr>
	<tr>
		<td class="top">Description:&nbsp;</td>
		<td><textarea spellcheck="true" name="description"></textarea></td>
	</tr>
	<tr>
		<td class="top">Password:</td>
		<td><input type="password" name="password" size="30"></td>
	</tr>
	<tr>
		<td class="top">Members start with:</td>
		<td>No permissions<input type="radio" name="Perms" value="none"><br />
			Basic permissions<input type="radio" name="Perms" value="basic" checked><br />
			Full permissions<input type="radio" name="Perms" value="full">
		</td>
	</tr>
	<tr>
		<td class="top">Recruiting:</td>
		<td>Yes<input type="radio" name="recruit" value="yes" checked><br />
			No<input type="radio" name="recruit" value="no">
<?php

include 'form.php';
include 'config.php';
if (isset($_POST['submit'])) {
    $fname = get("fname");
    $mname = get("mname");
    $lname = get("lname");
    $residence = get('residence');
    $parish_affiliation = get('affiliation');
    $affiliation = get('affiliate');
    $sex = 'male';
    alert($parish_affiliation);
} else {
    $fname = input_form("Firstname", "fname", "text");
    $mname = input_form("Middlename", "mname", "text");
    $lname = input_form("Lastname", "lname", "text");
    $residence = input_form("Residence", "residence", "area");
    $parish_affiliation = multi("Affiliation", "affiliation", array("Our Lady of Assumption Parish", "Guest"), array("home", "other"), "radio");
    $affiliation = input_form("Affiliation", "affiliate", "text");
    $submit = input_form("Submit", "submit", "submit");
    $form1 = create_form($fname . "" . $mname . "" . $lname . "" . $parish_affiliation . "" . $affiliation . "" . $residence . "" . $submit);
    $card = create_card("Register New Minister", "{$form1}");
    $content = $card;
    newpage($content);
}
Esempio n. 10
0
            echo $roles[$role_id];
        }
        echo '</td>';
    }
    echo '</tr>';
}
echo '</table>';
echo '</div>';
if ($player->alliance_id == 0) {
    // Newbie alliance is unlimited members, * means no new members allowed
    if (($member_count < 30 || $alliance_id == 302) && $password != "*") {
        echo '<br>';
        $container = array();
        $container["url"] = "alliance_join_processing.php";
        $container["alliance_id"] = $alliance_id;
        $form = create_form($container, 'Join');
        echo $form['form'];
        echo 'Enter password to join alliance<br><br>';
        echo '<input type="password" name="password" size="30">&nbsp;';
        echo $form['submit'];
        echo '</form>';
    }
}
if ($alliance_id == $player->alliance_id) {
    echo '<br><h2>Options</h2><br>';
    $container = array();
    $container['url'] = 'skeleton.php';
    $container['body'] = 'alliance_roster.php';
    if (!isset($var['action']) || $var['action'] == 'Hide Alliance Roles') {
        $container['action'] = 'Show Alliance Roles';
        print_button($container, 'Show Alliance Roles');
Esempio n. 11
0
account_id,
player_id,
player_name,
last_active
FROM player
WHERE game_id=' . SmrSession::$game_id . '
AND alliance_id=' . $player->alliance_id . '
AND account_id<>' . SmrSession::$old_account_id . '
ORDER BY last_active DESC
');
echo '<div align="center">';
if ($db->nf() != 0) {
    $container = array();
    $container['url'] = 'alliance_remove_member_processing.php';
    $container['body'] = '';
    $form = create_form($container, 'Banish \'em!');
    echo $form['form'];
    echo '<table cellspacing="0" cellpadding="0" class="standard inset"><th>Trader Name</th><th>Last Online</th><th>Action</th>';
    while ($db->next_record()) {
        // we won't exile ourself!
        if ($player->account_id != $account_id) {
            // get the amount of time since last_active
            $diff = time() - $db->f('last_active');
            if ($diff > 864000) {
                $diff = 864000;
            }
            // green
            if ($diff < 432000) {
                // scale it down to 255
                $dec = round($diff / 1694);
                // make it hex and add leading zero if necessary
Esempio n. 12
0
		<td><input type="text" size="5" name="from" maxlength="5" class="center" value="';
echo $player->sector_id;
echo '"></td>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;To:&nbsp;</td>
		<td><input type="text" size="5" name="to" maxlength="5" class="center"></td>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;';
echo $form['submit'];
echo '	</td>
	</tr>
</table>
</form>';
if (!empty($ship->hardware[HARDWARE_JUMP])) {
    $container = array();
    $container["url"] = "sector_jump_processing.php";
    $container["target_page"] = "current_sector.php";
    $form = create_form($container, 'Engage Jump (15)');
    echo $form['form'];
    echo '
	<br>
	<h2>Jumpdrive</h2><br>
	<table cellspacing="0" cellpadding="0" class="nobord nohpad">
		<tr>

			<td>Jump To:&nbsp;</td>
			<td><input type="text" size="5" name="to" maxlength="5" class="center"></td>
			<td>&nbsp;&nbsp;&nbsp;&nbsp;';
    echo $form['submit'];
    echo '	</td>
		</tr>
	</table>
	</form>';
$template->assign('PageTopic', $alliance->getAllianceName() . ' (' . $alliance->getAllianceID() . ')');
require_once get_file_loc('menu.inc');
create_alliance_menu($alliance->getAllianceID(), $alliance->getLeaderID());
$PHP_OUTPUT .= '<h2>Exemption Requests</h2><br />';
$PHP_OUTPUT .= 'Selecting a box will authorize it, leaving a box unselected will make it unauthorized after you submit.<br />';
//get rid of already approved entries
$db->query('UPDATE alliance_bank_transactions SET request_exempt = 0 WHERE exempt = 1');
//build player array
$db->query('SELECT * FROM player WHERE alliance_id = ' . $db->escapeNumber($alliance->getAllianceID()) . ' AND game_id = ' . $db->escapeNumber($alliance->getGameID()));
while ($db->nextRecord()) {
    $players[$db->getInt('account_id')] = $db->getField('player_name');
}
$db->query('SELECT * FROM alliance_bank_transactions WHERE request_exempt = 1 ' . 'AND alliance_id = ' . $db->escapeNumber($alliance->getAllianceID()) . ' AND game_id = ' . $db->escapeNumber($alliance->getGameID()) . ' AND exempt = 0');
if ($db->getNumRows()) {
    $container = create_container('bank_alliance_exempt_processing.php');
    $form = create_form($container, 'Make Exempt');
    $PHP_OUTPUT .= $form['form'];
    $PHP_OUTPUT .= create_table();
    $PHP_OUTPUT .= '<tr><th>Player Name</th><th>Type</th><th>Reason</th><th>Amount</th><th>Approve</th></tr>';
    while ($db->nextRecord()) {
        $trans = $db->getField('transaction') == 'Payment' ? 'Withdraw' : 'Deposit';
        $PHP_OUTPUT .= '<tr><td>' . $players[$db->getInt('payee_id')] . '</td><td>' . $trans . '</td><td>' . $db->getField('reason') . '</td><td>' . number_format($db->getInt('amount')) . '</td>';
        $PHP_OUTPUT .= '<td><input type="checkbox" name="exempt[' . $db->getField('transaction_id') . ']"></td>';
        $PHP_OUTPUT .= '</tr>';
    }
    $PHP_OUTPUT .= '</table>';
    $PHP_OUTPUT .= '<div align="center">';
    $PHP_OUTPUT .= $form['submit'];
    $PHP_OUTPUT .= '</div></form>';
} else {
    $PHP_OUTPUT .= '<div align="center">Nothing to authorize.</div>';
Esempio n. 14
0
        $result = cpg_db_query("SELECT max(priority) FROM {$CONFIG['TABLE_SHOP_CONFIG']}");
        $temp = mysql_fetch_row($result);
        $priority = is_numeric($temp[0]) ? ++$temp[0] : 0;
        mysql_free_result($result);
        cpg_db_query("INSERT INTO {$CONFIG['TABLE_SHOP_CONFIG']} (priority) VALUES ('{$priority}')");
        photoshop_refresh($_SERVER['PHP_SELF'] . '?file=photo_shop/photo_shop_config');
    } elseif (isset($_POST['apply_modifs'])) {
        photoshop_process_post_data();
    }
}
pageheader($lang_photoshop_config['title']);
$signature = 'Coppermine Photo Gallery ' . COPPERMINE_VERSION . ' (' . COPPERMINE_VERSION_STATUS . ')';
//config start
echo "<form action=\"index.php?file=photo_shop/photo_shop_config\" method=\"post\">";
starttable('100%', "{$lang_photoshop_config['title']} - {$signature}", 3);
create_form($lang_photoshop_admin_data);
echo '</table></td></tr>';
echo <<<EOT
                <tr>
                        <td align="left" class="tablef">
                            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                <tr>
                                    <td width="100%" align="center">
                                        <input type="submit" class="button" name="update_config" value="{$lang_admin_php['save_cfg']}" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                </tr>
EOT;
endtable();
Esempio n. 15
0
            if (strpos($sql_query[$i], '_config') || strpos($sql_query[$i], '_filetypes')) {
                db_query($sql_query[$i]);
            }
        }
    }
    pageheader($lang_config_php['title']);
    msg_box($lang_config_php['info'], $lang_config_php['restore_success'], $lang_continue, $PHP_SELF);
    pagefooter();
}
pageheader($lang_config_php['title']);
$signature = 'Coppermine Photo Gallery ' . COPPERMINE_VERSION;
starttable('100%', "{$lang_config_php['title']} - {$signature}", 2);
echo <<<EOT
        <form action="{$PHP_SELF}" method="post">

EOT;
create_form($lang_config_data);
echo <<<EOT
        <tr>
            <td colspan="2" align="center" class="tablef">
                        <input type="submit" class="button" name="update_config" value="{$lang_config_php['save_cfg']}">
                        &nbsp;&nbsp;
                        <input type="submit" class="button" name="restore_config" value="{$lang_config_php['restore_cfg']}">
                </td>
        </form>
        </tr>

EOT;
endtable();
pagefooter();
ob_end_flush();
Esempio n. 16
0
function mynewtheme_admin()
{
    global $themename, $shortname, $options, $spawned_options, $theme_name;
    if ($_REQUEST['saved']) {
        echo '<div id="message" class="updated fade"><p><strong>' . $themename . ' settings saved for this page.</strong></p></div>';
    }
    if ($_REQUEST['reset_all']) {
        echo '<div id="message" class="updated fade"><p><strong>' . $themename . ' settings reset.</strong></p></div>';
    }
    ?>
<div class="wrap">
    <h2>Settings for <?php 
    echo $themename;
    ?>
</h2>
    <div class="mnt-options">
<?php 
    create_form($options);
    ?>
    </div><!-- mnt-options -->
</div><!-- wrap -->
<?php 
}
Esempio n. 17
0
            if ($db->f('transaction') == 'Deposit') {
                print number_format($db->f('amount'));
            } else {
                echo '&nbsp;';
            }
            echo '</td></tr>';
        }
        echo '<tr>';
        echo '<th colspan="4" class="right">Ending Balance</th><td class="bold shrink right">';
        echo number_format($balance);
        echo '</td></tr></table></div>';
    } else {
        echo '<br>No transactions have been made on this account.<br>';
    }
    echo '<br>';
    echo '<h2>Make transaction</h2><br>';
    $container = array();
    $container['url'] = 'bank_anon_processing.php';
    $container['password'] = $password;
    $container['account_num'] = $account_num;
    $actions = array();
    $actions[] = array('Deposit', 'Deposit');
    $actions[] = array('Withdraw', 'Withdraw');
    $form = create_form($container, $actions);
    echo $form['form'];
    echo 'Amount:&nbsp;<input type="text" name="amount" size="10" value="0"><br><br>';
    echo $form['submit']['Deposit'];
    echo '&nbsp;&nbsp;';
    echo $form['submit']['Withdraw'];
    echo '</form>';
}
function class_form_creator_form_submit($data)
{
    if (count($data['type']) < 1) {
        natural_set_message('Please select at least one type and try again!', 'error');
        exit(0);
    }
    foreach ($data['type'] as $k => $v) {
        if ($v == 'class') {
            class_creator($data['table_name']);
        }
        if ($v == 'form') {
            create_form($data['table_name']);
        }
    }
}
Esempio n. 19
0
			</div>
			<!-- END PAGE HEADER-->
            
			<!-- content -->
           <div class="row">
				<div class="col-md-6 ">
					<!-- BEGIN SAMPLE FORM PORTLET-->
					<div class="portlet box blue">
						<div class="portlet-title">
							<div class="caption">
								<i class="fa fa-cogs"></i> Nuevo Usuario
							</div>
						</div>
						<div class="portlet-body form">
                         <?php 
$forma = array("action" => "admin_new_proc.php", "id" => "admin_new_form", "method" => "post", "enctype" => 0, "edit" => 0, "edit_values" => array(), "submit" => "Guardar");
$fields = array(array("type" => "text", "label" => "Nombre del usuario", "icon" => "fa-user", "required" => true, "name" => "user_fullname", "value" => "", "placeholder" => "Nombre del usuario", "disabled" => false, "data_values" => array(), "editor" => false), array("type" => "text", "label" => "Login", "icon" => "", "required" => true, "name" => "user_login", "value" => "", "placeholder" => "Acceso", "disabled" => false, "data_values" => array(), "editor" => false), array("type" => "email", "label" => "Email", "icon" => "fa-envelope", "required" => true, "name" => "user_email", "value" => "", "placeholder" => "Email", "disabled" => false, "data_values" => array(), "editor" => false), array("type" => "password", "label" => "Contraseña", "icon" => "fa-lock", "required" => true, "name" => "user_passwd", "value" => "", "placeholder" => "Contraseña", "disabled" => false, "data_values" => array(), "editor" => false), array("type" => "password", "label" => "Confirma contraseña", "icon" => "fa-lock", "required" => true, "name" => "user_passwd2", "value" => "", "placeholder" => "Confirma contraseña", "disabled" => false, "data_values" => array(), "editor" => false), array("type" => "dropdown", "label" => "Nivel de acceso", "icon" => "fa-cogs", "required" => true, "name" => "user_level", "value" => "", "placeholder" => "", "disabled" => false, "data_values" => array(array("value" => 2, "option" => "Usuario", "checked" => 0), array("value" => 1, "option" => "Administrador", "checked" => 0)), "editor" => false));
echo create_form($forma, $fields);
?>
						</div>
					</div>
            <!-- end content -->           
            
		</div>
	</div>
	<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->

<?php 
include "includes/footer.php";
Esempio n. 20
0
    $allianceRoles[$roleID]['Name'] = $db->getField('role');
    $allianceRoles[$roleID]['EditingRole'] = $var['role_id'] == $roleID;
    if ($allianceRoles[$roleID]['EditingRole']) {
        $container = create_container('alliance_roles_processing.php');
        $allianceRoles[$roleID]['WithdrawalLimit'] = $db->getInt('with_per_day');
        $allianceRoles[$roleID]['PositiveBalance'] = $db->getBoolean('positive_balance');
        $allianceRoles[$roleID]['TreatyCreated'] = $db->getBoolean('treaty_created');
        $allianceRoles[$roleID]['RemoveMember'] = $db->getBoolean('remove_member');
        $allianceRoles[$roleID]['ChangePass'] = $db->getBoolean('change_pass');
        $allianceRoles[$roleID]['ChangeMod'] = $db->getBoolean('change_mod');
        $allianceRoles[$roleID]['ChangeRoles'] = $db->getBoolean('change_roles');
        $allianceRoles[$roleID]['PlanetAccess'] = $db->getBoolean('planet_access');
        $allianceRoles[$roleID]['ModerateMessageboard'] = $db->getBoolean('mb_messages');
        $allianceRoles[$roleID]['ExemptWithdrawals'] = $db->getBoolean('exempt_with');
        $allianceRoles[$roleID]['SendAllianceMessage'] = $db->getBoolean('send_alliance_msg');
    } else {
        $container = create_container('skeleton.php', 'alliance_roles.php');
        $form = create_form($container, 'Edit');
        $PHP_OUTPUT .= $form['form'];
        $PHP_OUTPUT .= '<input type="text" name="role" value="' . htmlspecialchars($db->getField('role')) . '" maxlength="32">&nbsp;&nbsp;';
        $PHP_OUTPUT .= $form['submit'];
        $PHP_OUTPUT .= '</form><br />';
    }
    $container['role_id'] = $roleID;
    $container['alliance_id'] = $alliance->getAllianceID();
    $allianceRoles[$roleID]['HREF'] = SmrSession::getNewHREF($container);
}
$template->assignByRef('AllianceRoles', $allianceRoles);
$container = create_container('alliance_roles_processing.php');
$container['alliance_id'] = $alliance->getAllianceID();
$template->assign('CreateRole', array('HREF' => SmrSession::getNewHREF($container), 'CreatingRole' => true, 'EditingRole' => true, 'WithdrawalLimit' => 0, 'TreatyCreated' => false, 'RemoveMember' => false, 'ChangePass' => false, 'ChangeMod' => false, 'ChangeRoles' => false, 'PlanetAccess' => true, 'ModerateMessageboard' => false, 'ExemptWithdrawals' => false, 'SendAllianceMessage' => false));
Esempio n. 21
0
function layout_form($use_form)
{
    foreach ($use_form as $form_item) {
        ?>

        <li>
            <?php 
        if (isset($form_item["main_section"])) {
            ?>

                <label class="parent-label"><?php 
            echo $form_item["main_section"];
            ?>
</label>
                <div class="form-wrap">                 	
                    <?php 
            if (is_array($form_item["sub_elements"])) {
                foreach ($form_item["sub_elements"] as $sub_input) {
                    ?>

                             <?php 
                    if (isset($sub_input["show_if"]) && ($sub_input["show_if"] && get_option($sub_input["show_if"]["id"]) !== $sub_input["show_if"]["value"])) {
                        $class = "no_display";
                    } else {
                        $class = "";
                    }
                    ?>

							<div id="<?php 
                    echo $sub_input["id"];
                    ?>
_div" class="child-form <?php 
                    echo $class;
                    ?>
">
								<label class="child-label"><?php 
                    echo $sub_input["label"];
                    ?>
</label>
								
								<?php 
                    create_form($sub_input, count($form_item), "");
                    ?>

                                
								<?php 
                    if ($sub_input["description"] !== "") {
                        ?>

									<span class="tooltip"><?php 
                        echo $sub_input["description"];
                        ?>
</span>
								<?php 
                    }
                    ?>

							</div>
						<?php 
                }
            }
            ?>

					<?php 
            if (isset($form_item["main_image"])) {
                ?>

                        <div class="child-form">
                            <label class="child-label"></label>
                            <img src="<?php 
                echo $form_item["main_image"];
                ?>
" />
                        </div>
                    <?php 
            }
            ?>

                </div>
            <?php 
        } else {
            ?>

                <label class="parent-label"><?php 
            echo $form_item["label"];
            ?>
</label>
                <div class="form-wrap">
                    <?php 
            if (!isset($label_class)) {
                $label_class = "";
            }
            create_form($form_item, count($form_item), $label_class);
            ?>

                    <?php 
            if (isset($form_item["description"]) && $form_item["description"] !== "") {
                ?>

                        <span class="tooltip"><?php 
                $form_item["description"];
                ?>
</span>
                    <?php 
            }
            ?>

                </div>
            <?php 
        }
        ?>

        </li>
<?php 
    }
}
Esempio n. 22
0
    }
    if (!empty($CONFIG['user_field2_name'])) {
        $form_array[] = array($CONFIG['user_field2_name'], 'user2', 0, 255, 1);
    }
    if (!empty($CONFIG['user_field3_name'])) {
        $form_array[] = array($CONFIG['user_field3_name'], 'user3', 0, 255, 1);
    }
    if (!empty($CONFIG['user_field4_name'])) {
        $form_array[] = array($CONFIG['user_field4_name'], 'user4', 0, 255, 1);
    }
    // Check for movies and audio, and create width and height boxes if true.
    if (is_movie($file_set[1]) or is_audio($file_set[1])) {
        //Add width and height boxes to the form.
        $form_array[] = array($lang_admin_php['th_wd'], 'movie_wd', 0, 4, 1);
        $form_array[] = array($lang_admin_php['th_ht'], 'movie_ht', 0, 4, 1);
    }
    // Create the form and echo more instructions.
    create_form($form_array);
    // More instructions.
    if (count($escrow_array) > '1') {
        form_statement($lang_upload_php['place_instr_2']);
    }
    // Make button say 'Continue.'
    close_form($lang_continue);
    // Close the table, create footers, and flush the output buffer.
    endtable();
    pagefooter();
    ob_end_flush();
    // Exit the script.
    exit;
}
Esempio n. 23
0
<?php

if (!isset($var['alliance_id'])) {
    SmrSession::updateVar('alliance_id', $player->getAllianceID());
}
$alliance_id = $var['alliance_id'];
$alliance =& SmrAlliance::getAlliance($alliance_id, $player->getGameID());
$template->assign('PageTopic', $alliance->getAllianceName() . ' (' . $alliance->getAllianceID() . ')');
require_once get_file_loc('menu.inc');
create_alliance_menu($alliance_id, $alliance->getLeaderID());
$container = create_container('alliance_stat_processing.php');
$container['alliance_id'] = $alliance_id;
$form = create_form($container, 'Change');
$role_id = $player->getAllianceRole($alliance->getAllianceID());
$db->query('SELECT * FROM alliance_has_roles WHERE alliance_id = ' . $db->escapeNumber($alliance_id) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND role_id = ' . $db->escapeNumber($role_id));
$db->nextRecord();
$PHP_OUTPUT .= $form['form'];
//$PHP_OUTPUT.=create_echo_form(create_container('alliance_stat_processing.php', ''));
$PHP_OUTPUT .= '<table cellspacing="0" cellpadding="0" class="nobord nohpad">';
if ($db->getBoolean('change_pass')) {
    $PHP_OUTPUT .= '<tr><td class="top">Password:&nbsp;</td><td><input type="password" name="password" size="30" value="' . htmlspecialchars($alliance->getPassword()) . '"></td></tr>';
}
if ($db->getBoolean('change_mod') || $account->hasPermission(PERMISSION_EDIT_ALLIANCE_DESCRIPTION)) {
    $PHP_OUTPUT .= '<tr><td class="top">Description:&nbsp;</td><td><textarea spellcheck="true" name="description">';
    $PHP_OUTPUT .= $alliance->getDescription();
    $PHP_OUTPUT .= '</textarea></td></tr>';
}
if ($player->isAllianceLeader()) {
    $PHP_OUTPUT .= '<tr><td class="top">IRC Channel:&nbsp;</td><td><input type="text" name="irc" size="30" value="' . htmlspecialchars($alliance->getIrcChannel()) . '"> (For Caretaker and autojoining via chat link - works best if you join the channel using the chat link and type "/autoconnect on" as an op)</td></tr>';
}
if ($db->getBoolean('change_mod')) {
Esempio n. 24
0
<?php

$db->query('SELECT leader_id FROM alliance WHERE game_id=' . SmrSession::$game_id . ' AND alliance_id=' . $player->alliance_id . ' LIMIT 1');
$db->next_record();
print_topic($player->alliance_name . ' (' . $player->alliance_id . ')');
include get_file_loc('menue.inc');
print_alliance_menue($player->alliance_id, $db->f('leader_id'));
$container = array();
$container['url'] = 'alliance_broadcast_processing.php';
$container['alliance_id'] = $var['alliance_id'];
echo '<b>From: </b>';
echo $player->player_name . '(' . $player->player_id;
echo ')<br><b>To:</b> Whole Alliance<br><br>';
$form = create_form($container, 'Send Message');
echo $form['form'];
echo '<textarea name="message"></textarea><br><br>';
echo $form['submit'];
echo '</form>';
Esempio n. 25
0
 * @param Mixed $connection
 */
function save_field($form_id, $user_email, $field_type, $field_title, $field_name, $order, $options, $connection)
{
    $sql = "INSERT INTO `forms_fields` (`forms_id`, `forms_users_email`, `fields_type`, `field_title`, `field_name`, " . "`form_order`, `options`) VALUES ({$form_id}, '{$user_email}', '{$field_type}', " . "'{$field_title}', '{$field_name}', {$order}, '{$options}')";
    $connection->query($sql);
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $form_string = null;
    $form_error = array();
    if (!isset($_POST['field_type'])) {
        $form_error['nofields'] = "Form needs atleast one form field to be generated.";
    } else {
        $form_id = null;
        if (isset($_SESSION['user_email'])) {
            $form_id = create_form($_POST['form_name'], date("Y-m-d H:i:s"), $_SESSION['user_email'], $connection);
        }
        $form_string = "<h2>{$_POST['form_name']}</h2><form>";
        $form_string .= "<table>";
        for ($i = 0; $i < count($_POST['field_type']); $i++) {
            $form_string .= get_form_string($i);
            if ($form_id) {
                save_field($form_id, $_SESSION['user_email'], $_POST['field_type'][$i], $_POST['field_title'][$i], $_POST['field_name'][$i], $i + 1, $_POST['field_options'][$i], $connection);
            }
        }
        $form_string .= "</table>";
        $form_string .= "</form>";
        $_SESSION['form_title'] = $_POST['form_name'];
        $_SESSION['form_string'] = $form_string;
    }
}
Esempio n. 26
0
         }
     } else {
         // Nothing set at this category so lets show the current representation instead.
         if ($modulerepresentation->visible) {
             if ($islocked) {
                 $visibletd .= create_image_tag($OUTPUT->pix_url('i/hide'), 'hidden');
                 $visibletd .= $lockedimagetag;
             } else {
                 $visibletd .= create_form($OUTPUT, $currentmodule->name . "_visible_form", $selfpath, $strhide, 'hide', array('module_name' => $currentmodule->name, 'visible' => 'false', 'sesskey' => sesskey()));
             }
         } else {
             if ($islocked) {
                 $visibletd .= create_image_tag($OUTPUT->pix_url('i/show'), 'visible');
                 $visibletd .= $lockedimagetag;
             } else {
                 $visibletd .= create_form($OUTPUT, $currentmodule->name . "_visible_form", $selfpath, $strhide, 'show', array('module_name' => $currentmodule->name, 'visible' => 'true', 'sesskey' => sesskey()));
                 $class = ' class="dimmed_text"';
             }
         }
     }
 }
 $tabledata = array('<span' . $class . '>' . $strmodulename . '</span>');
 if ($haseditvisibilitycapability or $haseditsettingscapability) {
     $tabledata[] = $overridevaluetd;
     $tabledata[] = $visibletd;
     $tabledata[] = $overridetd;
     $tabledata[] = $lockedtd;
     $tabledata[] = $cleartd;
 }
 if ($haseditsettingscapability) {
     $tabledata[] = $settingstd;
Esempio n. 27
0
<?php

$alliance =& $player->getAlliance();
$template->assign('PageTopic', $alliance->getAllianceName() . ' (' . $alliance->getAllianceID() . ')');
require_once get_file_loc('menu.inc');
create_alliance_menu($player->getAllianceID(), $alliance->getLeaderID());
$container = create_container('alliance_leadership_processing.php');
$form = create_form($container, 'Handover Leadership');
$PHP_OUTPUT .= $form['form'];
$PHP_OUTPUT .= 'Please select the new Leader:&nbsp;&nbsp;&nbsp;<select name="leader_id" size="1">';
$db->query('
SELECT account_id,player_id,player_name 
FROM player 
WHERE game_id=' . $db->escapeNumber($alliance->getGameID()) . '
AND alliance_id=' . $db->escapeNumber($alliance->getAllianceID()));
while ($db->nextRecord()) {
    $PHP_OUTPUT .= '<option value="' . $db->getField('account_id') . '"';
    if ($db->getField('account_id') == $player->getAccountID()) {
        $PHP_OUTPUT .= ' selected="selected"';
    }
    $PHP_OUTPUT .= '>';
    $PHP_OUTPUT .= $db->getField('player_name');
    $PHP_OUTPUT .= ' (';
    $PHP_OUTPUT .= $db->getField('player_id');
    $PHP_OUTPUT .= ')</option>';
}
$PHP_OUTPUT .= '</select><br /><br />';
$PHP_OUTPUT .= $form['submit'];
$PHP_OUTPUT .= '</form>';
        $residence = input_form("Residence", "residence", "area");
        $username = input_form("Username", "username", "text");
        $password = input_form("Password", "password", "password");
        $retype_password = input_form("Re-type Password", "re-pass", "password");
        $submit = input_form("Submit", "submit", "submit");
        $section1 = card_break("Login Information", $username . "" . $password . "" . $retype_password);
        $section2 = card_break("Personal Information", $fname . "" . $mname . "" . $lname . "" . $sex . "" . $residence . "" . $submit);
        $form = create_form($section1 . "" . $section2);
        $card = create_card($title, $form);
        $content = $err . "" . $card;
        newpage($content);
    }
} else {
    $title = "Register a new Personnel";
    $desc = "";
    $fname = input_form("Firstname", "fname", "text");
    $mname = input_form("Middlename", "mname", "text");
    $lname = input_form("Lastname", "lname", "text");
    $sex = multi("Sex", "sex", array("Male", "Female"), array("male", "female"), "radio");
    $residence = input_form("Residence", "residence", "area");
    $username = input_form("Username", "username", "text");
    $password = input_form("Password", "password", "password");
    $retype_password = input_form("Re-type Password", "re-pass", "password");
    $submit = input_form("Submit", "submit", "submit");
    $section1 = card_break("Login Information", $username . "" . $password . "" . $retype_password);
    $section2 = card_break("Personal Information", $fname . "" . $mname . "" . $lname . "" . $sex . "" . $residence . "" . $submit);
    $form = create_form($section1 . "" . $section2);
    $card = create_card($title, $form);
    $content = $card;
    newpage($content);
}
<?php

include 'form.php';
$title = "card1";
$desc = "input1";
$s_titles = array('sub 1', 'sub2', "sub_3");
$s_contents = array('content of sub 1', 'content of sub 2', 'cuntent of sub tre');
$card1 = create_card($title, $desc, $s_titles, $s_contents);
//card is a page
//$card2 = create_card("title","description",array("sub_ttiles"),array("$contents"));basic
//function input_form($input_name,$input_id,$type)
$form = create_form(input_form("E-mail", "email", "text"));
$form = $form . "" . create_form(input_form("Password", "pass", "password"));
$card = create_card("Sample Form", $form, array(""), array(""));
$content = $card;
newpage($content);
?>

</body>
</html>
Esempio n. 30
0
    echo '</td>';
    echo '<td class="shrink nowrap top">';
    echo date('n/j/Y g:i:s A', $db->f('sendtime'));
    echo '</td></tr>';
}
print "</table></div>";
if ($mbWrite || in_array($player->account_id, $HIDDEN_PLAYERS)) {
    echo '<br><h2>Create Reply</h2><br>';
    $container = array();
    $container['url'] = 'alliance_message_add_processing.php';
    $container['alliance_id'] = $alliance_id;
    if (isset($var['alliance_eyes'])) {
        $container['alliance_eyes'] = $var['alliance_eyes'];
    }
    $container['thread_index'] = $thread_index;
    $container['thread_ids'] = $var['thread_ids'];
    $container['thread_topics'] = $var['thread_topics'];
    $container['thread_replies'] = $var['thread_replies'];
    $form = create_form($container, 'Create Reply');
    echo $form['form'];
    echo '
	<table cellspacing="0" cellpadding="0" class="nobord nohpad">
		<tr>
			<td class="top">Body:&nbsp;</td>
			<td><textarea name="body"></textarea></td>
		</tr>
	</table><br>
	';
    echo $form['submit'];
    echo '</form>';
}