require "functions.php"; $db_server = "localhost"; $db_user = "objednavky.20"; $db_passwd = "LE905326le8972"; $db_name = "objednavky_20"; $pripoj = mysql_connect ($db_server, $db_user, $db_passwd); // vyber db $vyber = mysql_select_db ($db_name); @mysql_query("SET NAMES 'utf-8';"); session_start(); error_reporting(0); function nastavenia_vypis($hodnota){ $resulte = mysql_query("SELECT popis FROM nastavenia WHERE nazov LIKE '$hodnota' LIMIT 1"); $vratenie = MySQL_Result($resulte, 0, "popis"); return $vratenie; } function zrusit_objednavku(){ $cislo_objednavky = $_SESSION["objednavka"]; mysql_query("DELETE FROM objednavky WHERE id LIKE '$cislo_objednavky'"); mysql_query("DELETE FROM polozky_objednavky WHERE id_objednavka LIKE '$cislo_objednavky'"); $_SESSION["objednavka"] = ""; } $cislo_objednavky_dest = $_SESSION["objednavka"]; $result_dest = mysql_query("SELECT * FROM objednavky WHERE id LIKE $cislo_objednavky_dest"); $spolu_objednavka_dest = MySQL_Result($result_dest, 0, "spolu"); if($spolu_objednavka_dest == ""){ zrusit_objednavku(); } if ($_GET["zmena_dorucenia"] == "1"){ mysql_query("UPDATE objednavky SET osobny_odber = '1' WHERE id LIKE '$cislo_objednavky_dest'"); } elseif ($_GET["zmena_dorucenia"] == "2"){ mysql_query("UPDATE objednavky SET osobny_odber = '0' WHERE id LIKE '$cislo_objednavky_dest'"); } ?>