Пример #1
0
<?php

include "models/function.php";
$id_lessons = $_GET['id_lessons'];
$id_clients = $_GET['id_clients'];
DB::updatePM("UPDATE answer set view=1 WHERE id_lessons={$id_lessons} and id_clients={$id_clients}");
if (isset($_POST['go'])) {
    $today = DB::today();
    $array = array("id_lessons" => $_POST['id_lessons'], "id_clients" => $_POST['id_clients'], "text" => $_POST['text'], "date" => $today, "piple" => "admin", "src" => "");
    DB::insert(DB::insertSql("answer", $array), $array);
    header("Location: answer_view.php?id_lessons=" . $_POST['id_lessons'] . "&id_clients=" . $_POST['id_clients'] . "#chat");
}
$dz = DB::selectParam("homework", "id_lessons", $id_lessons);
$answer = DB::selectSql("SELECT * FROM answer WHERE id_lessons={$id_lessons} AND (id_clients={$id_clients} OR id_clients=0)");
require_once 'view/tpl_top.php';
?>
<div class="app app-header-fixed">
    <?php 
include "view/tpl_popup_events.php";
include "view/header.php";
$active_g = "class=\"active\"";
include "view/nav.php";
?>
    <!-- content -->
    <div id="content" class="app-content" role="main">
        <div class="app-content-body ">
            <div class="hbox hbox-auto-xs hbox-auto-sm">
                <div class="col">
                    <div class="bg-light lter b-b wrapper-md wrapper-md__i">
                        <h1 class="m-n font-thin h3 inline">Материалы к уроку: <?php 
echo $less[0]['name'];
Пример #2
0
    $array = array("id_lessons" => $lesson, "id_clients" => $_SESSION['user_id'], "text" => $_POST['text'], "date" => $today, "piple" => "user");
    if ($_FILES["answer_materials"]["error"] == UPLOAD_ERR_OK) {
        $materials = Upload::file($_FILES["answer_materials"], "answer_materials");
        if ($materials) {
            $array += array("src" => $materials);
        } else {
            if ($_POST["go"] == "save") {
                $array += array("src" => "");
            }
        }
    }
    DB::insert(DB::insertSql("answer", $array), $array);
    header("Location: view_lessons.php?id=" . $_POST['id'] . "#chat");
}
$dz = DB::selectParam("homework", "id_lessons", $id);
$answer = DB::selectSql("SELECT * FROM answer WHERE id_lessons={$id} AND (id_clients={$_SESSION['user_id']} OR id_clients=0)");
require_once 'view/tpl_top.php';
?>
<div class="app app-header-fixed">
    <?php 
include "view/tpl_popup_events.php";
include "view/header.php";
$active_a = "class=\"active\"";
include "view/nav.php";
?>
    <!-- content -->
    <div id="content" class="app-content" role="main">
        <div class="app-content-body ">
            <div class="hbox hbox-auto-xs hbox-auto-sm">
                <div class="col">
                    <div class="bg-light lter b-b wrapper-md wrapper-md__i">
Пример #3
0
 case 'savesortprice':
     $data = $_POST["array"];
     $prices = json_decode($data, true);
     foreach ($prices as $price) {
         $array = array("nn" => $price["nn"]);
         DB::update(DB::updateSql("price", $array), $array, $price["id"]);
     }
     break;
 case 'editDefStatus':
     DB::updatePM("UPDATE `status-zakaz` SET `default`='0'");
     $array = array("default" => 1);
     $res = DB::update(DB::updateSql("status-zakaz", $array), $array, $_POST['id']);
     echo json_encode($res);
     break;
 case 'selectPrice':
     echo json_encode(DB::selectSql("SELECT price.id as id, catalog.id as catId, price.name as name, price.img as img, catalog.text as text, catalog.`longtext` as `longtext`, catalog.`name_ru` as `name_ru`  FROM price LEFT JOIN `catalog` ON catalog.id=price.section"));
     break;
     //    case 'news': echo json_encode(DB::selectID("news",$_POST["id"])); break;
     //    case 'section':
     //        require_once "../classes/Catalog.php";
     //        $obj = new Catalog();
     //        $result = $obj->selectId($_POST["id"]);
     //        echo json_encode($result);
     //    break;
     //
     //    case 'selectParent':
     //        require_once "../classes/Catalog.php";
     //        $obj = new Catalog();
     //        $result = $obj->selectId($_POST["id"]);
     //        echo json_encode($result);
     //        break;
