Example #1
0
case "registrace_import":
$count=0;
$res=MySQL_Query("SELECT * FROM fox2_registrace");
while ($reg=MySQL_Fetch_Assoc($res)):
//   echo "$reg[rc] $reg[id_oddilu] $reg[sport] $reg[rok]<br>\n";
   $x=MySQL_Query("SELECT * FROM osoby WHERE rc='$reg[rc]'");
   if (MySQL_Num_Rows($x)<>1):
      MySQL_Free_Result($x);
      echo "rodne cislo $reg[rc] nenalezeno<br>\n";
      continue;
     else:
      $osoba=MySQL_Fetch_Assoc($x);
      MySQL_Free_Result($x);
      endif;
   $x=MySQL_Query("SELECT * FROM oddily WHERE fox_id='$reg[id_oddilu]'");
   if (MySQL_Num_Rows($x)<>1):
      MySQL_Free_Result($x);
      echo "oddil $reg[id_oddilu] nenalezen<br>\n";
      continue;
     else:
      $oddil=MySQL_Fetch_Assoc($x);
      MySQL_Free_Result($x);
      endif;
   $od="$reg[rok]-01-01";
   $do="$reg[rok]-12-31";
   if ($reg[pulrok]=='1') $do="$reg[rok]-06-30";
   if ($reg[pulrok]=='2') $od="$reg[rok]-07-01";
   if ($reg[sport]=='SM') $reg[sport]='SG';
   if ($reg[sport]=='SZ') $reg[sport]='SG';
   $count++;
   $query="INSERT INTO registrace SET osoba='$osoba[id]', oddil='$oddil[id]', sport='$reg[sport]', funkce='Z', od='$od', do='$do'";
Example #2
0
	  <div id="filtersubmit"><input type="hidden" name="rid" value="' . $_REQUEST['rid'] . '" /><input type="submit" name="filter" value="Filtrovat" /></div>
	</fieldset>
</form><form name="addpersons" action="addpersons.php" method="post" class="otherform">';
        }
        filter();
        // vypis osob
        if ($usrinfo['right_power']) {
            $sql = "SELECT " . DB_PREFIX . "persons.phone AS 'phone', " . DB_PREFIX . "persons.secret AS 'secret', " . DB_PREFIX . "persons.name AS 'name', " . DB_PREFIX . "persons.surname AS 'surname', " . DB_PREFIX . "persons.id AS 'id', " . DB_PREFIX . "persons.symbol AS 'symbol', " . DB_PREFIX . "ar2p.role AS 'role', " . DB_PREFIX . "ar2p.iduser FROM " . DB_PREFIX . "persons LEFT JOIN " . DB_PREFIX . "ar2p ON " . DB_PREFIX . "ar2p.idperson=" . DB_PREFIX . "persons.id AND " . DB_PREFIX . "ar2p.idreport=" . $_REQUEST['rid'] . " WHERE " . DB_PREFIX . "persons.deleted=0 " . $fsql_dead . $fsql_archiv . " ORDER BY " . $fsql_sort;
        } else {
            $sql = "SELECT " . DB_PREFIX . "persons.phone AS 'phone', " . DB_PREFIX . "persons.secret AS 'secret', " . DB_PREFIX . "persons.name AS 'name', " . DB_PREFIX . "persons.surname AS 'surname', " . DB_PREFIX . "persons.id AS 'id', " . DB_PREFIX . "persons.symbol AS 'symbol', " . DB_PREFIX . "ar2p.role AS 'role', " . DB_PREFIX . "ar2p.iduser FROM " . DB_PREFIX . "persons LEFT JOIN " . DB_PREFIX . "ar2p ON " . DB_PREFIX . "ar2p.idperson=" . DB_PREFIX . "persons.id AND " . DB_PREFIX . "ar2p.idreport=" . $_REQUEST['rid'] . " WHERE " . DB_PREFIX . "persons.deleted=0 " . $fsql_dead . $fsql_archiv . " AND " . DB_PREFIX . "persons.secret=0 ORDER BY " . $fsql_sort;
        }
        $res = MySQL_Query($sql);
        ?>
