Exemple #1
0
<?php

require_once './inc/func_main.php';
if (is_numeric($_REQUEST['rid']) && $usrinfo['right_text']) {
    $sql_a = "SELECT * FROM " . DB_PREFIX . "c2s WHERE " . DB_PREFIX . "c2s.idsolver=" . $usrinfo['id'] . " AND " . DB_PREFIX . "c2s.idcase=" . $_REQUEST['rid'];
    $res_a = MySQL_Query($sql_a);
    $rec_a = MySQL_Fetch_array($res_a);
    $res = MySQL_Query("SELECT * FROM " . DB_PREFIX . "cases WHERE id=" . $_REQUEST['rid']);
    $rec = MySQL_Fetch_Assoc($res);
    if ($usrinfo['right_text'] && ($rec['secret'] == 0 || $usrinfo['right_power'] || $rec_a['iduser'])) {
        $symbolbutton = ' <a href="symbols.php">přiřadit symboly</a>';
    } else {
        $symbolbutton = '';
    }
    $res = MySQL_Query("SELECT * FROM " . DB_PREFIX . "cases WHERE id=" . $_REQUEST['rid']);
    if ($rec_c = MySQL_Fetch_Assoc($res)) {
        if (($rec_c['secret'] == 1 || $rec_c['deleted'] == 1) && !$usrinfo['right_power']) {
            unauthorizedAccess(3, $rec_c['secret'], $rec_c['deleted'], $_REQUEST['rid']);
        }
        auditTrail(3, 1, $_REQUEST['rid']);
        pageStart('Úprava případu');
        mainMenu(3);
        sparklets('<a href="./cases.php">případy</a> &raquo; <strong>úprava případu</strong>', $symbolbutton);
        if ($rec['secret'] == 1 && !$usrinfo['right_power'] && !$rec_a['iduser']) {
            echo '<div id="obsah"><p>Hezký pokus.</p></div>';
            goto end;
        }
        ?>
<div id="obsah">
	<script type="text/javascript">
	<!--

<form action="results.php" method="post"><?php 
$con = mysql_connect($address, $user, $pass);
if (!$con) {
    echo '<div class="alert alert-error">' . mysql_error() . '</div>';
} else {
    echo '<div class="alert alert-success">Successfully Connected</div>';
}
echo '<div class="alert alert-info">You can only search one field currently</div>';
print "<center>";
mysql_select_db($database, $con);
$rows = mysql_query("SELECT DISTINCT _faction FROM characters");
print "<div class='input-prepend'>\n  <span class='add-on'>Faction</span>\n  <select class='span2' name='faction'>\n";
//Get a row
while ($row = MySQL_Fetch_array($rows)) {
    //get a feild
    for ($i = 0; $i < count($row); $i++) {
        //Grab an element in the array
        $array = next($row);
        //A function I just learned :)
        //make sure there is something in it
        if ($array != "") {
            //echo it
            echo "<option>{$array}</option>";
        }
    }
}
echo "<option value='' selected='selected'> </option>";
print "</select></div>";
?>