Ejemplo n.º 1
0
<?php

require_once "sql.php";
require_once "goto.php";
?>

<?php 
$active = $_GET["active"] != 0 ? 1 : 0;
$stravenky = $_GET["stravenky"] != 0 ? 1 : 0;
if (!$_GET["id"]) {
    $res = db_query("\n\t\tINSERT INTO employees(name,plusminus,dovolene,active,stravenky)\n\t\tVALUES(\n\t\t\t'" . $_GET["name"] . "',\n\t\t\t'" . $_GET["plusminus"] . "',\n\t\t\t'" . $_GET["dovolene"] . "',\n\t\t\t'" . $active . "',\n\t\t\t'" . $stravenky . "'\n\t\t);");
} else {
    $res = db_query("\n\t\tUPDATE employees\n\t\tSET\n\t\t\tname='" . $_GET["name"] . "',\n\t\t\tplusminus='" . $_GET["plusminus"] . "',\n\t\t\tdovolene='" . $_GET["dovolene"] . "',\n\t\t\tactive='" . $active . "',\n\t\t\tstravenky='" . $stravenky . "'\n\t\tWHERE id='" . $_GET["id"] . "'\n\t;");
}
?>

<?php 
include "header.htm";
?>

<?php 
if ($res) {
    echo "V pořádku.";
    handle_goto_body($_GET["goto"]);
} else {
    echo "CHYBA!!!";
}
?>

<?php 
include "footer.htm";
Ejemplo n.º 2
0
<?php

require_once "auth.php";
require_once "goto.php";
?>

<?php 
$_SESSION["password"] = "";
?>

<?php 
include "header.htm";
?>

<?php 
handle_goto_body($_POST["goto"]);
?>

<p>
(snad) odhlášen
</p>

<?php 
include "footer.htm";