Example #1
0
    function loginForm()
    {
        ?>
<table cellspacing="0">
<tr><th><?php 
        echo lang('Server');
        ?>
<td><input type="hidden" name="driver" value="<?php 
        echo $this->driver;
        ?>
"><select name="server"><?php 
        echo optionlist($this->servers, SERVER);
        ?>
</select>
<tr><th><?php 
        echo lang('Username');
        ?>
<td><input id="username" name="username" value="<?php 
        echo h($_GET["username"]);
        ?>
">
<tr><th><?php 
        echo lang('Password');
        ?>
<td><input type="password" name="password">
</table>
<p><input type="submit" value="<?php 
        echo lang('Login');
        ?>
">
<?php 
        echo checkbox("permanent", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n";
        return true;
    }
Example #2
0
/**
 * Renders and outputs a login form.
 *
 * This function outputs a full HTML document,
 * including &lt;head&gt; and footer.
 *
 * @param string|array $message The activity message
 */
function doLoginForm($message)
{
    global $textarray_script, $event, $step;
    include txpath . '/lib/txplib_head.php';
    $event = 'login';
    if (gps('logout')) {
        $step = 'logout';
    } elseif (gps('reset')) {
        $step = 'reset';
    }
    pagetop(gTxt('login'), $message);
    $stay = (cs('txp_login') and !gps('logout') ? 1 : 0);
    $reset = gps('reset');
    $name = join(',', array_slice(explode(',', cs('txp_login')), 0, -1));
    $out = array();
    if ($reset) {
        $out[] = hed(gTxt('password_reset'), 2, array('id' => 'txp-login-heading')) . graf(n . span(tag(gTxt('name'), 'label', array('for' => 'login_name')), array('class' => 'txp-label')) . n . span(fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name'), array('class' => 'txp-value')), ' class="login-name"') . graf(fInput('submit', '', gTxt('password_reset_button'), 'publish') . n) . graf(href(gTxt('back_to_login'), 'index.php'), array('class' => 'login-return')) . hInput('p_reset', 1);
    } else {
        $out[] = hed(gTxt('login_to_textpattern'), 2, array('id' => 'txp-login-heading')) . graf(n . span(tag(gTxt('name'), 'label', array('for' => 'login_name')), array('class' => 'txp-label')) . n . span(fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name'), array('class' => 'txp-value')), array('class' => 'login-name')) . graf(n . span(tag(gTxt('password'), 'label', array('for' => 'login_password')), array('class' => 'txp-label')) . n . span(fInput('password', 'p_password', '', '', '', '', INPUT_REGULAR, '', 'login_password'), array('class' => 'txp-value')), array('class' => 'login-password')) . graf(checkbox('stay', 1, $stay, '', 'login_stay') . n . tag(gTxt('stay_logged_in'), 'label', array('for' => 'login_stay')) . popHelp('remember_login') . n, array('class' => 'login-stay')) . graf(fInput('submit', '', gTxt('log_in_button'), 'publish') . n) . graf(href(gTxt('password_forgotten'), '?reset=1'), array('class' => 'login-forgot'));
        if (gps('event')) {
            $out[] = eInput(gps('event'));
        }
    }
    echo form(tag(join('', $out), 'section', array('role' => 'region', 'class' => 'txp-login', 'aria-labelledby' => 'txp-login-heading')), '', '', 'post', '', '', 'login_form') . script_js('textpattern.textarray = ' . json_encode($textarray_script)) . n . '</main><!-- /txp-body -->' . n . '</body>' . n . '</html>';
    exit(0);
}
Example #3
0
function doLoginForm($message)
{
    include txpath . '/lib/txplib_head.php';
    pagetop(gTxt('login'), $message);
    $stay = (cs('txp_login') and !gps('logout') ? 1 : 0);
    $reset = gps('reset');
    $name = join(',', array_slice(explode(',', cs('txp_login')), 0, -1));
    echo n . '<div id="login_container" class="txp-container">';
    echo form('<div class="txp-login">' . n . hed(gTxt($reset ? 'password_reset' : 'login_to_textpattern'), 2) . n . graf('<span class="login-label"><label for="login_name">' . gTxt('name') . '</label></span>' . n . '<span class="login-value">' . fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name') . '</span>', ' class="login-name"') . ($reset ? '' : n . graf('<span class="login-label"><label for="login_password">' . gTxt('password') . '</label></span>' . n . '<span class="login-value">' . fInput('password', 'p_password', '', '', '', '', INPUT_REGULAR, '', 'login_password') . '</span>', ' class="login-password"')) . ($reset ? '' : graf(checkbox('stay', 1, $stay, '', 'login_stay') . n . '<label for="login_stay">' . gTxt('stay_logged_in') . '</label>' . sp . popHelp('remember_login'), ' class="login-stay"')) . ($reset ? n . hInput('p_reset', 1) : '') . n . graf(fInput('submit', '', gTxt($reset ? 'password_reset_button' : 'log_in_button'), 'publish')) . n . ($reset ? graf('<a href="index.php">' . gTxt('back_to_login') . '</a>', ' class="login-return"') : graf('<a href="?reset=1">' . gTxt('password_forgotten') . '</a>', ' class="login-forgot"')) . (gps('event') ? eInput(gps('event')) : '') . '</div>', '', '', 'post', '', '', 'login_form') . '</div>' . n . script_js(<<<EOSCR
// Focus on either username or password when empty
\$(document).ready(
\tfunction() {
\t\tvar has_name = \$("#login_name").val().length;
\t\tvar password_box = \$("#login_password").val();
\t\tvar has_password = (password_box) ? password_box.length : 0;
\t\tif (!has_name) {
\t\t\t\$("#login_name").focus();
\t\t} else if (!has_password) {
\t\t \t\$("#login_password").focus();
\t\t}
\t}
);
EOSCR
) . n . '</div><!-- /txp-body -->' . n . '</body>' . n . '</html>';
    exit(0);
}
Example #4
0
function GetAllComplaints($var, $gm)
{
    global $tbl_list_complaint;
    if ($var["serverindex"] == null || $var["serverindex"] == "") {
        echo "<script src='/js/page.js'></script>\n";
        echo "<script src='/js/checkbox.js'></script>\n";
        form($var, $gm);
        checkbox(true, true);
        ReturnAndBack();
        echo "</form>\n";
        return eachServerFrame($var, $gm);
    } else {
        $serv_id = intval($var["serverindex"]);
    }
    global $page_main, $tbl_sys_msg;
    $query_string = "select ua.ua_nMsgType, us.us_sName, c.c_sName, ua.ua_sErrorMsg, ua.ua_dtTime, ua.ua_uErrorCode from tbl_user_advice ua, tbl_char c, tbl_char_static cs, tbl_user_static us where ua.cs_uId = c.cs_uId and c.cs_uId = cs.cs_uId and cs.us_uId = us.us_uId order by ua_dtTime desc";
    page($var, $query_string, 58, "Game", $serv_id, $result, $page, $desc);
    echo "<table class='list_table'>\n";
    echo "<tr><th class='type' style='width:60px;'>" . $page_main["category"] . "</th><th style='width:80px;'>" . $page_main["user_name"] . "</th><th style='width:80px;'>" . $page_main["role_name"] . "</th><th>" . $page_main["content"] . "</th><th style='width:40px;'>" . $tbl_sys_msg["status"] . "</th><th style='width:120px;'>" . $tbl_sys_msg["time"] . "</th></tr>\n";
    while ($row = mysql_fetch_row($result)) {
        printf("<tr><td>%s</td><td><input type='checkbox' flag='user' value='%s' onclick='Checkbox(this)' />%s</td><td><input type='checkbox' flag='role' value='%s' onclick='Checkbox(this)' />%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $tbl_list_complaint[$row[0]], $row[1], $row[1], $row[2], $row[2], $row[3], "-", $row[4]);
    }
    echo "</table>\n";
    echo $page;
    return true;
}
Example #5
0
function RoleToUser($var, $gm)
{
    global $page_main;
    if ($var["serverindex"] == null || $var["serverindex"] == "") {
        echo "<script src='/js/checkbox.js' type='text/javascript'></script>\n";
        form($var, $gm);
        checkbox(true, false);
        echo "</form>\n";
        ReturnAndBack();
        $ret = eachServerFrame($var, $gm);
        ReturnAndBack();
        return $ret;
    }
    $serverid = $var["serverindex"];
    $role_names = $var["role_name"];
    $role_names = implode("','", explode(",", $role_names));
    $qs = "select distinct us.us_uId, us.us_sName from tbl_char_static cs, tbl_char c, tbl_user_static us where cs.cs_uId = c.cs_uId and cs.us_uId = us.us_uId and c.c_sName in ('" . $role_names . "');";
    $result = MySQLQuery($qs, "Game", $serverid);
    echo "<table class='list_table'>\n";
    echo "<tr><th>" . $page_main["user_id"] . "</th><th>" . $page_main["user_name"] . "</th></tr>\n";
    while ($row = mysql_fetch_row($result)) {
        printf("<tr" . ($i++ % 2 == 0 ? "" : " class='even'") . "><td>%s</td><td><input type='checkbox' flag='user' onclick='Checkbox(this);' value='%s'/>%s</td></tr>\n", $row[0], $row[1], $row[1]);
    }
    echo "</table>\n";
    return true;
}
Example #6
0
function GetCmpstByGM($var, $gm)
{
    global $tbl_sys_msg, $page_main, $tbl_list_compensate;
    if ($var["serverindex"] == null || $var["serverindex"] == "") {
        $js_src = <<<_js_src
<script type='text/javascript' src='/js/checkbox.js'></script>
<script type='text/javascript' src='/js/page.js'></script>
<script type='text/javascript'>
function cancel(id)
{
\tdocument.form1.target = "_block"
\tdocument.form1.action_name.value='124';
\tdocument.form1.id.value=id;
\tdocument.form1.submit();
}
</script>
_js_src;
        echo $js_src . "\n";
        echo "<script type='text/javascript' src='/js/log_info.js'></script>\n";
        form($var, $gm);
        echo "<input type='hidden' name='flag' />\n";
        echo "<input type='hidden' name='role_name' />\n";
        echo "<input type='hidden' name='str' />\n";
        echo "<input type='hidden' name='urs' />\n";
        echo "<input type='hidden' name='id' />";
        checkbox(false, true);
        ReturnAndBack();
        $ret = eachServerFrame($var, $gm);
        ReturnAndBack();
        echo "</form>\n";
        return $ret;
    }
    $serv_id = intval($var["serverindex"]);
    $gm_name = mysql_escape_string($gm);
    $filter = "";
    if ($var["flag"] != "" || $var["role_name"] != "") {
        $filter = " and";
        if ($var["flag"] != "") {
            $filter .= " reason like '%#[" . $var["flag"] . "[%'";
        }
        if ($var["flag"] != "" && $var["role_name"] != "") {
            $filter .= " and";
        }
        if ($var["role_name"] != "") {
            $k = $var["role_name"];
            $filter .= " (reason like '%[" . $k . ",%' or reason like '%," . $k . "]%' or reason like '%," . $k . ",%' or reason like '%[" . $k . "]%')";
        }
    }
    $query = "select gca_uId, gm, action_id, reason, action_state from tbl_gm_compensate_action where server_id = '{$serv_id}' and gm = '{$gm_name}'" . $filter . " order by gca_uId desc";
    page($var, $query, 123, "GMS", 0, $result, $page, $desc);
    echo "<table class='list_table'>\n";
    echo "<tr><th style='width:60px;'>" . $page_main["user_name"] . "</th><th style='width:160px;'>" . $page_main["event_type"] . "</th><th>" . $tbl_sys_msg["desc"] . "</th><th style='width:60px;'>" . $tbl_sys_msg["act"] . "</th><th style='width:80px;'>" . $tbl_sys_msg["status"] . "</th></tr>\n";
    while ($row = mysql_fetch_row($result)) {
        printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class='server' title='" . $serv_id . "'>%s</td></tr>", $row[1], GetGMCommandLogAction($row[2]), LogInfo($row[3]), hasAuth(124, $gm) && $row[4] == 1 ? "<input type=button value='" . $tbl_sys_msg["cancel"] . "' onclick='cancel(" . $row[0] . ")'/>" : "", $tbl_list_compensate[$row[4]]);
    }
    echo "</table>\n";
    echo $page;
    return true;
}
function rec_checkbox($row)
{
    $name = "rec_" . $row['id'];
    $hidden = 'last[' . $row['id'] . ']';
    $value = $row['reconciled'] != '';
    // save also in hidden field for testing during 'Reconcile'
    return checkbox(null, $name, $value, true, _('Reconcile this transaction')) . hidden($hidden, $value, false);
}
Example #8
0
function doLoginForm($message)
{
    global $txpcfg;
    include $txpcfg['txpath'] . '/lib/txplib_head.php';
    pagetop('log in');
    echo form(startTable('edit') . tr(td() . td(graf($message))) . tr(fLabelCell('name') . fInputCell('p_userid')) . tr(fLabelCell('password') . td(fInput('password', 'p_password', '', 'edit'))) . tr(td() . td(graf(checkbox('stay', 1, 1) . gTxt('stay_logged_in') . popHelp('remember_login')))) . tr(fLabelCell('') . td(fInput('submit', '', gTxt('log_in_button'), 'publish'))) . endTable());
    exit("</div></body></html>");
}
Example #9
0
function doLoginForm($message)
{
    global $txpcfg;
    include txpath . '/lib/txplib_head.php';
    pagetop(gTxt('login'));
    $stay = !(cs('txp_nostay') == 1);
    echo form(startTable('edit') . n . n . tr(n . td() . td(graf($message))) . n . n . tr(n . fLabelCell('name', '', 'name') . n . fInputCell('p_userid', '', 1, '', '', 'name')) . n . n . tr(n . fLabelCell('password', '', 'password') . n . td(fInput('password', 'p_password', '', 'edit', '', '', '', 2, 'password'))) . n . n . tr(n . td() . td(graf(checkbox('stay', 1, $stay, 3, 'stay') . '<label for="stay">' . gTxt('stay_logged_in') . '</label>' . sp . popHelp('remember_login')))) . n . n . tr(n . td() . td(fInput('submit', '', gTxt('log_in_button'), 'publish', '', '', '', 4))) . endTable() . (gps('event') ? eInput(gps('event')) : '')) . n . '</div>' . n . n . '</body>' . n . '</html>';
    exit(0);
}
Example #10
0
 function getHtmlTag($class = "")
 {
     $html = "\n\t\t\t\t\t<ul class=\"checkboxes_group {$class}\" style=\"width: " . (count($this->list_code) * 51 + 10 + 14) . "px;\">\n\t\t\t\t\t\t<li class=\"select_all_none\">\n\t\t\t\t\t\t\t<img style=\"width: 10px;\" src=\"img/all.png\" alt=\"" . __("Select all buttons") . "\" title=\"" . __("Select all buttons") . "\"/>\n\t\t\t\t\t\t\t<img style=\"width: 10px;\" src=\"img/none.png\" alt=\"" . __("Deselect all buttons") . "\" title=\"" . __("Deselect all buttons") . "\"/>\n\t\t\t\t\t\t</li>";
     foreach ($this->list_code as $code) {
         $html .= "\n\t\t\t\t\t\t\t<li class='li_checkbox'>" . checkbox("img", $this->id, $this->checked, $code, __($code), __($code)) . "</li>";
     }
     $html .= "\n\t\t\t\t\t</ul>";
     return $html;
 }
Example #11
0
function plug_deploy($deploy)
{
    $qb = $_SESSION['qb'];
    $USE = $_SESSION['USE'];
    $raed = suj_of_id($deploy);
    $nl = $_GET['nl'] ? $_GET['nl'] : "nl";
    if ($deploy && $USE) {
        //prep
        list($qauth, $subj) = sql('name,suj', 'qda', 'r', 'id="' . $deploy . '"');
        $msg = sql('msg', 'qdm', 'v', 'id="' . $deploy . '"');
        if ($USE == $qauth or auth(5)) {
            $http = host();
            if (!$_POST['dpl']) {
                reqp('mail');
                $qmail = mail_list_tosend();
                $ret .= form("/?read={$deploy}&deploy={$deploy}&nl=nlb", txarea('dpl" maxlength="1000', $qmail, 40, 10) . br() . checkbox("dpf", "ok", "html", 1) . checkbox("multiple", "ok", "each_one", 1) . input2('submit', "send", nms(50), 'popbt'));
            } else {
                $htacc = urlread($deploy);
                $_SESSION['nl'] = $nl;
                //deploy
                if ($_POST['dpf'] == "ok") {
                    $mail_format = "html";
                    $txt = format_txt($msg, $nl, $deploy);
                    $txt = html_entity_decode($txt);
                    $txt = str_replace('href="/', 'href="' . $http . '/', $txt);
                    $msg = lkc("", $http . $htacc, bal("h2", $subj));
                    $msg .= divc("panel justy", $txt);
                } else {
                    $mail_format = "txt";
                    $msg = clean_internaltag($msg);
                    $msg = html_entity_decode($msg);
                }
                $_SESSION['nl'] = "";
                //send
                $sender = sql('mail', 'qdu', 'v', 'name="' . $USE . '"');
                $lstm = str_replace("\n", ",", $_POST['dpl']);
                $lstm = str_replace("\r", ",", $lstm);
                $listmail = explode(",", trim($lstm));
                if ($_POST['multiple'] == "ok" && is_array($listmail)) {
                    $sentto = send_mail_r($listmail, $mail_format, $qb . ' :: ' . $raed, $msg, $sender, $htacc);
                } else {
                    $sentto = $_POST['dpl'];
                    $vm = str_replace(array(",", ";", "\n", " "), ",", $sentto);
                    send_mail($mail_format, $vm, $qb . ' :: ' . $raed, $msg, $sender, $htacc);
                }
                $ret .= lkc("popbt", '/?read=' . $deploy, 'article ' . $deploy . ' sent to: ' . $sentto);
            }
        } else {
            $ret .= btn("popdel", "forbidden");
        }
    }
    //if($_POST['dpl'])return $ret;
    return $ret;
}
Example #12
0
function doLoginForm($message)
{
    global $txpcfg;
    include txpath . '/lib/txplib_head.php';
    pagetop(gTxt('login'));
    $stay = (cs('txp_login') and !gps('logout') ? 1 : 0);
    $reset = gps('reset');
    list($name) = split(',', cs('txp_login'));
    echo form(startTable('edit') . n . n . tr(n . td() . td(graf($message))) . n . n . tr(n . fLabelCell('name', '', 'name') . n . fInputCell('p_userid', $name, 1, '', '', 'name')) . ($reset ? '' : n . n . tr(n . fLabelCell('password', '', 'password') . n . td(fInput('password', 'p_password', '', 'edit', '', '', '', 2, 'password')))) . ($reset ? '' : n . n . tr(n . td() . td(graf(checkbox('stay', 1, $stay, 3, 'stay') . '<label for="stay">' . gTxt('stay_logged_in') . '</label>' . sp . popHelp('remember_login'))))) . n . n . tr(n . td() . td(($reset ? hInput('p_reset', 1) : '') . fInput('submit', '', gTxt($reset ? 'password_reset_button' : 'log_in_button'), 'publish', '', '', '', 4) . ($reset ? '' : graf('<a href="?reset=1">' . gTxt('password_forgotten') . '</a>')))) . endTable() . (gps('event') ? eInput(gps('event')) : '')) . n . '</body>' . n . '</html>';
    exit(0);
}
Example #13
0
function plug_ummdico($p, $o)
{
    //umm_sav();
    ses('qu', 'umm_dico');
    $ret = bal('h3', 'Recherche sur le dictionnaire des vocables');
    $ret .= input(1, 'search', '', '') . ' ';
    $ret .= checkbox('chk', '1', 'phonétique', 0);
    $ret .= lj('txtbox', 'ucbk_plug___ummdico_ud*search_1_2_search|chk', 'chercher') . br() . br();
    $ret .= divd('ucbk', '') . br();
    //callback
    return $ret;
}
function connect_error()
{
    global $connection, $token, $error, $drivers;
    $databases = array();
    if (DB != "") {
        page_header(lang('Database') . ": " . h(DB), lang('Invalid database.'), true);
    } else {
        if ($_POST["db"] && !$error) {
            queries_redirect(substr(ME, 0, -1), lang('Databases have been dropped.'), drop_databases($_POST["db"]));
        }
        page_header(lang('Select database'), $error, false);
        echo "<p><a href='" . h(ME) . "database='>" . lang('Create new database') . "</a>\n";
        foreach (array('privileges' => lang('Privileges'), 'processlist' => lang('Process list'), 'variables' => lang('Variables'), 'status' => lang('Status')) as $key => $val) {
            if (support($key)) {
                echo "<a href='" . h(ME) . "{$key}='>{$val}</a>\n";
            }
        }
        echo "<p>" . lang('%s version: %s through PHP extension %s', $drivers[DRIVER], "<b>{$connection->server_info}</b>", "<b>{$connection->extension}</b>") . "\n";
        echo "<p>" . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n";
        if ($_GET["refresh"]) {
            set_session("dbs", null);
        }
        $databases = get_databases();
        if ($databases) {
            $scheme = support("scheme");
            $collations = collations();
            echo "<form action='' method='post'>\n";
            echo "<table cellspacing='0' class='checkable' onclick='tableClick(event);'>\n";
            echo "<thead><tr><td>&nbsp;<th>" . lang('Database') . "<td>" . lang('Collation') . "<td>" . lang('Tables') . "</thead>\n";
            foreach ($databases as $db) {
                $root = h(ME) . "db=" . urlencode($db);
                echo "<tr" . odd() . "><td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"]));
                echo "<th><a href='{$root}'>" . h($db) . "</a>";
                echo "<td><a href='{$root}" . ($scheme ? "&amp;ns=" : "") . "&amp;database=' title='" . lang('Alter database') . "'>" . nbsp(db_collation($db, $collations)) . "</a>";
                echo "<td align='right'><a href='{$root}&amp;schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>?</a>";
                echo "\n";
            }
            echo "</table>\n";
            echo "<script type='text/javascript'>tableCheck();</script>\n";
            echo "<p><input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /db/)", 1) . ">\n";
            // 1 - eventStop
            echo "<input type='hidden' name='token' value='{$token}'>\n";
            echo "<a href='" . h(ME) . "refresh=1' onclick='eventStop(event);'>" . lang('Refresh') . "</a>\n";
            echo "</form>\n";
        }
    }
    page_footer("db");
    if ($databases) {
        echo "<script type='text/javascript'>ajaxSetHtml('" . js_adminer_escape(ME) . "script=connect');</script>\n";
    }
}
Example #15
0
function connect_error()
{
    global $adminer, $connection, $token, $error, $drivers;
    if (DB != "") {
        header("HTTP/1.1 404 Not Found");
        page_header(lang('Database') . ": " . h(DB), lang('Invalid database.'), true);
    } else {
        if ($_POST["db"] && !$error) {
            queries_redirect(substr(ME, 0, -1), lang('Databases have been dropped.'), drop_databases($_POST["db"]));
        }
        //Encabezado y botones de la parte superior en la seleccion de bases de datos
        page_header(lang('Select database'), $error, false);
        echo "<p>\n";
        foreach (array('database' => lang('Create new database'), 'privileges' => lang('Privileges'), 'processlist' => lang('Process list'), 'variables' => lang('Variables'), 'status' => lang('Status')) as $key => $val) {
            if (support($key)) {
                echo "<a class='btn btn-xs btn-primary' href='" . h(ME) . "{$key}='>{$val}</a>\n";
            }
        }
        //Presenta informacion de la conexion
        echo "<p><i class='fa fa-exchange fa-fw'></i> " . lang('%s version: %s through PHP extension %s', $drivers[DRIVER], "<b>" . h($connection->server_info) . "</b>", "<b>{$connection->extension}</b>") . "\n";
        echo "<p><i class='fa fa-user fa-fw'></i> " . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n";
        //Presenta la lista de bases de datos existentes y los encabezados
        $databases = $adminer->databases();
        if ($databases) {
            $scheme = support("scheme");
            $collations = collations();
            echo "<form action='' method='post'>\n";
            echo "<table cellspacing='0' class='checkable table table-condensed table-responsive table-hover' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n";
            echo "<thead><tr>" . (support("database") ? "<th>&nbsp;" : "") . "<th>" . lang('Database') . " - <a class='btn btn-default btn-xs' href='" . h(ME) . "refresh=1'><i class='fa fa-refresh fa-fw'></i> " . lang('Refresh') . "</a>" . "<th>" . lang('Collation') . "<th>" . lang('Tables') . "<th>" . lang('Size') . " - <a  class='btn btn-default btn-xs' href='" . h(ME) . "dbsize=1' onclick=\"return !ajaxSetHtml('" . js_escape(ME) . "script=connect');\">" . lang('Compute') . "</a>" . "</thead>\n";
            //Presenta la lista de bases de datos
            $databases = $_GET["dbsize"] ? count_tables($databases) : array_flip($databases);
            foreach ($databases as $db => $tables) {
                $root = h(ME) . "db=" . urlencode($db);
                echo "<tr" . odd() . ">" . (support("database") ? "\n\t\t\t\t\t<td align=center>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"])) : "");
                echo "<th><a  href='{$root}'>" . h($db) . "</a>";
                $collation = nbsp(db_collation($db, $collations));
                echo "<td>" . (support("database") ? "<a href='{$root}" . ($scheme ? "&amp;ns=" : "") . "&amp;database=' title='" . lang('Alter database') . "'>{$collation}</a>" : $collation);
                echo "<td align='right'><a href='{$root}&amp;schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>" . ($_GET["dbsize"] ? $tables : "?") . "</a>";
                echo "<td align='right' id='size-" . h($db) . "'>" . ($_GET["dbsize"] ? db_size($db) : "?");
                echo "\n";
            }
            echo "</table>\n";
            //Agrega boton de eliminar
            echo support("database") ? "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>\n" . "<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^db/));\">\n" . "<input class='btn btn-xs btn-danger' type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n" . "</div></fieldset>\n" : "";
            echo "<script type='text/javascript'>tableCheck();</script>\n";
            echo "<input type='hidden' name='token' value='{$token}'>\n";
            echo "</form>\n";
        }
    }
    page_footer("db");
}
Example #16
0
function f_inp_widths($defs)
{
    $set = 'text" size="3';
    list($l_large, $m_large, $r_large, $t_large) = obtain_widths($defs);
    $t .= btn("txtnoir", 'leftbar ' . input2($set, 'l_large', $l_large, "")) . ' ';
    $t .= btn("txtnoir", 'content ' . $m_large . 'px') . ' ';
    $t .= btn("txtnoir", 'rightbar ' . input2($set, 'r_large', $r_large, "")) . ' ';
    $t .= btn("txtnoir", 'page ' . input2($set, 't_total', $t_large, "")) . ' ';
    $t .= input2('submit', 'save', "apply_widths", "") . ' ';
    $t .= checkbox('saveblocks', 'ok', 'apply (mods_' . prmb(1) . ')', 0) . ' ';
    $t .= hlpbt('designwidths') . br();
    $inp = $t . br();
    return form('/?admin=css', $inp);
}
Example #17
0
function options($self, $title, $prefix, $entityName, $withCsvOptions, $withMagmiDelete, $withEnable, $withDefaults, $pruneKeepDefaultValue, $sourceText, $plugin)
{
    $default_rows_for_sets = "attribute_set_name,attribute_code,attribute_group_name\n*,name,General\n*,description,General\n*,short_description,General\n*,sku,General\n*,weight,General\n*,news_from_date,General\n*,news_to_date,General\n*,status,General\n*,url_key,General\n*,visibility,General\n*,country_of_manufacture,General\n*,price,Prices\n*,group_price,Prices\n*,special_price,Prices\n*,special_from_date,Prices\n*,special_to_date,Prices\n*,tier_price,Prices\n*,msrp_enabled,Prices\n*,msrp_display_actual_price_type,Prices\n*,msrp,Prices\n*,tax_class_id,Prices\n*,price_view,Prices\n*,meta_title,Meta Information\n*,meta_keyword,Meta Information\n*,meta_description,Meta Information\n*,image,Images\n*,small_image,Images\n*,thumbnail,Images\n*,media_gallery,Images\n*,gallery,Images\n*,is_recurring,Recurring Profile\n*,recurring_profile,Recurring Profile\n*,custom_design,Design\n*,custom_design_from,Design\n*,custom_design_to,Design\n*,custom_layout_update,Design\n*,page_layout,Design\n*,options_container,Design\n*,gift_message_available,Gift Options";
    if (isset($title)) {
        ?>
<h3><?php 
        echo $title;
        ?>
</h3><?php 
    }
    if ($withEnable) {
        checkbox($self, $prefix, 'enable', true, "Enable {$entityName} import");
        startDiv($self, $prefix, 'enabled', $self->getParam($prefix . ":enable", "on") == "on");
    }
    if ($withCsvOptions) {
        csvOptions($self, $prefix);
    }
    ?>
    <h4>Import behavior</h4>
    <?php 
    if ($withDefaults) {
        text($self, $prefix, 'default_values', "", "Set default values for non-existing columns in {$sourceText} (JSON)");
    }
    if ($prefix == '5B5AAI') {
        textarea($self, $prefix, 'default_rows', $default_rows_for_sets, "Add these attribute associations to given CSV data, '*' for attribute set name  means 'for each attribute set from given CSV' (Format: CSV with titles, spearator ',', enclosure '\"').");
    }
    checkbox($self, $prefix, 'prune', true, "Prune {$entityName}s which are not in {$sourceText} from database");
    startDiv($self, $prefix, 'prune_opts');
    if ($prefix == '5B5ATI' || $prefix == '5B5AAI') {
        checkbox($self, $prefix, 'prune_keep_system_attributes', true, "Dont touch non-user attributes when pruning.");
    }
    text($self, $prefix, 'prune_only', '', "prune only {$entityName}s matching regexp");
    text($self, $prefix, 'prune_keep', $pruneKeepDefaultValue, "additionally, keep following {$entityName}s when pruning, even if not given in {$sourceText} (comma-separated)");
    endDiv($self);
    if ($withMagmiDelete) {
        checkbox($self, $prefix, 'magmi_delete', true, "Delete {$entityName}s marked \"magmi:delete\" = 1");
    }
    checkbox($self, $prefix, 'create', true, "Create {$entityName}s from {$sourceText} which are not in database");
    checkbox($self, $prefix, 'update', true, "Update {$entityName}s from {$sourceText} which are already in database");
    if ($prefix == '5B5ASI') {
        startDiv($self, $prefix, 'attribute_groups');
        options($self, null, '5B5AGI', 'attribute group', false, false, false, false, "General,Prices,Meta Information,Images,Recurring Profile,Design,Gift Options", '"magmi:groups"', $plugin);
        endDiv($self);
    }
    if ($withEnable) {
        endDiv($self);
    }
    javascript($self, $prefix, $withCsvOptions, $plugin);
}
Example #18
0
function discuss_edit()
{
    $discussid = gps('discussid');
    extract(safe_row("*", "txp_discuss", "discussid='{$discussid}'"));
    $ta = '<textarea name="message" cols="60" rows="15">' . htmlspecialchars($message) . '</textarea>';
    if (fetch('ip', 'txp_discuss_ipban', 'ip', $ip)) {
        $banstep = 'ipban_unban';
        $bantext = gTxt('unban');
    } else {
        $banstep = 'ipban_add';
        $bantext = gTxt('ban');
    }
    $banlink = '[<a href="?event=discuss' . a . 'step=' . $banstep . a . 'ip=' . $ip . a . 'name=' . urlencode($name) . a . 'discussid=' . $discussid . '">' . $bantext . '</a>]';
    pagetop(gTxt('edit_comment'));
    echo form(startTable('edit') . stackRows(fLabelCell('name') . fInputCell('name', $name), fLabelCell('email') . fInputCell('email', $email), fLabelCell('website') . fInputCell('web', $web), td() . td($ta), fLabelCell('visible') . td(checkbox('visible', 1, $visible)), fLabelCell('IP') . td($ip . sp . $banlink), td() . td(fInput('submit', 'step', gTxt('save'), 'publish')), hInput("discussid", $discussid) . hInput('ip', $ip) . eInput('discuss') . sInput('discuss_save')) . endTable());
}
    function loginForm()
    {
        ?>
<table cellspacing="0">
<tr><th>System<td><select name='auth[driver]'><option value="server" selected>MySQL</select>
<tr><th>Server<td><input name="auth[server]" value="" title="hostname[:port]" placeholder="localhost" autocapitalize="off">
<tr><th>Username<td><input name="auth[username]" id="username" value="" placeholder="WordPress" autocapitalize="off">
<tr><th>Password<td><input type="password" name="auth[password]" placeholder="WordPress">
<tr><th>Database<td><input name="auth[db]" value="" autocapitalize="off" placeholder="WordPress">
</table>
<p><input type="submit" value="<?php 
        echo lang('Login');
        ?>
">
<?php 
        echo checkbox("auth[permanent]", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n";
        return true;
    }
Example #20
0
function GetRoles($var, $gm, $fun)
{
    if ($var["serverindex"] == null || $var["serverindex"] == "") {
        $js_src = <<<_js_src
<script type='text/javascript' src='/js/checkbox.js'></script>
<script type='text/javascript' src='/js/page.js'></script>
<script>
\tfunction ViewUser(obj,urs)
\t{
\t\talert(\$(obj).html());
\t\tdocument.form1.action_name.value = '50';
\t\tdocument.form1.serverid.value = \$(obj).parents(".panel").find("input[name='serverindex']").val();
\t\tdocument.form1.urs.value = urs;
\t\tdocument.form1.submit();
\t}
\tfunction ViewRole(obj,role_name)
\t{
\t\tdocument.form1.action_name.value = '97';
\t\tdocument.form1.serverid.value = \$(obj).parents(".panel").find("input[name='serverindex']").val();
\t\tdocument.form1.role_name.value = role_name;
\t\tdocument.form1.submit();
\t}
</script>
_js_src;
        echo $js_src . "\n";
        form($var, $gm);
        echo "<input type='hidden' name='role_name' />";
        echo "<input type='hidden' name='urs' />";
        checkbox(true, true);
        ReturnAndBack();
        $ret = eachServerFrame($var, $gm);
        ReturnAndBack();
        echo "</form>\n";
        return $ret;
    }
    $serverid = $var["serverindex"];
    $channel_id = $var["channel_id"];
    $tbl_content = $fun($var, $gm);
    return true;
}
Example #21
0
        public function loginForm()
        {
            $drivers = array('server' => 'MySQL');
            ?>
			<table cellspacing="0">
				<tr><th>Systém<td><?php 
            echo html_select("driver", $drivers, DRIVER);
            ?>
				<tr><th>Uživatel<td><input type="text" name="username" id="username" value="<?php 
            echo h($_GET["username"]);
            ?>
">
				<tr><th>Heslo<td><input type="password" name="password" id="password">
			</table>
			<input name="server" type="hidden" value="localhost">
			<script type="text/javascript">
				document.getElementById('username').focus();
			</script>
			<p><input type="submit" value="Přihlásit">
<?php 
            echo checkbox("permanent", 1, $_COOKIE["adminer_permanent"], 'Trvalé přihlášení') . "\n";
        }
Example #22
0
function display_langs()
{
    start_table(TABLESTYLE);
    $th = array(_("Language"), _("Encoding"), _("Description"), _("Install"));
    table_header($th);
    $k = 0;
    $langs = get_languages_list();
    foreach ($langs as $pkg_name => $lang) {
        $available = @$lang['available'];
        $installed = @$lang['version'];
        $id = @$lang['local_id'];
        if (!$available) {
            continue;
        }
        alt_table_row_color($k);
        label_cell($lang['name']);
        label_cell($lang['encoding']);
        label_cell(is_array($lang['Descr']) ? implode('<br>', $lang['Descr']) : $lang['Descr']);
        label_cell($installed ? _("Installed") : checkbox(null, 'langs[' . $lang['package'] . ']'), "align='center'");
        end_row();
    }
    end_table(1);
}
Example #23
0
    function loginForm()
    {
        ?>
<table cellspacing="0">
<tr><th><?php 
        echo lang('Server');
        ?>
<td><input type="hidden" id="username" name="auth[username]" value="root"><input type="hidden" name="auth[password]"><input type="hidden" name="auth[driver]" value="<?php 
        echo $this->driver;
        ?>
"><select name="auth[server]"><?php 
        echo optionlist($this->servers, SERVER);
        ?>
</select>
</table>
<p><input type="submit" value="<?php 
        echo lang('Login');
        ?>
">
<?php 
        echo checkbox("auth[permanent]", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n";
        return true;
    }
Example #24
0
			$displaySet = false;
		} else {
			foreach($extensions as $ext) {
				if (!$pf->canAddFileType($ext)) {
					$displaySet = false;
				}
			}
		}
		
		if ($displaySet) {
		?>
	
		<li class="ccm-file-set-add-cb">
				<label>
				<?php 
echo checkbox('fsID', $s->getFileSetID(), $s->state);
?>
				<span><?php 
echo $s->getFileSetName();
?>
</span>
				</label>
		</li>
	<? } 
	} ?>
	
		</ul>
	</div>
	<? } else { ?>
		<?php 
echo t('You have not created any file sets yet.');
Example #25
0
        echo select_input(" disabled", $fields, $column);
        echo "<label><input disabled type='checkbox'>" . lang('descending') . "</label> ";
    }
    echo "<td><td>\n";
}
$j = 1;
foreach ($row["indexes"] as $index) {
    if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) {
        echo "<tr><td>" . html_select("indexes[{$j}][type]", array(-1 => "") + $index_types, $index["type"], $j == count($row["indexes"]) ? "indexesAddRow(this);" : 1);
        echo "<td>";
        ksort($index["columns"]);
        $i = 1;
        foreach ($index["columns"] as $key => $column) {
            echo "<span>" . select_input(" name='indexes[{$j}][columns][{$i}]' onchange=\"" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . "(this, '" . js_escape($jush == "sql" ? "" : $_GET["indexes"] . "_") . "');\"", $fields ? array_combine($fields, $fields) : $fields, $column);
            echo $jush == "sql" || $jush == "mssql" ? "<input type='number' name='indexes[{$j}][lengths][{$i}]' class='size' value='" . h($index["lengths"][$key]) . "'>" : "";
            echo $jush != "sql" ? checkbox("indexes[{$j}][descs][{$i}]", 1, $index["descs"][$key], lang('descending')) : "";
            echo " </span>";
            $i++;
        }
        echo "<td><input name='indexes[{$j}][name]' value='" . h($index["name"]) . "' autocapitalize='off'>\n";
        echo "<td><input class='btn btn-xs btn-danger' type='submit' name='drop_col[{$j}]' data-toggle='tooltip' data-placement='top' value='X' title='" . lang('Remove') . "' onclick=\"return !editingRemoveRow(this, 'indexes\$1[type]');\">\n";
    }
    $j++;
}
?>
</table>
<p>
<input class="btn btn-xs btn-success" type="submit" value="<?php 
echo lang('Save');
?>
">
Example #26
0
function article_edit($message = '', $concurrent = FALSE)
{
    global $vars, $txp_user, $comments_disabled_after, $txpcfg, $prefs;
    extract($prefs);
    extract(gpsa(array('view', 'from_view', 'step')));
    if (!empty($GLOBALS['ID'])) {
        // newly-saved article
        $ID = $GLOBALS['ID'];
        $step = 'edit';
    } else {
        $ID = gps('ID');
    }
    include_once txpath . '/lib/classTextile.php';
    $textile = new Textile();
    // switch to 'text' view upon page load and after article post
    if (!$view || gps('save') || gps('publish')) {
        $view = 'text';
    }
    if (!$step) {
        $step = "create";
    }
    if ($step == "edit" && $view == "text" && !empty($ID) && $from_view != 'preview' && $from_view != 'html' && !$concurrent) {
        $pull = true;
        //-- it's an existing article - off we go to the db
        $ID = assert_int($ID);
        $rs = safe_row("*, unix_timestamp(Posted) as sPosted,\n\t\t\t\tunix_timestamp(Expires) as sExpires,\n\t\t\t\tunix_timestamp(LastMod) as sLastMod", "textpattern", "ID={$ID}");
        extract($rs);
        $reset_time = $publish_now = $Status < 4;
    } else {
        $pull = false;
        //-- assume they came from post
        if ($from_view == 'preview' or $from_view == 'html') {
            $store_out = array();
            $store = unserialize(base64_decode(ps('store')));
            foreach ($vars as $var) {
                if (isset($store[$var])) {
                    $store_out[$var] = $store[$var];
                }
            }
        } else {
            $store_out = gpsa($vars);
            if ($concurrent) {
                $store_out['sLastMod'] = safe_field('unix_timestamp(LastMod) as sLastMod', 'textpattern', 'ID=' . $ID);
            }
        }
        extract($store_out);
    }
    $GLOBALS['step'] = $step;
    if ($step == 'create') {
        $textile_body = $use_textile;
        $textile_excerpt = $use_textile;
    }
    if ($step != 'create') {
        // Previous record?
        $prev_id = checkIfNeighbour('prev', $sPosted);
        // Next record?
        $next_id = checkIfNeighbour('next', $sPosted);
    }
    $page_title = $Title ? $Title : gTxt('write');
    pagetop($page_title, $message);
    echo n . n . '<form name="article" method="post" action="index.php">';
    if (!empty($store_out)) {
        echo hInput('store', base64_encode(serialize($store_out)));
    }
    echo hInput('ID', $ID) . eInput('article') . sInput($step) . '<input type="hidden" name="view" />' . startTable('edit') . '<tr>' . n . '<td id="article-col-1">';
    if ($view == 'text') {
        //-- markup help --------------
        echo side_help($textile_body, $textile_excerpt) . '<h3 class="plain"><a href="#advanced" onclick="toggleDisplay(\'advanced\'); return false;">' . gTxt('advanced_options') . '</a></h3>', '<div id="advanced" class="toggle" style="display:none">', n . graf('<label for="markup-body">' . gTxt('article_markup') . '</label>' . br . pref_text('textile_body', $textile_body, 'markup-body')), n . graf('<label for="markup-excerpt">' . gTxt('excerpt_markup') . '</label>' . br . pref_text('textile_excerpt', $textile_excerpt, 'markup-excerpt')), $allow_form_override ? graf('<label for="override-form">' . gTxt('override_default_form') . '</label>' . sp . popHelp('override_form') . br . form_pop($override_form, 'override-form')) : '', $custom_1_set ? custField(1, $custom_1_set, $custom_1) : '', $custom_2_set ? custField(2, $custom_2_set, $custom_2) : '', $custom_3_set ? custField(3, $custom_3_set, $custom_3) : '', $custom_4_set ? custField(4, $custom_4_set, $custom_4) : '', $custom_5_set ? custField(5, $custom_5_set, $custom_5) : '', $custom_6_set ? custField(6, $custom_6_set, $custom_6) : '', $custom_7_set ? custField(7, $custom_7_set, $custom_7) : '', $custom_8_set ? custField(8, $custom_8_set, $custom_8) : '', $custom_9_set ? custField(9, $custom_9_set, $custom_9) : '', $custom_10_set ? custField(10, $custom_10_set, $custom_10) : '', n . graf('<label for="keywords">' . gTxt('keywords') . '</label>' . sp . popHelp('keywords') . br . n . '<textarea id="keywords" name="Keywords" cols="18" rows="5">' . htmlspecialchars(str_replace(',', ', ', $Keywords)) . '</textarea>'), n . graf('<label for="article-image">' . gTxt('article_image') . '</label>' . sp . popHelp('article_image') . br . fInput('text', 'Image', $Image, 'edit', '', '', 22, '', 'article-image')), n . graf('<label for="url-title">' . gTxt('url_title') . '</label>' . sp . popHelp('url_title') . br . fInput('text', 'url_title', $url_title, 'edit', '', '', 22, '', 'url-title')), '</div>

			<h3 class="plain"><a href="#recent" onclick="toggleDisplay(\'recent\'); return false;">' . gTxt('recent_articles') . '</a>' . '</h3>' . '<div id="recent" class="toggle" style="display:none">';
        $recents = safe_rows_start("Title, ID", 'textpattern', "1=1 order by LastMod desc limit 10");
        if ($recents) {
            echo '<ul class="plain-list">';
            while ($recent = nextRow($recents)) {
                if (!$recent['Title']) {
                    $recent['Title'] = gTxt('untitled') . sp . $recent['ID'];
                }
                echo n . t . '<li><a href="?event=article' . a . 'step=edit' . a . 'ID=' . $recent['ID'] . '">' . escape_title($recent['Title']) . '</a></li>';
            }
            echo '</ul>';
        }
        echo '</div>';
    } else {
        echo sp;
    }
    echo '</td>' . n . '<td id="article-main">';
    //-- title input --------------
    if ($view == 'preview') {
        echo hed(gTxt('preview'), 2) . hed($Title, 1);
    } elseif ($view == 'html') {
        echo hed('XHTML', 2) . hed($Title, 1);
    } elseif ($view == 'text') {
        echo n . '<p><label for="title">' . gTxt('title') . '</label>' . sp . popHelp('title') . br . '<input type="text" id="title" name="Title" value="' . escape_title($Title) . '" class="edit" size="40" tabindex="1" />';
        if ($step != 'create') {
            include_once txpath . '/publish/taghandlers.php';
            $url = permlinkurl_id($ID);
            if ($Status != 4 and $Status != 5) {
                $url .= (strpos($url, '?') === FALSE ? '?' : '&amp;') . 'txpreview=' . intval($ID) . '.' . time();
            }
            echo sp . sp . '<a href="' . $url . '" class="article-view">' . gTxt('view') . '</a>';
        }
        echo '</p>';
    }
    //-- body --------------------
    if ($view == 'preview') {
        if ($textile_body == USE_TEXTILE) {
            echo $textile->TextileThis($Body);
        } else {
            if ($textile_body == CONVERT_LINEBREAKS) {
                echo nl2br($Body);
            } else {
                if ($textile_body == LEAVE_TEXT_UNTOUCHED) {
                    echo $Body;
                }
            }
        }
    } elseif ($view == 'html') {
        if ($textile_body == USE_TEXTILE) {
            $bod = $textile->TextileThis($Body);
        } else {
            if ($textile_body == CONVERT_LINEBREAKS) {
                $bod = nl2br($Body);
            } else {
                if ($textile_body == LEAVE_TEXT_UNTOUCHED) {
                    $bod = $Body;
                }
            }
        }
        echo tag(str_replace(array(n, t), array(br, sp . sp . sp . sp), htmlspecialchars($bod)), 'code');
    } else {
        echo n . graf('<label for="body">' . gTxt('body') . '</label>' . sp . popHelp('body') . br . '<textarea id="body" name="Body" cols="55" rows="31" tabindex="2">' . htmlspecialchars($Body) . '</textarea>');
    }
    //-- excerpt --------------------
    if ($articles_use_excerpts) {
        if ($view == 'text') {
            echo n . graf('<label for="excerpt">' . gTxt('excerpt') . '</label>' . sp . popHelp('excerpt') . br . '<textarea id="excerpt" name="Excerpt" cols="55" rows="5" tabindex="3">' . htmlspecialchars($Excerpt) . '</textarea>');
        } else {
            echo n . '<hr width="50%" />';
            echo $textile_excerpt == USE_TEXTILE ? $view == 'preview' ? graf($textile->textileThis($Excerpt)) : tag(str_replace(array(n, t), array(br, sp . sp . sp . sp), htmlspecialchars($textile->TextileThis($Excerpt))), 'code') : graf($Excerpt);
        }
    }
    //-- author --------------
    if ($view == "text" && $step != "create") {
        echo '<p class="small">' . gTxt('posted_by') . ': ' . htmlspecialchars($AuthorID) . ' &#183; ' . safe_strftime('%d %b %Y &#183; %X', $sPosted);
        if ($sPosted != $sLastMod) {
            echo br . gTxt('modified_by') . ': ' . htmlspecialchars($LastModID) . ' &#183; ' . safe_strftime('%d %b %Y &#183; %X', $sLastMod);
        }
        echo '</p>';
    }
    echo hInput('from_view', $view), '</td>';
    echo '<td id="article-tabs">';
    //-- layer tabs -------------------
    echo $use_textile == USE_TEXTILE || $textile_body == USE_TEXTILE ? '<ul>' . (tab('text', $view) . tab('html', $view) . tab('preview', $view)) . '</ul>' : '&#160;';
    echo '</td>';
    echo '<td id="article-col-2">';
    if ($view == 'text') {
        if ($step != 'create') {
            echo n . graf(href(gtxt('create_new'), 'index.php?event=article'));
        }
        //-- prev/next article links --
        if ($step != 'create' and ($prev_id or $next_id)) {
            echo '<p>', $prev_id ? prevnext_link('&#8249;' . gTxt('prev'), 'article', 'edit', $prev_id, gTxt('prev')) : '', $next_id ? prevnext_link(gTxt('next') . '&#8250;', 'article', 'edit', $next_id, gTxt('next')) : '', '</p>';
        }
        //-- status radios --------------
        echo n . n . '<fieldset id="write-status">' . n . '<legend>' . gTxt('status') . '</legend>' . n . status_radio($Status) . n . '</fieldset>';
        //-- category selects -----------
        echo n . n . '<fieldset id="write-sort">' . n . '<legend>' . gTxt('sort_display') . '</legend>' . n . graf('<label for="category-1">' . gTxt('category1') . '</label> ' . '<span class="small">[' . eLink('category', '', '', '', gTxt('edit')) . ']</span>' . br . n . category_popup('Category1', $Category1, 'category-1')) . n . graf('<label for="category-2">' . gTxt('category2') . '</label>' . br . n . category_popup('Category2', $Category2, 'category-2'));
        //-- section select --------------
        if (!$from_view && !$pull) {
            $Section = getDefaultSection();
        }
        echo n . graf('<label for="section">' . gTxt('section') . '</label> ' . '<span class="small">[' . eLink('section', '', '', '', gTxt('edit')) . ']</span>' . br . section_popup($Section, 'section')) . n . '</fieldset>' . n . n . '<h3 class="plain"><a href="#more" onclick="toggleDisplay(\'more\'); return false;">' . gTxt('more') . '</a></h3>', '<div id="more" class="toggle" style="display:none">';
        //-- comments stuff --------------
        if ($step == "create") {
            //Avoiding invite disappear when previewing
            $AnnotateInvite = !empty($store_out['AnnotateInvite']) ? $store_out['AnnotateInvite'] : $comments_default_invite;
            if ($comments_on_default == 1) {
                $Annotate = 1;
            }
        }
        if ($use_comments == 1) {
            echo n . n . '<fieldset id="write-comments">' . n . '<legend>' . gTxt('comments') . '</legend>';
            $comments_expired = false;
            if ($step != 'create' && $comments_disabled_after) {
                $lifespan = $comments_disabled_after * 86400;
                $time_since = time() - $sPosted;
                if ($time_since > $lifespan) {
                    $comments_expired = true;
                }
            }
            if ($comments_expired) {
                echo n . n . graf(gTxt('expired'));
            } else {
                echo n . n . graf(onoffRadio('Annotate', $Annotate)) . n . n . graf('<label for="comment-invite">' . gTxt('comment_invitation') . '</label>' . br . fInput('text', 'AnnotateInvite', $AnnotateInvite, 'edit', '', '', '', '', 'comment-invite'));
            }
            echo n . n . '</fieldset>';
        }
        if ($step == "create" and empty($GLOBALS['ID'])) {
            //-- timestamp -------------------
            //Avoiding modified date to disappear
            $persist_timestamp = !empty($store_out['year']) ? safe_strtotime($store_out['year'] . '-' . $store_out['month'] . '-' . $store_out['day'] . ' ' . $store_out['hour'] . ':' . $store_out['minute'] . ':' . $store_out['second']) : time();
            echo n . n . '<fieldset id="write-timestamp">' . n . '<legend>' . gTxt('timestamp') . '</legend>' . n . graf(checkbox('publish_now', '1', $publish_now, '', 'publish_now') . '<label for="publish_now">' . gTxt('set_to_now') . '</label>') . n . graf(gTxt('or_publish_at') . sp . popHelp('timestamp')) . n . graf(gtxt('date') . sp . tsi('year', '%Y', $persist_timestamp) . ' / ' . tsi('month', '%m', $persist_timestamp) . ' / ' . tsi('day', '%d', $persist_timestamp)) . n . graf(gTxt('time') . sp . tsi('hour', '%H', $persist_timestamp) . ' : ' . tsi('minute', '%M', $persist_timestamp) . ' : ' . tsi('second', '%S', $persist_timestamp)) . n . '</fieldset>';
            //-- expires -------------------
            $persist_timestamp = !empty($store_out['exp_year']) ? safe_strtotime($store_out['exp_year'] . '-' . $store_out['exp_month'] . '-' . $store_out['exp_day'] . ' ' . $store_out['exp_hour'] . ':' . $store_out['exp_minute'] . ':' . $store_out['second']) : NULLDATETIME;
            echo n . n . '<fieldset id="write-expires">' . n . '<legend>' . gTxt('expires') . '</legend>' . n . graf(gtxt('date') . sp . tsi('exp_year', '%Y', $persist_timestamp) . ' / ' . tsi('exp_month', '%m', $persist_timestamp) . ' / ' . tsi('exp_day', '%d', $persist_timestamp)) . n . graf(gTxt('time') . sp . tsi('exp_hour', '%H', $persist_timestamp) . ' : ' . tsi('exp_minute', '%M', $persist_timestamp) . ' : ' . tsi('exp_second', '%S', $persist_timestamp)) . n . '</fieldset>' . n . n . '</div>';
            //-- publish button --------------
            echo has_privs('article.publish') ? fInput('submit', 'publish', gTxt('publish'), "publish", '', '', '', 4) : fInput('submit', 'publish', gTxt('save'), "publish", '', '', '', 4);
        } else {
            //-- timestamp -------------------
            if (!empty($year)) {
                $sPosted = safe_strtotime($year . '-' . $month . '-' . $day . ' ' . $hour . ':' . $minute . ':' . $second);
            }
            echo n . n . '<fieldset id="write-timestamp">' . n . '<legend>' . gTxt('timestamp') . '</legend>' . n . graf(checkbox('reset_time', '1', $reset_time, '', 'reset_time') . '<label for="reset_time">' . gTxt('reset_time') . '</label>') . n . graf(gTxt('published_at') . sp . popHelp('timestamp')) . n . graf(gtxt('date') . sp . tsi('year', '%Y', $sPosted) . ' / ' . tsi('month', '%m', $sPosted) . ' / ' . tsi('day', '%d', $sPosted)) . n . graf(gTxt('time') . sp . tsi('hour', '%H', $sPosted) . ' : ' . tsi('minute', '%M', $sPosted) . ' : ' . tsi('second', '%S', $sPosted)) . n . hInput('sPosted', $sPosted), n . hInput('sLastMod', $sLastMod), n . hInput('AuthorID', $AuthorID), n . hInput('LastModID', $LastModID), n . '</fieldset>';
            //-- expires -------------------
            if (!empty($exp_year)) {
                if (empty($exp_month)) {
                    $exp_month = 1;
                }
                if (empty($exp_day)) {
                    $exp_day = 1;
                }
                if (empty($exp_hour)) {
                    $exp_hour = 0;
                }
                if (empty($exp_minute)) {
                    $exp_minute = 0;
                }
                if (empty($exp_second)) {
                    $exp_second = 0;
                }
                $sExpires = safe_strtotime($exp_year . '-' . $exp_month . '-' . $exp_day . ' ' . $exp_hour . ':' . $exp_minute . ':' . $exp_second);
            }
            echo n . n . '<fieldset id="write-expires">' . n . '<legend>' . gTxt('expires') . '</legend>' . n . graf(gtxt('date') . sp . tsi('exp_year', '%Y', $sExpires) . ' / ' . tsi('exp_month', '%m', $sExpires) . ' / ' . tsi('exp_day', '%d', $sExpires)) . n . graf(gTxt('time') . sp . tsi('exp_hour', '%H', $sExpires) . ' : ' . tsi('exp_minute', '%M', $sExpires) . ' : ' . tsi('exp_second', '%S', $sExpires)) . n . hInput('sExpires', $sExpires) . n . '</fieldset>' . n . n . '</div>';
            //-- save button --------------
            if ($Status >= 4 and has_privs('article.edit.published') or $Status >= 4 and $AuthorID == $txp_user and has_privs('article.edit.own.published') or $Status < 4 and has_privs('article.edit') or $Status < 4 and $AuthorID == $txp_user and has_privs('article.edit.own')) {
                echo fInput('submit', 'save', gTxt('save'), "publish", '', '', '', 4);
            }
        }
    }
    echo '</td></tr></table></form>';
}
Example #27
0
            echo "</TR>\n";
            ob_flush();
            flush();
        }
        echo "</TABLE>\n";
        if (isset($_POST['xls'])) {
            $xlsresult = db_query($db, $sql);
            $columns = array("package", "jobcount", "cpuhours", "users", "groups");
            result_as_xls($xlsresult, $columns, $_POST['system'] . "-software_usage-" . $_POST['start_date'] . "-" . $_POST['end_date']);
        }
        if (isset($_POST['ods'])) {
            $odsresult = db_query($db, $sql);
            $columns = array("package", "jobcount", "cpuhours", "users", "groups");
            result_as_ods($odsresult, $columns, $_POST['system'] . "-software_usage-" . $_POST['start_date'] . "-" . $_POST['end_date']);
        }
    }
    db_disconnect($db);
    bookmarkable_url();
} else {
    begin_form("usage-summary.php");
    system_chooser();
    date_fields();
    $orders = array("jobcount", "cpuhours", "users", "groups");
    checkboxes_from_array("Supplemental reports", array("institution", "software"));
    $defaultorder = "cpuhours";
    pulldown("order", "Order results by", $orders, $defaultorder);
    checkbox("Generate Excel files for supplemental reports", "xls");
    checkbox("Generate ODF files for supplemental reports", "ods");
    end_form();
}
page_footer();
Example #28
0
                }
            }
            echo "<p class='pages'>";
            if (+$limit && ($found_rows === false || $found_rows > $limit)) {
                // display first, previous 4, next 4 and last page
                $max_page = $found_rows === false ? $page + (count($rows) >= $limit ? 2 : 1) : floor(($found_rows - 1) / $limit);
                echo '<a href="' . h(remove_from_uri("page")) . "\" onclick=\"pageClick(this.href, +prompt('" . lang('Page') . "', '" . ($page + 1) . "'), event); return false;\">" . lang('Page') . "</a>:";
                echo pagination(0, $page) . ($page > 5 ? " ..." : "");
                for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) {
                    echo pagination($i, $page);
                }
                echo ($page + 5 < $max_page ? " ..." : "") . ($exact_count && $found_rows !== false ? pagination($max_page, $page) : ' <a href="' . h(remove_from_uri("page") . "&page=last") . '">' . lang('last') . "</a>");
            }
            echo $found_rows !== false ? " (" . ($exact_count ? "" : "~ ") . lang('%d row(s)', $found_rows) . ")" : "";
            echo +$limit && ($found_rows === false ? count($rows) + 1 : $found_rows - $page * $limit) > $limit ? ' <a href="' . h(remove_from_uri("page") . "&page=" . ($page + 1)) . '" onclick="return !selectLoadMore(this, ' . +$limit . ', \'' . lang('Loading') . '\');">' . lang('Load more data') . '</a>' : '';
            echo " " . checkbox("all", 1, 0, lang('whole result')) . "\n";
            if ($adminer->selectCommandPrint()) {
                ?>
<fieldset><legend><?php 
                echo lang('Edit');
                ?>
</legend><div>
<input type="submit" value="<?php 
                echo lang('Save');
                ?>
"<?php 
                echo $_GET["modify"] ? '' : ' title="' . lang('Double click on a value to modify it.') . '" class="jsonly"';
                ?>
>
<input type="submit" name="edit" value="<?php 
                echo lang('Edit');
Example #29
0
function new_pass_form()
{
    return '<div style="margin: 3em auto auto auto; text-align: center;">' . form(tag(gTxt('change_password'), 'h3') . graf('<label for="new_pass">' . gTxt('new_password') . '</label> ' . fInput('password', 'new_pass', '', 'edit', '', '', '20', '1', 'new_pass') . checkbox('mail_password', '1', true, '', 'mail_password') . '<label for="mail_password">' . gTxt('mail_it') . '</label> ' . fInput('submit', 'change_pass', gTxt('submit'), 'smallerbox') . eInput('admin') . sInput('change_pass'), ' style="text-align: center;"')) . '</div>';
}
Example #30
0
function GetAllCompensate($var, $gm)
{
    global $page_action_name, $page_main, $tbl_sys_msg, $tbl_game_server;
    if ($var["serverindex"] == null || $var["serverindex"] == "" and $var["flag"] == "" and $var["role_name"] == "") {
        $strjs = <<<_strjs
<script type="text/javascript" src="/js/page.js"></script>
<script type="text/javascript">
function pass(obj,id){
\tdocument.form1.action_name.value='54';
\tdocument.form1.id.value=id;
\tdocument.form1.serverid.value = \$(obj).parents(".panel").attr("id").substring(4);
\tdocument.form1.target='_block';
\tdocument.form1.submit();
}
function cancel(obj,id)
{
\tdocument.form1.action_name.value='55';
\tdocument.form1.id.value=id;
\tdocument.form1.serverid.value = \$(obj).parents(".panel").attr("id").substring(4);
\tdocument.form1.target='_block';
\tdocument.form1.submit();
}
function pass_all(){
\tdocument.form1.action_name.value='54';
\tdocument.form1.target='_block';
\tdocument.form1.submit();
}
function cancel_all(){
\tdocument.form1.action_name.value='55';
\tdocument.form1.target='_block';
\tdocument.form1.submit();
}
</script>
_strjs;
        echo $strjs . "\n";
        echo "<script type='text/javascript' src='/js/page.js'></script>\n";
        echo "<script type='text/javascript' src='/js/log_info.js'></script>\n";
        echo "<script type='text/javascript' src='/js/checkbox.js'></script>\n";
        form($var, $gm);
        checkbox(true, true);
        echo "<input type='hidden' name='flag' />\n";
        echo "<input type='hidden' name='role_name' />\n";
        echo "<input type='hidden' name='str' />\n";
        echo "<input type='hidden' name='urs' />\n";
        echo "<input type='hidden' name='id'/>\n";
        $ret = eachServerFrame($var, $gm);
        ReturnAndBack();
        echo "</form>\n";
        return $ret;
    } else {
        $serv_id = intval($var["serverindex"]);
    }
    $filter = "";
    if ($var["flag"] != "" || $var["role_name"] != "") {
        $filter = " and";
        if ($var["flag"] != "") {
            $filter .= " reason like '%#[" . $var["flag"] . "[%'";
        }
        if ($var["flag"] != "" && $var["role_name"] != "") {
            $filter .= " and";
        }
        if ($var["role_name"] != "") {
            $k = $var["role_name"];
            $filter .= " (reason like '%[" . $k . ",%' or reason like '%," . $k . "]%' or reason like '%," . $k . ",%' or reason like '%[" . $k . "]%')";
        }
    }
    $query_string = "select gca_uId, gm, action_id, reason from tbl_gm_compensate_action where action_state = 1 and server_id = '{$serv_id}'" . $filter . " order by gca_uId desc";
    page($var, $query_string, 53, "GMS", 0, $result, $page, $desc);
    echo "<table class='list_table'>\n";
    echo "<tr><th style='width:60px;'>" . $page_main["user_name"] . "</th><th style='width:120px;'>" . $page_main["event_type"] . "</th><th>" . $tbl_sys_msg["desc"] . "</th><th style='width:120px;'>" . $tbl_sys_msg["act"] . "</th><th>" . $tbl_sys_msg["server"] . "</th></tr>\n";
    while ($row = mysql_fetch_row($result)) {
        printf("<tr><td align='center'>%s</td><td><input type='checkbox' name='ids[]' value='%d_%d'/>%s</td><td>%s</td><td align='center'>%s%s</td><td>%s</td></tr>\n", $row[1], $row[0], $serv_id, GetGMCommandLogAction($row[2]), LogInfo($row[3]), hasAuth(54, $gm) ? "<input type=button value='" . $tbl_sys_msg["pass"] . "' onclick='pass(this," . $row[0] . ")'/>" : "", hasAuth(55, $gm) ? "<input type=button value='" . $tbl_sys_msg["cancel"] . "' onclick='cancel(this," . $row[0] . ")'/>" : "", $tbl_game_server[$serv_id][2]);
    }
    echo "</table>\n";
    echo "<table class='list_table'>\n";
    echo "<tr><td>";
    if (HasAuth(54, $gm)) {
        echo "<input type='button' onclick='pass_all()' value='" . $page_action_name[54] . "' />";
    }
    if (HasAuth(55, $gm)) {
        echo "<input type='button' onclick='cancel_all()' value='" . $page_action_name[55] . "' />";
    }
    echo "</td></tr>\n";
    echo "</table>\n";
    echo $page;
    return true;
}