Exemple #1
0
/**
 * Make an input field
 * @param string $label
 * @param string $field
 * @param string $name
 * @param string $size
 * @param array $values
 * @param string $add
 */
function addressbook_inp_field($label, $field, $name, $size, $values, $add)
{
    global $color;
    $value = isset($values[$field]) ? $values[$field] : '';
    $td_str = addInput($name . '[' . $field . ']', $value, $size) . $add;
    return html_tag('tr', html_tag('td', $label . ':', 'right', $color[4]) . html_tag('td', $td_str, 'left', $color[4])) . "\n";
}
Exemple #2
0
 function execute()
 {
     $Id = __post("Id");
     if ((int) $Id > 0) {
         $token = __post("token");
         $data = $this->getListDetail($Id);
         foreach ($data as $key => $value) {
             ${$key} = $value;
         }
     }
     $list_form = new XTemplate('Config/HospitalAdd.html');
     $arr_info_province_id = $this->getListProvince();
     $Attr_province_id = array('rel' => '{Require:\'R\',Alert:\'Vui lòng chọn tỉnh thành \'}', 'style' => '');
     $txt_province_id = addSelectList2('province_id', $arr_info_province_id, NULL, $Attr_province_id, $list_form, $province_id);
     $arr_info_status = array(1 => 'Active', 0 => 'InActive');
     $Attr_status = array('rel' => '{Require:\'R\',Alert:\'Vui lòng chọn trạng thái \'}', 'style' => '');
     $txt_status = addSelectList2('status', $arr_info_status, NULL, $Attr_status, $list_form, $status);
     $Attr_pstname = array('rel' => '{Require:\'R\',Alert:\'Vui lòng nhập tên bệnh viện \'}', 'style' => 'width:200px;');
     $txt_pstname = addInput('text', 'name', $name, $Attr_pstname, $list_form);
     $Attr_pstorder = array('style' => '');
     $txt_pstorder = addInput('text', 'order', $order, $Attr_pstorder, $list_form);
     $list_form->assign('Id', $Id);
     $list_form->assign('token', $token);
     $list_form->parse('main');
     $html = $list_form->out_return('main');
     die($html);
 }
Exemple #3
0
            $editfield = '';
            $i = 0;
            foreach ($data['value'] as $k => $v) {
                if ($data['type'] == 'array_keyval') {
                    $editfield .= addInput("config_{$key}[{$i}][key]", $k, 0, 0, $extra);
                    $editfield .= addInput("config_{$key}[{$i}][val]", $v, 0, 0, $extra);
                } else {
                    $editfield .= addInput("config_{$key}[{$i}]", $v, 0, 0, $extra);
                }
                $editfield .= "<br />";
                $i++;
            }
            if ($data['type'] == 'array_keyval') {
                $editfield .= addInput("config_{$key}[{$i}][key]", '', 0, 0, $extra);
                $editfield .= addInput("config_{$key}[{$i}][val]", '', 0, 0, $extra);
            } else {
                $editfield .= addInput("config_{$key}[{$i}]", '', 0, 0, $extra);
            }
            break;
        default:
            $editfield = '';
            break;
    }
    // Ignore unknown datatypes
    if (empty($editfield)) {
        continue;
    }
    echo "<tr><td>" . htmlspecialchars(ucfirst(strtr($key, '_', ' '))) . "</td><td style=\"white-space: nowrap;\">" . $editfield . "</td><td>" . htmlspecialchars($data['desc']) . "</td></tr>\n";
}
echo "</tbody>\n</table>\n<p>" . addSubmit('Save', 'save') . addSubmit('Cancel', 'cancel', null, true, 'formnovalidate') . "</p>" . addEndForm();
require LIBWWWDIR . '/footer.php';
Exemple #4
0
    ?>
		<label for='data_0__mapping__0__extra__{id}__allow_submit_0'>no</label>
	</td>
	<td>
		<?php 
    echo addRadioButton("data[0][mapping][0][extra][{id}][allow_judge]", true, 1);
    ?>
		<label for='data_0__mapping__0__extra__{id}__allow_judge_1'>yes</label>
		<?php 
    echo addRadioButton("data[0][mapping][0][extra][{id}][allow_judge]", false, 0);
    ?>
		<label for='data_0__mapping__0__extra__{id}__allow_judge_0'>no</label>
	</td>
	<td>
		<?php 
    echo addInput("data[0][mapping][0][extra][{id}][color]", '{color}', 15, 25, 'class="color {required:false,adjust:false,hash:true,caps:false}"');
    ?>
	</td>
	<td>
		<?php 
    echo addInputField('number', "data[0][mapping][0][extra][{id}][lazy_eval_results]", '{lazy_eval_results}', ' min="0" max="1"');
    ?>
	</td>
</tr>
</script>
<table id="problems_table">
	<thead>
	<tr>
		<th>ID</th>
		<th>name</th>
		<th>short name</th>
Exemple #5
0
<tr><td><label for="data_0__name_">Description:</label></td>
<td><?php 
    echo addInput('data[0][name]', @$row['name'], 15, 255, 'required');
    ?>
</td></tr>

<tr><td><label for="data_0__sortorder_">Sort order:</label></td>
<td><?php 
    echo addInputField('number', 'data[0][sortorder]', empty($row['sortorder']) ? 0 : $row['sortorder'], ' size="3" maxlength="2"');
    ?>
</td></tr>

<tr><td><label for="data_0__color_">Colour:</label></td>
<td><?php 
    echo addInput('data[0][color]', @$row['color'], 15, 25, 'class="color {required:false,adjust:false,hash:true,caps:false}"');
    ?>
<a target="_blank"
href="http://www.w3schools.com/cssref/css_colornames.asp"><img
src="../images/b_help.png" class="smallpicto" alt="?" /></a></td></tr>

<tr><td>Visible:</td>
<td><?php 
    echo addRadioButton('data[0][visible]', !isset($row['visible']) || $row['visible'], 1);
    ?>
 <label for="data_0__visible_1">yes</label>
<?php 
    echo addRadioButton('data[0][visible]', isset($row['visible']) && !$row['visible'], 0);
    ?>
 <label for="data_0__visible_0">no</label></td></tr>
Exemple #6
0
/**
 * Returns a form to rejudge all judgings based on a (table,id)
 * pair. For example, to rejudge all for language 'java', call
 * as rejudgeForm('language', 'java').
 */
