Skip to content

Commit

Permalink
0.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Farrien committed Aug 23, 2018
1 parent 50ea7a2 commit 2ab96c5
Show file tree
Hide file tree
Showing 44 changed files with 436 additions and 150 deletions.
6 changes: 3 additions & 3 deletions app_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ OWNER_NAME=Farrien
APP_NAME=SimpleApp
LOGO_ADDR=
IGNORE_HTMLTAGS=1
PATCH_VER=0.5.4
PATCH_VER=0.5.5
PATCH_NAME=ASN13JUL8FRZSE
REQUESTS_DETECTING=
SMS_NOTIFICATION_RECEIVER_PHONE=

DATABASE_SETTING_HOSTNAME=localhost
DATABASE_SETTING_DBNAME=sanity_origin
DATABASE_SETTING_USER=sanity
DATABASE_SETTING_PASSWORD=db_sanity
DATABASE_SETTING_USER=root
DATABASE_SETTING_PASSWORD=

ENC_SALT=SweetHarmony
DEBUG_R_CLASS=0
Expand Down
31 changes: 31 additions & 0 deletions client/app-shop.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
sn.shop = {};

sn.shop.orders = localStorage;

let temp_bin = new Array();
let bin = sn.shop.orders.getItem('bin');
if (!bin) {
sn.shop.orders.setItem('bin', JSON.stringify(temp_bin));
console.log('temp_bin set');
}
console.log(sn.shop.orders);

sn.shop.addToOrder = function(product_id) {
let json_bin = sn.shop.orders.getItem('bin');
let arr = JSON.parse(json_bin);
arr.push(product_id);
sn.shop.orders.setItem('bin', JSON.stringify(arr));
}

sn.shop.clearOrder = function() {
sn.shop.orders.setItem('bin', JSON.stringify(temp_bin));
console.log('bin is clean.');
}

sn.shop.completeOrder = function() {
mr.Query('../get/ShopBasket/performNewOrder', {items : sn.shop.orders.getItem('bin')}, function(response) {
// console.log(response);
var r = JSON.parse(response);

if (r.result == true) {
sn.shop.clearOrder();
}
});
}