<div id="in-form-table">
<?php 
        if (MySQL_Num_Rows($res)) {
            echo '<table>
<thead>
	<tr>
	<th>#</th>
	<th>Úloha</th>
' . ($sportraits ? '<th>Portrét</th>' : '') . ($ssymbols ? '<th>Symbol</th>' : '') . '
	  <th>Jméno</th>
	</tr>
</thead>
<tbody>
';
            $even = 0;
            $iterator = 0;
            while ($rec = MySQL_Fetch_Assoc($res)) {
                echo '<script type="text/javascript" language="JavaScript">
Example #3
0
function getRecord($type, $idrecord)
{
    if ($idrecord > 0) {
        switch ($type) {
            case 1:
                $sql_type = "SELECT " . DB_PREFIX . "persons.name as 'name', " . DB_PREFIX . "persons.surname as 'surname' FROM " . DB_PREFIX . "persons WHERE " . DB_PREFIX . "persons.id='" . $idrecord . "'";
                $res_type = MySQL_Query($sql_type);
                if (MySQL_Num_Rows($res_type)) {
                    while ($rec_type = MySQL_Fetch_Assoc($res_type)) {
                        $name = StripSlashes($rec_type['surname']) . ', ' . StripSlashes($rec_type['name']);
                    }
                } else {
                    $name = 'neznámý';
                }
                break;
            case 2:
                $sql_type = "SELECT " . DB_PREFIX . "groups.title as 'name' FROM " . DB_PREFIX . "groups WHERE " . DB_PREFIX . "groups.id='" . $idrecord . "'";
                $res_type = MySQL_Query($sql_type);
                if (MySQL_Num_Rows($res_type)) {
                    while ($rec_type = MySQL_Fetch_Assoc($res_type)) {
                        $name = StripSlashes($rec_type['name']);
                    }
                } else {
                    $name = 'neznámý';
                }
                break;
            case 3:
                $sql_type = "SELECT " . DB_PREFIX . "cases.title as 'name' FROM " . DB_PREFIX . "cases WHERE " . DB_PREFIX . "cases.id='" . $idrecord . "'";
                $res_type = MySQL_Query($sql_type);
                if (MySQL_Num_Rows($res_type)) {
                    while ($rec_type = MySQL_Fetch_Assoc($res_type)) {
                        $name = StripSlashes($rec_type['name']);
                    }
                } else {
                    $name = 'neznámý';
                }
                break;
            case 4:
                $sql_type = "SELECT " . DB_PREFIX . "reports.label as 'name' FROM " . DB_PREFIX . "reports WHERE " . DB_PREFIX . "reports.id='" . $idrecord . "'";
                $res_type = MySQL_Query($sql_type);
                if (MySQL_Num_Rows($res_type)) {
                    while ($rec_type = MySQL_Fetch_Assoc($res_type)) {
                        $name = StripSlashes($rec_type['name']);
                    }
                } else {
                    $name = 'neznámý';
                }
                break;
            case 7:
                $name = $idrecord;
                break;
            case 8:
                $sql_type = "SELECT " . DB_PREFIX . "users.login as 'name' FROM " . DB_PREFIX . "users WHERE " . DB_PREFIX . "users.id='" . $idrecord . "'";
                $res_type = MySQL_Query($sql_type);
                if (MySQL_Num_Rows($res_type)) {
                    while ($rec_type = MySQL_Fetch_Assoc($res_type)) {
                        $name = StripSlashes($rec_type['name']);
                    }
                } else {
                    $name = 'neznámý';
                }
                break;
            case 10:
                $name = $idrecord;
                break;
        }
        return $name;
    } else {
        $name = 'globální operace';
        return $name;
    }
}
function page_counter($id, $table, $sort, $view_number, $sess, $link, $i, $page)
{
    $count = MySQL_Query("SELECT {$id} FROM {$table} WHERE {$sort} AND ul_group = '{$sess['4']}'") or die($query_error);
    //vybíráme zprávy
    $page_count = Ceil(MySQL_Num_Rows($count) / $view_number);
    //poèet stran, na kterých se zprávy zobrazí
    for ($i = 0; $i < $page_count; $i++) {
        echo " | ";
        if ($page != $i) {
            echo "<a href=\"{$link}{$i}\">";
        }
        echo $i + 1;
        if ($page != $i) {
            echo '</a> ';
        }
    }
}
Example #5
0
    $cases[] = '<a href="./readcase.php?rid=' . $perc['id'] . '&hidenotes=0">' . StripSlashes($perc['title']) . '</a>';
}
echo implode($cases, '<br />') != "" ? implode($cases, '<br />') : '<em>Nemáte žádný přiřazený neuzavřený případ.</em>';
?>
</p>
        </td>
        <td>
        <h3>Nedokončené úkoly: <?php 
$sql_r = "SELECT * FROM " . DB_PREFIX . "tasks WHERE " . DB_PREFIX . "tasks.iduser="******" AND " . DB_PREFIX . "tasks.status=0 ORDER BY " . DB_PREFIX . "tasks.created ASC";
$res_r = MySQL_Query($sql_r);
$rec_count = MySQL_Num_Rows($res_r);
echo $rec_count;
?>
                        </h3><p>
                        <?php 
if (MySQL_Num_Rows($res_r)) {
    $tasks = array();
    while ($rec_r = MySQL_Fetch_Assoc($res_r)) {
        $tasks[] = StripSlashes($rec_r['task']) . ' (' . getAuthor($rec_r['created_by'], 2) . ') | <a href="procother.php?fnshtask=' . $rec_r['id'] . '">hotovo</a>';
    }
    echo implode($tasks, '<br />');
} else {
    echo 'Nemáte žádné nedokončené úkoly.';
}
?>
</p>
        </td>
        </tr></table>
        <div class="clear">&nbsp;</div>
</fieldset>
</div>
Example #6
0
function auditTrail($record_type, $operation_type, $idrecord)
{
    global $usrinfo;
    $sql_check = "SELECT * FROM " . DB_PREFIX . "audit_trail WHERE iduser='******'id'] . "' AND time='" . time() . "'";
    $res_check = MySQL_Query($sql_check);
    if (MySQL_Num_Rows($res_check)) {
    } else {
        if (!$usrinfo['currip']) {
            $currip = $_SERVER['REMOTE_ADDR'];
        } else {
            $currip = $usrinfo['currip'];
        }
        $sql_au = "INSERT INTO " . DB_PREFIX . "audit_trail VALUES('','" . $usrinfo['id'] . "','" . time() . "','" . $operation_type . "','" . $record_type . "','" . $idrecord . "','" . $currip . "','" . $usrinfo['right_org'] . "')";
        MySql_Query($sql_au);
    }
}
    //		header("Location: ./group.php?action=info");
}
// DELETE GROUP
if ($group_del != "") {
    @($sql = mysql_query("DELETE FROM uniletim_groups WHERE grp_id = '{$group_del}'"));
    @($sql = mysql_query("DELETE FROM uniletim_announces WHERE ul_group = '{$group_del}'"));
    @($sql = mysql_query("DELETE FROM uniletim_members WHERE ul_group = '{$group_del}'"));
    @($sql = mysql_query("DELETE FROM uniletim_sections WHERE ul_group = '{$group_del}'"));
    @($sql = mysql_query("DELETE FROM uniletim_subsections WHERE ul_group = '{$group_del}'"));
    $result = _GROUP . " " . _WAS_DELETED_FEMALE;
}
// ADD GROUP
if ($group_add != "") {
    mysql_query("select * from uniletim_groups");
    if (mysql_affected_rows() == 0) {
        $dbInstalled = MySQL_Num_Rows(MySQL_Query("SHOW TABLES")) ? 1 : 0;
        if (!$dbInstalled) {
            include "./includes/tables.inc.php";
        }
    }
    if ($mbr_password == "" || $grp_name == "") {
        $error = _INS_RQRD_DATA . "\n";
    } elseif ($mbr_password != $mbr_password2) {
        $error = _PASSWD_TWICE_RQRD . "\n";
    } else {
        mysql_query("select * from uniletim_members where mbr_login = '******'");
        if (mysql_affected_rows() > 0) {
            $error1 = "<b>{$in_chu}</b>\n";
        } else {
            mysql_query("select * from uniletim_groups where grp_name = '{$grp_name}'");
            if (mysql_affected_rows() > 0) {
Example #8
0
	FUNCTION result($result) {
		$this->result = $result;
		$this->num_rows = @MySQL_Num_Rows($this->result);
		}
Session_name("{$SN}");
Session_start();
$sid = Session_id();
$date = Date("U");
$ad = Date("U") - 1800;
$MSQ = @MySQL_Query("SELECT * FROM uniletim_auth WHERE (aut_id = '{$sid}')");
// AND (aut_date >= '$ad')
$sess = @MySQL_Fetch_Row($MSQ);
if (@MySQL_Num_Rows($MSQ) < 1) {
    $auth = "0";
    // test if the db.tables are created; if not, jump to install.php
    $dbInstalled = MySQL_Num_Rows(MySQL_Query("SHOW TABLES")) ? 1 : 0;
    if (!$dbInstalled) {
        include "./includes/tables.inc.php";
    }
    $memberExists = MySQL_Num_Rows(MySQL_Query("SELECT mbr_id FROM uniletim_members")) ? 1 : 0;
    if (!$memberExists) {
        include "./install.php";
        exit;
    }
    if ($lang == "") {
        $lang = $app_lang;
    }
} else {
    $lang = $sess[9];
    $MSQ = MySQL_Query("UPDATE uniletim_auth SET aut_date = {$date} WHERE aut_id = '{$sid}'");
}
// change group
if ($group_ch != "") {
    mysql_query("UPDATE uniletim_auth SET aut_group='{$group_ch}', aut_group_name='{$grp_name}' WHERE aut_id='{$sess['0']}'");
    $MSQ = MySQL_Query("SELECT * FROM uniletim_auth WHERE (aut_id = '{$sid}')");
//  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
//  You should have received a copy of the GNU General Public License  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 or visit http://www.gnu.sk/ for Vseobecna zverejnovacia licencia GNU
// skript sluzi k autorizacii uzivatelov
include "./config.php";
$SN = "hvxator";
Session_name("{$SN}");
Session_start();
$sid = Session_id();
$date = Date("U");
$ad = Date("U") - 1800;
$MSQ = MySQL_Query("SELECT * FROM uniletim_auth WHERE (aut_id = '{$sid}')");
// AND (aut_date >= $ad)
$sess = mysql_fetch_row($MSQ);
if (MySQL_Num_Rows($MSQ) != 1) {
    header("Location: ./login.php");
    $auth = "0";
    exit;
} else {
    $lang = $sess[9];
    $MSQ = MySQL_Query("UPDATE uniletim_auth SET aut_date = {$date} WHERE aut_id = '{$sid}'");
}
// change group
if ($group_ch != "") {
    mysql_query("UPDATE uniletim_auth SET aut_group='{$group_ch}', aut_group_name='{$grp_name}' WHERE aut_id='{$sess['0']}'");
    $MSQ = MySQL_Query("SELECT * FROM uniletim_auth WHERE (aut_id = '{$sid}')");
    // AND (aut_date >= '$ad')
    $sess = mysql_fetch_row($MSQ);
}
?>
//  Copyright (C) 2003 PRIESTOR o.z., Ondrej Vegh, Robert Zelnik, Michal Jurco
//  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (in Slovak Republic
//  in the terms of the Vseobecna zverejnovacia licencia GNU) as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
//  You should have received a copy of the GNU General Public License  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 or visit http://www.gnu.sk/ for Vseobecna zverejnovacia licencia GNU
// login and authorisation of user
include "./config.php";
if (isset($login) and isset($password)) {
    // is set urername and password
    $password = MD5($password);
    $SQL = MySQL_Query("SELECT * FROM uniletim_members WHERE (mbr_login LIKE '{$login}') AND (mbr_password LIKE '{$password}')");
    $INFO = mysql_fetch_row($SQL);
    if (MySQL_Num_Rows($SQL) < 1) {
        header("Location: ./login.php?echo=error");
        exit;
    } else {
        $SN = "hvxator";
        Session_name("{$SN}");
        Session_start();
        $sid = Session_id();
        $time = Date("U");
        $at = Date("U") - 1800;
        $SQL = MySQL_Query("SELECT * FROM uniletim_perms WHERE perm_member = '{$INFO['0']}' AND perm_default = 'd'");
        $PERM = mysql_fetch_row($SQL);
        $SQL = MySQL_Query("SELECT * FROM uniletim_groups WHERE grp_id = '{$PERM['2']}'");
        $GROUP = mysql_fetch_row($SQL);
        if ($GROUP[4] == "") {
            $design = $app_design;