function rejudgeForm($table, $id)
{
    $ret = addForm('rejudge.php') . addHidden('table', $table) . addHidden('id', $id);
    $button = 'REJUDGE this submission';
    $question = "Rejudge submission s{$id}?";
    $disabled = false;
    $allbutton = false;
    // special case submission
    if ($table == 'submission') {
        // disable the form button if there are no valid judgings anyway
        // (nothing to rejudge) or if the result is already correct
        global $DB;
        $validresult = $DB->q('MAYBEVALUE SELECT result FROM judging WHERE
		                       submitid = %i AND valid = 1', $id);
        if (IS_ADMIN) {
            if (!$validresult) {
                $question = "Restart judging of PENDING submission s{$id}, " . 'are you sure?';
                $button = 'RESTART judging';
            } elseif ($validresult == 'correct') {
                $question = "Rejudge CORRECT submission s{$id}, " . 'are you sure?';
            }
        } else {
            if (!$validresult || $validresult == 'correct') {
                $disabled = true;
            }
        }
    } else {
        $button = "REJUDGE ALL for {$table} {$id}";
        $question = "Rejudge all submissions for this {$table}?";
        if (IS_ADMIN) {
            $allbutton = true;
        }
    }
    $ret .= '<input type="submit" value="' . htmlspecialchars($button) . '" ' . ($disabled ? 'disabled="disabled"' : 'onclick="return confirm(\'' . htmlspecialchars($question) . '\');"') . " />\n" . ($allbutton ? addCheckBox('include_all') . '<label for="include_all">include pending/correct submissions</label>' : '') . addCheckBox('full_rejudge') . '<label for="full_rejudge">create rejudging with reason: </label>' . addInput('reason', '', 0, 255) . addEndForm();
    return $ret;
}
Exemple #7
0
    requireAdmin();
    $DB->q('UPDATE judgehost SET active = %i', isset($_POST['cmd-activate']) ? 1 : 0);
    auditlog('judgehost', null, 'marked all ' . (isset($_POST['cmd-activate']) ? 'active' : 'inactive'));
}
if ($cmd == 'add' || $cmd == 'edit') {
    requireAdmin();
    $restrictions = $DB->q('KEYVALUETABLE SELECT restrictionid, name
	                        FROM judgehost_restriction ORDER BY restrictionid');
    $restrictions = array(null => '-- No restrictions --') + $restrictions;
    echo addForm('edit.php');
    ?>
<script type="text/template" id="judgehost_template">
<tr>
	<td>
		<?php 
    echo addInput("data[{id}][hostname]", null, 20, 50, 'pattern="[A-Za-z0-9._-]+"');
    ?>
	</td>
	<td>
		<?php 
    echo addSelect("data[{id}][active]", array(1 => 'yes', 0 => 'no'), '1', true);
    ?>
	</td>
	<td>
		<?php 
    echo addSelect("data[{id}][restrictionid]", $restrictions, null, true);
    ?>
	</td>
</tr>
</script>
<?php 
Exemple #8
0
    echo addTextArea('data[0][comments]', @$row['comments']);
    ?>
</td></tr>

<?php 
    $num_contests = $DB->q("VALUE SELECT COUNT(*) FROM contest c WHERE c.public = 0");
    if ($num_contests > 0) {
        $prepopulate = $DB->q("TABLE SELECT c.cid AS id, c.name, c.shortname,\n\t                       CONCAT(c.name, ' (', c.shortname, ' - c', c.cid, ')') AS search\n\t                       FROM contest c INNER JOIN contestteam USING (cid)\n\t                       WHERE teamid = %i", $id);
        ?>

<!-- contest selection -->
<tr>
	<td>Private contests:</td>
	<td>
		<?php 
        echo addInput('data[0][mapping][0][items]', '', 50);
        ?>
		<script type="text/javascript">
			$(function() {
				$('#data_0__mapping__0__items_').tokenInput('ajax_contests.php?public=0', {
					propertyToSearch: 'search',
					hintText: 'Type to search for contest ID, name, or short name',
					noResultsText: 'No private contests found',
					preventDuplicates: true,
					excludeCurrent: true,
					prePopulate: <?php 
        echo json_encode($prepopulate);
        ?>
				});
			});
		</script>
/* --- End functions --- */
if ($compose_new_win == '1') {
    compose_Header($color, $mailbox);
} else {
    displayPageHeader($color, $mailbox);
}
/* Initialize addressbook */
$abook = addressbook_init();
echo '<br />' . html_tag('table', html_tag('tr', html_tag('td', '<b>' . _("Address Book Search") . '</b>', 'center', $color[0])), 'center', '', 'width="95%" cellpadding="2" cellspacing="2" border="0"');
/* Search form */
echo '<center>' . html_tag('table', '', 'center', '', 'border="0"') . html_tag('tr') . html_tag('td', '', 'left', '', 'nowrap valign="middle"') . "\n" . addForm($PHP_SELF . '?html_addr_search=true', 'post', 'f') . "\n<center>\n" . '  <nobr><strong>' . _("Search for") . "</strong>\n";
addr_insert_hidden();
if (!isset($addrquery)) {
    $addrquery = '';
}
echo addInput('addrquery', $addrquery, 26);
/* List all backends to allow the user to choose where to search */
if (!isset($backend)) {
    $backend = '';
}
if ($abook->numbackends > 1) {
    echo '<strong>' . _("in") . '</strong>&nbsp;';
    $selopts['-1'] = _("All address books");
    $ret = $abook->get_backend_list();
    while (list($undef, $v) = each($ret)) {
        $selopts[$v->bnum] = $v->sname;
    }
    echo addSelect('backend', $selopts, $backend, TRUE);
} else {
    echo addHidden('backend', '-1');
}
Exemple #10
0
    }
    echo "</script>\n\n";
    ?>
<h3>Create new testcase</h3>

<table>
<tr><td>Input testdata: </td><td><?php 
    echo addFileField('add_input');
    ?>
</td></tr>
<tr><td>Output testdata:</td><td><?php 
    echo addFileField('add_output');
    ?>
</td></tr>
<tr><td>Sample testcase:</td><td><?php 
    echo addSelect('add_sample', array("no", "yes"), 0, true);
    ?>
</td></tr>
<tr><td>Description:    </td><td><?php 
    echo addInput('add_desc', '', 30);
    ?>
</td></tr>
<tr><td>Image:          </td><td><?php 
    echo addFileField('add_image');
    ?>
</td></tr>
</table>
<?php 
    echo "<br />" . addSubmit('Submit all changes') . addEndForm();
}
require LIBWWWDIR . '/footer.php';
    @(include $theme[$theme_default]['PATH']);
}
displayHtmlHeader("{$org_name} - " . _("Login"), $header, FALSE);
echo "<body text=\"{$color['8']}\" bgcolor=\"{$color['4']}\" link=\"{$color['7']}\" vlink=\"{$color['7']}\" alink=\"{$color['7']}\" onLoad=\"squirrelmail_loginpage_onload()\">" . "\n" . '<form action="redirect.php" method="post" onSubmit="document.forms[0].js_autodetect_results.value=\'' . SMPREF_JS_ON . '\';">' . "\n";
$username_form_name = 'login_username';
$password_form_name = 'secretkey';
do_hook('login_top');
$loginname_value = sqGetGlobalVar('loginname', $loginname) ? htmlspecialchars($loginname) : '';
/* If they don't have a logo, don't bother.. */
if (isset($org_logo) && $org_logo) {
    /* Display width and height like good little people */
    $width_and_height = '';
    if (isset($org_logo_width) && is_numeric($org_logo_width) && $org_logo_width > 0) {
        $width_and_height = " width=\"{$org_logo_width}\"";
    }
    if (isset($org_logo_height) && is_numeric($org_logo_height) && $org_logo_height > 0) {
        $width_and_height .= " height=\"{$org_logo_height}\"";
    }
}
if (sqgetGlobalVar('mailto', $mailto)) {
    $rcptaddress = addHidden('mailto', $mailto);
} else {
    $rcptaddress = '';
}
echo html_tag('table', html_tag('tr', html_tag('td', '<center>' . (isset($org_logo) && $org_logo ? '<img src="' . $org_logo . '" alt="' . sprintf(_("%s Logo"), $org_name) . '"' . $width_and_height . ' /><br />' . "\n" : '') . (isset($hide_sm_attributions) && $hide_sm_attributions ? '' : '<small>' . sprintf(_("SquirrelMail version %s"), $version) . '<br />' . "\n" . '  ' . _("By the SquirrelMail Development Team") . '<br /></small>' . "\n") . html_tag('table', html_tag('tr', html_tag('td', '<b>' . sprintf(_("%s Login"), $org_name) . "</b>\n", 'center', $color[0])) . html_tag('tr', html_tag('td', "\n" . html_tag('table', html_tag('tr', html_tag('td', _("Name:"), 'right', '', 'width="30%"') . html_tag('td', addInput($username_form_name, $loginname_value), 'left', '', 'width="*"')) . "\n" . html_tag('tr', html_tag('td', _("Password:"******"30%"') . html_tag('td', addPwField($password_form_name) . addHidden('js_autodetect_results', SMPREF_JS_OFF) . $rcptaddress . addHidden('just_logged_in', '1'), 'left', '', 'width="*"')), 'center', $color[4], 'border="0" width="100%"'), 'left', $color[4])) . html_tag('tr', html_tag('td', '<center>' . addSubmit(_("Login")) . '</center>', 'left')), '', $color[4], 'border="0" width="350"') . '</center>', 'center')), '', $color[4], 'border="0" cellspacing="0" cellpadding="0" width="100%"');
do_hook('login_form');
echo '</form>' . "\n";
do_hook('login_bottom');
?>
</body></html>
if (isset($vcard_nice['tel;cell'])) {
    $opts[$vcard_nice['tel;cell']] = _("Cellular Phone");
}
if (isset($vcard_nice['tel;fax'])) {
    $opts[$vcard_nice['tel;fax']] = _("Fax");
}
if (isset($vcard_nice['note'])) {
    $opts[$vcard_nice['note']] = _("Note");
}
/*
 * If the vcard comes with nothing but name and e-mail address, the user gets
 * the chance to type some additional info. If there's more info in the card,
 * the user gets to choose what will be added as additional info.
 */
if (count($opts) == 0) {
    echo addInput('addaddr[label]', '', '20');
} else {
    echo addSelect('addaddr[label]', $opts, '', TRUE);
}
?>
</td></tr>
<tr><td colspan="2" align="center"><br />
<?php 
echo addHidden('addaddr[firstname]', $vcard_safe['firstname']) . addHidden('addaddr[lastname]', $vcard_safe['lastname']) . addSubmit(_("Add to Address Book"), 'addaddr[SUBMIT]');
?>
</td></tr>
</table>
</form>
</td></tr>
<tr><td align="center">
<?php 
Exemple #13
0
		               OCTET_LENGTH(zipfile) AS size
		               FROM executable
		               WHERE execid = %s', $id);
        echo addHidden('keydata[0][execid]', $row['execid']);
        echo specialchars($row['execid']);
    } else {
        echo "<tr><td><label for=\"data_0__execid_\">Executable ID:</label></td><td>";
        echo addInput('data[0][execid]', null, 8, 10, " required pattern=\"" . IDENTIFIER_CHARS . "+\"");
        echo " (alphanumerics only)";
    }
    echo "</td></tr>\n";
    // FIXME: unzip and show zip here
    ?>
<tr><td><label for="data_0__description_">Executable description:</label></td>
<td><?php 
    echo addInput('data[0][description]', @$row['description'], 30, 255, 'required');
    ?>
</td></tr>
<tr><td><label for="data_0__type_">Executable type:</label></td>
<td><?php 
    echo addSelect('data[0][type]', $executable_types, @$row['type'], True);
    ?>
</td></tr>
<tr><td>Content:     </td><td><a href="show_executable.php?edit_source=1&amp;id=<?php 
    echo specialchars($id);
    ?>
">edit file contents</a></td></tr>
</table>

<?php 
    echo addHidden('cmd', $cmd) . addHidden('table', 'executable') . addHidden('referrer', @$_GET['referrer']) . addSubmit('Save') . addSubmit('Cancel', 'cancel', null, true, 'formnovalidate') . addEndForm();
function showInputForm($session, $values = false)
{
    global $send_to, $send_to_cc, $body, $startMessage, $passed_body, $color, $use_signature, $signature, $prefix_sig, $editor_size, $editor_height, $attachments, $subject, $newmail, $use_javascript_addr_book, $send_to_bcc, $passed_id, $mailbox, $from_htmladdr_search, $location_of_buttons, $attachment_dir, $username, $data_dir, $identity, $idents, $draft_id, $delete_draft, $mailprio, $default_use_mdn, $mdn_user_support, $compose_new_win, $saved_draft, $mail_sent, $sig_first, $edit_as_new, $action, $username, $compose_messages, $composesession, $default_charset;
    $composeMessage = $compose_messages[$session];
    if ($values) {
        $send_to = $values['send_to'];
        $send_to_cc = $values['send_to_cc'];
        $send_to_bcc = $values['send_to_bcc'];
        $subject = $values['subject'];
        $mailprio = $values['mailprio'];
        $body = $values['body'];
        $identity = (int) $values['identity'];
    } else {
        $send_to = decodeHeader($send_to, true, false);
        $send_to_cc = decodeHeader($send_to_cc, true, false);
        $send_to_bcc = decodeHeader($send_to_bcc, true, false);
    }
    if ($use_javascript_addr_book) {
        echo "\n" . '<script language="JavaScript">' . "\n<!--\n" . 'function open_abook() { ' . "\n" . '  var nwin = window.open("addrbook_popup.php","abookpopup",' . '"width=670,height=300,resizable=yes,scrollbars=yes");' . "\n" . '  if((!nwin.opener) && (document.windows != null))' . "\n" . '    nwin.opener = document.windows;' . "\n" . "}\n" . "// -->\n</script>\n\n";
    }
    echo "\n" . '<form name="compose" action="compose.php" method="post" ' . 'enctype="multipart/form-data"';
    do_hook('compose_form');
    echo ">\n";
    echo addHidden('startMessage', $startMessage);
    if ($action == 'draft') {
        echo addHidden('delete_draft', $passed_id);
    }
    if (isset($delete_draft)) {
        echo addHidden('delete_draft', $delete_draft);
    }
    if (isset($session)) {
        echo addHidden('session', $session);
    }
    if (isset($passed_id)) {
        echo addHidden('passed_id', $passed_id);
    }
    if ($saved_draft == 'yes') {
        echo '<br /><center><b>' . _("Draft Saved") . '</center></b>';
    }
    if ($mail_sent == 'yes') {
        echo '<br /><center><b>' . _("Your Message has been sent.") . '</center></b>';
    }
    echo '<table align="center" cellspacing="0" border="0">' . "\n";
    if ($compose_new_win == '1') {
        echo '<table align="center" bgcolor="' . $color[0] . '" width="100%" border="0">' . "\n" . '   <tr><td></td>' . html_tag('td', '', 'right') . '<input type="button" name="Close" onClick="return self.close()" value="' . _("Close") . '" /></td></tr>' . "\n";
    }
    if ($location_of_buttons == 'top') {
        showComposeButtonRow();
    }
    /* display select list for identities */
    if (count($idents) > 1) {
        $ident_list = array();
        foreach ($idents as $id => $data) {
            $ident_list[$id] = $data['full_name'] . ' <' . $data['email_address'] . '>';
        }
        echo '   <tr>' . "\n" . html_tag('td', '', 'right', $color[4], 'width="10%"') . _("From:") . '</td>' . "\n" . html_tag('td', '', 'left', $color[4], 'width="90%"') . '         ' . addSelect('identity', $ident_list, $identity, TRUE);
        echo '      </td>' . "\n" . '   </tr>' . "\n";
    }
    echo '   <tr>' . "\n" . html_tag('td', '', 'right', $color[4], 'width="10%"') . _("To") . ':</td>' . "\n" . html_tag('td', '', 'left', $color[4], 'width="90%"') . addInput('send_to', $send_to, 60) . '<br />' . "\n" . '      </td>' . "\n" . '   </tr>' . "\n" . '   <tr>' . "\n" . html_tag('td', '', 'right', $color[4]) . _("Cc") . ':</td>' . "\n" . html_tag('td', '', 'left', $color[4]) . addInput('send_to_cc', $send_to_cc, 60) . '<br />' . "\n" . '      </td>' . "\n" . '   </tr>' . "\n" . '   <tr>' . "\n" . html_tag('td', '', 'right', $color[4]) . _("Bcc") . ':</td>' . "\n" . html_tag('td', '', 'left', $color[4]) . addInput('send_to_bcc', $send_to_bcc, 60) . '<br />' . "\n" . '      </td>' . "\n" . '   </tr>' . "\n" . '   <tr>' . "\n" . html_tag('td', '', 'right', $color[4]) . _("Subject") . ':</td>' . "\n" . html_tag('td', '', 'left', $color[4]) . "\n";
    echo '         ' . addInput('subject', $subject, 60) . '      </td>' . "\n" . '   </tr>' . "\n\n";
    if ($location_of_buttons == 'between') {
        showComposeButtonRow();
    }
    /* why this distinction? */
    if ($compose_new_win == '1') {
        echo '   <tr>' . "\n" . '      <td bgcolor="' . $color[0] . '" colspan="2" align="center">' . "\n" . '         <textarea name="body" id="body" rows="' . (int) $editor_height . '" cols="' . (int) $editor_size . '" wrap="virtual">';
    } else {
        echo '   <tr>' . "\n" . '      <td bgcolor="' . $color[4] . '" colspan="2">' . "\n" . '         &nbsp;&nbsp;<textarea name="body" id="body" rows="' . (int) $editor_height . '" cols="' . (int) $editor_size . '" wrap="virtual">';
    }
    if ($use_signature == true && $newmail == true && !isset($from_htmladdr_search)) {
        $signature = $idents[$identity]['signature'];
        if ($sig_first == '1') {
            if ($default_charset == 'iso-2022-jp') {
                echo "\n\n" . ($prefix_sig == true ? "-- \n" : '') . mb_convert_encoding($signature, 'EUC-JP');
            } else {
                echo "\n\n" . ($prefix_sig == true ? "-- \n" : '') . decodeHeader($signature, false, false);
            }
            echo "\n\n" . htmlspecialchars(decodeHeader($body, false, false));
        } else {
            echo "\n\n" . htmlspecialchars(decodeHeader($body, false, false));
            if ($default_charset == 'iso-2022-jp') {
                echo "\n\n" . ($prefix_sig == true ? "-- \n" : '') . mb_convert_encoding($signature, 'EUC-JP');
            } else {
                echo "\n\n" . ($prefix_sig == true ? "-- \n" : '') . decodeHeader($signature, false, false);
            }
        }
    } else {
        echo htmlspecialchars(decodeHeader($body, false, false));
    }
    echo '</textarea><br />' . "\n" . '      </td>' . "\n" . '   </tr>' . "\n";
    if ($location_of_buttons == 'bottom') {
        showComposeButtonRow();
    } else {
        echo '   <tr>' . "\n" . html_tag('td', '', 'right', '', 'colspan="2"') . "\n" . '         ' . addSubmit(_("Send"), 'send') . '         &nbsp;&nbsp;&nbsp;&nbsp;<br /><br />' . "\n" . '      </td>' . "\n" . '   </tr>' . "\n";
    }
    /* This code is for attachments */
    if ((bool) ini_get('file_uploads')) {
        /* Calculate the max size for an uploaded file.
         * This is advisory for the user because we can't actually prevent
         * people to upload too large files. */
        $sizes = array();
        /* php.ini vars which influence the max for uploads */
        $configvars = array('post_max_size', 'memory_limit', 'upload_max_filesize');
        foreach ($configvars as $var) {
            /* skip 0 or empty values */
            if ($size = getByteSize(ini_get($var))) {
                $sizes[] = $size;
            }
        }
        if (count($sizes) > 0) {
            $maxsize = '(max.&nbsp;' . show_readable_size(min($sizes)) . ')';
        } else {
            $maxsize = '';
        }
        echo addHidden('MAX_FILE_SIZE', min($sizes)) . '   <tr>' . "\n" . '      <td colspan="2">' . "\n" . '         <table width="100%" cellpadding="1" cellspacing="0" align="center"' . ' border="0" bgcolor="' . $color[9] . '">' . "\n" . '            <tr>' . "\n" . '               <td>' . "\n" . '                 <table width="100%" cellpadding="3" cellspacing="0" align="center"' . ' border="0">' . "\n" . '                    <tr>' . "\n" . html_tag('td', '', 'right', '', 'valign="middle"') . _("Attach:") . '</td>' . "\n" . html_tag('td', '', 'left', '', 'valign="middle"') . '                          <input name="attachfile" size="48" type="file" />' . "\n" . '                          &nbsp;&nbsp;<input type="submit" name="attach"' . ' value="' . _("Add") . '" />' . "\n" . $maxsize . '                       </td>' . "\n" . '                    </tr>' . "\n";
        $s_a = array();
        if ($composeMessage->entities) {
            foreach ($composeMessage->entities as $key => $attachment) {
                $attached_file = $attachment->att_local_name;
                if ($attachment->att_local_name || $attachment->body_part) {
                    $attached_filename = decodeHeader($attachment->mime_header->getParameter('name'));
                    $type = $attachment->mime_header->type0 . '/' . $attachment->mime_header->type1;
                    $s_a[] = '<table bgcolor="' . $color[0] . '" border="0"><tr><td>' . addCheckBox('delete[]', FALSE, $key) . "</td><td>\n" . $attached_filename . '</td><td>-</td><td> ' . $type . '</td><td>(' . show_readable_size(filesize($attached_file)) . ')</td></tr></table>' . "\n";
                }
            }
        }
        if (count($s_a)) {
            foreach ($s_a as $s) {
                echo '<tr>' . html_tag('td', '', 'left', $color[0], 'colspan="2"') . $s . '</td></tr>';
            }
            echo '<tr><td colspan="2"><input type="submit" name="do_delete" value="' . _("Delete selected attachments") . "\" />\n" . '</td></tr>';
        }
        echo '                  </table>' . "\n" . '               </td>' . "\n" . '            </tr>' . "\n" . '         </table>' . "\n" . '      </td>' . "\n" . '   </tr>' . "\n";
    }
    // End of file_uploads if-block
    /* End of attachment code */
    if ($compose_new_win == '1') {
        echo '</table>' . "\n";
    }
    echo '</table>' . "\n" . addHidden('username', $username) . addHidden('smaction', $action) . addHidden('mailbox', $mailbox);
    /*
      store the complete ComposeMessages array in a hidden input value
      so we can restore them in case of a session timeout.
    */
    sqgetGlobalVar('QUERY_STRING', $queryString, SQ_SERVER);
    echo addHidden('restoremessages', serialize($compose_messages)) . addHidden('composesession', $composesession) . addHidden('querystring', $queryString) . "</form>\n";
    if (!(bool) ini_get('file_uploads')) {
        /* File uploads are off, so we didn't show that part of the form.
           To avoid bogus bug reports, tell the user why. */
        echo 'Because PHP file uploads are turned off, you can not attach files ';
        echo "to this message.  Please see your system administrator for details.\r\n";
    }
    do_hook('compose_bottom');
    echo '</body></html>' . "\n";
}
/* Choose correct colors for top and bottom frame */
if ($show == 'form' && !isset($listall)) {
    echo '<body text="' . $color[6] . '" bgcolor="' . $color[3] . '" ' . 'link="' . $color[6] . '" vlink="' . $color[6] . '" ' . 'alink="' . $color[6] . '" ' . 'OnLoad="document.sform.query.focus();">';
} else {
    echo '<body text="' . $color[8] . '" bgcolor="' . $color[4] . '" ' . 'link="' . $color[7] . '" vlink="' . $color[7] . '" ' . 'alink="' . $color[7] . "\">\n";
}
/* Empty search */
if (empty($query) && empty($show) && empty($listall)) {
    echo html_tag('p', '<br />' . _("No persons matching your search were found"), 'center') . "\n</body></html>\n";
    exit;
}
/* Initialize addressbook */
$abook = addressbook_init();
/* Create search form */
if ($show == 'form' && empty($listall)) {
    echo '<form name="sform" target="abookres" action="addrbook_search.php' . '" method="post">' . "\n" . html_tag('table', '', '', '', 'border="0" width="100%" height="100%"') . html_tag('tr') . html_tag('td', '  <strong>' . _("Search for") . "</strong>\n", 'left', '', 'nowrap valign="middle" width="10%"') . html_tag('td', '', 'left', '', '') . addInput('query', $query, 28);
    /* List all backends to allow the user to choose where to search */
    if ($abook->numbackends > 1) {
        echo '<strong>' . _("in") . '</strong>&nbsp;' . "\n";
        $selopts = array();
        $selopts['-1'] = _("All address books");
        $ret = $abook->get_backend_list();
        while (list($undef, $v) = each($ret)) {
            $selopts[$v->bnum] = $v->sname;
        }
        echo addSelect('backend', $selopts, '-1', TRUE);
    } else {
        echo addHidden('backend', '-1');
    }
    echo '</td></tr>' . html_tag('tr', html_tag('td', '', 'left') . html_tag('td', '<input type="submit" value="' . _("Search") . '" name="show" />' . '&nbsp;|&nbsp;<input type="submit" value="' . _("List all") . '" name="listall" />' . "\n" . '&nbsp;|&nbsp;<input type="button" value="' . _("Close") . '" onclick="parent.close();" />' . "\n", 'left')) . '</table></form>' . "\n";
} else {
<tr><td colspan="2">
<h3>Restrict to any of the following <?php 
        echo $type;
        ?>
s (leave empty to allow all)</h3>
</td></tr>
<?php 
        $prepopulate = array();
        if (is_array($row['restrictions'][$type])) {
            foreach ($row['restrictions'][$type] as $id) {
                $prepopulate[] = array('id' => $id, 'search' => $type_settings['allData'][$id]);
            }
        }
        ?>
<tr><td></td><td><?php 
        echo addInput("data[0][restrictions][{$type}]", '', 50);
        ?>
</td></tr>
<script type="text/javascript">
	$(function() {
		$('#data_0__restrictions__<?php 
        echo $type;
        ?>
_').tokenInput('<?php 
        echo $type_settings['ajax'];
        ?>
', {
			propertyToSearch: 'search',
			hintText: '<?php 
        echo $type_settings['hintText'];
        ?>
/** Build the what text input
 */
function asearch_get_form_what($what, $row_num = 0)
{
    return function_exists('addInput') ? addInput('what[' . $row_num . ']', $what, '35') : '<input type="text" size="35" name="what[' . $row_num . ']" value="' . htmlspecialchars($what) . '" />';
}
Exemple #18
0
}
print "<form action=\"options.php\" method=\"post\">\n";
print "<center><table border=\"1\">\n";
print "<tr><th>Select</th><th>Test Name</th><th>IMAP command string</th>\n";
print "</tr><tr><td>\n";
foreach ($type as $index => $value) {
    print "</td></tr><tr><td width=\"10%\"><input type=\"checkbox\" value=\"1\" name=\"CHECK_{$index}\"";
    if ($index == 'TEST_0' && ($submit == 'default' || $submit == '')) {
        print " checked";
    }
    $check = "CHECK_" . $index;
    if (isset(${$check}) && $submit != 'clear' && $submit != 'default') {
        print " checked";
    }
    print "></td><td width=\"30%\">{$index}</td><td width=\"60%\">\n";
    print addInput($index, $value, 60);
}
print "</td></tr></table></center><br>\n";
print "<center>" . addSubmit('submit', 'submit') . addSubmit('clear', 'submit') . addSubmit('default', 'submit') . "</center><br>\n";
$tests = array();
if ($submit == 'submit') {
    foreach ($type as $index => $value) {
        $check = "CHECK_" . $index;
        if (isset(${$check})) {
            $type[$index] = ${$index};
            array_push($tests, $index);
        }
    }
    for ($i = 0; $i < count($tests); $i++) {
        print "<center><table width=\"95%\" border=\"0\" bgcolor=\"" . $color[4] . "\">\n";
        print "<tr><td><b>" . $tests[$i] . "</b></td></tr>";
Exemple #19
0
/**
 * update event info
 * @return void
 * @access private
 */
function update_event_form()
{
    global $color, $editor_size, $year, $day, $month, $hour, $minute, $calendardata;
    $tmparray = $calendardata["{$month}{$day}{$year}"]["{$hour}{$minute}"];
    $tab = '    ';
    echo "\n<form name=\"eventupdate\" action=\"event_edit.php\" method=\"post\">\n" . $tab . addHidden('year', $year) . $tab . addHidden('month', $month) . $tab . addHidden('day', $day) . $tab . addHidden('hour', $hour) . $tab . addHidden('minute', $minute) . $tab . addHidden('updated', 'yes') . html_tag('tr') . html_tag('td', _("Date:"), 'right', $color[4]) . "\n" . html_tag('td', '', 'left', $color[4]) . "      <select name=\"event_year\">\n";
    select_option_year($year);
    echo "      </select>\n" . "      &nbsp;&nbsp;\n" . "      <select name=\"event_month\">\n";
    select_option_month($month);
    echo "      </select>\n" . "      &nbsp;&nbsp;\n" . "      <select name=\"event_day\">\n";
    select_option_day($day);
    echo "      </select>\n" . "      </td></tr>\n" . html_tag('tr') . html_tag('td', _("Time:"), 'right', $color[4]) . "\n" . html_tag('td', '', 'left', $color[4]) . "      <select name=\"event_hour\">\n";
    select_option_hour($hour);
    echo "      </select>\n" . "      &nbsp;:&nbsp;\n" . "      <select name=\"event_minute\">\n";
    select_option_minute($minute);
    echo "      </select>\n" . "      </td></tr>\n" . html_tag('tr') . html_tag('td', _("Length:"), 'right', $color[4]) . "\n" . html_tag('td', '', 'left', $color[4]) . "      <select name=\"event_length\">\n";
    select_option_length($tmparray['length']);
    echo "      </select>\n" . "      </td></tr>\n" . html_tag('tr') . html_tag('td', _("Priority:"), 'right', $color[4]) . "\n" . html_tag('td', '', 'left', $color[4]) . "      <select name=\"event_priority\">\n";
    select_option_priority($tmparray['priority']);
    echo "      </select>\n" . "      </td></tr>\n" . html_tag('tr') . html_tag('td', _("Title:"), 'right', $color[4]) . "\n" . html_tag('td', addInput('event_title', $tmparray['title'], 30, 50), 'left', $color[4]) . "\n</tr>\n" . html_tag('tr') . html_tag('td', addTextArea('event_text', $tmparray['message'], $editor_size, 5), 'left', $color[4], 'colspan="2"') . '</tr>' . html_tag('tr') . html_tag('td', addSubmit(_("Update Event"), 'send'), 'left', $color[4], 'colspan="2"') . "</tr></form>\n";
}
        }
        echo "</tr>\n";
    }
    echo "</table>\n";
    echo "</td></tr>\n";
    echo html_tag('tr', html_tag('td', '<small><small>&nbsp;</small></small>', 'left')) . "\n";
    echo html_tag('tr', '', '', $color[0]) . "\n";
    echo html_tag('td', '', 'center', '', 'colspan="2"') . "\n";
    echo "         <select name=\"match_type\">\n";
    oh_opt('from', isset($theid) ? $message_highlight_list[$theid]['match_type'] == 'from' : 1, _("From"));
    oh_opt('to', isset($theid) ? $message_highlight_list[$theid]['match_type'] == 'to' : 0, _("To"));
    oh_opt('cc', isset($theid) ? $message_highlight_list[$theid]['match_type'] == 'cc' : 0, _("Cc"));
    oh_opt('to_cc', isset($theid) ? $message_highlight_list[$theid]['match_type'] == 'to_cc' : 0, _("To or Cc"));
    oh_opt('subject', isset($theid) ? $message_highlight_list[$theid]['match_type'] == 'subject' : 0, _("Subject"));
    echo "         </select>\n";
    echo '<b>' . _("Matches") . ':</b> ';
    if ($action == 'edit' && isset($theid) && isset($message_highlight_list[$theid]['value'])) {
        $disp = $message_highlight_list[$theid]['value'];
    } else {
        $disp = '';
    }
    echo '         ' . addInput('value', $disp, 40);
    echo "        </td>\n";
    echo "   </tr>\n";
    echo "</table>\n";
    echo '<center><input type="submit" value="' . _("Submit") . "\" /></center>\n";
    echo "</form>\n";
}
do_hook('options_highlight_bottom');
?>
</table></body></html>
    ?>
<tr><td><label for="data_0__shortname_">Shortname:</label></td>
<td><?php 
    echo addInput('data[0][shortname]', @$row['shortname'], 40, 30, 'required');
    ?>
</td></tr>

<tr><td><label for="data_0__name_">Name:</label></td>
<td><?php 
    echo addInput('data[0][name]', @$row['name'], 40, 255, 'required');
    ?>
</td></tr>

<tr><td><label for="data_0__country_">Country:</label></td>
<td><?php 
    echo addInput('data[0][country]', @$row['country'], 4, 3, 'pattern="[A-Z]{3}" title="three uppercase letters (ISO-3166-1 alpha-3)"');
    ?>
<a target="_blank"
href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Current_codes"><img
src="../images/b_help.png" class="smallpicto" alt="?" /></a></td></tr>

<tr><td><label for="data_0__comments_">Comments:</label></td>
<td><?php 
    echo addTextArea('data[0][comments]', @$row['comments']);
    ?>
</td></tr>

</table>

<?php 
    echo addHidden('cmd', $cmd) . addHidden('table', 'team_affiliation') . addHidden('referrer', @$_GET['referrer']) . addSubmit('Save') . addSubmit('Cancel', 'cancel', null, true, 'formnovalidate') . addEndForm();
Exemple #22
0
</td></tr>

<tr><td><label for="data_0__password_">Password:</label></td><td><?php 
    if (!empty($row['password'])) {
        echo "<em>set</em>";
    } else {
        echo "<em>not set</em>";
    }
    ?>
 - to change: <?php 
    echo addInputField('password', 'data[0][password]', "", ' size="19" maxlength="255"');
    ?>
</td></tr>
<tr><td><label for="data_0__ip_address_">IP Address:</label></td>
<td><?php 
    echo addInput('data[0][ip_address]', @$row['ip_address'], 35, 255);
    ?>
</td></tr>

<tr><td><label for="data_0__enabled_">Enabled:</label></td>
<td><?php 
    echo addRadioButton('data[0][enabled]', !isset($row['']) || $row['enabled'], 1);
    ?>
 <label for="data_0__enabled_1">yes</label>
<?php 
    echo addRadioButton('data[0][enabled]', isset($row['enabled']) && !$row['enabled'], 0);
    ?>
 <label for="data_0__enabled_0">no</label></td></tr>

<!-- team selection -->
<tr><td><label for="data_0__teamid_">Team:</label></td>
Exemple #23
0
    echo addSelect('data[0][special_run]', $execmap, @$row['special_run'], True);
    ?>
</td></tr>

<tr><td><label for="data_0__special_compare_">Compare script:</label></td>
<td>
<?php 
    $execmap = $DB->q("KEYVALUETABLE SELECT execid,description FROM executable\n                   WHERE type = 'compare' ORDER BY execid");
    $execmap = array('' => 'default') + $execmap;
    echo addSelect('data[0][special_compare]', $execmap, @$row['special_compare'], True);
    ?>
</td></tr>

<tr><td><label for="data_0__special_compare_args_">Compare args:</label></td>
<td><?php 
    echo addInput('data[0][special_compare_args]', @$row['special_compare_args'], 30, 255);
    ?>
</td></tr>

</table>

<?php 
    echo addHidden('cmd', $cmd) . addHidden('table', 'problem') . addHidden('referrer', @$_GET['referrer']) . addSubmit('Save') . addSubmit('Cancel', 'cancel', null, true, 'formnovalidate') . addEndForm();
    if (class_exists("ZipArchive")) {
        $selected_cid = $cid === null ? -1 : $cid;
        $contests = $DB->q("KEYVALUETABLE SELECT cid, CONCAT('c', cid, ': ' , shortname, ' - ', name) FROM contest");
        $values = array(-1 => 'Do not add / update contest data');
        foreach ($contests as $cid => $contest) {
            $values[$cid] = $contest;
        }
        echo "<br /><em>or</em><br /><br />\n" . addForm($pagename, 'post', null, 'multipart/form-data') . addHidden('id', @$row['probid']) . 'Contest: ' . addSelect('contest', $values, $selected_cid, true) . '<label for="problem_archive__">Upload problem archive:</label>' . addFileField('problem_archive[]') . addSubmit('Upload', 'upload') . addEndForm();
Exemple #24
0
            $verification_required = dbconfig_get('verification_required', 0);
            if (!($verification_required && $jud['verified'])) {
                $val = !$jud['verified'];
                echo addForm('verify.php') . addHidden('id', $jud['judgingid']) . addHidden('val', $val) . addHidden('redirect', @$_SERVER['HTTP_REFERER']);
            }
            echo "<p>Verified: " . "<strong>" . printyn($jud['verified']) . "</strong>";
            if ($jud['verified'] && !empty($jud['jury_member'])) {
                echo ", by " . specialchars($jud['jury_member']);
                if (!empty($jud['verify_comment'])) {
                    echo ' with comment "' . specialchars($jud['verify_comment']) . '"';
                }
            }
            if (!($verification_required && $jud['verified'])) {
                echo '; ' . addSubmit(($val ? '' : 'un') . 'mark verified', 'verify');
                if ($val) {
                    echo ' with comment ' . addInput('comment', '', 25);
                }
                echo "</p>" . addEndForm();
            } else {
                echo "</p>\n";
            }
        }
    } else {
        // judging not ended yet
        echo "<p><b>Judging is not finished yet!</b></p>\n";
    }
    ?>
<script type="text/javascript">
<!--
togglelastruns();
// -->
    displayPageHeader($color, 'None');
    plain_error_message(_("You have not selected a folder to rename. Please do so.") . '<br /><a href="../src/folders.php">' . _("Click here to go back") . '</a>.', $color);
    exit;
}
if (substr($old, strlen($old) - strlen($delimiter)) == $delimiter) {
    $isfolder = TRUE;
    $old = substr($old, 0, strlen($old) - 1);
} else {
    $isfolder = FALSE;
}
$old = imap_utf7_decode_local($old);
// displayable mailbox format is without folder prefix on front
global $folder_prefix;
if (substr($old, 0, strlen($folder_prefix)) == $folder_prefix) {
    $displayable_old = substr($old, strlen($folder_prefix));
} else {
    $displayable_old = $old;
}
if (strpos($displayable_old, $delimiter)) {
    $old_name = substr($displayable_old, strrpos($displayable_old, $delimiter) + 1);
    $parent = htmlspecialchars(substr($displayable_old, 0, strrpos($displayable_old, $delimiter)) . ' ' . $delimiter);
} else {
    $old_name = $displayable_old;
    $parent = '';
}
displayPageHeader($color, 'None');
echo '<br />' . html_tag('table', '', 'center', '', 'width="95%" border="0"') . html_tag('tr', html_tag('td', '<b>' . _("Rename a folder") . '</b>', 'center', $color[0])) . html_tag('tr') . html_tag('td', '', 'center', $color[4]) . addForm('folders_rename_do.php') . _("New name:") . '<br /><b>' . $parent . '</b>' . addInput('new_name', $old_name, 25) . '<br />' . "\n";
if ($isfolder) {
    echo addHidden('isfolder', 'true');
}
echo addHidden('orig', $old) . addHidden('old_name', $old_name) . '<input type="submit" value="' . _("Submit") . "\" />\n" . '</form><br /></td></tr></table>';
Exemple #26
0
<tr><td><label for="data_0__time_factor_">Time factor:</label></td>
<td><?php 
    echo addInputField('number', 'data[0][time_factor]', isset($row['time_factor']) ? $row['time_factor'] : 1, ' min="0" step="any" required');
    ?>
 &times;</td></tr>
<tr><td><label for="data_0__compile_script_">Compile script:</label></td>
<td>
<?php 
    $execmap = $DB->q("KEYVALUETABLE SELECT execid,description FROM executable\n\t\t\tWHERE type = 'compile'\n\t\t\tORDER BY execid");
    $execmap[''] = 'none';
    echo addSelect('data[0][compile_script]', $execmap, @$row['compile_script'], True);
    ?>
</td></tr>
<tr><td><label for="data_0__extensions_">Extensions:</label></td>
<td><?php 
    echo addInput('data[0][extensions]', @$row['extensions'], 20, 255, 'required');
    ?>
 (as JSON encoded array, for example <kbd>["cpp","cc","c++"]</kbd>)</td></tr>
</table>

<?php 
    echo addHidden('cmd', $cmd) . addHidden('table', 'language') . addHidden('referrer', @$_GET['referrer']) . addSubmit('Save') . addSubmit('Cancel', 'cancel', null, true, 'formnovalidate') . addEndForm();
    require LIBWWWDIR . '/footer.php';
    exit;
}
$data = $DB->q('TUPLE SELECT * FROM language WHERE langid = %s', $id);
if (!$data) {
    error("Missing or invalid language id");
}
echo "<h1>Language " . specialchars($data['name']) . "</h1>\n\n";
echo addForm($pagename . '?id=' . urlencode($id)) . "<p>\n" . addHidden('id', $id) . addHidden('val[toggle_judge]', !$data['allow_judge']) . addHidden('val[toggle_submit]', !$data['allow_submit']) . "</p>\n";
Exemple #27
0
 function execute()
 {
     $_Title = 'Quản lý Bệnh viện';
     $_msg = null;
     $captcha = new SimpleCaptcha();
     $formmode = $_POST["formmode"];
     $mode_inpvl = __post('mode_inpvl');
     $captchatxt = __post('captcha');
     $captchaForm = __post('captchaForm');
     $idchk = $_POST["chk"];
     $flagCaptcha = $captcha->CaptchaValidate($captchatxt);
     $flagCaptchaForm = $captcha->CaptchaValidate($captchaForm);
     $id = __post('Id');
     /*===================================*/
     if ($formmode != '') {
         $name = __post("name");
         $province_id = __post("province_id");
         $status = (int) __post("status");
         $order = (int) __post("order");
         $_msg = $this->form_add($id, $province_id, $name, $status, $order);
         if (!isset($_msg)) {
             $_msg['result'] = -20;
         }
     }
     $list_form = new XTemplate('Config/Hospital.html');
     $left_menu = $this->rmenu();
     $list_form->assign('slide_bar', $this->slide_bar($left_menu));
     $list_form->assign('tabs', $this->set_tabs());
     $list_form->assign('dialog_title', 'thành viên');
     $CaptchaText = $captcha->CreateText();
     /****** Delete (8) - Export (16) ***********************************/
     $arr_attr_btnmdelete = array('style' => '', 'onclick' => 'sbm_form(8,\'' . $CaptchaText . '\')');
     $inp_btnmdelete = addInput2('button', 'btndelete', $btnmdelete, $arr_attr_btnmdelete, $list_form, 'Xóa');
     if ($mode_inpvl == 'DELETE') {
         $idList = '0';
         foreach ($idchk as $ind => $delvl) {
             $idArr = explode('|', $delvl);
             if ($idArr[1] == $this->md5sum($this->prefix['delete'] . $idArr[0])) {
                 $idList .= ',' . $idArr[0];
             }
         }
         if ($idList != '0') {
             $_msg = $this->form_delete($idList);
         }
     }
     /****** Delete (8) - Export (16) ***********************************/
     if ($this->acl_per(16)) {
         $arr_attr_btnexport = array('style' => '', 'onclick' => 'sbm_form(16,\'' . $CaptchaText . '\')');
         $inp_btnexport = addInput2('button', 'btnexport', $btnexport, $arr_attr_btnexport, $list_form, 'Xuất Excel');
     }
     /*************************************
      *****************/
     $keyword = __post("keyword");
     $selectkeyword = __post("selectkeyword");
     $Attr_keyword = array('rel1' => '{Require:\'R\',Alert:\'Vui lòng nhập Keyword  \'}', 'style' => '');
     $txt_keyword = addInput('text', 'keyword', $keyword, $Attr_keyword, $list_form);
     $infosk[0] = array('t1.name' => 'Tên bệnh viện');
     $vlkey = array_keys($infosk[$selectkeyword]);
     //list($vlkey, $vlval) = each();
     $Attr_selectkeyword = array('style' => '');
     $txt_selectkeyword = addSelectList5('selectkeyword', $infosk, NULL, $Attr_selectkeyword, $list_form, $selectkeyword);
     if ($keyword != '' && $vlkey[0] != '') {
         $filter = ' and ' . $vlkey[0] . " like N'%{$keyword}%'";
     }
     $s_province_id = (int) __post('s_province_id');
     $s_status = __post('s_status');
     if ($s_province_id > 0) {
         $filter = ' and t1.province_id = ' . $s_province_id;
     }
     if ($s_status != "") {
         $filter = ' and t1.status = ' . (int) $s_status;
     }
     //-----------------------------------------//
     $gridview = '';
     $gridview .= $this->PageHeader();
     $gridview .= $this->_AddPageHeader();
     $exportGrid = $this->setHeader();
     $DBList = $this->setList($CaptchaText, $filter, $conpany_list);
     $exportGrid .= $DBList[0];
     $gridview .= $exportGrid;
     $gridview .= $this->setFooter();
     $gridview .= $this->setPaging();
     $arr_info_province_id = $this->getListProvince();
     $Attr_province_id = array('style' => '');
     $txt_province_id = addSelectList2('s_province_id', $arr_info_province_id, "-- Tất cả --", $Attr_province_id, $list_form, $s_province_id);
     $arr_info_status = array(1 => 'Active', 0 => 'InActive');
     $Attr_status = array('style' => '');
     $txt_status = addSelectList2('s_status', $arr_info_status, "-- Tất cả --", $Attr_status, $list_form, $s_status);
     if ($mode_inpvl === 'EXPORT' && $this->acl_per(16)) {
         $this->ExportToExcel(fnStrConvert($_Title), strip_tags($exportGrid, '<table><tr><td><th>'));
         die;
     }
     //-----------------------------------------//
     setMessage($list_form, $_msg);
     $list_form->assign('title', $_Title);
     $list_form->assign('_error_', $error);
     $list_form->assign('gridview', $gridview);
     $list_form->parse('main');
     $this->html = $list_form->out_return('main');
     echo $this->html;
 }
/**
 * Make an input field
 * @param string $label
 * @param string $field
 * @param string $name
 * @param string $size
 * @param array $values
 * @param string $add
 */
function addressbook_inp_field($label, $field, $name, $size, $values, $add = '')
{
    global $color;
    $value = isset($values[$field]) ? $values[$field] : '';
    if (is_array($value)) {
        $td_str = addSelect($name . '[' . $field . ']', $value);
    } else {
        $td_str = addInput($name . '[' . $field . ']', $value, $size);
    }
    $td_str .= $add;
    return html_tag('tr', html_tag('td', $label . ':', 'right', $color[4]) . html_tag('td', $td_str, 'left', $color[4])) . "\n";
}
            break;
        case 'rename':
            $td_str .= _("Renamed successfully!");
            break;
        case 'subscribe-doesnotexist':
            $td_str .= _("Subscription Unsuccessful - Folder does not exist.");
            break;
    }
    $td_str .= '</b><br />';
    echo html_tag('table', html_tag('tr', html_tag('td', $td_str . '<a href="../src/left_main.php" target="left">' . _("refresh folder list") . '</a>', 'center')), 'center', '', 'width="100%" cellpadding="4" cellspacing="0" border="0"');
}
echo "\n<br />";
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imapConnection, true);
/** CREATING FOLDERS **/
echo html_tag('table', '', 'center', '', 'width="70%" cellpadding="4" cellspacing="0" border="0"') . html_tag('tr', html_tag('td', '<b>' . _("Create Folder") . '</b>', 'center', $color[9])) . html_tag('tr') . html_tag('td', '', 'center', $color[0]) . addForm('folders_create.php', 'POST', 'cf') . addInput('folder_name', '', 25) . "<br />\n" . _("as a subfolder of") . '<br />' . "<tt><select name=\"subfolder\">\n";
$show_selected = array();
$skip_folders = array();
$server_type = strtolower($imap_server_type);
if ($server_type == 'courier') {
    array_push($skip_folders, 'inbox.trash');
    if ($default_folder_prefix == 'INBOX.') {
        array_push($skip_folders, 'INBOX');
    }
}
if ($default_sub_of_inbox == false) {
    echo '<option selected="selected" value="">[ ' . _("None") . " ]</option>\n";
} else {
    echo '<option value="">[ ' . _("None") . " ]</option>\n";
    $show_selected = array('inbox');
}
Exemple #30
0
<li><a href="impexp_contestyaml.php">Contest data (contest.yaml)</a></li>
<li><a href="problems.php">Problem archive</a></li>
<li>Tab separated, export:
	<a href="impexp_tsv.php?act=ex&amp;fmt=groups">groups.tsv</a>,
	<a href="impexp_tsv.php?act=ex&amp;fmt=teams">teams.tsv</a>,
	<a href="impexp_tsv.php?act=ex&amp;fmt=scoreboard">scoreboard.tsv</a>,
	<a href="impexp_tsv.php?act=ex&amp;fmt=results">results.tsv</a>
<li>
<?php 
echo addForm('impexp_tsv.php', 'post', null, 'multipart/form-data') . 'Tab separated, import: ' . '<label for="fmt">type:</label> ' . addSelect('fmt', array('groups', 'teams', 'accounts')) . ', <label for="tsv">file:</label>' . addFileField('tsv') . addHidden('act', 'im') . addSubmit('import') . addEndForm();
?>
</li>
</ul>

<h2>Import teams / Upload standings from / to icpc.baylor.edu</h2>

<p>
Create a "Web Services Token" with appropriate rights in the "Export" section
for your contest at <a
href="https://icpc.baylor.edu/login">https://icpc.baylor.edu/login</a>. You can
find the Contest ID (e.g. <code>Southwestern-Europe-2014</code>) in the URL.
</p>

<?php 
echo addForm("impexp_baylor.php");
echo "<table>\n";
echo "<tr><td><label for=\"contest\">Contest ID:</label></td>" . "<td>" . addInput('contest', @$contest, null, null, 'required') . "</td></tr>\n";
echo "<tr><td><label for=\"token\">Access token:</label></td>" . "<td>" . addInput('token', @$token, null, null, 'required') . "</td></tr>\n";
echo "</table>\n";
echo addSubmit('Fetch teams', 'fetch') . addSubmit('Upload standings', 'upload') . addEndForm();
require LIBWWWDIR . '/footer.php';