sn.shop.CreateCallbackRequest = function(product_id) {
let crp = document.getElementById('callbackRequestPhone');
Expand Down
54 changes: 54 additions & 0 deletions client/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,24 @@ button.xver {
margin: 0;
}

button.xver:disabled {
background-image: none;
background-color: #e3e3e3;
color: #999;
}

button.xver:hover {
box-shadow: 0 8px 16px rgba(0,0,0,.08), 0 4px 24px rgba(0,0,0,.08);
}

.logo-image {
background-image: var(--logoResLink);
background-size: cover;
background-position: center;
width: 36px;
height: 36px;
}

.pageWrap .layout {
margin-top: 16px;
}
Expand Down Expand Up @@ -529,6 +543,46 @@ button.xver:hover {
padding: 8px 16px;
}

.shop-basket {

}

.shop-basket-list {
padding-top: 8px;
}

.shop-basket-list .shop-basket-item {
display: flex;
justify-content: flex-start;
font-size: 100%;
padding: 8px 0;
line-height: 100%;
}

.shop-basket-list .shop-basket-item .product-title {
flex: 3;
}

.shop-basket-list .shop-basket-item .product-single-cost, .shop-basket-list .shop-basket-item .product-total-cost, .shop-basket-list .shop-basket-item .product-count {
flex: 1;
padding-right: 16px;
}

.shop-basket-control-buttons {
background-color: #f4f4f4;
padding: 16px;
margin-top: 8px;
display: flex;
justify-content: space-between;
}

button.xver.white {
background-image: none;
background-color: #fff;
border: 1px solid #d3d3d3;
color: #444;
}

@media screen and (min-width: 768px) {
.shop-sidebar-items .shop-sidebar-item-name {transition:100ms all linear;}
.shop-sidebar-items .shop-sidebar-item-name:hover {
Expand Down
62 changes: 54 additions & 8 deletions client/login-page.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
.back-button-block {
padding: 16px 0;
text-align: center;
}

.back-button-block a.handle-parent {
color: #fff;
line-height: 100%;
font-size: 100%;
display: block;
position: relative;
}

.back-button-block a.handle-parent:before, .back-button-block a.handle-parent:after {
content: '';
display: block;
height: 3px;
width: 6px;
background-color: #fff;
position: absolute;
top: calc(50% + 2px);
left: -16px;
transform: rotate(60deg);
}

.back-button-block a.handle-parent:after {
transform: rotate(-60deg);
top: calc(50% - 2px);
}

.logo-position {
display: flex;
justify-content: center;
}

.LoginSingle {
background-color: #181b2e;
background-image: radial-gradient(circle farthest-corner at 50% 50%, #13141e, #383577);
Expand All @@ -11,23 +46,23 @@

.LoginSingle ._wrapper {
background: rgba(0,0,0,0.5);
padding: 16pt 8pt;
padding: 16px 8px;
box-sizing: border-box;
height: 100%;
min-height: 100vh;
}

.LoginForm {
background: rgba(255,255,255,0.95);
background: #fff;
width: 100%;
box-sizing: border-box;
padding: 16pt 24pt;
padding: 16px;
margin: 0 auto;
box-shadow: 0 4px 24px rgba(0,0,0,0.24), 0 16px 32px rgba(0,0,0,0.16);
}

.LoginForm ._formIcon {
padding: 16pt;
padding: 16px;
}

.LoginForm ._formIcon img {
Expand All @@ -47,6 +82,11 @@
}

@media screen and (min-width: 768px) {

.back-button-block a.handle-parent:hover {
text-decoration: underline;
}

.LoginSingle {
min-height: 100vh;
height: 100%;
Expand All @@ -59,21 +99,27 @@
height: 100%;
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.LoginForm {
background: rgba(255,255,255,0.95);
max-width: 320px;
max-width: 288px;
box-sizing: border-box;
padding: 24px 40px;
padding: 24px;
margin: 0 auto;
box-shadow: 0 4px 24px rgba(0,0,0,0.24), 0 16px 32px rgba(0,0,0,0.16);
}

.LoginForm ._formIcon {
padding: 40px;
width: 100%;
height: 180px;
box-sizing: border-box;
background-image: url('../res/ui/auth-page-face-grey.png');
background-size: 128px;
background-repeat: no-repeat;
background-position: center;
}

.LoginForm ._formIcon img {
Expand Down
6 changes: 2 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
if (isset($_GET['ownp'])) {
$OwnOrigin = true;
define('OwnOrigin', true);
} else {
define('OwnOrigin', false);
}

# Checking VC-part file
Expand All @@ -42,7 +40,7 @@
if (file_exists($vc_path)) require_once $vc_path;

if ($SN->GetErrors()) $PageTitle = 'Ошибка';
if (!OwnOrigin) include_once TEMPLATES_DIR . DESIGN_TEMPLATE . TPL_PAGE_HEADER;
if (!$OwnOrigin) include_once TEMPLATES_DIR . DESIGN_TEMPLATE . TPL_PAGE_HEADER;

if ($SN->GetErrors()) {
$SN->PrintErrors();
Expand All @@ -54,6 +52,6 @@
}
}

if (!OwnOrigin) include_once TEMPLATES_DIR . DESIGN_TEMPLATE . TPL_PAGE_FOOTER;
if (!$OwnOrigin) include_once TEMPLATES_DIR . DESIGN_TEMPLATE . TPL_PAGE_FOOTER;

$SN->RegisterScriptDuration();
13 changes: 9 additions & 4 deletions mypanel/controller/start/dashboard.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?
$q = $pdo_db->query('SELECT IFNULL(app_icon_img, "ui/no-photo-lighter.png") AS app_icon_img, IFNULL(app_tech_path, false) AS fFlag, app_name FROM sanity_prop_apps ORDER BY sort DESC, app_name ASC');
$AllApps = [];
while ($f = $q->fetch(2)) {
$AllApps[] = $f;
# Destroy the call if this file called directly
defined('SN_Start') or die('Access denied.');

class StartDashboardController extends MyPanelController {
public function start() {
$this->SetTitle('Главная');
$this->Model('Start/Dashboard');
$this->data['apps'] = $this->model->getApps();
}
}

/*
Expand Down
14 changes: 14 additions & 0 deletions mypanel/model/start/dashboard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?
# Destroy the call if this file called directly
defined('SN_Start') or die('Access denied.');

class StartDashboardModel extends MyPanelModel {
public function getApps() {
$q = $this->pdo->query('SELECT IFNULL(app_icon_img, "ui/no-photo-lighter.png") AS app_icon_img, IFNULL(app_tech_path, false) AS fFlag, app_name FROM sanity_prop_apps ORDER BY sort DESC, app_name ASC');
$apps = [];
while ($f = $q->fetch(2)) {
$apps[] = $f;
}
return $apps;
}
}
4 changes: 3 additions & 1 deletion mypanel/view/modules/public.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@

<div class="data-box-field">
<a class="ui-mypanel-link" href="?act=modules/main/add">Добавить новый</a>
</div>
</div>

<div class="field-space"></div>
2 changes: 2 additions & 0 deletions mypanel/view/modules/public_create.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
</form>
</div>

<div class="field-space"></div>

<script>
function local_action_1() {
mr.SendForm('?act=core/modules/add', '#modules-main-add', function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?# Prevent access from direct calls
defined('SN_Start') or header('HTTP/1.1 404 Not Found');?>

<div class="uip-Background" style="background-image: url('/./res/ui/rIH860Hxws4.jpg');">
<div class="uip-AppsList">
<?$i = 0;
foreach ($AllApps as $v) {
foreach ($apps as $v) {
if ($i == 0) echo '<div class="uip-AppsRow">';?>
<a href="?act=<?=$v['fFlag']?>">
<div class="uip-AppShortcut <?if(!$v['fFlag']) echo 'disabled';?>">
Expand Down
3 changes: 0 additions & 3 deletions php.ini

This file was deleted.

5 changes: 0 additions & 5 deletions public/automat.php

This file was deleted.

49 changes: 49 additions & 0 deletions public/basket.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?# Destroy the call if this file called directly
defined('SN_Start') or die('Access denied.');?>

<div class="breadcrumb-container">
<div class="Breadcrumbs"><?=$PageTitle?></div>
</div>

<div id="basket_items" class="shop-basket-list">

</div>

<div class="shop-basket-control-buttons">
<button class="xver" id="basket-complete-btn" onclick="registerOrder();" disabled>Оформить</button>
<button class="xver white" onclick="removeBasket()">Очистить</button>
</div>

<script>
mr.Query('../get/ShopBasket/ConvertProducts', {items : sn.shop.orders.getItem('bin')}, function(response) {
var r = JSON.parse(response);
var a = {els:[]};
console.log(r);
if (r.result.length > 0) {
document.getElementById('basket-complete-btn').disabled = false;
}
for (var k in r.result) {
let preparedModel = {
attr:'shop-basket-item',
inner:[
{attr:'product-title', inner:[{inner:r.result[k].product_name}]},
{attr:'product-single-cost', inner:[{inner:r.result[k].cost + ' ₽'}]},
{attr:'product-count', inner:[{inner:String(r.result[k].count + ' шт')}]},
{attr:'product-total-cost', inner:[{inner:String(r.result[k].total_cost + ' ₽')}]},
]
}
a.els.push(preparedModel);
};
mr.Dom('#basket_items').CreateDOMbyRules(a);
});

function registerOrder() {
sn.shop.completeOrder();
location.href = '/orders/';
}

function removeBasket() {
sn.shop.clearOrder();
location.reload();
}
</script>
Loading

0 comments on commit 2ab96c5

Please sign in to comment.