当前位置: 首页>>代码示例>>PHP>>正文


PHP def_value函数代码示例

本文整理汇总了PHP中def_value函数的典型用法代码示例。如果您正苦于以下问题:PHP def_value函数的具体用法?PHP def_value怎么用?PHP def_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了def_value函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: print_revision_cp

function print_revision_cp($cp, $revision)
{
    $data = sql_query("SELECT id_obj, meno, adresa, mesto, psc, ico, dic, telefon, email, vystavil, vlastne_cislo_obj,\r\n                                    komentar, doruc_meno, doruc_adresa, doruc_mesto, doruc_psc,\r\n                                    DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum\r\n                                    FROM revizia \r\n                                    WHERE id={$revision} \r\n                                    LIMIT 1");
    $data_row = sql_query("SELECT * \r\n                            FROM objednavka_row\r\n                            WHERE id_revizia = " . $revision . "\r\n                            ");
    $data = $data[0];
    $fieldsets_c = count($data_row);
    for ($i = 0; $i < $fieldsets_c; $i++) {
        $ks[$i] = $data_row[$i][ks];
        $product_type[$i] = $data_row[$i][id_product_type];
        $product[$i] = $data_row[$i][id_product];
        $product_delivery[$i] = $data_row[$i][id_product_delivery];
        $atyp_text[$i] = $data_row[$i][atyp_text];
        $data_row_option = sql_query("SELECT id_product_atribute, id_product_atribute_option \r\n                                    FROM objednavka_row_atribute \r\n                                    WHERE id_revizia=\"{$revision}\" AND id_objednavka_row=\"{$data_row[$i][id]}\"");
        //dd($form_data_row_option);
        foreach ($data_row_option as $option) {
            $data_rows[$i][$option["id_product_atribute"]] = $option["id_product_atribute_option"];
        }
    }
    $data[ks_all] = $ks;
    $data[product_type_all] = $product_type;
    $data[product_all] = $product;
    $data[product_delivery_all] = $product_delivery;
    $data[atyp_text_all] = $atyp_text;
    $data[product_atribute_options_all] = $data_rows;
    $files = sql_query("SELECT meno, meno_old, pripona \r\n                                FROM subor\r\n                                WHERE id_obj=" . $data["id_obj"] . "");
    //var_dump($files);
    $data_obj = sql_query("SELECT DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum, c_obj, id_zakaznik,\r\n                                    DATE_FORMAT(datum, '%Y') AS rok\r\n                                    FROM objednavka \r\n                                    WHERE id=" . $data["id_obj"] . " LIMIT 1");
    $data_obj = $data_obj[0];
    $message = "";
    $message .= "<h1>Objednávka č. " . $data_obj["c_obj"] . "/" . $data_obj["rok"] . "</h1>";
    $message .= "<h5>zo dňa: " . $data_obj["datum"] . "</h5>";
    $message .= "<div class=\"print_hlavicka\">";
    $message .= "<table class=\"print_dodavatel\"><tr><td></td><td><strong>Dodávateľ</strong></td></tr>";
    $message .= "<tr><td></td><td>" . def_value("default_firma", "hodnota") . "</td></tr>";
    $message .= "<tr><td></td><td>" . def_value("default_adresa", "hodnota") . "</td></tr>";
    $message .= "<tr><td></td><td>" . def_value("default_mesto", "hodnota") . "</td></tr>";
    $message .= "<tr><td>IČO:</td><td>" . def_value("default_ico", "hodnota") . "</td></tr>";
    $message .= "<tr><td>DIČ:</td><td>" . def_value("default_dic", "hodnota") . "</td></tr>";
    $message .= "<tr><td>tel.:</td><td>" . def_value("default_telefon", "hodnota") . "</td></tr>";
    $message .= "<tr><td>mobil:</td><td>" . def_value("default_mobil", "hodnota") . "</td></tr>";
    $message .= "<tr><td>email:</td><td>" . def_value("default_email", "hodnota") . "<br> " . def_value("default_email_2", "hodnota") . "</td></tr>";
    $message .= "</table>";
    if ($data_obj[id_zakaznik] > 0) {
        $meno_zakaznika = sql_query("SELECT meno, adresa, ico, telefon, email FROM uzivatel WHERE id={$data_obj['id_zakaznik']} LIMIT 1");
        $meno_zakaznika = $meno_zakaznika[0];
        $data[meno] = $meno_zakaznika[meno];
        $data[adresa] = $meno_zakaznika[adresa];
        $data[ico] = $meno_zakaznika[ico];
        $data[telefon] = $meno_zakaznika[telefon];
        $data[email] = $meno_zakaznika[email];
    }
    $message .= "<div class=\"print_odberatel\"><table class=\"print_odberatel\"><tr><td></td><td>Objednávateľ:</td></tr>";
    $message .= "<tr><td></td><td class=\"print_bigger\">" . $data["meno"] . "</td></tr>";
    $message .= "<tr><td></td><td>" . $data["adresa"] . "</td></tr>";
    $message .= "<tr><td></td><td>" . $data["psc"] . " " . $data["mesto"] . "</td></tr>";
    $message .= "<tr><td>IČO:</td><td>" . $data["ico"] . "</td></tr>";
    $message .= "<tr><td>DIČ:</td><td>" . $data["dic"] . "</td></tr>";
    $message .= "<tr><td>tel.:</td><td>" . $data["telefon"] . "</td></tr>";
    $message .= "<tr><td>email:</td><td>" . $data["email"] . "</td></tr>";
    $message .= "</table>";
    $message .= "</div>\r\n                    <div style=\"clear: both\"></div>\r\n                    </div>";
    $data_row = sql_query("SELECT * \r\n                            FROM objednavka_row\r\n                            WHERE id_revizia = " . $revision . "\r\n                            ");
    //var_dump($data_row);
    $fieldsets_c = count($data_row);
    for ($i = 0; $i < $fieldsets_c; $i++) {
        $ks[$i] = $data_row[$i][ks];
        $id[$i] = $data_row[$i][id];
        $product_type[$i] = $data_row[$i][id_product_type];
        $product[$i] = $data_row[$i][id_product];
        $product_delivery[$i] = $data_row[$i][id_product_delivery];
        $atyp_text[$i] = $data_row[$i][atyp_text];
        $data_row_option = sql_query("SELECT id_product_atribute, id_product_atribute_option \r\n                                    FROM objednavka_row_atribute \r\n                                    WHERE id_revizia=\"{$revision}\" AND id_objednavka_row=\"{$data_row[$i][id]}\"");
        //dd($form_data_row_option);
        foreach ($data_row_option as $option) {
            $data_rows[$i][$option["id_product_atribute"]] = $option["id_product_atribute_option"];
        }
        $query = "SELECT * from cp_row WHERE id_cp=" . sec_input(sec_sql($_GET["cp"])) . " AND id_objednavka_row=" . $data_row[$i][id] . "";
        $cp_row = sql_query($query)[0];
        $cena[$i] = $cp_row[cena];
        $zlava[$i] = $cp_row[zlava];
        //var_dump($cp_row);
    }
    $data[id_all] = $id;
    $data[ks_all] = $ks;
    $data[product_type_all] = $product_type;
    $data[product_all] = $product;
    $data[product_delivery_all] = $product_delivery;
    $data[atyp_text_all] = $atyp_text;
    $data[product_atribute_options_all] = $data_rows;
    $data[product_price_all] = $cena;
    $data[zlava_all] = $zlava;
    /// riadky cenovej ponuky
    $message .= "<div class=\"print_hlavicka3\">\r\n            <table>\r\n               <tr>\r\n                              \r\n               <th style=\"width: 450px;\">produkt</th>               \r\n               <th style=\"width: 100px;\">doprava</th>              \r\n               <th style=\"width: 50px;\">j.cena</th>\r\n               <th style=\"width: 50px;\">Spolu</th>\r\n               <th style=\"width: 120px;\">zľava %</th>\r\n               <th style=\"width: 80px;\">po zľave</th>\r\n               </tr>";
    //echo hidden("name", "value");
    //var_dump($data);
    $fieldsets_c = count($data["ks_all"]);
    for ($i = 0; $i < $fieldsets_c; $i++) {
        $poradie = 0;
        $poradie = $i + 1;
        $message .= "<tr>\r\n                     \r\n                     ";
//.........这里部分代码省略.........
开发者ID:jozefvasko,项目名称:benap-app,代码行数:101,代码来源:fnc.php

示例2: session_start

<?php

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_material"])) {
    $material = sec_sql(sec_input($_GET["select_material"]));
    $query = "SELECT count(id) as counter from hrubka WHERE id_material={$material}";
    $has_hrubka = sql_query($query);
    $skryt_zakaznikom = "AND skryt_zakaznikom=0";
    if ($_SESSION["logged"] == 1) {
        $skryt_zakaznikom = "";
    }
    if ($has_hrubka[0]["counter"] > 0) {
        $where = "AND id_material={$material}";
    } else {
        $where = "AND id_material=0";
    }
    echo select("hrubka[]", "Hrúbka", "SELECT id, hodnota, meno FROM hrubka WHERE vymaz=0 {$where} {$skryt_zakaznikom} ORDER BY hodnota", def_value("default_hrubka", "hodnota"), "", "hrubka", "", "NO");
}
开发者ID:jozefvasko,项目名称:kraf-app,代码行数:24,代码来源:select_dropdown_hrubka.php

示例3: send_email_revision_cp

function send_email_revision_cp($revision, $cp)
{
    require_once 'include/PHPMailer/PHPMailerAutoload.php';
    $email_to_default = def_value("default_email", "hodnota");
    mysql_query("BEGIN");
    $data = sql_query("SELECT id_obj, meno, adresa, mesto, psc, ico, dic, telefon, email, komentar,\r\n                                vystavil, vlastne_cislo_obj, doruc_meno, doruc_adresa, doruc_mesto, \r\n                                doruc_psc,\r\n                                    DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum\r\n                                    FROM revizia \r\n                                    WHERE id={$revision} \r\n                                    LIMIT 1");
    $data_row = sql_query("SELECT id, ks, id_product_type, id_product, id_product_delivery, atyp_text\r\n                                    FROM objednavka_row \r\n                                    WHERE id_revizia={$revision}");
    $data = $data[0];
    $fieldsets_c = count($data_row);
    for ($i = 0; $i < $fieldsets_c; $i++) {
        $ks[$i] = $data_row[$i][ks];
        $product_type[$i] = $data_row[$i][id_product_type];
        $product[$i] = $data_row[$i][id_product];
        $product_delivery[$i] = $data_row[$i][id_product_delivery];
        $atyp_text[$i] = $data_row[$i][atyp_text];
        $data_row_option = sql_query("SELECT id_product_atribute, id_product_atribute_option \r\n                                    FROM objednavka_row_atribute \r\n                                    WHERE id_revizia=\"{$revision}\" AND id_objednavka_row=\"{$data_row[$i][id]}\"");
        //dd($form_data_row_option);
        foreach ($data_row_option as $option) {
            $data_rows[$i][$option["id_product_atribute"]] = $option["id_product_atribute_option"];
        }
    }
    $data[ks_all] = $ks;
    $data[product_type_all] = $product_type;
    $data[product_all] = $product;
    $data[product_delivery_all] = $product_delivery;
    $data[atyp_text_all] = $atyp_text;
    $data[product_atribute_options_all] = $data_rows;
    $files = sql_query("SELECT meno, meno_old, pripona \r\n                                FROM subor\r\n                                WHERE id_obj=" . $data["id_obj"] . "");
    //var_dump($data);
    $data_obj = sql_query("SELECT DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum, c_obj, status,\r\n                                    DATE_FORMAT(datum, '%Y') AS rok\r\n                                    FROM objednavka \r\n                                    WHERE id=" . $data["id_obj"] . " LIMIT 1");
    $data_obj = $data_obj[0];
    $secure_key = sql_query("SELECT secure_key\r\n                                    FROM objednavka_secure\r\n                                    WHERE id_obj=" . $data["id_obj"] . " AND \r\n                                          id_revizia={$revision} LIMIT 1");
    $secure_key = $secure_key[0][secure_key];
    $message = "<html>";
    $message .= "<head>";
    $message .= "<style>\r\n                    table.items {\r\n                        border-collapse: collapse;\r\n                        border-spacing: 0;\r\n                    }\r\n                    table.items td {\r\n                         border: 1px solid #c1c1c1;\r\n                    }\r\n                    </style>";
    $message .= "</head>";
    $message .= "<body>";
    $message .= "<img src=\"http://" . $_SERVER['HTTP_HOST'] . "/assets/images/logo.jpg\">";
    $message .= "<h1>Cenová ponuka k objednávke č. " . $data_obj["c_obj"] . "/" . $data_obj["rok"] . "</h1>";
    if (!empty($data["vlastne_cislo_obj"])) {
        $message .= "Vaše číslo objednávky: " . $data["vlastne_cislo_obj"] . "<br>";
    }
    $message .= "zo dňa: " . $data_obj["datum"] . "<br><br>";
    $message .= "<table><tr>";
    $message .= "<td style=\"width: 400px;\"><strong>Dodávateľ</strong><br>";
    $message .= "<table><tr><td>" . def_value("default_firma", "hodnota") . "</td></tr>";
    $message .= "<tr><td>" . def_value("default_adresa", "hodnota") . "<br>" . def_value("default_mesto", "hodnota") . "</td></tr>";
    $message .= "<tr><td>IČO: " . def_value("default_ico", "hodnota") . "<br> DIČ: " . def_value("default_dic", "hodnota") . "</td></tr>";
    $message .= "<tr><td>" . def_value("default_telefon", "hodnota") . "<br> " . def_value("default_mobil", "hodnota") . "</td></tr>";
    $message .= "<tr><td>" . def_value("default_email", "hodnota") . "<br> " . def_value("default_email_2", "hodnota") . "</td></tr>";
    $message .= "</table><br><br></td>";
    $message .= "<td style=\"width: 50%;\"><strong>Objednávateľ:</strong>";
    $message .= "<table><tr><td></td><td>" . $data["meno"] . "</td></tr>";
    $message .= "<tr><td></td><td>" . $data["adresa"] . "</td></tr>";
    $message .= "<tr><td></td><td>" . $data["psc"] . " " . $data["mesto"] . "</td></tr>";
    $message .= "<tr><td>IČO</td><td>" . $data["ico"] . "</td></tr>";
    $message .= "<tr><td>DIČ</td><td>" . $data["dic"] . "</td></tr>";
    $message .= "<tr><td>tel.</td><td>" . $data["telefon"] . "</td></tr>";
    $message .= "<tr><td>email:</td><td>" . $data["email"] . "</td></tr>";
    $message .= "<tr><td>vystavil:</td><td>" . $data["vystavil"] . "</td></tr>";
    $message .= "</table><br><strong>Adresa doručenia:</strong>";
    $message .= "<table><tr><td>" . $data["doruc_meno"] . "</td></tr>";
    $message .= "<tr><td>" . $data["doruc_adresa"] . "</td></tr>";
    $message .= "<tr><td>" . $data["doruc_psc"] . " " . $data["doruc_mesto"] . "</td></tr>";
    $message .= "</table><br></td>";
    $message .= "</tr></table><br><br>";
    $fieldsets_c = count($data_row);
    for ($i = 0; $i < $fieldsets_c; $i++) {
        $ks[$i] = $data_row[$i][ks];
        $id[$i] = $data_row[$i][id];
        $product_type[$i] = $data_row[$i][id_product_type];
        $product[$i] = $data_row[$i][id_product];
        $product_delivery[$i] = $data_row[$i][id_product_delivery];
        $atyp_text[$i] = $data_row[$i][atyp_text];
        $data_row_option = sql_query("SELECT id_product_atribute, id_product_atribute_option \r\n                                    FROM objednavka_row_atribute \r\n                                    WHERE id_revizia=\"{$revision}\" AND id_objednavka_row=\"{$data_row[$i][id]}\"");
        //dd($form_data_row_option);
        foreach ($data_row_option as $option) {
            $data_rows[$i][$option["id_product_atribute"]] = $option["id_product_atribute_option"];
        }
        $query = "SELECT * from cp_row WHERE id_cp=" . sec_input(sec_sql($_GET["cp"])) . " AND id_objednavka_row=" . $data_row[$i][id] . "";
        $cp_row = sql_query($query)[0];
        $cena[$i] = $cp_row[cena];
        $zlava[$i] = $cp_row[zlava];
        //var_dump($cp_row);
    }
    $data[id_all] = $id;
    $data[ks_all] = $ks;
    $data[product_type_all] = $product_type;
    $data[product_all] = $product;
    $data[product_delivery_all] = $product_delivery;
    $data[atyp_text_all] = $atyp_text;
    $data[product_atribute_options_all] = $data_rows;
    $data[product_price_all] = $cena;
    $data[zlava_all] = $zlava;
    $message .= "<div class=\"print_hlavicka3\">\r\n            <table style=\"font-size: 80%;\" class=\"items\">\r\n               <tr style=\"background-color: #efefef; font-size: 9pt;\">\r\n               <th></th>\r\n               <th style=\"width: 380px;\">produkt</th>\r\n               <th style=\"width: 40px;\">množstvo</th>\r\n               <th style=\"width: 100px;\">doprava</th>              \r\n               <th style=\"width: 50px;\">j.cena</th>\r\n               <th style=\"width: 50px;\">Spolu</th>\r\n               <th style=\"width: 100px;\">zľava %</th>\r\n               <th style=\"width: 80px;\">po zľave</th>\r\n               </tr>";
    //var_dump(sql_query("SELECT * from cp WHERE id=$cp"));
    //var_dump($data);
    $fieldsets_c = count($data["ks_all"]);
    for ($i = 0; $i < $fieldsets_c; $i++) {
//.........这里部分代码省略.........
开发者ID:jozefvasko,项目名称:benap-app,代码行数:101,代码来源:cp.php

示例4: edit


//.........这里部分代码省略.........
                    $error_msg[] = "Heslo môže mať od 5 do 30 znakov";
                }
                if ($password != $password_confirm) {
                    $error_msg[] = "Heslá nie sú identické";
                }
            }
        }
        //var_dump($error_msg);
        if (empty($error_msg)) {
            $query = "UPDATE {$table}\r\n                      SET meno = \"{$meno}\" \r\n                      WHERE id = {$id}";
            if ($table == "product_type") {
                $query = "UPDATE {$table}\r\n                      SET meno = \"{$meno}\", skryt_zakaznikom=\"{$skryt_zakaznikom}\", def=\"{$def}\"\r\n                      WHERE id = {$id}";
            }
            if ($table == "product") {
                $query = "UPDATE {$table}\r\n                      SET meno = \"{$meno}\", id_product_type=\"{$id_product_type}\", montazny_balik = \"{$montazny_balik}\",\r\n                          skryt_zakaznikom=\"{$skryt_zakaznikom}\", skryt_prihlasenym=\"{$skryt_prihlasenym}\", skryt_atributy = \"{$skryt_atributy}\", def=\"{$def}\"\r\n                      WHERE id = {$id}";
            }
            if ($table == "product_delivery") {
                $query = "UPDATE {$table}\r\n                      SET meno = \"{$meno}\", skryt_zakaznikom=\"{$skryt_zakaznikom}\", def=\"{$def}\"\r\n                      WHERE id = {$id}";
            }
            if ($table == "product_atribute") {
                $query = "UPDATE {$table}\r\n                      SET meno = \"{$meno}\", skryt_zakaznikom=\"{$skryt_zakaznikom}\", def=\"{$def}\"\r\n                      WHERE id = {$id}";
            }
            if ($table == "ean") {
                $query = "UPDATE {$table}\r\n                      SET code = \"{$code}\", ean=\"{$ean}\"\r\n                      WHERE id = {$id}";
            }
            if ($table == "product_atribute_option") {
                $query = "UPDATE {$table}\r\n                      SET meno = \"{$meno}\", id_product_atribute=\"{$id_product_atribute}\",\r\n                          id_c_hladina = \"{$c_hladina}\", skryt_zakaznikom=\"{$skryt_zakaznikom}\", def=\"{$def}\"\r\n                      WHERE id = {$id}";
            }
            if ($table == "cp_abs_vyrobca") {
                $query = "UPDATE {$table}\r\n                      SET meno = \"{$meno}\"\r\n                      WHERE id = {$id}";
            }
            if ($table == "dekor") {
                if (empty($stvorakov) or $stvorakov <= 0) {
                    $stvorakov = def_value("default_stvorak", "hodnota");
                }
                $hodnota = rep_dia($hodnota, 1);
                $query = "UPDATE {$table}\r\n                      SET meno = \"{$meno}\", hodnota = \"{$hodnota}\", id_material=\"{$id_material}\", id_vyrobca=\"{$id_vyrobca}\",\r\n                          stvorakov=\"{$stvorakov}\", kubikov=\"{$kubikov}\", skryt_zakaznikom=\"{$skryt_zakaznikom}\"\r\n                      WHERE id = {$id}";
                if ($data) {
                    $directory = "assets/images/dekor/";
                    if (!file_exists($directory)) {
                        mkdir($directory, 0777, true);
                    }
                    $filename = $data["file_tmp_name"];
                    $max_size = 250;
                    // percentage of resize
                    // Content type
                    //header('Content-type: image/jpeg');
                    // Get new dimensions
                    list($width, $height) = getimagesize($filename);
                    if ($width > $height) {
                        $percent = $max_size / $width;
                        $new_width = $max_size;
                        $new_height = $height * $percent;
                    } else {
                        $percent = $max_size / $height;
                        $new_height = $max_size;
                        $new_width = $width * $percent;
                    }
                    // Resample
                    $image_p = imagecreatetruecolor($new_width, $new_height);
                    $image = imagecreatefromjpeg($filename);
                    imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
                    // Output
                    imagejpeg($image_p, $directory . "/" . $data["file_name"] . "." . $data["file_ext"], 100);
                    move_uploaded_file($data["file_tmp_name"], $directory . "/orig_" . $data["file_name"] . "." . $data["file_ext"]);
                    //exit();
开发者ID:jozefvasko,项目名称:benap-app,代码行数:67,代码来源:nastavenia.php

示例5: display_all_revisions

function display_all_revisions($order)
{
    $objednavka = sql_query("SELECT id, DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum, c_obj, id_zakaznik, komplet, vymaz, status, komentar_private \r\n                                 FROM objednavka \r\n                                 WHERE id=\"{$order}\" LIMIT 1");
    $objednavka = $objednavka[0];
    echo "<h1>Objednávka č. {$objednavka['c_obj']} " . (def_value("default_obj_status_spracovana", "hodnota") == $objednavka["status"] ? "<span class=\"red_text paddet\">SPRACOVANÁ</span>" : "") . "</h1>";
    echo "<div class=\"main_box_33\">";
    $access = check_access_true("objednavka_edit");
    if ($access == TRUE) {
        echo "<form method=\"POST\">";
        echo select("zakaznik", "Priradená zákazníkovi", "SELECT id, meno FROM uzivatel WHERE vymaz=0 AND skupina=2 ORDER BY meno", $objednavka[id_zakaznik], "---", "", "");
        echo submit("save_zakaznik", "Priradiť");
        echo "</form>";
    }
    echo "</div>";
    echo "<table id=\"all_revisions\">";
    $revizia = sql_query("\r\n                            SELECT revizia.id, revizia.meno, revizia.adresa, material.meno AS mat_meno,\r\n                                   DATE_FORMAT(revizia.datum, '%d. %m. %Y, %H:%i') AS dat_upr,\r\n                                   vyrobca.meno as vyr_meno, dekor.meno as dek_meno, revizia.dekor_vlastny,\r\n                                   uzivatel.meno as uziv_meno\r\n                            FROM revizia\r\n                            LEFT JOIN material\r\n                            ON revizia.id_material=material.id \r\n                            LEFT JOIN vyrobca\r\n                            ON revizia.id_vyrobca=vyrobca.id\r\n                            LEFT JOIN dekor\r\n                            ON revizia.id_dekor=dekor.id\r\n                            LEFT JOIN uzivatel\r\n                            ON revizia.upravil=uzivatel.id\r\n                            WHERE revizia.id_obj = \"" . $order . "\"\r\n                            ORDER BY revizia.datum DESC\r\n                            ");
    //var_dump($revizia);
    foreach ($revizia as $rev) {
        $is_cp = sql_query("SELECT count(id) as count FROM cp \r\n                            WHERE id_revizia = \"" . $rev[id] . "\"");
        $is_cp = $is_cp[0][count];
        $email_cp = sql_query("SELECT DATE_FORMAT(datum_email, '%d. %m. %Y, %H:%i') AS datum_email_upr FROM cp \r\n                                        WHERE id_revizia = \"" . $rev[id] . "\" AND datum_email <>0 LIMIT 1");
        //$email_cp = count($email_cp);
        //var_dump($email_cp);
        $query_vyroba = "SELECT count(status) status FROM revizia_vyroba WHERE id_obj=" . $order . " AND id_revizia=\"" . $rev[id] . "\" AND status>0";
        $query_vyroba = sql_query($query_vyroba);
        $display_rev = 1;
        if ($access == TRUE) {
            $adressto = "objednavky";
        } else {
            $adressto = "vyroba";
            $filename = "files/csv_new/obj-{$order}/rev-{$rev[id]}/*.csv";
            //var_dump(glob($filename));
            if (glob($filename) != false) {
                $display_rev = 1;
            } else {
                $display_rev = 0;
            }
        }
        //echo $display_rev;
        if ($display_rev > 0) {
            echo "\r\n        <tr>\r\n            <td class=\"obj_cislo\">" . $rev[id] . "</td>\r\n            <td class=\"obj_datum\">\r\n                " . $rev["dat_upr"] . "</td>\r\n            <td class=\"obj_meno\">\r\n                <a href=\"?vyber={$adressto}&order=" . $order . "&revision=" . $rev[id] . "\">\r\n                " . $rev[meno] . "" . (!empty($rev[adresa]) ? ", " . $rev[adresa] : "") . "</a>\r\n            </td>\r\n            <td class=\"obj_material\">\r\n                " . $rev[mat_meno] . "" . (!empty($rev[vyr_meno]) ? ", " . $rev[vyr_meno] : "") . "" . (!empty($rev[dek_meno]) ? ", " . $rev[dek_meno] : "") . "" . (!empty($rev[dekor_vlastny]) ? ", " . $rev[dekor_vlastny] : "") . "</td>\r\n            <td class=\"obj_icons\">" . ($is_cp > 0 ? "<a href=\"?vyber=cp&order={$order}&revision=" . $rev[id] . "&action=display_all\"><img src=\"assets/images/euro.png\" title=\"Objednávka má vypracované Cenové Ponuky: {$is_cp}\"></a>" : "<img src=\"assets/images/euro_no.png\" title=\"Objednávka bez Cenových ponúk\">") . "\r\n             " . (count($email_cp) > 0 ? "<img src=\"assets/images/checked.png\" title=\"CP odoslaná: " . $email_cp[0]["datum_email_upr"] . "\">" : "") . "  \r\n                 <a href=\"?vyber=vyroba&order={$order}&revision=" . $rev[id] . "\">" . ($query_vyroba[0]["status"] > 0 ? "<img src=\"assets/images/vyroba.png\" title=\"Objednávka vo výrobe\">" : "<img src=\"assets/images/vyroba_no.png\" title=\"Bez výroby\">") . "</a>\r\n             " . (!empty($rev["uziv_meno"]) ? "<span class=\"upravil\">" . $rev["uziv_meno"] . "</span>" : "") . "     \r\n            </td>  \r\n                 \r\n        </tr>\r\n        ";
        }
    }
    echo "</table>";
    // zobrazenie detailov objednávky
    echo "<div class=\"new_task_form_poznamka\">";
    echo "<form method=\"POST\" id=\"do_objednavka_poznamka\" action=\"?vyber=objednavky&order={$order}&action=komentar_private\">";
    echo textarea("komentar_private", $objednavka["komentar_private"], "Súkromný komentár k objednávke (nezveréjnene zákazníkom)", 50, 3, "komentar_private");
    echo submit("submit_poznamka", "Odoslať");
    echo "</form>";
    echo "</div>";
    echo "<div class=\"order_details\">\r\n        <div>Objednávka prijatá: {$objednavka['datum']}</div>";
    if ($access == TRUE) {
        echo "<div>" . ($objednavka[komplet] == 0 ? "Objednávka neuzavretá - <a href=\"?vyber=objednavky&order={$order}&action=close\">Uzavrieť</a>" : "Objednávka je kompletná - <a href=\"?vyber=objednavky&order={$order}&action=open\">Otvoriť</a>") . " </div>";
        echo "<div class=\"main_box_33\">";
        echo "<form method=\"POST\">";
        echo select("status", "Stav objednávky:", "SELECT id, meno FROM objednavka_status ORDER BY id", $objednavka[status], "", "", "", "NO");
        echo submit("save_status", "Uložiť stav objednávky");
        echo "</form>";
        echo "</div>";
        echo "<div>" . ($objednavka[vymaz] == 0 ? "<a href=\"?vyber=objednavky&order={$order}&action=delete\">Úplne vymazať objednávku</a>" : "<a href=\"?vyber=objednavky&order={$order}&action=delete\">Zrušiť vymazanie objednávky</a>") . "</div>       \r\n";
    }
    // zobrazenie pridaných súborov
    $files = sql_query("SELECT id_revizia, meno, meno_old, pripona, DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum \r\n                                FROM subor\r\n                                WHERE id_obj=\"{$order}\"");
    echo "<div id=\"added_files\"" . (count($files) > 0 ? " class=\"attatch_exists\"" : "") . ">\r\n                <h2>Všetky nahraté súbory</h2>";
    //var_dump($files);
    for ($i = 0; $i < count($files); $i++) {
        $directory = "files/obj-{$order}/rev-{$files[$i][id_revizia]}";
        echo "revízia č. {$files[$i][id_revizia]} <a href=\"{$directory}/" . $files[$i]["meno"] . "." . $files[$i]["pripona"] . "\" target=\"_blank\">" . $files[$i]["meno_old"] . "</a><br>";
    }
    echo "</div>\r\n                \r\n            ";
    echo "</div>";
}
开发者ID:jozefvasko,项目名称:kraf-app,代码行数:73,代码来源:objednavky.php

示例6: print_revision_skrine

function print_revision_skrine($order, $revision)
{
    $data = sql_query("SELECT meno, adresa, ico_icdph, telefon, email, id_obj,\r\n                                    sirka, vyska, dvere_ks, madlo, farba, hrubka_skrine, svg, komentar\r\n                                    FROM revizia_skrine \r\n                                    WHERE id_obj=\"{$order}\" AND id=\"{$revision}\" \r\n                                    LIMIT 1")[0];
    $data_narez = sql_query("SELECT dvere, predel, sirka, vyska, zrkadlo, lakobel,\r\n                                            vyrobca, dekor, iny_dekor, vertikalne\r\n                                    FROM skrine \r\n                                    WHERE id_revizia=\"{$revision}\"");
    $data["svg"] = base64_decode($data["svg"]);
    //var_dump($data);
    $predel = 1;
    foreach ($data_narez as $row) {
        $data["dvere" . $row["dvere"]]["sirka"] = $row["sirka"];
        $data["dvere" . $row["dvere"]]["predel"][$predel] = ["predel" => $row["predel"], "sirka" => $row["sirka"], "vyska" => $row["vyska"], "zrkadlo" => $row["zrkadlo"], "lakobel" => $row["lakobel"], "vyrobca" => $row["vyrobca"], "dekor" => $row["dekor"], "iny_dekor" => $row["iny_dekor"], "vertikalne" => $row["vertikalne"]];
        $predel = $predel + 1;
    }
    //var_dump($files);
    $data_obj = sql_query("SELECT DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum, c_obj, id_zakaznik,\r\n                                    DATE_FORMAT(datum, '%Y') AS rok\r\n                                    FROM objednavka_skrine \r\n                                    WHERE id=" . $data["id_obj"] . " LIMIT 1");
    $data_obj = $data_obj[0];
    $message = "";
    $message .= "<h1>Objednávka skrine č. " . $data_obj["c_obj"] . "/" . $data_obj["rok"] . "</h1>";
    $message .= "<h5>zo dňa: " . $data_obj["datum"] . "</h5>";
    $message .= "<div class=\"print_hlavicka\">";
    $message .= "<table class=\"print_dodavatel\"><tr><td></td><td><strong>Dodávateľ</strong></td></tr>";
    $message .= "<tr><td></td><td>" . def_value("default_firma", "hodnota") . "</td></tr>";
    $message .= "<tr><td></td><td>" . def_value("default_adresa", "hodnota") . "</td></tr>";
    $message .= "<tr><td></td><td>" . def_value("default_mesto", "hodnota") . "</td></tr>";
    $message .= "<tr><td>IČO:</td><td>" . def_value("default_ico", "hodnota") . "</td></tr>";
    $message .= "<tr><td>DIČ:</td><td>" . def_value("default_dic", "hodnota") . "</td></tr>";
    $message .= "<tr><td>tel.:</td><td>" . def_value("default_telefon", "hodnota") . "</td></tr>";
    $message .= "<tr><td>mobil:</td><td>" . def_value("default_mobil", "hodnota") . "</td></tr>";
    $message .= "<tr><td>email:</td><td>" . def_value("default_email", "hodnota") . ", " . def_value("default_email_2", "hodnota") . "</td></tr>";
    $message .= "</table>";
    if ($data_obj[id_zakaznik] > 0) {
        $meno_zakaznika = sql_query("SELECT meno, adresa, ico_icdph, telefon, email FROM uzivatel WHERE id={$data_obj['id_zakaznik']} LIMIT 1");
        $meno_zakaznika = $meno_zakaznika[0];
        $data[meno] = $meno_zakaznika[meno];
        $data[adresa] = $meno_zakaznika[adresa];
        $data[ico_icdph] = $meno_zakaznika[ico_icdph];
        $data[telefon] = $meno_zakaznika[telefon];
        $data[email] = $meno_zakaznika[email];
    }
    $message .= "<div class=\"print_odberatel\"><table class=\"print_odberatel\"><tr><td></td><td>Objednávateľ:</td></tr>";
    $message .= "<tr><td></td><td class=\"print_bigger\">" . $data["meno"] . "</td></tr>";
    $message .= "<tr><td></td><td>" . $data["adresa"] . "</td></tr>";
    $message .= "<tr><td>IČO:</td><td>" . $data["ico_icdph"] . "</td></tr>";
    $message .= "<tr><td>tel.:</td><td>" . $data["telefon"] . "</td></tr>";
    $message .= "<tr><td>email:</td><td>" . $data["email"] . "</td></tr>";
    $message .= "</table>";
    $message .= "</div>\r\n                    </div>";
    $message .= "<div class=\"print_hlavicka2\">";
    $message .= "<table>\r\n                     <tr><td>rozmer:</td><td class=\"print_bigger\">" . sec_input($data["sirka"]) . " x " . sec_input($data["vyska"]) . " mm</td></tr>\r\n                     <tr><td>hrúbka:</td><td class=\"print_bigger\">" . sec_input($data["hrubka_skrine"]) . " mm</td></tr>";
    $message .= "<tr><td>počet dverí:</td><td>" . $data["dvere_ks"] . "</td></tr>";
    $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];
    $message .= "<tr><td>madlo:</td><td class=\"\">" . $madlo["meno"] . " " . $farba["meno"] . "</td></tr>";
    $message .= "</table><br></div>";
    $message .= "<div id=\"snap_skrine_display\">";
    $message .= "" . $data["svg"] . "";
    $message .= "</div>";
    $message .= "<div class=\"print_hlavicka3 print_skrine_vyroba\">";
    $message .= "<table id=\"form_data_table\">";
    $message .= "<tr>\r\n                                <td colspan=2 class=\"print_bigger\">Kusovník pre výrobu</td>                                \r\n                            </tr>";
    for ($i = 1; $i <= $data["dvere_ks"]; $i++) {
        //var_dump($data["dvere".$i]);
        //echo $dvere_rozdiel;
        if ($data["dvere_ks"] > 1) {
            $zmensenie = ($data["sirka"] + $madlo["dvere"] + ($data["dvere_ks"] - 2) * $madlo["orez"]) / $data["dvere_ks"];
            $zmensenie = round($zmensenie, 0);
            //echo "(".$data["sirka"] ." + ". $madlo["dvere"] ." + (". ($data["dvere_ks"]-2) ."*". $madlo["orez"] ."))/".$data["dvere_ks"]."<br>";
        }
        $message .= "<tr>\r\n                     <td class=\"skrine_middle\">{$i}. dvere </td>                \r\n                     <td class=\"form_dvere\">";
        $message .= "<table class=\"predel\">";
        $pr = 1;
        //echo count($data["dvere".$i]["predel"]);
        $dvere_st = round($data["sirka"] / $data["dvere_ks"], 0);
        foreach ($data["dvere" . $i]["predel"] as $key => $predel) {
            $dvere_rozdiel = $dvere_st - $predel["sirka"];
            //echo $dvere_rozdiel;
            $zmensenie = $zmensenie - $dvere_rozdiel;
            $message .= "<tr>";
            $message .= "<td class=\"predel_ks\">" . $predel["predel"] . ". </td>";
            $sirka = $zmensenie;
            if (!empty($predel["zrkadlo"])) {
                $sirka = $zmensenie + 15;
            }
            if (!empty($predel["lakobel"])) {
                $sirka = $zmensenie + 10;
            }
            $rozmer = $predel["vyska"] . " x {$sirka}";
            if ($predel["vertikalne"] > 0) {
                $rozmer = "{$sirka} x " . $predel["vyska"];
            }
            $message .= "<td class=\"predel_middle\"><span class=\"bold\">{$rozmer} mm</span> </td>";
            $message .= "<td class=\"\">";
            if (!empty($predel["zrkadlo"])) {
                $message .= "podkladový materiál / rozmer zrkadla: <span class=\"bold\">" . ($predel["vyska"] - 2) . " x " . ($sirka - 2) . " mm</span>";
            }
            if (!empty($predel["lakobel"])) {
                $message .= "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];
//.........这里部分代码省略.........
开发者ID:jozefvasko,项目名称:kraf-app,代码行数:101,代码来源:print.php

示例7: 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);
}
开发者ID:jozefvasko,项目名称:benap-app,代码行数:30,代码来源:select_product_atribute.php

示例8: max

 //var_dump($id_zakaznik_row);
 //var_dump($id_zakaznik);
 //die();
 $query = "SELECT max(c_obj) c_obj FROM objednavka";
 $c_obj = sql_query($query);
 $c_obj = $c_obj[0]["c_obj"] + 1;
 if (!empty($data["secure_key"])) {
     $obj_id = sql_query("SELECT id_obj FROM objednavka_secure where secure_key=\"" . $data["secure_key"] . "\" LIMIT 1");
     if (count($obj_id) < 1) {
         die("objednavká s týmto kľúčom neexistuje");
     }
     $obj_id = $obj_id[0][id_obj];
     $obj_st = sql_query("SELECT status, DATE_FORMAT(datum, '%Y') AS datum, komplet \r\n                                         FROM objednavka where id=\"{$obj_id}\" LIMIT 1");
     $obj_st = $obj_st[0];
     //var_dump($obj_st);
     if ($obj_st[komplet] == 0 and ($obj_st[status] == 0 or $obj_st[status] == def_value("default_obj_status_rozpracovana", "hodnota"))) {
         if ($status_cp == "") {
             $status_cp = 0;
         }
         sql_update("UPDATE objednavka SET status=\"{$status_cp}\", datum=NOW(), id_zakaznik={$zakaznik_exists['id']}\r\n                            " . ($obj_st[datum] != $rok ? ", c_obj={$c_obj}" : "") . "\r\n                                    WHERE id=\"{$obj_id}\"");
     } else {
         // ak objednávka je uzavretá
         // alebo ak status nie je 0 a rozpracovana
         echo "Vaša objednávka už bola spracovaná / uzavretá a nie je možné ju už upravovať.";
         die;
     }
 } else {
     $query = "INSERT INTO objednavka (datum, c_obj, status {$id_zakaznik_row})\r\n                            VALUES (now(), {$c_obj}, \"{$status_cp}\" {$id_zakaznik})";
     //var_dump($query);
     $sql_objednavka = sql_insert($query);
     $obj_id = $sql_objednavka["inserted_id"];
开发者ID:jozefvasko,项目名称:benap-app,代码行数:31,代码来源:formular.php

示例9: PHPMailer

 require_once 'include/PHPMailer/PHPMailerAutoload.php';
 $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(empty($odosielatel) ? def_value("default_email", "hodnota") : $odosielatel["email"], def_value("default_firma", "hodnota"));
 $email_to = $dodavatel["email"];
 $email_subject = "Objednávka od " . def_value("default_firma", "hodnota") . "";
 //$headers = "From: \"".def_value("default_firma", "hodnota")."\" <".def_value("default_email", "hodnota").">\r\n";
 //$headers .= "Reply-To: ".def_value("default_email", "hodnota")."\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";
 $mail->Subject = $email_subject;
 $mail->Body = $message;
 $mail->AddAddress($email_to);
 $mail->AddCC($odosielatel["email"]);
 $error = 0;
 if (!$mail->Send()) {
     $error = 1;
     log_email($email_subject, $email_to, "error", $message . "\n" . $mail->ErrorInfo);
 } else {
     log_email($email_subject, $email_to);
开发者ID:jozefvasko,项目名称:kraf-app,代码行数:31,代码来源:do_objednavka.php

示例10: send_email_revision_

function send_email_revision_($revision, $only_kraf = "", $status = "")
{
    //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_obj, meno, adresa, ico_icdph, telefon, email, id_material as material,\r\n                                    id_vyrobca as vyrobca, id_dekor as dekor, dekor_vlastny, komentar,\r\n                                    DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum\r\n                                    FROM revizia \r\n                                    WHERE id={$revision} \r\n                                    LIMIT 1");
    $data_narez = sql_query("SELECT ks, dlzka, sirka, nazov, poznamka, hrubka, orientacia,\r\n                                    hrana1, hrana2, hrana3, hrana4\r\n                                    FROM porez \r\n                                    WHERE id_revizia={$revision}");
    $data = $data[0];
    $fieldsets_c = count($data_narez);
    for ($i = 0; $i < $fieldsets_c; $i++) {
        $ks[$i] = $data_narez[$i][ks];
        $dlzka[$i] = $data_narez[$i][dlzka];
        $sirka[$i] = $data_narez[$i][sirka];
        $nazov[$i] = $data_narez[$i][nazov];
        $poznamka[$i] = $data_narez[$i][poznamka];
        $hrubka[$i] = $data_narez[$i][hrubka];
        $orientacia[$i] = $data_narez[$i][orientacia];
        $hrana1[$i] = $data_narez[$i][hrana1];
        $hrana2[$i] = $data_narez[$i][hrana2];
        $hrana3[$i] = $data_narez[$i][hrana3];
        $hrana4[$i] = $data_narez[$i][hrana4];
    }
    $data[ks_all] = $ks;
    $data[dlzka_all] = $dlzka;
    $data[sirka_all] = $sirka;
    $data[nazov_all] = $nazov;
    $data[poznamka_all] = $poznamka;
    $data[hrubka_all] = $hrubka;
    $data[orientacia_all] = $orientacia;
    $data[hrana1_all] = $hrana1;
    $data[hrana2_all] = $hrana2;
    $data[hrana3_all] = $hrana3;
    $data[hrana4_all] = $hrana4;
    //var_dump($data);
    $files = sql_query("SELECT meno, meno_old, pripona \r\n                                FROM subor\r\n                                WHERE id_obj=" . $data["id_obj"] . "");
    //var_dump($data);
    $data_obj = sql_query("SELECT DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum, c_obj, status,\r\n                                    DATE_FORMAT(datum, '%Y') AS rok\r\n                                    FROM objednavka \r\n                                    WHERE id=" . $data["id_obj"] . " LIMIT 1");
    $data_obj = $data_obj[0];
    $secure_key = sql_query("SELECT secure_key\r\n                                    FROM objednavka_secure\r\n                                    WHERE id_obj=" . $data["id_obj"] . " AND \r\n                                          id_revizia={$revision} LIMIT 1");
    $secure_key = $secure_key[0][secure_key];
    $message = "<html><body>";
    $message .= "<img src=\"http://" . def_value("default_url", "hodnota") . "/assets/images/logo.jpg\">";
    $message .= "<h1>Objednávka č. " . $data_obj["c_obj"] . "/" . $data_obj["rok"] . "</h1>";
    $message .= "zo dňa: " . $data_obj["datum"] . "<br><br>";
    $message .= "<table><tr>";
    $message .= "<td style=\"width: 400px;\"><strong>Dodávateľ</strong><br>";
    $message .= "<table><tr><td>" . def_value("default_firma", "hodnota") . "</td></tr>";
    $message .= "<tr><td>" . def_value("default_adresa", "hodnota") . "<br>" . def_value("default_mesto", "hodnota") . "</td></tr>";
    $message .= "<tr><td>IČO: " . def_value("default_ico", "hodnota") . "<br> DIČ: " . def_value("default_dic", "hodnota") . "</td></tr>";
    $message .= "<tr><td>" . def_value("default_telefon", "hodnota") . "<br> " . def_value("default_mobil", "hodnota") . "</td></tr>";
    $message .= "<tr><td>" . def_value("default_email", "hodnota") . "<br> " . def_value("default_email_2", "hodnota") . "</td></tr>";
    $message .= "</table><br><br></td>";
    $message .= "<td style=\"width: 50%;\"><strong>Objednávateľ:</strong>";
    $message .= "<table><tr><td>" . $data["meno"] . "</td></tr>";
    $message .= "<tr><td>" . $data["adresa"] . "</td></tr>";
    $message .= "<tr><td>" . $data["ico_icdph"] . "</td></tr>";
    $message .= "<tr><td>" . $data["telefon"] . "</td></tr>";
    $message .= "<tr><td>" . $data["email"] . "</td></tr>";
    $message .= "</table><br><br></td>";
    $message .= "</tr></table>";
    $message .= "<strong>Materiál:</strong>";
    $material = sql_query("SELECT meno FROM material WHERE id=" . sec_sql(sec_input($data["material"])) . " LIMIT 1");
    $material = $material[0];
    $message .= "<table><tr><td>" . $material["meno"] . "</td></tr>";
    $vyrobca = sql_query("SELECT meno FROM vyrobca WHERE id=\"" . sec_sql(sec_input($data["vyrobca"])) . "\" LIMIT 1");
    $vyrobca = $vyrobca[0];
    $dekor = sql_query("SELECT meno FROM dekor WHERE id=" . sec_sql(sec_input($data["dekor"])) . " LIMIT 1");
    $dekor = $dekor[0];
    $message .= "<tr><td>" . $vyrobca["meno"] . " " . $dekor["meno"] . "</td></tr>";
    $message .= "<tr><td>" . $data["dekor_vlastny"] . "</td></tr>";
    $message .= "</table><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: 40px;\">ks</th>\r\n               <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 180px;\">rozmer</th>\r\n               <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 150px;\">Názov</th>\r\n               <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 150px;\">Poznámka</th>\r\n               <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 50px;\">hrúbka</th>\r\n               <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 50px;\">orient.</th>\r\n               <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 20px;\">dolná</th>\r\n               <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 20px;\">pravá</th>\r\n               <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 20px;\">horná</th>\r\n               <th style=\"background-color: lightsteelblue; color: white; padding:5px; font-size: 90%; width: 20px;\">ľava</th>\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>\r\n                    <td class=\"form_ks\">" . sec_input($data["ks_all"][$i]) . "</td>\r\n                    <td class=\"form_rozmer\">" . sec_input($data["dlzka_all"][$i]) . " x " . $data["sirka_all"][$i] . " mm</td>\r\n                    <td class=\"form_nazov\">" . sec_input($data["nazov_all"][$i]) . "</td>\r\n                    <td class=\"form_nazov\">" . sec_input($data["poznamka_all"][$i]) . "</td>";
        $hrubka = sql_query("SELECT meno FROM hrubka WHERE id=" . sec_sql(sec_input($data["hrubka_all"][$i])) . " LIMIT 1");
        $hrubka = $hrubka[0];
        $message .= "\r\n                    <td class=\"form_hrana\">" . $hrubka["meno"] . "</td>";
        $orientacia = sql_query("SELECT meno FROM orientacia WHERE id=" . sec_sql(sec_input($data["orientacia_all"][$i])) . " LIMIT 1");
        $orientacia = $orientacia[0];
        $message .= "\r\n                    <td class=\"form_hrana\">" . $orientacia["meno"] . "</td>";
        $hrana = sql_query("SELECT meno FROM hrana WHERE id=" . sec_sql(sec_input($data["hrana1_all"][$i])) . " LIMIT 1");
        $hrana = $hrana[0];
        $message .= "<td class=\"form_hrana\">" . $hrana[meno] . "</td>";
        $hrana = sql_query("SELECT meno FROM hrana WHERE id=" . sec_sql(sec_input($data["hrana2_all"][$i])) . " LIMIT 1");
        $hrana = $hrana[0];
        $message .= "<td class=\"form_hrana\">" . $hrana[meno] . "</td>";
        $hrana = sql_query("SELECT meno FROM hrana WHERE id=" . sec_sql(sec_input($data["hrana3_all"][$i])) . " LIMIT 1");
        $hrana = $hrana[0];
        $message .= "\r\n                    <td class=\"form_hrana\">" . $hrana[meno] . "</td>";
        $hrana = sql_query("SELECT meno FROM hrana WHERE id=" . sec_sql(sec_input($data["hrana4_all"][$i])) . " LIMIT 1");
        $hrana = $hrana[0];
        $message .= "<td class=\"form_hrana\">" . $hrana[meno] . "</td>";
        $vypocet = $data["dlzka_all"][$i] * $data["sirka_all"][$i] / 1000000;
        $vypocet = $vypocet * $data["ks_all"][$i];
        if (is_duplak($data["hrubka_all"][$i])) {
            $paska = 0;
//.........这里部分代码省略.........
开发者ID:jozefvasko,项目名称:kraf-app,代码行数:101,代码来源:skrine.php

示例11: sql_query

$vyrobca = sql_query("SELECT meno FROM vyrobca WHERE id=\"" . sec_sql(sec_input($data["vyrobca"])) . "\" LIMIT 1");
$vyrobca = $vyrobca[0];
$dekor = sql_query("SELECT meno FROM dekor WHERE id=" . sec_sql(sec_input($data["dekor"])) . " LIMIT 1");
$dekor = $dekor[0];
$message .= "<tr><td>dekor:</td><td class=\"print_bigger\">" . $vyrobca["meno"] . " " . $dekor["meno"] . "</td></tr>";
$message .= "<tr><td>vlastný dekor:</td><td>" . $data["dekor_vlastny"] . "</td></tr>";
$message .= "</table><br></div>";
$message .= "<div class=\"print_hlavicka3\">\r\n            <table>\r\n               <tr>\r\n               <th></th>\r\n               <th style=\"width: 40px;\">ks</th>\r\n               <th style=\"width: 180px;\">rozmer</th>\r\n               <th style=\"width: 270px;\">Názov</th>\r\n               <th style=\"width: 270px;\">Poznámka</th>\r\n               <th style=\"width: 50px;\">hrúbka</th>\r\n               <th style=\"width: 50px;\">orient.</th>\r\n               <th style=\"width: 20px;\">dolná</th>\r\n               <th style=\"width: 20px;\">pravá</th>\r\n               <th style=\"width: 20px;\">horná</th>\r\n               <th style=\"width: 20px;\">ľavá</th>\r\n               <th></th>\r\n               </tr>";
if ($data["dlzka_all"][$i] > def_value("max_dlzka", "hodnota") - 20 or $data["sirka_all"][$i] > def_value("max_sirka", "hodnota") - 20) {
    $poznamka[$i] = "<strong>POZOR!!</strong> " . $poznamka[$i];
}
//var_dump($data);
for ($i = 0; $i < $fieldsets_c; $i++) {
    $poradie = 0;
    $poradie = $i + 1;
    $message .= "<tr>\r\n                    <td class=\"form_poradie\">{$poradie}. </td>\r\n                    <td class=\"form_ks\">" . sec_input($data["ks_all"][$i]) . "</td>\r\n                    <td class=\"form_rozmer\">" . sec_input($data["dlzka_all"][$i]) . " x " . $data["sirka_all"][$i] . " mm</td>\r\n                    <td class=\"form_nazov\">" . sec_input($data["nazov_all"][$i]) . "</td>\r\n                    <td class=\"form_nazov\">\r\n                    " . (($data["dlzka_all"][$i] > def_value("max_dlzka", "hodnota") - 20 or $data["sirka_all"][$i] > def_value("max_sirka", "hodnota") - 20) ? "" . sec_input($data["poznamka_all"][$i]) . " <strong>POZOR ROZMER!!</strong>" : "" . sec_input($data["poznamka_all"][$i]) . "") . "\r\n                        </td>";
    $hrubka = sql_query("SELECT meno FROM hrubka WHERE id=" . sec_sql(sec_input($data["hrubka_all"][$i])) . " LIMIT 1");
    $hrubka = $hrubka[0];
    $message .= "\r\n                    <td class=\"form_hrana\">" . $hrubka["meno"] . "</td>";
    $orientacia = sql_query("SELECT meno, hodnota FROM orientacia WHERE id=" . sec_sql(sec_input($data["orientacia_all"][$i])) . " LIMIT 1");
    $orientacia = $orientacia[0];
    $message .= "\r\n                    <td class=\"form_hrana\">" . $orientacia["meno"] . "</td>";
    $hrana = sql_query("SELECT meno FROM hrana WHERE id=" . sec_sql(sec_input($data["hrana1_all"][$i])) . " LIMIT 1");
    $hrana = $hrana[0];
    $message .= "<td class=\"form_hrana\">" . $hrana[meno] . "</td>";
    $hrana = sql_query("SELECT meno FROM hrana WHERE id=" . sec_sql(sec_input($data["hrana2_all"][$i])) . " LIMIT 1");
    $hrana = $hrana[0];
    $message .= "<td class=\"form_hrana\">" . $hrana[meno] . "</td>";
    $hrana = sql_query("SELECT meno FROM hrana WHERE id=" . sec_sql(sec_input($data["hrana3_all"][$i])) . " LIMIT 1");
    $hrana = $hrana[0];
    $message .= "\r\n                    <td class=\"form_hrana\">" . $hrana[meno] . "</td>";
开发者ID:jozefvasko,项目名称:kraf-app,代码行数:31,代码来源:vyroba.php

示例12: die

// prvá stránka formulára - koniec
if ($page == 2) {
    //var_dump($_SESSION["posted_form"]);
    if ($_POST[submit_confirm] or $_POST[submit_save]) {
        $data = $_SESSION["posted_form"];
        if (empty($error_msg)) {
            if (empty($_SESSION["posted_form"]) || !isset($_SESSION["posted_form"])) {
                die("nie su žiadne údaje na nahrávanie");
            }
            // vlozenie do objednávaok
            mysql_query("BEGIN");
            if ($_POST[submit_save]) {
                $status_cp = def_value("default_obj_status_rozpracovana", "hodnota");
            }
            if ($sub == "cp") {
                $status_cp = def_value("default_obj_status_cp", "hodnota");
            }
            if (!empty($data["secure_key"])) {
            } else {
                $query = "INSERT INTO velkoobchod (datum, datum_vlastny, status)\n                            VALUES (now(), \"" . sec_input(sec_sql($data["datum"])) . "\", \"{$status_cp}\")";
                //var_dump($query);
                //die();
                $sql_objednavka = sql_insert($query);
                $obj_id = $sql_objednavka["inserted_id"];
            }
            $upravil = $_SESSION[username];
            if (empty($upravil)) {
                $upravil = 0;
            }
            // vlozenie do revizii
            $query = "INSERT INTO revizia_velkoobchod \n                          (id_velkoobchod, datum_vlastny, komentar, datum, upravil)\n                          VALUES \n                          ({$obj_id},\n                              \"" . sec_input(sec_sql($data["datum"])) . "\",\n                              \"" . sec_input(sec_sql($data["komentar"])) . "\",\n                              now(), {$upravil}) ";
开发者ID:jozefvasko,项目名称:kraf-app,代码行数:31,代码来源:formular_velkoobchod.php

示例13: edit


//.........这里部分代码省略.........
                    $error_msg[] = "telefon je povinný údaj a môže mať od 8 do 50 znakov";
                }
                if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
                    $error_msg[] = "email je v nesprávnom tvare";
                }
            }
            if (!is_numeric($id) or empty($id)) {
                $error_msg[] = "ID ma nesprávnu hodnotu";
            }
            if (!empty($password) and !empty($old_password) and !empty($password_confirm)) {
                $old_password_original = sql_query("SELECT heslo FROM {$table} WHERE id={$id} AND heslo=\"" . md5($old_password) . "\" LIMIT 1");
                if (count($old_password_original) < 1) {
                    $error_msg[] = "Staré heslo nie je správne";
                }
                if (strlen($password) < 4 or strlen($password) > 30) {
                    $error_msg[] = "Heslo môže mať od 5 do 30 znakov";
                }
                if ($password != $password_confirm) {
                    $error_msg[] = "Heslá nie sú identické";
                }
            }
        }
        //var_dump($error_msg);
        if (empty($error_msg)) {
            $query = "UPDATE {$table}\n                      SET meno = \"{$meno}\", hodnota = \"{$hodnota}\"\n                      WHERE id = {$id}";
            if ($table == "vyrobca") {
                $query = "UPDATE {$table}\n                      SET meno = \"{$meno}\", hodnota = \"{$hodnota}\", id_material=\"{$id_material}\",\n                          skryt_zakaznikom=\"{$skryt_zakaznikom}\"\n                      WHERE id = {$id}";
            }
            if ($table == "cp_abs_vyrobca") {
                $query = "UPDATE {$table}\n                      SET meno = \"{$meno}\"\n                      WHERE id = {$id}";
            }
            if ($table == "dekor") {
                if (empty($stvorakov) or $stvorakov <= 0) {
                    $stvorakov = def_value("default_stvorak", "hodnota");
                }
                $hodnota = rep_dia($hodnota, 1);
                $query = "UPDATE {$table}\n                      SET meno = \"{$meno}\", hodnota = \"{$hodnota}\", id_material=\"{$id_material}\", id_vyrobca=\"{$id_vyrobca}\",\n                          stvorakov=\"{$stvorakov}\", skryt_zakaznikom=\"{$skryt_zakaznikom}\"\n                      WHERE id = {$id}";
                if ($data) {
                    $directory = "assets/images/dekor/";
                    if (!file_exists($directory)) {
                        mkdir($directory, 0777, true);
                    }
                    $filename = $data["file_tmp_name"];
                    $max_size = 250;
                    // percentage of resize
                    // Content type
                    //header('Content-type: image/jpeg');
                    // Get new dimensions
                    list($width, $height) = getimagesize($filename);
                    if ($width > $height) {
                        $percent = $max_size / $width;
                        $new_width = $max_size;
                        $new_height = $height * $percent;
                    } else {
                        $percent = $max_size / $height;
                        $new_height = $max_size;
                        $new_width = $width * $percent;
                    }
                    // Resample
                    $image_p = imagecreatetruecolor($new_width, $new_height);
                    $image = imagecreatefromjpeg($filename);
                    imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
                    // Output
                    imagejpeg($image_p, $directory . "/" . $data["file_name"] . "." . $data["file_ext"], 100);
                    move_uploaded_file($data["file_tmp_name"], $directory . "/orig_" . $data["file_name"] . "." . $data["file_ext"]);
                    //exit();
开发者ID:jozefvasko,项目名称:kraf-app,代码行数:67,代码来源:nastavenia.php

示例14: send_email_revision_cp

function send_email_revision_cp($revision, $cp)
{
    require_once 'include/PHPMailer/PHPMailerAutoload.php';
    $email_to_kraf = def_value("default_email", "hodnota");
    mysql_query("BEGIN");
    $data = sql_query("SELECT id_obj, meno, adresa, ico_icdph, telefon, email, id_material as material,\r\n                                    id_vyrobca as vyrobca, id_dekor as dekor, dekor_vlastny, komentar,\r\n                                    DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum\r\n                                    FROM revizia \r\n                                    WHERE id={$revision} \r\n                                    LIMIT 1");
    $data_narez = sql_query("SELECT ks, dlzka, sirka, nazov, poznamka, hrubka, orientacia,\r\n                                    hrana1, hrana2, hrana3, hrana4\r\n                                    FROM porez \r\n                                    WHERE id_revizia={$revision}");
    $data = $data[0];
    $fieldsets_c = count($data_narez);
    for ($i = 0; $i < $fieldsets_c; $i++) {
        $ks[$i] = $data_narez[$i][ks];
        $dlzka[$i] = $data_narez[$i][dlzka];
        $sirka[$i] = $data_narez[$i][sirka];
        $nazov[$i] = $data_narez[$i][nazov];
        $poznamka[$i] = $data_narez[$i][poznamka];
        $hrubka[$i] = $data_narez[$i][hrubka];
        $orientacia[$i] = $data_narez[$i][orientacia];
        $hrana1[$i] = $data_narez[$i][hrana1];
        $hrana2[$i] = $data_narez[$i][hrana2];
        $hrana3[$i] = $data_narez[$i][hrana3];
        $hrana4[$i] = $data_narez[$i][hrana4];
    }
    $data[ks_all] = $ks;
    $data[dlzka_all] = $dlzka;
    $data[sirka_all] = $sirka;
    $data[nazov_all] = $nazov;
    $data[poznamka_all] = $poznamka;
    $data[hrubka_all] = $hrubka;
    $data[orientacia_all] = $orientacia;
    $data[hrana1_all] = $hrana1;
    $data[hrana2_all] = $hrana2;
    $data[hrana3_all] = $hrana3;
    $data[hrana4_all] = $hrana4;
    $files = sql_query("SELECT meno, meno_old, pripona \r\n                                FROM subor\r\n                                WHERE id_obj=" . $data["id_obj"] . "");
    //var_dump($data);
    $data_obj = sql_query("SELECT DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum, c_obj,\r\n                                    DATE_FORMAT(datum, '%Y') AS rok\r\n                                    FROM objednavka \r\n                                    WHERE id=" . $data["id_obj"] . " LIMIT 1");
    $data_obj = $data_obj[0];
    $message = "<html><body>";
    $message .= "<img src=\"http://" . def_value("default_url", "hodnota") . "/assets/images/logo.jpg\">";
    $message .= "<h1>Cenová ponuka k objednávke č. " . $data_obj["c_obj"] . " / " . $data_obj["rok"] . "</h1>";
    $message .= "zo dňa: " . $data_obj["datum"] . "<br><br>";
    $message .= "<table><tr>";
    $message .= "<td style=\"width: 400px;\"><strong>Dodávateľ</strong><br>";
    $message .= "<table><tr><td>" . def_value("default_firma", "hodnota") . "</td></tr>";
    $message .= "<tr><td>" . def_value("default_adresa", "hodnota") . "<br>" . def_value("default_mesto", "hodnota") . "</td></tr>";
    $message .= "<tr><td>IČO: " . def_value("default_ico", "hodnota") . "<br> DIČ: " . def_value("default_dic", "hodnota") . "</td></tr>";
    $message .= "<tr><td>" . def_value("default_telefon", "hodnota") . "<br> " . def_value("default_mobil", "hodnota") . "</td></tr>";
    $message .= "<tr><td>" . def_value("default_email", "hodnota") . "<br> " . def_value("default_email_2", "hodnota") . "</td></tr>";
    $message .= "</table><br><br></td>";
    $message .= "<td style=\"width: 50%;\"><strong>Objednávateľ:</strong>";
    $message .= "<table><tr><td>" . $data["meno"] . "</td></tr>";
    $message .= "<tr><td>" . $data["adresa"] . "</td></tr>";
    $message .= "<tr><td>" . $data["ico_icdph"] . "</td></tr>";
    $message .= "<tr><td>" . $data["telefon"] . "</td></tr>";
    $message .= "<tr><td>" . $data["email"] . "</td></tr>";
    $message .= "</table><br><br></td>";
    $message .= "</tr></table>";
    $message .= "<strong>Materiál:</strong>";
    $material = sql_query("SELECT meno FROM material WHERE id=" . sec_sql(sec_input($data["material"])) . " LIMIT 1");
    $material = $material[0];
    $message .= "<table><tr><td>" . $material["meno"] . "</td></tr>";
    $vyrobca = sql_query("SELECT meno FROM vyrobca WHERE id=" . sec_sql(sec_input($data["vyrobca"])) . " LIMIT 1");
    $vyrobca = $vyrobca[0];
    $dekor = sql_query("SELECT meno FROM dekor WHERE id=" . sec_sql(sec_input($data["dekor"])) . " LIMIT 1");
    $dekor = $dekor[0];
    $message .= "<tr><td>" . $vyrobca["meno"] . " " . $dekor["meno"] . "</td></tr>";
    $message .= "<tr><td>" . $data["dekor_vlastny"] . "</td></tr>";
    $message .= "</table><br><br>";
    $message .= "<div class=\"print_hlavicka3\">\r\n            <table style=\"font-size: 100%;\">\r\n               <tr style=\"background-color: #efefef; font-size: 9pt;\">\r\n               \r\n               <th style=\"width: 350px;\">položka</th>\r\n               <th style=\"width: 80px;\">množstvo</th>\r\n               <th style=\"width: 80px;\">jedn. cena</th>\r\n               <th style=\"width: 80px;\">Celkom</th>\r\n               </tr>";
    //var_dump(sql_query("SELECT * from cp WHERE id=$cp"));
    $data_narez = sql_query("SELECT c.vlastna_cena, c.dekor_ks, d.cena dekor_ks_cena, c.dekor_ks_sum,\r\n                                        c.dekor_m2, c.dekor_m2_jedn dekor_m2_cena, c.dekor_m2_sum,\r\n                                        c.porez, p.cena porez_cena, c.porez_sum,\r\n                                        c.lepenie, l.cena lepenie_cena, round(lepenie_sum, 2) lepenie_sum,\r\n                                        c.cnc_priprava, c1.cena cnc_priprava_cena, c.cnc_priprava_sum,\r\n                                        c.cnc_praca, c2.cena cnc_praca_cena, c.cnc_praca_sum,\r\n                                        c.olep_obluk, o.cena olep_obluk_cena, c.olep_obluk_sum\r\n                                    FROM cp c\r\n                                    LEFT JOIN cp_dekor_ks d ON c.id_dekor_ks = d.id \r\n                                    LEFT JOIN cp_porez p ON c.id_porez = p.id\r\n                                    LEFT JOIN cp_lepenie l ON c.id_lepenie = l.id\r\n                                    LEFT JOIN cp_cnc_opracovanie c1 ON c.id_cnc_priprava = c1.id\r\n                                    LEFT JOIN cp_cnc_praca c2 ON c.id_cnc_praca = c2.id\r\n                                    LEFT JOIN cp_olep_obluk o ON c.id_olep_obluk = o.id\r\n                                    \r\n                                    WHERE c.id={$cp} LIMIT 1");
    $data_narez = $data_narez[0];
    $fieldsets_c = count($data_narez);
    for ($i = 0; $i < $fieldsets_c; $i++) {
        $ks[$i] = $data_narez[$i][ks];
        $dlzka[$i] = $data_narez[$i][dlzka];
        $sirka[$i] = $data_narez[$i][sirka];
    }
    $data[ks_all] = $ks;
    $data[dlzka_all] = $dlzka;
    //var_dump($data_narez);
    if ($data_narez[dekor_ks_cena] <= 0) {
        $data_narez[dekor_ks_cena] = $data_narez[vlastna_cena];
    }
    $full_sum = 0;
    $message .= riadok_print_cp($data_narez[dekor_ks], $data_narez[dekor_ks_cena], $data_narez[dekor_ks_sum], "Material ks");
    $full_sum += $data_narez[dekor_ks_sum];
    $message .= riadok_print_cp($data_narez[dekor_m2], $data_narez[dekor_m2_cena], $data_narez[dekor_m2_sum], "Material m2");
    $full_sum += $data_narez[dekor_m2_sum];
    $message .= riadok_print_cp($data_narez[porez], $data_narez[porez_cena], $data_narez[porez_sum], "Porez");
    $full_sum += $data_narez[porez_sum];
    $num_hrana = sql_query("SELECT id, hodnota FROM hrana WHERE vymaz=0 ORDER BY id");
    foreach ($num_hrana as $hrana) {
        $hrana_abs = sql_query("SELECT a.cena abs, b.cena, a.sum, c.hodnota from cp_hrana a \r\n                                LEFT JOIN cp_abs b\r\n                                ON a.id_abs = b.id\r\n                                LEFT JOIN hrana c\r\n                                ON b.id_hrana = c.id\r\n                                WHERE a.id_cp={$cp} AND c.id={$hrana['id']}");
        $hrana_abs = $hrana_abs[0];
        //var_dump($hrana);
        if (!empty($hrana_abs[hodnota])) {
            $message .= riadok_print_cp($hrana_abs[abs], $hrana_abs[cena], $hrana_abs[sum], $hrana_abs[hodnota]);
            $full_sum += $hrana_abs[sum];
        }
//.........这里部分代码省略.........
开发者ID:jozefvasko,项目名称:kraf-app,代码行数:101,代码来源:cp.php

示例15: generate_csv_new

function generate_csv_new($order, $revision, $sub = "")
{
    mysql_query("BEGIN");
    $rev = empty($revision) ? 0 : $revision;
    sql_insert("INSERT INTO revizia_aktivita (uzivatel_id, revizia, status) \r\n                    VALUES ({$_SESSION[username]}, {$rev}, \"vytvorenie CSV\")");
    $obj = sql_query("SELECT id, DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum, status, c_obj\r\n                      FROM objednavka \r\n                      WHERE id=\"{$order}\"\r\n                      LIMIT 1");
    $obj = $obj[0];
    $rev = sql_query("SELECT DATE_FORMAT(datum, '%d. %m. %Y, %H:%i') AS datum,\r\n                        meno, adresa, ico_icdph, telefon, email, id_material, id_vyrobca, id_hrubka, id_dekor,\r\n                        dekor_vlastny, komentar\r\n                      FROM revizia \r\n                      WHERE id_obj=\"{$order}\" AND id=\"{$revision}\"\r\n                      LIMIT 1");
    $rev = $rev[0];
    $c_obj = $obj["c_obj"];
    $material = sql_query("SELECT meno, max_dlzka, max_sirka\r\n                            FROM material \r\n                            WHERE id=\"" . $rev["id_material"] . "\" \r\n                            LIMIT 1")[0];
    $hrubka = sql_query("SELECT id, hodnota\r\n                            FROM hrubka \r\n                            WHERE id=\"" . $rev["id_hrubka"] . "\" \r\n                            LIMIT 1")[0];
    if (is_duplak($hrubka["id"])) {
        $hrubka["hodnota"] = "18";
    }
    $meno_csv = sec_input(rep_dia($rev[meno]));
    $meno_csv = str_replace('/', "", $meno_csv);
    $meno_csv = str_replace(" ", "", $meno_csv);
    $meno_csv = str_replace(".", "", $meno_csv);
    //$material[meno] = str_replace(" ", "", $material[meno]);
    $vyrobca[meno] = str_replace(" ", "", $vyrobca[meno]);
    if (strlen($meno_csv) > 10) {
        $meno_csv = substr($meno_csv, 0, 10);
    }
    $directory = "files/csv_new/obj-{$order}/rev-{$revision}";
    if (!file_exists($directory)) {
        mkdir($directory, 0777, true);
    }
    if (!empty($sub) && $sub == "pasy") {
        $meno_csv = $meno_csv . "-pasy";
    }
    $fp = fopen("{$directory}/{$c_obj}-{$meno_csv}.csv", "w+");
    $rev[meno] = rep_dia($rev[meno]);
    $rev[meno] = str_replace(" ", "_", $rev[meno]);
    $meno_suboru = $rev[meno] . "" . (strlen($dekor[hodnota]) > 1 ? "_{$dekor['hodnota']}" : "") . "";
    $meno_suboru = mb_substr($meno_suboru, 0, 20, "UTF-8");
    //$rev[meno] = str_replace("/", "", $rev[meno]);
    /*
        $hlavicka = "0;".rep_dia($material["meno"]).";2800;2070;18;*;10;10;10;10;1
    ";   */
    $hlavicka = "";
    $hlavicka2 = "";
    $nar = sql_query("SELECT ks, dlzka, sirka, nazov, poznamka, duplak, hrubka, orientacia,\r\n                         hrana1, hrana2, hrana3, hrana4, duplak_paska\r\n                      FROM porez \r\n                      WHERE id_revizia=\"{$revision}\"\r\n                      ");
    $hrana = sql_query("SELECT id, hodnota, hodnota_csv, meno\r\n                      FROM hrana \r\n                      ");
    if (empty($material["max_dlzka"])) {
        $max_dlzka = def_value("max_dlzka", "hodnota");
    } else {
        $max_dlzka = $material["max_dlzka"];
    }
    if (empty($material["max_sirka"])) {
        $max_sirka = def_value("max_sirka", "hodnota");
    } else {
        $max_sirka = $material["max_sirka"];
    }
    //dd($material);
    foreach ($nar as $value) {
        //var_dump($value);
        $value[nazov] = str_replace(" ", "_", rep_dia($value[nazov]));
        $value[poznamka] = str_replace(" ", "_", rep_dia($value[poznamka]));
        $value[nazov] = preg_replace("/[^A-Z0-9a-z\\w ]/u", '', $value[nazov]);
        $value[poznamka] = preg_replace("/[^A-Z0-9a-z\\w ]/u", '', $value[poznamka]);
        //if ($value[orientacia]==0) $value[orientacia] = "";
        /*
        if (!empty($value[nazov])) {
            $value[nazov] = $value[nazov];
            
        } else {
            $value[nazov] = $rev[meno];
        }
        if (!empty($value[poznamka])) {
            $value[poznamka] = $value[poznamka];
            
        } else {
            $value[poznamka] = $rev[meno];
        }
        */
        if (strlen($value[nazov]) > 30) {
            $value[nazov] = substr($value[nazov], 0, 30);
        }
        if (strlen($value[poznamka]) > 40) {
            $value[poznamka] = substr($value[poznamka], 0, 40);
        }
        //var_dump($value[nazov]);
        foreach ($hrana as $value_hrana) {
            //var_dump($value_hrana);
            for ($i = 1; $i < 5; $i++) {
                if ($value_hrana[id] == $value["hrana" . $i]) {
                    $value["hrana" . $i] = $value_hrana[meno];
                    $value["hrana" . $i . "_hodnota"] = $value_hrana[hodnota];
                }
                if ($value["hrana" . $i] == "0") {
                    $value["hrana" . $i] = "";
                }
                if ($value["hrana" . $i] != "" and is_duplak($value[hrubka]) or $value["hrana" . $i] != "" and $value[duplak_paska] == 1) {
                    $value["hrana" . $i] = "42/2";
                }
            }
        }
        /*
        $orientacia = sql_query("SELECT meno, hodnota FROM orientacia WHERE id=\"$value[orientacia]\" LIMIT 1");
//.........这里部分代码省略.........
开发者ID:jozefvasko,项目名称:kraf-app,代码行数:101,代码来源:generate_csv.php


注:本文中的def_value函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。