本文整理汇总了PHP中sec_sql函数的典型用法代码示例。如果您正苦于以下问题:PHP sec_sql函数的具体用法?PHP sec_sql怎么用?PHP sec_sql使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sec_sql函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
function edit($table, $vyber, $id)
{
$error_msg = array();
if ($_POST[submit]) {
$meno = sec_sql(sec_input($_POST["meno"]));
$hodnota = sec_sql(sec_input($_POST["hodnota"]));
if (strlen($meno) > 30 or strlen($meno) < 3) {
$error_msg[] = "Meno môže mať od 4 do 30 znakov";
}
if (strlen($hodnota) > 30 or strlen($hodnota) < 3) {
$error_msg[] = "Hodnota môže mať od 4 do 30 znakov";
}
//var_dump($error_msg);
if (empty($error_msg)) {
echo "ok";
} else {
echo "<div id=error_message>" . implode("<br>", $error_msg) . "</div>";
}
}
$id = sec_sql($id);
$query = "Select id, hodnota, meno from " . PREFIX . "{$table} WHERE id={$id}";
$value = sql_query($query);
$value = $value[0];
echo "<form method=\"POST\">";
hidden("id", $value[id]);
textfield("meno", $value[meno], "Meno", 50, 20);
textfield("hodnota", $value[hodnota], "Hodnota", 40, 20);
submit("submit", "Odoslať");
echo "</form>";
}
示例2: edit
function edit($table, $vyber, $id, $sub, $page = 1)
{
$error_msg = array();
//dd($_POST);
//exit();
if ($_POST[submit]) {
$meno = sec_sql(sec_input($_POST["meno"]));
$email = sec_sql(sec_input($_POST["email"]));
$email_potvrdenie = sec_sql(sec_input($_POST["email_potvrdenie"]));
$meno_potvrdenie = sec_sql(sec_input($_POST["meno_potvrdenie"]));
$email_meno = sec_sql(sec_input($_POST["email_meno"]));
if (strlen($meno) > 50 or strlen($meno) < 1) {
$error_msg[] = "Meno môže mať od 1 do 50 znakov";
}
if (empty($error_msg)) {
if ($table == "dodavatel") {
$query = "UPDATE {$table}\r\n SET meno = \"{$meno}\", email=\"{$email}\"\r\n WHERE id = {$id}";
}
if ($table == "do_produkt") {
$query = "UPDATE {$table}\r\n SET meno = \"{$meno}\", email_meno=\"{$email_meno}\"\r\n WHERE id = {$id}";
}
sql_update($query);
//echo $id_perm_uroven;
header("location: index.php?vyber={$vyber}&sub={$table}&page={$page}");
exit;
} else {
echo "<div id=error_message>" . implode("<br>", $error_msg) . "</div>";
}
}
$id = sec_sql($id);
$query = "Select * from {$table} WHERE id={$id}";
$value = sql_query($query);
$value = $value[0];
$zobraz_vo = array(1 => "skryť", 0 => "zobraz");
echo "<form method=\"POST\">";
hidden("id", $value[id]);
echo textfield("meno", $value[meno], "Meno", 50, 30);
if ($table == "dodavatel") {
echo textfield("email", $value[email], "Email", 50, 40);
}
if ($table == "do_produkt") {
echo textfield("email_meno", $value[email_meno], "Email meno", 50, 40);
}
echo submit("submit", "Odoslať");
echo "<a href=\"?vyber={$vyber}&sub={$sub}\">Späť</a>";
echo "</form>";
}
示例3: sec_sql
<?php
$safe = "U,,5Enc!";
$root = $_SERVER['DOCUMENT_ROOT'];
include_once "config/datab.php";
// subor s nastaveniami databaz
include_once "config/fnc.php";
// vloženie hlavičky stránky
if (isset($_GET["select_material"])) {
$material = sec_sql(sec_input($_GET["select_material"]));
$def_hrana_duplak = def_value("default_duplak_hrana_value", "hodnota");
echo select("hrana", "Hrúbka", "SELECT id, hodnota, meno FROM hrana WHERE vymaz=0 {$where} ORDER BY hodnota", def_value("default_hrubka", "hodnota"), "", "hrubka", "", "NO");
}
示例4: sec_sql
// subor s nastaveniami databaz
include_once "config/fnc.php";
// vloženie hlavičky stránky
include_once "config/config.php";
$minimized = "minimized";
$tasker = "ghost";
//var_dump($vyber);
if (!empty($_POST["dodavatel"]) and !empty($_POST["text"]) and !empty($_POST["zakaznik"])) {
$dodavatel = sec_sql(sec_input($_POST["dodavatel"]));
$ks = str_replace(',', '.', sec_sql(sec_input($_POST["ks"])));
$ks = floatval($ks);
$text = sec_sql(sec_input($_POST["text"]));
$jednotka = sec_sql(sec_input($_POST["jednotky"]));
$zakaznik = sec_sql(sec_input($_POST["zakaznik"]));
$objednavka = sec_sql(sec_input($_POST["order"]));
$from = sec_sql(sec_input($_POST["from"]));
mysql_query("BEGIN");
$produkt = sql_query("Select id from do_produkt\r\n WHERE meno = \"{$text}\" ");
if (count($produkt) == 0) {
$sql_obj = sql_insert("INSERT INTO do_produkt (meno)\r\n VALUES (\"{$text}\") ");
$produkt = $sql_obj["inserted_id"];
} else {
$produkt = $produkt[0]["id"];
}
//dd($produkt);
$sql_obj = sql_insert("INSERT INTO do_objednavka (datum_zmeny, id_dodavatel, objednavka)\r\n VALUES (now(), \"{$dodavatel}\", \"{$objednavka}\" )\r\n ");
$obj_id = $sql_obj["inserted_id"];
sql_insert("INSERT INTO do_objednavka_row (id_do_objednavka, datum, ks, jednotka, text, id_do_produkt, objednavka, zakaznik, vytvoril, zadal)\r\n VALUES (\"{$obj_id}\", now(), \"{$ks}\", \"{$jednotka}\", \"{$text}\", \"{$produkt}\", \"{$objednavka}\", \"{$zakaznik}\", {$_SESSION["username"]}, {$from} )\r\n ");
sql_insert("INSERT INTO do_objednavka_row_search (id_obj, zakaznik, text)\r\n VALUES (\"{$obj_id}\", \"{$zakaznik}\", \"{$text}\" )\r\n ");
mysql_query("COMMIT");
}
示例5: sec_sql
<?php
if ($_POST["filter"]) {
//var_dump($_POST);
$_SESSION["filter_vyroba_od"] = sec_sql(sec_input($_POST["filter_vyroba_od"]));
$_SESSION["filter_vyroba_do"] = sec_sql(sec_input($_POST["filter_vyroba_do"]));
$_SESSION["filter_vyroba_zakaznik"] = sec_sql(sec_input($_POST["filter_vyroba_zakaznik"]));
$_SESSION["filter_vyroba_zakaznik_no"] = sec_sql(sec_input($_POST["filter_vyroba_zakaznik_no"]));
$_SESSION["filter_vyroba_product_type"] = sec_sql(sec_input($_POST["filter_vyroba_product_type"]));
$_SESSION["filter_vyroba_product"] = sec_sql(sec_input($_POST["filter_vyroba_product"]));
$_SESSION["filter_vyroba_dl"] = sec_sql(sec_input($_POST["filter_vyroba_dl"]));
$_SESSION["filter_vyroba_matrac_rozmer"] = sec_sql(sec_input($_POST["filter_vyroba_matrac_rozmer"]));
}
$day_limit = 30;
$where = array();
$where[] = "vp.vymaz=0";
$where[] = "vp.status=5";
if (!empty($_SESSION["filter_vyroba_od"])) {
$where[] = "datum_vyroby >= \"{$_SESSION["filter_vyroba_od"]} 00:00:00\"";
} else {
$where[] = "datum_vyroby >= DATE_SUB(CURDATE(), INTERVAL {$day_limit} DAY)";
}
if (!empty($_SESSION["filter_vyroba_do"])) {
$where[] = "datum_vyroby <= \"{$_SESSION["filter_vyroba_do"]} 23:59:59\"";
}
echo "<h1>Výroba</h1>";
echo "<form method=\"POST\">";
echo "<div class=\"filter_vyroba clearfix\">";
echo textfield("filter_vyroba_od", $_SESSION["filter_vyroba_od"], "od:", 15, 10, "filter_vyroba_od datetime");
echo textfield("filter_vyroba_do", $_SESSION["filter_vyroba_do"], "do:", 15, 10, "filter_vyroba_do datetime");
echo select("filter_vyroba_zakaznik", "Filtruj zákazníkov:", "SELECT id, CONCAT(meno, ', ', doruc_mesto) meno FROM uzivatel WHERE skupina=2 AND vymaz=0 ORDER BY meno", $_SESSION["filter_vyroba_zakaznik"], "", "", "");
示例6: mysql_query
$data = $_SESSION["posted_form_edit_rev"];
//var_dump($data);
// vlozenie do revizii
mysql_query("BEGIN");
$query = "INSERT INTO revizia \r\n (id_obj, meno, adresa, mesto, ico_icdph, telefon, email, id_material, id_hrubka, id_vyrobca,\r\n id_dekor, dekor_vlastny, komentar, komentar_private, datum, upravil)\r\n VALUES \r\n ({$order},\r\n \"" . sec_input(sec_sql($data["meno"])) . "\",\r\n \"" . sec_input(sec_sql($data["adresa"])) . "\",\r\n \"" . sec_input(sec_sql($data["mesto"])) . "\",\r\n \"" . sec_input(sec_sql($data["ico_icdph"])) . "\",\r\n \"" . sec_input(sec_sql($data["telefon"])) . "\",\r\n \"" . sec_input(sec_sql($data["email"])) . "\",\r\n " . sec_input(sec_sql($data["material"])) . ",\r\n " . sec_input(sec_sql($data["hrubka_rev"])) . ",\r\n " . sec_input(sec_sql($data["vyrobca"])) . ",\r\n " . sec_input(sec_sql($data["dekor"])) . ",\r\n \"" . sec_input(sec_sql($data["dekor_vlastny"])) . "\",\r\n \"" . sec_input(sec_sql($data["komentar"])) . "\",\r\n \"" . sec_input(sec_sql($data["komentar_private"])) . "\",\r\n now(), {$_SESSION['username']})";
$sql_revizia = sql_insert($query);
$revizia_id = $sql_revizia["inserted_id"];
$fieldsets_c = count($data["ks_all"]);
// vlozenie do porezu
for ($i = 0; $i < $fieldsets_c; $i++) {
$data_for_count = array("ks_all" => $data["ks_all"][$i], "dlzka_all" => $data["dlzka_all"][$i], "sirka_all" => $data["sirka_all"][$i], "hrubka_all" => $data["hrubka_all"][$i], "hrana1_all" => $data["hrana1_all"][$i], "hrana2_all" => $data["hrana2_all"][$i], "hrana3_all" => $data["hrana3_all"][$i], "hrana4_all" => $data["hrana4_all"][$i], "duplak_paska_all" => $data["duplak_paska_all"][$i]);
$vypocet = porez_vypocty($data_for_count);
//var_dump($vypocet);
$stvorak = $vypocet[stvorak];
$lepenie = $vypocet[lepenie];
$query = "INSERT INTO porez \r\n (id_revizia, ks, dlzka, sirka, stvorak, lepenie, nazov, poznamka, duplak, hrubka, orientacia,\r\n hrana1, hrana2, hrana3, hrana4, duplak_paska, roh1x, roh1y, roh2x, roh2y,\r\n roh3x, roh3y, roh4x, roh4y)\r\n VALUES \r\n ({$revizia_id},\r\n " . sec_input(sec_sql($data["ks_all"][$i])) . ",\r\n " . sec_input(sec_sql($data["dlzka_all"][$i])) . ",\r\n " . sec_input(sec_sql($data["sirka_all"][$i])) . ",\r\n " . $stvorak . ", " . $lepenie . ",\r\n \"" . sec_input(sec_sql($data["nazov_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["poznamka_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["duplak_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["hrubka_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["orientacia_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["hrana1_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["hrana2_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["hrana3_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["hrana4_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["duplak_paska_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["roh1x_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["roh1y_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["roh2x_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["roh2y_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["roh3x_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["roh3y_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["roh4x_all"][$i])) . "\",\r\n \"" . sec_input(sec_sql($data["roh4y_all"][$i])) . "\"\r\n )";
$sql_porez = sql_insert($query);
$porez_id = $sql_porez["inserted_id"];
if (!isset($vypocet[paska_normal]) or empty($vypocet[paska_normal])) {
$vypocet[paska_normal] = array();
}
foreach ($vypocet[paska_normal] as $key => $paska) {
if ($paska[rozmer] > 0) {
$query = "INSERT INTO porez_hrana (id_revizia, id_porez, id_hrana, dlzka, dlzka_nadmiera)\r\n VALUES ({$revizia_id}, {$porez_id}, {$key}, \"{$paska['rozmer']}\", \"{$paska['nadmiera']}\")";
//var_dump($query);
$sql_porez_hrana = sql_insert($query);
}
}
$duplak_hrana_id = sql_query("SELECT id FROM hrana WHERE duplak=1 LIMIT 1");
$duplak_hrana_id = $duplak_hrana_id[0][id];
if ($vypocet[paska_duplak][rozmer] > 0) {
示例7: print_revision_cp_vyrobny_plan
function print_revision_cp_vyrobny_plan($cp, $revision)
{
$data = sql_query("SELECT id_vyrobny_plan, DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum\r\n FROM revizia_vyrobny_plan \r\n WHERE id={$revision} \r\n LIMIT 1")[0];
$data_row = sql_query("SELECT vyr.*, obr.*, rev.meno, rev.mesto, rev.doruc_mesto, rev.email, \r\n rev.komentar, rev.komentar_private, rev.vlastne_cislo_obj, obj.id_zakaznik, obj.c_obj, obj.datum \r\n FROM vyrobny_plan_row vyr\r\n INNER JOIN objednavka_row obr\r\n ON vyr.id_objednavka_row = obr.id\r\n INNER JOIN revizia rev\r\n ON obr.id_revizia = rev.id\r\n INNER JOIN objednavka obj\r\n ON rev.id_obj = obj.id\r\n WHERE id_revizia_vyrobny_plan = " . $revision . "\r\n AND vyr.vymaz = 0;\r\n ");
foreach ($data_row as $key => $row) {
$data_row_option = sql_query("SELECT id_product_atribute, id_product_atribute_option \r\n FROM objednavka_row_atribute \r\n WHERE id_revizia=\"{$row['id_revizia']}\" AND id_objednavka_row=\"{$row[id]}\"");
//var_dump($data_row_option);
foreach ($data_row_option as $option) {
$data_row[$key]["product_atribute_options_all"][$option["id_product_atribute"]] = $option["id_product_atribute_option"];
}
if ($row["id_zakaznik"] == 0) {
$data_zak[$row["id_zakaznik"]][$row["id_revizia"]][] = $data_row[$key];
} else {
$data_zak[$row["id_zakaznik"]][] = $data_row[$key];
}
}
//var_dump($data_zak);
$data_obj = sql_query("SELECT id, meno, popis, DATE_FORMAT(datum_vyvozu, '%d. %m. %Y') AS datum, \r\n DATE_FORMAT(datum, '%Y') AS rok\r\n FROM vyrobny_plan \r\n WHERE id=" . $data["id_vyrobny_plan"] . " LIMIT 1");
$data_obj = $data_obj[0];
$message = "";
$message .= "<h1>Cenová ponuka <br> Výrobný Plán č. " . $data_obj["id"] . "/" . $data_obj["rok"] . " - " . $data_obj["meno"] . " </h1>";
$message .= "<h5>Dátum vývozu: " . $data_obj["datum"] . "</h5>";
$message .= !empty($data_obj["popis"]) ? "<h5>Popis: " . $data_obj["popis"] . "</h5>" : "";
/*
$data_row = sql_query("SELECT *
FROM vyrobny_plan_row vyr
INNER JOIN objednavka_row obr
ON vyr.id_objednavka_row = obr.id
WHERE id_revizia_vyrobny_plan = ".$revision."
");
*/
$message .= "<div class=\"print_hlavicka3\">\r\n <table>\r\n <tr>\r\n \r\n <th style=\"width: 460px;\">produkt</th> \r\n <th style=\"width: 90px;\">j.cena</th> \r\n <th style=\"width: 100px;\">zľava % / j.cena po</th>\r\n <th style=\"width: 80px;\">Spolu</th>\r\n <th style=\"width: 80px;\"></th>\r\n <th style=\"width: 100px;\">komentár</th>\r\n </tr>";
foreach ($data_zak as $key => $zakaznik) {
//var_dump($key);
$data_z = array();
if ($key > 0) {
if ($sum_zakaznik > 0) {
$message .= "<tr>";
$message .= "<td colspan=3 class=\"right\">Spolu pre zákazníka / objednávku</td>";
$message .= "<td colspan=3 class=\"bold\">{$sum_zakaznik} €</td>";
$message .= "</tr>";
}
$sum_zakaznik = 0;
$message .= "<tr class=\"silver\">";
$query = "SELECT meno, mesto, doruc_mesto, email FROM uzivatel WHERE id=" . $key . " LIMIT 1";
$zakaz = sql_query($query)[0];
//dd($zakaz);
$data_z["meno"] = $zakaz["meno"];
$data_z["doruc_mesto"] = $zakaz["doruc_mesto"];
$data_z["mesto"] = $zakaz["mesto"];
$data_z["email"] = $zakaz["email"];
$odberatel = $data_z["meno"];
if (empty($data_z["doruc_mesto"])) {
$odberatel .= empty($data_z["mesto"]) ? "" : ", " . $data_z["mesto"];
} else {
$odberatel .= ", " . $data_z["doruc_mesto"];
}
$odberatel = "<span class=\"bold\">" . $odberatel . "</span>" . (!empty($data_z["email"]) ? " (" . $data_z["email"] . ")" : "") . "";
$message .= "<td colspan=6>{$odberatel}</td>";
$message .= "</tr>";
}
//var_dump($zakaznik);
foreach ($zakaznik as $keyer => $riadok) {
//var_dump($riadok);
//var_dump($sum_zakaznik);
if ($key > 0) {
$message .= "<tr>";
$product_type = sql_query("SELECT meno FROM product_type WHERE id=" . sec_sql(sec_input($riadok["id_product_type"])) . " LIMIT 1");
$product_type = $product_type[0];
$product = sql_query("SELECT id, meno FROM product WHERE id=" . sec_sql(sec_input($riadok["id_product"])) . " LIMIT 1")[0];
$options_str = array();
//var_dump($data);
if (!isset($riadok["product_atribute_options_all"]) or empty($riadok["product_atribute_options_all"])) {
$riadok["product_atribute_options_all"] = array();
}
foreach ($riadok["product_atribute_options_all"] as $option) {
//var_dump($option);
$options_str[] = sql_query("SELECT meno FROM product_atribute_option WHERE id=" . sec_sql(sec_input($option)) . " LIMIT 1")[0]["meno"];
}
$vlastne_cislo_obj = "";
if (!empty($riadok["vlastne_cislo_obj"])) {
$vlastne_cislo_obj = " (" . $riadok["vlastne_cislo_obj"] . ") ";
}
$options_str = empty($options_str) ? "" : " (" . join(", ", $options_str) . ")";
//var_dump($options_str);
$message .= "<td class=\"form_nazov_siroky\"><span class=\"bold\">" . sec_input($riadok["ks"]) . "x</span> " . $product_type["meno"] . " <span class=\"bold\">" . $product["meno"] . "</span>\r\n " . $options_str . "\r\n <span class=\"smaller\"><br>obj. č. {$riadok["c_obj"]}/" . dateYear($riadok["datum"]) . " {$vlastne_cislo_obj} z " . dateDate($riadok["datum"]) . "</span>\r\n " . (empty($riadok["atyp_text"]) ? "" : "<br>Atyp: " . sec_input($riadok["atyp_text"])) . "\r\n " . (empty($riadok["komentar"]) ? "" : "<br>- " . sec_input($riadok["komentar"])) . "\r\n " . (empty($riadok["komentar_private"]) ? "" : "<br>- " . sec_input($riadok["komentar_private"])) . "</td>";
$ks_sum = $ks_sum + $riadok["ks"];
$query = "SELECT * from cp_vyrobny_plan_row WHERE id_cp_vyrobny_plan=" . sec_input(sec_sql($_GET["cp"])) . " AND id_objednavka_row=" . $riadok[id] . "";
$cp_row = sql_query($query)[0];
//var_dump($cp_row);
$cena = $cp_row[cena];
$zlava = $cp_row[zlava];
$black = $cp_row[black];
$ppd = $cp_row[ppd];
$komis = $cp_row[komis];
$koment = $cp_row[koment];
$id_cp_product = $cp_row[id_cp_product];
if (!isset($riadok["product_atribute_options_all"]) or empty($riadok["product_atribute_options_all"])) {
$riadok["product_atribute_options_all"] = array();
}
//.........这里部分代码省略.........
示例8: display_form_data
function display_form_data($fieldsets_c, $secure_key = "")
{
$data = $_SESSION["posted_form"];
$fieldsets_c = count($data["ks_all"]);
//var_dump($data);
//var_dump($_SESSION["csrf_key"]);
if ($_SESSION["csrf_key"] != $data["secure_csrf"]) {
echo "ACCESS_dennied!!";
header("location: ?vyber={$vyber}&page=1");
die;
}
//var_dump($data);
echo "<table id=\"form_data_objednavatel\" class=\"form_data_objednavatel\">\r\n <tr>\r\n <td class=\"hlavicka\">Meno / Firma</td><td class=\"objednavatel obj_meno\">" . sec_input($data["meno"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Adresa</td><td class=\"objednavatel\">" . sec_input($data["adresa"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Mesto</td><td class=\"objednavatel\">" . sec_input($data["psc"]) . " " . sec_input($data["mesto"]) . "</td>\r\n </tr>\r\n \r\n <tr>\r\n <td class=\"hlavicka\">IČO</td><td class=\"objednavatel\">" . sec_input($data["ico"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">DIČ</td><td class=\"objednavatel\">" . sec_input($data["dic"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">telefon</td><td class=\"objednavatel\">" . sec_input($data["telefon"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">email</td><td class=\"objednavatel\">" . sec_input($data["email"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Vaše číslo obj.</td><td class=\"objednavatel\">" . sec_input($data["vlastne_cislo_obj"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Vystavil</td><td class=\"objednavatel\">" . sec_input($data["vystavil"]) . "</td>\r\n </tr>";
echo "</table>";
echo "<table id=\"form_data_doruc\" class=\"form_data_objednavatel\">\r\n <tr>\r\n <td class=\"hlavicka\"></td><td class=\"objednavatel obj_meno\">Adresa doručenia</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Meno / Firma</td><td class=\"objednavatel obj_meno\">" . sec_input($data["doruc_meno"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Adresa</td><td class=\"objednavatel\">" . sec_input($data["doruc_adresa"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Mesto</td><td class=\"objednavatel\">" . sec_input($data["doruc_psc"]) . " " . sec_input($data["doruc_mesto"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Telefón</td><td class=\"objednavatel\">" . sec_input($data["doruc_telefon"]) . "</td>\r\n </tr>\r\n \r\n ";
echo "</table>";
//dd($data);
echo "<table id=\"form_data_table\">\r\n <tr>\r\n <th></th> \r\n <th>produkt</th>\r\n <th>množstvo</th>\r\n <th>doprava</th>\r\n <th>atyp text</th> \r\n <th></th>\r\n </tr>";
for ($i = 0; $i < $fieldsets_c; $i++) {
$poradie = 0;
$poradie = $i + 1;
echo "<tr>\r\n <td class=\"form_poradie\">{$poradie}. </td>\r\n ";
$product_type = sql_query("SELECT meno FROM product_type WHERE id=" . sec_sql(sec_input($data["product_type_all"][$i])) . " LIMIT 1");
$product_type = $product_type[0];
$product = sql_query("SELECT meno FROM product WHERE id=" . sec_sql(sec_input($data["product_all"][$i])) . " LIMIT 1")[0];
$options_str = array();
//dd($data);
if (!isset($data["product_atribute_options_all"][$i]) or empty($data["product_atribute_options_all"][$i])) {
$data["product_atribute_options_all"][$i] = array();
}
foreach ($data["product_atribute_options_all"][$i] as $option) {
//var_dump($option);
$options_str[] = sql_query("SELECT meno FROM product_atribute_option WHERE id=" . sec_sql(sec_input($option)) . " LIMIT 1")[0]["meno"];
}
//var_dump($options_str);
$options_str = empty($options_str) ? "" : " (" . join(" / ", $options_str) . ")";
echo "<td class=\"form_nazov_siroky\">" . $product_type["meno"] . " " . $product["meno"] . "" . $options_str . "</td>";
$product_delivery = sql_query("SELECT meno FROM product_delivery WHERE id=" . sec_sql(sec_input($data["product_delivery_all"][$i])) . " LIMIT 1");
$product_delivery = $product_delivery[0];
echo "<td class=\"form_ks\">" . sec_input($data["ks_all"][$i]) . " ks</td>";
echo "<td class=\"form_nazov ali-center\">" . $product_delivery["meno"] . "</td>";
echo "<td class=\"form_nazov\">" . sec_input($data["atyp_text_all"][$i]) . "</td>";
echo "<td class=\"td_vypocet\">" . ($vypocet > 0 ? $vypocet_final : "") . "</td>";
echo "</tr>";
}
echo "</table>";
echo "<div id=\"form_komentar\">\r\n " . sec_input($data["komentar"]) . " \r\n </div>";
echo "<div id=\"form_komentar\">\r\n " . sec_input($data["komentar_private"]) . " \r\n </div>";
echo "<form method=\"POST\" id=\"formular\" enctype=\"multipart/form-data\">";
echo "<div class=\"formular_buttons clearfix\">";
echo submit("submit_confirm", "Odoslať objednávku");
echo submit("submit_save", "Uložiť objednávku");
echo "<div class=\"confirm_order_another\"><a href=\"?vyber=formular&page=1\">Vrátiť sa Späť k úprave</a></div>";
echo "</div>";
echo "</form>\r\n \r\n ";
echo "<div class=\"help_text clearfix\">";
echo "<ul>";
echo "<li>Po odoslaní objednávky Vám bude doručený potvrdzujúci email</li>";
echo "<li>Ak si prajete objednávku ešte opraviť použite tlačítko <strong>Vrátiť sa Späť</strong></li>";
echo "<li>Ak Vaša objednávka ešte nie je v tejto chvíli kompletná a v jej dokončení chcete pokračovať neskôr, použite tlačítko <strong>Uložiť objednávku</strong>.<br>\r\n Po uložení Vám bude na Vašu adresu doručený email s potvrdením a inštukciami, ako pokračovať vo vypĺňaní uloženej objednávky.\r\n </li>";
echo "</ul>";
echo "</div>";
}
示例9: send_email_revision_velkoobchod
function send_email_revision_velkoobchod($revision)
{
//var_dump($revision);
//die();
require_once 'include/PHPMailer/PHPMailerAutoload.php';
$email_to_kraf = def_value("default_email", "hodnota");
mysql_query("BEGIN");
$data = sql_query("SELECT id_velkoobchod, komentar, sum,\r\n DATE_FORMAT(datum_vlastny, '%d. %m. %Y') AS datum\r\n FROM revizia_velkoobchod \r\n WHERE id={$revision} \r\n LIMIT 1");
$data_narez = sql_query("SELECT id_revizia as revizia, id_material as material, id_vyrobca as vyrobca, \r\n id_dekor as dekor, id_dekor_cena as dekor_cena, m2, m3, sum\r\n FROM porez_velkoobchod \r\n WHERE id_revizia={$revision}");
$data = $data[0];
$fieldsets_c = count($data_narez);
for ($i = 0; $i < $fieldsets_c; $i++) {
$m2[$i] = $data_narez[$i][m2];
$m3[$i] = $data_narez[$i][m3];
$material[$i] = $data_narez[$i][material];
$vyrobca[$i] = $data_narez[$i][vyrobca];
$dekor[$i] = $data_narez[$i][dekor];
$dekor_cena[$i] = $data_narez[$i][dekor_cena];
$sum[$i] = $data_narez[$i][sum];
}
$data[m2_all] = $m2;
$data[m3_all] = $m3;
$data[material_all] = $material;
$data[vyrobca_all] = $vyrobca;
$data[dekor_all] = $dekor;
$data[dekor_cena_all] = $dekor_cena;
$data[sum_all] = $sum;
//var_dump($data);
$data_obj = sql_query("SELECT id, DATE_FORMAT(datum_vlastny, '%d. %m. %Y') AS datum,\r\n DATE_FORMAT(datum, '%Y') AS rok\r\n FROM velkoobchod \r\n WHERE id=" . $data["id_velkoobchod"] . " LIMIT 1");
$data_obj = $data_obj[0];
//var_dump($data_obj); die();
$message = "<html><body>";
$message .= "<img src=\"http://" . def_value("default_url", "hodnota") . "/assets/images/logo.jpg\">";
$message .= "<h1>Objednávka č. " . $data_obj["id"] . "/" . $data_obj["rok"] . "</h1>";
$message .= "zo dňa: " . $data_obj["datum"] . "<br><br>";
$message .= "<table style=\"font-size: 10pt;\">\r\n <tr style=\"border-bottom: solid 1px darkslategrey ;\">\r\n <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 20px;\"></th>\r\n <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 130px;\">materiál</th>\r\n <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 150px;\">výrobca</th>\r\n <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 200px;\">dekor</th>\r\n <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 40px;\">ks</th>\r\n <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 40px;\">m3</th>\r\n <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 60px;\">j.cena</th>\r\n <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 50px;\">spolu</th>\r\n \r\n </tr>";
for ($i = 0; $i < $fieldsets_c; $i++) {
$poradie = 0;
$poradie = $i + 1;
$message .= "<tr>\r\n <td class=\"form_poradie\">{$poradie}. </td>";
$material = sql_query("SELECT meno FROM material WHERE id=" . sec_sql(sec_input($data["material_all"][$i])) . " LIMIT 1");
$material = $material[0];
$message .= "\r\n <td class=\"form_nazov\">" . $material["meno"] . "</td>";
$vyrobca = sql_query("SELECT meno FROM vyrobca WHERE id=" . sec_sql(sec_input($data["vyrobca_all"][$i])) . " LIMIT 1");
$vyrobca = $vyrobca[0];
$message .= "\r\n <td class=\"form_nazov\">" . $vyrobca["meno"] . "</td>";
$dekor = sql_query("SELECT meno FROM dekor WHERE id=" . sec_sql(sec_input($data["dekor_all"][$i])) . " LIMIT 1");
$dekor = $dekor[0];
$message .= "<td class=\"form_nazov\">" . $dekor[meno] . "</td>";
$message .= "\r\n <td class=\"form_hrana\">" . sec_input($data["m2_all"][$i]) . "</td>\r\n <td class=\"form_hrana\">" . sec_input($data["m3_all"][$i]) . "</td>";
$dekor_cena = sql_query("SELECT cena FROM cp_dekor_ks WHERE id=" . sec_sql(sec_input($data["dekor_cena_all"][$i])) . " LIMIT 1");
$dekor_cena = $dekor_cena[0];
$message .= "<td class=\"form_hrana\">" . round($dekor_cena[cena], 2) . "</td>";
$message .= "<td class=\"form_data_material\">" . round(sec_input($data["sum_all"][$i]), 2) . "</td>";
//var_dump($vypocet_paska_sum);
//$message .= "<td class=\"td_vypocet\">".($vypocet>0 ? $vypocet_final : "" )."</td>";
$message .= "</tr>";
}
$message .= "</table><br>";
$message .= "<div class=\"form_vypocet_sum\">Spolu: " . round($data["sum"], 2) . " </div>";
$message .= "<br>" . $data["komentar"] . "<br><br>";
$message .= "email vytvorený: " . date("j. n. Y - H:i") . "<br>";
$message .= "</body></html>";
mysql_query("COMMIT");
$headers = "From: \"KRaF - Veľkoobchod\" <" . $email_to_kraf . ">\r\n";
$headers .= "Reply-To: " . $email_to_kraf . "\r\n";
//$headers .= "CC: scooti@stonline.sk\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
//print_r($message);
//exit();
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->CharSet = "UTF-8";
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
//$mail->SMTPSecure = 'ssl';
$mail->Host = def_value("default_email_host", "hodnota");
$mail->Port = def_value("default_email_port", "hodnota");
$mail->Username = def_value("default_email_username", "hodnota");
$mail->Password = def_value("default_email_password", "hodnota");
$mail->isHTML(true);
$mail->setLanguage('sk', 'language/');
$mail->SetFrom(def_value("default_email", "hodnota"), def_value("default_firma", "hodnota"));
$email_to = $email_to_kraf;
$email_subject = "Velkoobchod č. " . $data_obj["id"] . "/" . $data_obj["rok"] . " zo dňa " . $data_obj["datum"] . "";
$mail->Subject = $email_subject;
$mail->Body = $message;
$mail->AddAddress($email_to);
$mail->Send();
//mail($email_to, $email_subject, $message, $headers);
//var_dump($email_to);
//var_dump($data["email"]);
//echo "Email bol úspešne odoslaný na adresu: $email_to";
}
示例10: delete
function delete($table, $vyber, $id, $sub)
{
$id = sec_sql(sec_input($id));
$query = "Select vymaz from {$table} WHERE id={$id}";
$value = sql_query($query);
if ($value[0][vymaz] == 0) {
$vymaz = 1;
} else {
$vymaz = 0;
}
if (!is_numeric($id) or empty($id)) {
$error_msg[] = "ID ma nesprávnu hodnotu";
}
//var_dump($error_msg);
if (empty($error_msg)) {
$query = "UPDATE {$table}\r\n SET vymaz = {$vymaz}\r\n WHERE id = {$id}";
sql_update($query);
header("location: index.php?vyber={$vyber}&sub={$table}");
} else {
echo "<div id=error_message>" . implode("<br>", $error_msg) . "</div>";
}
echo "<h2>Skutočne chcete vymazať položku " . $value[0][meno] . "?</h2>";
echo "<form method=\"POST\">";
echo hidden("id", $value[id]);
echo submit("submit", "Vymazať");
echo "</form>";
}
示例11: sec_input
}
if (isset($_GET["id"])) {
$id = sec_input($_GET["id"]);
}
if (isset($_GET["rok"])) {
$rok = sec_input($_GET["rok"]);
}
if (isset($_GET["mesiac"])) {
$mesiac = sec_input($_GET["mesiac"]);
}
if (isset($_GET["message"])) {
$message = sec_input($_GET["message"]);
}
if (isset($_POST["meno"])) {
$meno = sec_input($_POST["meno"]);
}
if (isset($_POST["adresa"])) {
$adresa = sec_input($_POST["adresa"]);
}
if (isset($_POST["ico_icdph"])) {
$ico_icdph = sec_input($_POST["ico_icdph"]);
}
if (isset($_POST["telefon"])) {
$telefon = sec_input($_POST["telefon"]);
}
if (isset($_POST["email"])) {
$email = sec_input($_POST["email"]);
}
if (isset($_POST["vyrobca"])) {
$vyrobca = sec_input(sec_sql($_POST["vyrobca"]));
}
示例12: mysql_query
if (empty($error_msg)) {
//var_dump($_POST);
$_SESSION["posted_form_edit_rev"] = $form_data;
$data = $_SESSION["posted_form_edit_rev"];
//var_dump($data);
// vlozenie do revizii
mysql_query("BEGIN");
$query = "INSERT INTO revizia \n (id_obj, meno, adresa, mesto, psc, ico, dic, telefon, email, komentar, komentar_private,\n vystavil, vlastne_cislo_obj, doruc_meno, doruc_adresa, doruc_mesto, \n doruc_psc, doruc_telefon, datum, upravil)\n VALUES \n ({$order},\n \"" . sec_input(sec_sql($data["meno"])) . "\",\n \"" . sec_input(sec_sql($data["adresa"])) . "\",\n \"" . sec_input(sec_sql($data["mesto"])) . "\",\n \"" . sec_input(sec_sql($data["psc"])) . "\",\n \"" . sec_input(sec_sql($data["ico"])) . "\",\n \"" . sec_input(sec_sql($data["dic"])) . "\",\n \"" . sec_input(sec_sql($data["telefon"])) . "\",\n \"" . sec_input(sec_sql($data["email"])) . "\", \n \"" . sec_input(sec_sql($data["komentar"])) . "\",\n \"" . sec_input(sec_sql($data["komentar_private"])) . "\",\n \"" . sec_input(sec_sql($data["vystavil"])) . "\",\n \"" . sec_input(sec_sql($data["vlastne_cislo_obj"])) . "\",\n \"" . sec_input(sec_sql($data["doruc_meno"])) . "\",\n \"" . sec_input(sec_sql($data["doruc_adresa"])) . "\",\n \"" . sec_input(sec_sql($data["doruc_mesto"])) . "\",\n \"" . sec_input(sec_sql($data["doruc_psc"])) . "\",\n \"" . sec_input(sec_sql($data["doruc_telefon"])) . "\",\n now(), {$_SESSION['username']})";
$sql_revizia = sql_insert($query);
$revizia_id = $sql_revizia["inserted_id"];
$fieldsets_c = count($data["ks_all"]);
// vlozenie do porezu
$obj_delivery = 1;
for ($i = 0; $i < $fieldsets_c; $i++) {
$data_for_count = array("ks_all" => $data["ks_all"][$i], "product_type_all" => $data["product_type_all"][$i], "product_all" => $data["product_all"][$i], "product_delivery_all" => $data["product_delivery_all"][$i], "atyp_text_all" => $data["atyp_text_all"][$i], "vlastna_cena_all" => $data["vlastna_cena_all"][$i], "vyrobny_plan_all" => $data["vyrobny_plan_all"][$i]);
$query = "INSERT INTO objednavka_row \n (id_revizia, ks, id_product_type, id_product, id_product_delivery, atyp_text, vlastna_cena, vyrobny_plan)\n VALUES \n ({$revizia_id},\n " . sec_input(sec_sql($data["ks_all"][$i])) . ",\n " . sec_input(sec_sql($data["product_type_all"][$i])) . ",\n " . sec_input(sec_sql($data["product_all"][$i])) . ", \n \"" . sec_input(sec_sql($data["product_delivery_all"][$i])) . "\",\n \"" . sec_input(sec_sql($data["atyp_text_all"][$i])) . "\",\n \"" . sec_input(sec_sql($data["vlastna_cena_all"][$i])) . "\",\n \"" . sec_input(sec_sql($data["vyrobny_plan_all"][$i])) . "\"\n )";
$sql_porez = sql_insert($query);
$porez_id = $sql_porez["inserted_id"];
if ($data["product_delivery_all"][$i] == 4) {
$obj_delivery = $data["product_delivery_all"][$i];
}
if (!isset($data[product_atribute_options_all][$i]) or empty($data[product_atribute_options_all][$i])) {
$data[product_atribute_options_all][$i] = array();
}
foreach ($data[product_atribute_options_all][$i] as $key => $option) {
$query = "INSERT INTO objednavka_row_atribute \n (id_revizia, id_objednavka_row, id_product_atribute, id_product_atribute_option)\n VALUES ({$revizia_id}, {$porez_id}, {$key}, {$option})";
//var_dump($query);
$sql_porez_hrana = sql_insert($query);
}
}
sql_update("UPDATE objednavka SET delivery=\"{$obj_delivery}\"\n WHERE id=\"{$order}\"");
示例13: display_form_data
function display_form_data($fieldsets_c, $secure_key = "")
{
$data = $_SESSION["posted_form"];
$fieldsets_c = count($data["ks_all"]);
//dd($data);
//var_dump($_SESSION["csrf_key"]);
//df($data["secure_csrf"]);
//df($_SESSION["csrf_key"]);
if ($_SESSION["csrf_key"] != $data["secure_csrf"]) {
echo "ACCESS_dennied!!";
header("location: ?vyber={$vyber}&page=1");
die;
}
//var_dump($data);
echo "<table id=\"form_data_objednavatel\">\r\n <tr>\r\n <td class=\"hlavicka\">Meno / Firma</td><td class=\"objednavatel obj_meno\">" . sec_input($data["meno"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Adresa</td><td class=\"objednavatel\">" . sec_input($data["adresa"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">IČO / IČ DPH</td><td class=\"objednavatel\">" . sec_input($data["ico_icdph"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">telefon</td><td class=\"objednavatel\">" . sec_input($data["telefon"]) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">email</td><td class=\"objednavatel\">" . sec_input($data["email"]) . "</td>\r\n </tr>";
echo "</table>";
echo "<table id=\"form_data_material\">\r\n <tr>\r\n <td class=\"hlavicka\">Rozmer</td>";
echo "<td class=\"objednavatel obj_meno\">\r\n " . sec_input($data["sirka"]) . " x " . sec_input($data["vyska"]) . " mm \r\n ";
echo "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Počet dverí</td>";
echo "<td class=\"objednavatel\">\r\n " . sec_input($data["dvere_ks"]) . "";
echo "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Madlo</td>";
$madlo = sql_query("SELECT meno, dvere, orez FROM madlo WHERE id=" . sec_sql(sec_input($data["madlo"])) . " LIMIT 1")[0];
$farba = sql_query("SELECT meno FROM farba WHERE id=" . sec_sql(sec_input($data["farba"])) . " LIMIT 1")[0];
echo "<td class=\"objednavatel\">" . $madlo["meno"] . "";
echo "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Farba</td>";
echo "<td class=\"objednavatel\">" . $farba["meno"] . "";
echo "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"hlavicka\">Hrúbka</td>";
echo "<td class=\"objednavatel\">" . sec_input($data["hrubka_skrine"]) . "";
echo "</td>\r\n </tr>\r\n ";
echo "</table>";
echo "\r\n <script src=\"assets/addons/Snapsvg/dist/snap.svg-min.js\" type=\"text/javascript\"></script>\r\n <script src=\"assets/script/script_skrine.js?" . filemtime("assets/script/script_skrine.js") . "\" type=\"text/javascript\"></script>\r\n \r\n <div id=\"snap_skrine_display\">\r\n " . $data["svg"] . "\r\n </div>";
echo "<table id=\"form_data_table\">\r\n ";
for ($i = 1; $i <= $data["dvere_ks"]; $i++) {
//var_dump($data["dvere".$i]);
if (empty($data["hrana1_all"][$i])) {
$data["hrana1_all"][$i] = "0";
}
echo "<tr>\r\n <td class=\"skrine_middle\">{$i}. dvere </td> \r\n <td class=\"form_rozmer\">" . (!empty($data["dvere" . $i]["sirka"]) ? round(sec_input($data["dvere" . $i]["sirka"]), 2) . "mm" : $data["sirka"] / $data["dvere_ks"] . "") . "</td>\r\n <td class=\"form_dvere\">";
echo "<table class=\"predel\">";
echo "<tr><th></th><th></th><th></th></tr>";
foreach ($data["dvere" . $i]["predel"] as $key => $predel) {
//var_dump($predel);
echo "<tr>";
echo "<td class=\"predel_ks\">{$key}. </td>";
echo "<td class=\"predel_middle\">výška: <span class=\"bold\">" . $predel["vyska"] . "mm</span> </td>";
echo "<td class=\"\">";
if (!empty($predel["zrkadlo"])) {
echo "zrkadlo";
}
if (!empty($predel["lakobel"])) {
echo "lakobel";
}
$dekor_text = array();
if (!empty($predel["vyrobca"])) {
$vyrobca = sql_query("SELECT meno FROM vyrobca WHERE id=\"" . sec_sql(sec_input($predel["vyrobca"])) . "\" LIMIT 1")[0];
$dekor_text[] = $vyrobca["meno"];
}
if (!empty($predel["dekor"])) {
$dekor = sql_query("SELECT meno FROM dekor WHERE id=" . sec_sql(sec_input($predel["dekor"])) . " LIMIT 1")[0];
$dekor_text[] = $dekor["meno"];
}
if (!empty($predel["iny_dekor"])) {
$dekor_text[] = $predel["iny_dekor"];
}
echo implode(",", $dekor_text);
if (!empty($predel["vertikalne"])) {
echo ", vertikálne";
}
echo "</td>";
echo "</tr>";
}
echo "</table>";
echo "</td>";
echo "</tr>";
}
echo "</table>";
echo "<div class=\"form_vypocet_sum\"></div>";
echo "<div id=\"form_komentar\">\r\n " . sec_input($data["komentar"]) . " \r\n </div>";
echo "<form method=\"POST\" id=\"formular\">";
echo "<div class=\"formular_buttons clearfix\">";
echo submit("submit_confirm", "Odoslať objednávku");
echo submit("submit_save", "Uložiť objednávku");
echo "<div class=\"confirm_order_another\"><a href=\"?vyber=formular_skrine&page=1\">Vrátiť sa Späť k úprave</a></div>";
echo "</div>";
echo "</form>\r\n \r\n ";
echo "<div class=\"help_text clearfix\">";
echo "<ul>";
echo "<li>Po odoslaní objednávky Vám bude doručený potvrdzujúci email</li>";
echo "<li>Ak si prajete objednávku ešte opraviť použite tlačítko <strong>Vrátiť sa Späť</strong></li>";
echo "<li>Ak Vaša objednávka ešte nie je v tejto chvíli kompletná a v jej dokončení chcete pokračovať neskôr, použite tlačítko <strong>Uložiť objednávku</strong>.<br>\r\n Po uložení Vám bude na Vašu adresu doručený email s potvrdením a inštukciami, ako pokračovať vo vypĺňaní uloženej objednávky.\r\n </li>";
echo "</ul>";
echo "</div>";
}
示例14: session_start
session_start();
$safe = "U,,5Enc!";
$root = $_SERVER['DOCUMENT_ROOT'];
include_once "config/datab.php";
// subor s nastaveniami databaz
include_once "config/fnc.php";
// vloženie hlavičky stránky
if (isset($_GET["select_product_type"])) {
$skryt_zakaznikom = "AND skryt_zakaznikom=0";
if ($_SESSION["logged"] == 1) {
$skryt_zakaznikom = "";
}
$product_atribute = sec_sql(sec_input($_GET["select_product_type"]));
$product = sec_sql(sec_input($_GET["product"]));
$query = "SELECT pa.id, pa.meno FROM `product_atribute` pa INNER JOIN product_atribute_product_types pt ON pt.id_product_atribute = pa.id\r\n WHERE pa.vymaz=0 AND id_product_type=" . (empty($product_atribute) ? def_value("default_product_type", "hodnota") : $product_atribute) . "\r\n ORDER BY pa.def DESC, pa.meno";
$atributes = sql_query($query);
$key = sec_sql(sec_input($_GET["key"]));
$query = "SELECT id FROM product \r\n WHERE id = {$product} AND skryt_atributy = \"1\" \r\n ";
$producter = sql_query($query);
//print_r($query);
if (empty($producter)) {
foreach ($atributes as $atribute) {
echo "<div class=\"atribute-row\">";
echo hidden("product_atribute[]", $atribute[id]);
echo select("product_atribute_option[{$key}][{$atribute['id']}]", $atribute[meno], "SELECT id, meno FROM product_atribute_option WHERE id_product_atribute=" . $atribute[id] . " AND vymaz=0 ORDER BY def DESC, def DESC, meno ASC", $product_type_all[$i], "-vyberte si-", "product_atribute_option_v", "", "NO");
echo "</div>";
}
}
//var_dump($_SESSION);
}
示例15: sec_sql
<?php
$safe = "U,,5Enc!";
$root = $_SERVER['DOCUMENT_ROOT'];
include_once $root . "kraf.sk/NAREZOVKA_app/application/config/datab.php";
// subor s nastaveniami databaz
include_once $root . "kraf.sk/NAREZOVKA_app/application/config/fnc.php";
// vloženie hlavičky stránky
if (isset($_GET["select_vyrobca"])) {
$vyrobca = sec_sql($_GET["select_vyrobca"]);
echo select("dekor", "Dekor", "SELECT id, hodnota, meno FROM dekor WHERE id_vyrobca='{$vyrobca}' and vymaz=0");
}