" />
prijava registracija'; else echo ""; $passed = []; if (!empty($_POST["izbriši"])) $db->exec("delete from stvari where lastnik = '{$_SERVER["PHP_AUTH_USER"]}' and id = '{$_POST["id"]}'"); if (!empty($_POST["dodaj"]) && !empty($_SERVER["PHP_AUTH_USER"])) $db->exec("insert into stvari (lastnik) values ('{$_SERVER["PHP_AUTH_USER"]}')"); foreach ($_POST as $k => $v) if (is_numeric($k)) { foreach ($_POST as $k2 => $v2) { $sp = strpos($k2, "" . $k); if ($sp) $passed[] = substr($k2, 0, $sp); } $par = []; foreach ($passed as $p) { if (strpos(strtolower($p), "id") === false) $par[] = "'" . SQLite3::escapeString($p) . "' = '" . SQLite3::escapeString($_POST[$p . $k]) . "'"; } $s = "update stvari set " . implode(", ", $par) . " where lastnik='{$_SERVER["PHP_AUTH_USER"]}' and id={$k}"; echo $s; $db->exec($s); } if (!empty($_REQUEST["q"])) $ret = $ro->query("select * from stvari where " . $_REQUEST["q"] . " order by datum desc"); else $ret = $ro->query("select * from stvari order by datum desc"); $i = 0; foreach ($ret as $row) { if ($i == 0) foreach ($row as $k => $v) if ($k != "id" && !is_numeric($k)) echo ""; echo ""; foreach ($row as $k => $v) { if ($k == "id" || is_numeric($k)) continue; echo ""; } if ($row["lastnik"] == @$_SERVER['PHP_AUTH_USER'] && $k != "lastnik") { echo ""; } else if ($row["lastnik"] != @$_SERVER['PHP_AUTH_USER'] && $k != "slika") echo "$v"; } echo ""; $i++; }
$k
"; $ok = false; foreach (["input", "name"] as $w) if (strpos(strtolower($v), $w) === FALSE) $ok = true; if ($k == "slika" && !empty($v)) echo ""; if ($k == "datum") echo ""; if ($k == "lastnik" && $v == @$_SERVER['PHP_AUTH_USER']) { echo ""; echo ""; echo "