Пример #4
0
?>
><a href="kurs.php" class="transition"><i class="fa fa-graduation-cap text-success-lter"></i><span>Курсы</span></a></li>
					<li <?php 
echo $active_b;
?>
><a href="users.php" class="transition"><i class="fa fa-users text-success-lter"></i><span>Пользователи</span></a></li>
					<li <?php 
echo $active_c;
?>
><a href="calendar.php" class="transition"><i class="fa fa-calendar text-success-lter"></i><span>Календарь событий</span></a></li>
					<li <?php 
echo $active_f;
?>
><a href="materials.php" class="transition"><i class="fa fa-file-text-o text-success-lter"></i><span>Материалы</span></a></li>
					<?php 
$answer_count = count(DB::selectSql("SELECT * FROM answer WHERE view=0 group by id_clients,id_lessons ORDER BY date DESC"));
?>
					<li <?php 
echo $active_g;
?>
><a href="answer.php" class="transition"><b class="badge bg-info pull-right"><?php 
echo $answer_count;
?>
</b><i class="fa fa-file-text-o text-success-lter"></i><span>Домашнее задание</span></a></li>
					<li class="line dk"></li>
					<li>
						<form class="ajax" method="post" action="ajax.php">
							<input type="hidden" name="act" value="logout">
							<div class="form-actions">
								<button class="btn btn-large btn-primary btn-block" type="submit">Выход</button>
							</div>
Пример #5
0
     if (isset($_POST['arr_id'])) {
         $arr_id = json_decode($_POST['arr_id']);
         $arr_data = json_decode($_POST['arr_data']);
         $array = array_combine($arr_id, $arr_data);
         foreach ($array as $key => $value) {
             $array = array("name" => $value);
             $result = DB::update(DB::updateSql($_POST['table'], $array), $array, $key);
         }
         echo json_encode($result);
     }
     break;
 case 'moreInfo':
     if (isset($_POST['id'])) {
         //$result = DB::selectParam('price','id',$_POST['id'],false,false);
         $id = $_POST['id'];
         $result = DB::selectSql("\n                                    SELECT pr.id, pr.name, pr.included_price, pr.img, ip.id as ip_id, ip.id_size, ip.id_module, ip.sale, ip.price, ip.price_old, m.name as module_name\n                                    FROM price as pr\n                                    RIGHT JOIN info_prod as ip ON pr.id = ip.id_price\n                                    RIGHT JOIN modules as m ON m.id = ip.id_module\n                                    WHERE pr.id = {$id}  order by price ASC\n            ");
         //$result[0]['included_price'] = unserialize($result[0]['included_price']);
         //$result[0]['sizes'] = unserialize($result[0]['sizes']);
         foreach ($result as $key => $val) {
             $result[$key]['img'] = unserialize($val['img']);
             $result[$key]['included_price'] = unserialize($val['included_price']);
             $result_name_sizes = DB::selectParam('sizes', 'id', $val['id_size'], false, false);
             $sizes = $result_name_sizes[0]['height'] . 'x' . $result_name_sizes[0]['width'];
             $result[$key]['size'] = $sizes;
             $arr_name_included_price = array();
             foreach ($result[$key]['included_price'] as $value1) {
                 $name_included_price = DB::selectParam('included_price', 'id', $value1, false, false);
                 array_push($arr_name_included_price, $name_included_price[0]['name']);
             }
             $result[$key]['included_price'] = array_combine($result[$key]['included_price'], $arr_name_included_price);
         }
Пример #6
0
<?php

require_once '../admin_new/classes/ConnectDB.php';
require_once '../admin_new/classes/DBase.php';
$obj = new DB();
list($marka, $engine, $transmission, $run) = explode('|', $_POST['calc']);
$sql = "SELECT * FROM to_price WHERE marka=" . $marka . " AND engine=" . $engine . " AND transmission=" . $transmission . " AND run=" . $run;
$result = DB::selectSql($sql);
$arr = unserialize($result[0]['manufactur']);
$arr1 = array();
foreach ($arr as $k => $v) {
    $arr1[] = DB::selectID('to_manufactur', $arr[$k]);
}
echo json_encode($arr1);
Пример #7
0
<?php

include "models/function.php";
IncludeClass::inc(array("Catalog"));
$param = "catalog";
$record = false;
if (isset($_GET['top'])) {
    $id_prod = $_GET['top'];
    $sql = "UPDATE price SET nn = 0 WHERE id = {$id_prod}";
    DB::updatePM($sql);
}
if (isset($_GET['down'])) {
    $id = $_GET['id'];
    $sql_count = "SELECT count(nn)as amount FROM price WHERE section={$id}";
    $count = DB::selectSql($sql_count);
    $id_prod = $_GET['down'];
    $sql = "UPDATE price SET nn =" . $count[0]['amount'] . " WHERE id = {$id_prod}";
    DB::updatePM($sql);
}
if (isset($_POST["go"])) {
    $table = $_POST["table"];
    if ($table == "catalog") {
        if (!$_POST["name_en"]) {
            $_POST["name_en"] = Rename::replace($_POST["name_ru"]);
        } else {
            $_POST["name_en"] = Rename::replace($_POST["name_en"]);
        }
        $array = array("name_ru" => $_POST['name_ru'], "name_en" => $_POST['name_en'], "parent" => $_POST['parent'], "title" => $_POST['title'], "desc" => $_POST['desc'], "keywords" => $_POST['keywords']);
    } else {
        $array = array("name_ru" => $_POST['name_ru'], "title" => $_POST['title'], "text" => $_POST['text'], "parent" => 0);
        $src = DB::filesUpload($_FILES['photo'], $_POST["table"]);
Пример #8
0
$maillist = explode('|', $_POST['emailsarr']);
$format = $_POST['format'];
if ($_POST['oform'] == 0) {
    $arrpopup = array("name" => $_POST['name'], "phone" => $_POST['phone'], "email" => $_POST['email'], "quest" => $_POST['ques'], "formname" => $_POST['formname']);
    DB::insert(DB::insertSql("callback", $arrpopup), $arrpopup);
} else {
    if ($_POST['oform'] == 1) {
        $login = ConfigSites::sessionId();
        $sum = DB::selectSql("SELECT SUM(summ) as sum FROM cart WHERE id_session='{$login}' ");
        //сумма заказа без перерасчётов
        $arrayZakaz = array("name" => $_POST['name'], "phone" => $_POST['phone'], "email" => $_POST['email'], "sum" => $sum[0]['sum']);
        $lastId = DB::insert(DB::insertSql("zakaz", $arrayZakaz), $arrayZakaz);
        $carts = DB::selectParam("cart", "id_session", $login, false, false);
        foreach ($carts as $cart) {
            $id_price = $cart['id_price'];
            $price = DB::selectSql("SELECT * FROM price WHERE id = {$id_price}");
            $name = $price[0]['name'];
            $nomer = $price[0]['nomer'];
            $img = $price[0]['img'];
            $arrOform = array("zakaz_id" => $lastId, "price_id" => $cart['id_price'], "name" => $name, "nomer" => $nomer, "amount" => $cart['kol'], "cost" => $cart['cost'], "sum" => $cart['summ'], "size" => $cart['size'], "img" => $img);
            DB::insert(DB::insertSql("zakaz_count", $arrOform), $arrOform);
        }
        DB::deleteCartLogin($login);
        $arrpopup = array("name" => $_POST['name'], "phone" => $_POST['phone'], "email" => $_POST['email'], "quest" => $_POST['ques'], "formname" => $_POST['formname']);
        //echo json_encode($arrpopup);
        DB::insert(DB::insertSql("callback", $arrpopup), $arrpopup);
    }
}
$headers = "Content-type: text/html; charset=utf-8 \r\n";
$headers .= "From: {$sitename}\r\n";
$td1_style = "border: 1px solid #000; max-width: 140px; padding: 5px 10px; font-weight: bold; background-color: #e8e8e8;";
Пример #9
0
<?php

include "config.php";
$login = ConfigSites::sessionId();
$result = DB::selectSql("SELECT cart.id as id, cart.price_id, cart.kol as kol, price.name as name, price.nomer as nomer, price.price as price, price.price_old as price_old, price_photo.src as src FROM cart LEFT JOIN price ON price.id=cart.price_id LEFT JOIN price_photo ON price_photo.price_id=cart.price_id WHERE cart.login='******' GROUP BY cart.id");
$result_price = DB::selectParam('price', 'id', 1, false, false, false, false);
//$promo = DB::selectSql("SELECT * FROM promo WHERE promocode=$promocode");
//var_dump($result);
?>
<!DOCTYPE html>
<html lang="ru">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width">
	<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE">
	<title></title>
	<link rel="shortcut icon" href="<?php 
echo ConfigSites::$prefix;
?>
img/favicon.ico" type="image/x-icon">
	<link rel="icon" href="<?php 
echo ConfigSites::$prefix;
?>
img/favicon.ico" type="image/x-icon">
	<link rel="stylesheet" href="<?php 
echo ConfigSites::$prefix;
?>
css/style.css" />
	<link rel="stylesheet" href="<?php 
echo ConfigSites::$prefix;
?>
Пример #10
0
if (isset($_GET["delete"])) {
    DB::del($_GET["title"],$_GET["delete"]);
	if (isset($_GET["act"]) and $_GET["act"]) {
		header("Location: production.php?id=".$_GET["act"]."&table=catalog");
	} else {
		header("Location: production.php");
	}
}

if (isset($_GET["id"])) {
	$id = $_GET["id"];
	//$records = DB::selectParam("price","section",$_GET["id"],"nn|ASC");
	$records = DB::selectSql("
							  SELECT pr.id, pr.section, pr.name, pr.nomer, pr.img, pr.nn, pr.best, pr.hide, MIN(ip.price) as min_price
							  FROM price as pr
							  LEFT JOIN info_prod as ip ON pr.id=ip.id_price
							  WHERE section=$id
							  group by ip.id_price
							  order by best DESC, hide ASC, nn ASC");
}
require_once 'view/tpl_top.php';
?>
<div class="app app-header-fixed  ">
	<div class="modal <?php 
echo $table;
?>
 fade" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<form method="post">
					<div class="modal-header">
Пример #11
0
include "models/function.php";
$lesson = $_SESSION['lessons'];
if (isset($_POST['go'])) {
    $array = array("id_lessons" => $lesson, "id_clients" => $_SESSION['user_id'], "text" => $_POST['text']);
    $lastId = DB::insert(DB::insertSql("answer", $array), $array);
    $materials = Upload::files($_FILES["answer_materials"], "answer_materials");
    if ($materials) {
        foreach ($materials as $materials_src_tmp) {
            $array_materials = array("id_answer" => $lastId, "src" => $materials_src_tmp);
            DB::insert(DB::insertSql("answer_materials", $array_materials), $array_materials);
        }
    }
}
$less = DB::selectID("lessons", $lesson);
$dz = DB::selectParam("homework", "id_lessons", $lesson, false, false);
$answer = DB::selectSql("SELECT * FROM answer WHERE id_lessons={$lesson} AND id_clients={$_SESSION['user_id']}");
require_once 'view/tpl_top.php';
?>
<div class="app app-header-fixed">
    <?php 
include "view/tpl_popup_events.php";
include "view/header.php";
$active_c = "class=\"active\"";
include "view/nav.php";
?>
	<!-- content -->
	<div id="content" class="app-content" role="main">
		<div class="app-content-body ">
			<div class="hbox hbox-auto-xs hbox-auto-sm">
				<div class="col">
					<div class="bg-light lter b-b wrapper-md wrapper-md__i">
Пример #12
0
     if ($_POST['kol'] == "plus") {
         DB::updatePM("UPDATE `cart` SET `kol` = `kol`+1 WHERE id =" . $_POST['id']);
     } else {
         DB::updatePM("UPDATE `cart` SET `kol` = `kol`-1 WHERE id =" . $_POST['id']);
     }
     break;
 case 'prepay':
     DB::updatePM("UPDATE `cart` SET `percent` = " . $_POST['percent'] . " WHERE id =" . $_POST['id']);
     break;
 case 'delCart':
     DB::deleteCart($_POST['id']);
     break;
 case 'promo':
     if (isset($_POST['promocode'])) {
         $promocode = trim($_POST['promocode']);
         $promo = DB::selectSql("SELECT * FROM promo");
         $promo = unserialize($promo[0]["promocode"]);
         foreach ($promo as $key => $val) {
             if ($key == $_POST['promocode']) {
                 $result = array('promocode' => $key, 'percent' => $val);
                 break;
             } else {
                 $result = false;
             }
         }
         echo json_encode($result);
     }
     break;
 case 'search':
     $search = json_decode($_POST['array']);
     if (isset($_POST['limit'])) {
Пример #13
0
<?php

if (!isset($_GET['lesson'])) {
    header("Location: ../");
}
require_once '../admin/classes/ConnectDB.php';
require_once '../admin/classes/DBase.php';
require_once '../admin/classes/Install.php';
$install = new Install();
$db = new DB();
if (isset($_POST['username']) and isset($_POST['password'])) {
    $hash = md5($_POST['password']);
    $res = DB::selectSql("SELECT * FROM clients WHERE email='{$_POST['username']}' AND password = '******'");
    if ($res) {
        session_start();
        $_SESSION['user_id'] = $res[0]['id'];
        $_SESSION['lessons'] = $_POST['less'];
    } else {
        header("Location: index.php?lesson=" . $_POST['less']);
    }
}
if ($_SESSION['user_id']) {
    header("Location: lessons.php");
} else {
    ?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Авторизация</title>
    <?php 
Пример #14
0
                    $array_info_prod['id_price'] = $_GET['edit'];
                    $result = DB::insert(DB::insertSql("info_prod",$array_info_prod),$array_info_prod);
                }
            }
        }
        header("Location: production.php?id=".$_POST["section"]."&table=catalog");
    }

}
$record = false;
if (isset($_GET["edit"])) {
    //$record = DB::selectID("price",$_GET['edit'])[0];
    $id = $_GET['edit'];
    $records = DB::selectSql("
							SELECT pr.id, pr.section, pr.name, pr.nomer, pr.included_price, pr.title, pr.description, pr.keywords, pr.img, pr.img_title, pr.img_alt, ip.id as id_info_prod, ip.id_price, ip.id_size, ip.id_module, ip.price, ip.price_old, ip.sale
                            FROM price as pr
							JOIN info_prod as ip ON pr.id=ip.id_price
							WHERE pr.id=$id
							");
    if(isset($records[0]['included_price']) && !empty($records[0]['included_price'])) {
        $record_included_price = unserialize($records[0]['included_price']);
    }
    if(isset($records[0]['img']) && !empty($records[0]['img'])) {
        $images = unserialize($records[0]['img']);
    }
}
//var_dump($record_included_price);
$relateds = DB::select("price");
$sizes = DB::select("sizes");
$modules = DB::select("modules");
$included_price = DB::select("included_price");
Пример #15
0
    case 'card':
        $login = ConfigSites::sessionId();
        $result = DB::selectSql("
                                SELECT cart.id as id, cart.kol as kol, cart.summ, cart.old_sum, cart.cost, cart.old_cost, pr.name as name, pr.nomer as nomer, MIN(ip.price) as min_price, MIN(ip.price_old) as min_price_old
                                FROM cart
                                 JOIN price as pr ON pr.id=cart.id_price
                                 JOIN info_prod as ip ON pr.id=ip.id_price
                                WHERE cart.id_session='$login' GROUP BY cart.id
                                ");
        echo json_encode($result);
        break;
    case 'curcost':
        $login = ConfigSites::sessionId();
        $id = $_POST['id'];
        $result = DB::selectSql("
                                SELECT cost, old_cost
                                FROM cart WHERE id = '$id'
                                ");
        echo json_encode($result);
        break;

    case 'kol':
        $id = $_POST['id'];
        $kol = $_POST['kol'];
        $summ = $_POST['summ'];
        $old_sum = $_POST['sum_old'];
        $result = DB::updatePM("
            UPDATE cart
            SET kol = $kol ,
                summ = $summ ,
                old_sum = $old_sum
            WHERE id = $id ");
Пример #16
0
<?php

include "config.php";
$login = ConfigSites::sessionId();
$records = DB::selectSql("SELECT\n    cart.id as id,\n    price.id as price_id,\n    price.nomer as nomer,\n    price.name as name,\n    price.price as price,\n    cart.size as size,\n    cart.kol as kol,\n    price_photo.src as src,\n    colors.rgb as color\n    FROM cart\n    LEFT JOIN price ON price.id=cart.price_id\n    LEFT JOIN colors ON colors.id=cart.color\n    LEFT JOIN price_photo ON price_photo.price_id=cart.price_id AND price_photo.color=cart.color\n    WHERE login='******'");
?>
<!DOCTYPE html>
<html lang="ru">
<head>
	<meta charset="utf-8">
	<!-- <meta name="viewport" content="width=device-width"> -->
	<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
	<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE">
	<title>GLZN &mdash; платье</title>
	<link rel="shortcut icon" href="<?php 
echo ConfigSites::$prefix;
?>
img/favicon.ico" type="image/x-icon">
	<link rel="icon" href="<?php 
echo ConfigSites::$prefix;
?>
img/favicon.ico" type="image/x-icon">
	<link rel="stylesheet" href="<?php 
echo ConfigSites::$prefix;
?>
css/style.css" />
	<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.slick/1.5.7/slick.css"/>
</head>
<body id="card">
	<div class="content black">
        <div class="burger">
Пример #17
0
<?php

include "models/function.php";
$records = DB::selectSql("SELECT * FROM answer group by id_clients,id_lessons ORDER BY date DESC");
require_once 'view/tpl_top.php';
?>
<div class="app app-header-fixed">
    <?php 
include "view/tpl_popup_events.php";
include "view/header.php";
$active_g = "class=\"active\"";
include "view/nav.php";
?>
	<!-- content -->
	<div id="content" class="app-content" role="main">
		<div class="app-content-body ">
			<div class="hbox hbox-auto-xs hbox-auto-sm">
				<div class="col">
					<div class="bg-light lter b-b wrapper-md wrapper-md__i">
						<h1 class="m-n font-thin h3 inline">Ответы на домашнее задание</h1>
					</div>
                    <div class="wrapper-md">
                        <?php 
if ($records != false) {
    ?>
                            <table class="table table-striped b-t b-light">
                                <tr>
                                    <td>Пользователь</td>
                                    <td>Урок</td>
                                    <td>Дата</td>
                                    <td width="90">Просмотр</td>
Пример #18
0
<?php

include "../config.php";
switch ($_POST['form']) {
    case 'card':
        $login = ConfigSites::sessionId();
        $data = DB::selectSql("SELECT\n\t\t\t\t\tcart.id as id,\n\t\t\t\t\tprice.id as price_id,\n\t\t\t\t\tprice.name as name,\n\t\t\t\t\tprice.price as price,\n\t\t\t\t\tcart.size as size,\n\t\t\t\t\tcart.kol as kol,\n\t\t\t\t\tprice_photo.src as src,\n\t\t\t\t\tcolors.rgb as color\n\t\t\t\t\tFROM cart\n\t\t\t\t\tLEFT JOIN price ON price.id=cart.price_id\n\t\t\t\t\tLEFT JOIN colors ON colors.id=cart.color\n\t\t\t\t\tLEFT JOIN price_photo ON price_photo.price_id=cart.price_id AND price_photo.color=cart.color\n\t\t\t\t\tWHERE login='******'");
        echo json_encode($data);
        break;
    case 'add_card':
        $now = ConfigSites::today();
        $login = ConfigSites::sessionId();
        $array = array('price_id' => $_POST['id'], 'login' => $login, 'size' => $_POST['size'], 'color' => $_POST['color'], 'kol' => $_POST['kol'], 'date' => $now);
        $lastId = DB::insert(DB::insertSql("cart", $array), $array);
        return $lastId;
        break;
    case 'card_count_minus':
        DB::updatePM("UPDATE `cart` SET `kol` = `kol`-1 WHERE id =" . $_POST['id']);
        break;
    case 'card_count_plus':
        DB::updatePM("UPDATE `cart` SET `kol` = `kol`+1 WHERE id =" . $_POST['id']);
        break;
    case 'delete_card':
        DB::deleteCart($_POST['id']);
        break;
    case 'oformzakaz':
        $headers = "Content-type: text/html; charset=utf-8 \r\n";
        $headers .= "From: GLZN <*****@*****.**>\r\n";
        $td1_style = "border: 1px solid #000; max-width: 140px; padding: 5px 10px; font-weight: bold; background-color: #e8e8e8;";
        $td2_style = "border: 1px solid #000; max-width: 460px; min-width: 300px; padding: 5px 10px;";
        $now = ConfigSites::today();
Пример #19
0
    </div>
</div>
<?php 
if (isset($record[0]["related"]) && !empty($record[0]["related"])) {
    ?>
    <div class="adds">
        <div class="wrapp">
            <div class="adds-head">Подберите комплект</div>
            <div class="container group complekt">
                <ul class="list">
                    <?php 
    $array_selected = unserialize($record[0]["related"]);
    //var_dump($array_selected);
    $str = "id=" . join(' or id=', $array_selected);
    $sql = "SELECT * FROM price WHERE " . $str;
    $relateds = DB::selectSql($sql);
    $sun = 0;
    $item = 0;
    $count_related = count($relateds);
    //var_dump($relateds);
    foreach ($relateds as $related) {
        $item++;
        $sun = $sun + $related['price'];
        $photo = DB::selectParam("price_photo", "price_id", $related['id'], false, "limit 1");
        $proverka = DB::selectParam('price', 'nomer', $related['nomer'], false, false, false, false);
        ?>
                        <li class="item">
                            <a href="<?php 
        echo ConfigSites::$prefix;
        ?>
product/<?php 
Пример #20
0
                                                <th>Артикул</th>
                                                <th>Код товара</th>
                                                <th>Наименование</th>
                                                <th>Материал</th>
                                                <th>Кол-во</th>
                                                <th>Размер</th>
                                                <th>Цена по прайсу</th>
                                                <th>Процент оплаты</th>
                                                <th>Итого</th>

                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php 
foreach ($zakaz as $zakazz) {
    $photo = DB::selectSql("SELECT * FROM price_photo WHERE price_id={$zakazz['price_id']}");
    $price = DB::selectID("price", $zakazz['price_id']);
    ?>
                                                <tr>
                                                    <td><img src="../<?php 
    echo $photo[0]["src"];
    ?>
" alt="" style="width: 250px"/></td>
                                                    <td><?php 
    echo $price[0]["nomer"];
    ?>
</td>
                                                    <td><?php 
    echo $price[0]["code"];
    ?>
</td>
Пример #21
0
<?php

include "models/function.php";
$kurs = $_SESSION['lessons'];
$records = DB::selectSql("SELECT * FROM dop WHERE id_kurs=0 OR id_kurs={$kurs}");
require_once 'view/tpl_top.php';
?>
<div class="app app-header-fixed">
    <?php 
include "view/tpl_popup_events.php";
include "view/header.php";
$active_b = "class=\"active\"";
include "view/nav.php";
?>
    <!-- content -->
    <div id="content" class="app-content" role="main">
        <div class="app-content-body ">
            <div class="hbox hbox-auto-xs hbox-auto-sm">
                <div class="col">
                    <div class="bg-light lter b-b wrapper-md wrapper-md__i">
                        <h1 class="m-n font-thin h3 inline">Дополнительные материалы</h1>
                    </div>
                        <div class="wrapper-lg">
                        <?php 
if ($records != false) {
    ?>
                            <table class="table table-striped b-t b-light">
                                <tr>
                                    <td>Категория</td>
                                    <td>Название</td>
                                    <td width="90">Ссылка</td>
Пример #22
0
    }
    if ($_POST['email'] == "undefined") {
        $_POST['email'] = NULL;
    }
    if ($_POST['ques'] == "undefined") {
        $_POST['ques'] = NULL;
    }
    if ($_POST['formname'] == "undefined") {
        $_POST['formname'] = NULL;
    }
    $arrpopup = array("name" => $_POST['name'], "phone" => $_POST['phone'], "email" => $_POST['email'], "quest" => $_POST['ques'], "date" => $today, "formname" => $_POST['formname']);
    DB::insert(DB::insertSql("callback", $arrpopup), $arrpopup);
} else {
    if ($_POST['oform'] == 1) {
        $login = ConfigSites::sessionId();
        $sun = DB::selectSql("SELECT SUM(cart.kol*price.price) as sun FROM cart LEFT JOIN price ON price.id=cart.price_id WHERE login='******'");
        //сумма заказа без перерасчётов
        if (isset($_POST['promo']) && !empty($_POST['promo'])) {
            $promo = $_POST['promo'];
        } else {
            $promo = NULL;
        }
        $arrayZakaz = array("date" => $today, "sun" => $_POST['total_zakaz'], "name" => $_POST['name_zakaz'], "phone" => $_POST['phone_zakaz'], "email" => $_POST['email_zakaz'], "promo_skidka" => $promo, "region" => $_POST['region_zakaz'], "index" => $_POST['index_zakaz'], "city" => $_POST['city_zakaz'], "street" => $_POST['street_zakaz'], "apartment" => $_POST['apartment_zakaz'], "comment" => $_POST['comment_zakaz'], "payment" => $_POST['oplata_zakaz'], "delivery" => $_POST['dostavka_zakaz'], "status_payment" => $_POST['status_payment']);
        $lastId = DB::insert(DB::insertSql("count_zakaz", $arrayZakaz), $arrayZakaz);
        $inv_desc = "Оплата заказа №" . $lastId;
        $out_summ = $_POST['total_zakaz'];
        $crc = md5("{$mrh_login}:{$out_summ}:{$lastId}:{$mrh_pass1}:shp_Item={$shp_item}");
        $array_outJs = array("zakaz" => $lastId, "summ" => $out_summ, "inv_desc" => $inv_desc, "name" => $_POST['name_zakaz'], "phone" => $_POST['phone_zakaz'], "email" => $_POST['email_zakaz'], "crc" => $crc);
        echo json_encode($array_outJs);
        $carts = DB::selectParam("cart", "login", $login, false, false);
        foreach ($carts as $cart) {
Пример #23
0
    $dateEnd = $_POST['date'] . " " . $_POST['endHors'] . ":" . $_POST['endMin'] . ":00";
    $array += array("start" => $dateStart, "end" => $dateEnd);
    if ($_POST["go"] == "save") {
        DB::insert(DB::insertSql($param, $array), $array);
        header("Location: calendar.php");
    } else {
        $id = $_POST['go'];
        DB::update(DB::updateSql($param, $array), $array, $id);
        header("Location: calendar.php");
    }
}
if (isset($_GET["delete"])) {
    Delete::del($_GET["title"], $_GET["delete"]);
    header("Location: calendar.php");
}
$records = DB::selectSql("SELECT * FROM events ORDER BY start DESC");
require_once 'view/tpl_top.php';
?>
<div class="app app-header-fixed">
    <?php 
include "view/tpl_popup_events.php";
include "view/header.php";
$active_h = "class=\"active\"";
include "view/nav.php";
?>
	<!-- content -->
	<div id="content" class="app-content" role="main">
		<div class="app-content-body ">
			<div class="hbox hbox-auto-xs hbox-auto-sm">
				<div class="col">
					<div class="bg-light lter b-b wrapper-md wrapper-md__i">