admin panel temp settings
This commit is contained in:
parent
c05b7a63cf
commit
2959f79815
|
|
@ -6,6 +6,9 @@ class Plugin extends PluginBase
|
|||
{
|
||||
public function registerComponents()
|
||||
{
|
||||
return [
|
||||
'Romanah\Gokbakja\Components\Action' => 'action',
|
||||
];
|
||||
}
|
||||
|
||||
public function registerSettings()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,224 @@
|
|||
<?php
|
||||
|
||||
namespace Romanah\Gokbakja\Components;
|
||||
|
||||
use Cms\Classes\ComponentBase;
|
||||
use Romanah\Gokbakja\Models\Action as ActionModel;
|
||||
use Redirect;
|
||||
use Flash;
|
||||
|
||||
class Action extends ComponentBase
|
||||
{
|
||||
|
||||
|
||||
public function componentDetails()
|
||||
{
|
||||
return [
|
||||
'name' => 'Action',
|
||||
'description' => 'actions settings'
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function onCreateAction()
|
||||
{
|
||||
$user = \Auth::user();
|
||||
|
||||
$data = post();
|
||||
$actionType = $this->param("type");
|
||||
|
||||
if ($actionType == 'inbox') {
|
||||
|
||||
$createResult = new ActionModel();
|
||||
$createResult->product_id = $data["product_id"];
|
||||
$createResult->type = 'inbox';
|
||||
$createResult->amount = $data["quantity"];
|
||||
$createResult->stock_id = $data["stock_id"];
|
||||
$createResult->user_id = $user->id;
|
||||
|
||||
$createResult->save();
|
||||
// $createResult = DollorModel::create([]);
|
||||
|
||||
// dd($data);
|
||||
if ($createResult) {
|
||||
Flash::success("Action Inbox Ustunlikli Goshuldy");
|
||||
return Redirect::refresh();
|
||||
}
|
||||
} elseif ($actionType == 'outbox') {
|
||||
$qty = ActionModel::where("product_id", $data["product_id"])
|
||||
->where("stock_id", $data["stock_id"])
|
||||
->sum("amount");
|
||||
|
||||
// $productOutbox = ActionModel::where("product_id", $data["product_id"])
|
||||
// ->where("stock_id", $data["stock_id"])
|
||||
// ->where("type", "outbox")
|
||||
// ->sum("quantity");
|
||||
|
||||
// $productQuantity = $productInbox - $productOutbox;
|
||||
// dump($productQuantity);
|
||||
if ($qty >= $data["quantity"]) {
|
||||
$createResult = new ActionModel();
|
||||
$createResult->product_id = $data["product_id"];
|
||||
$createResult->type = 'outbox';
|
||||
$createResult->quantity = -$data["quantity"];
|
||||
$createResult->stock_id = $data["stock_id"];
|
||||
$createResult->user_id = $user->id;
|
||||
|
||||
$createResult->save();
|
||||
// $createResult = DollorModel::create([]);
|
||||
|
||||
// dd($data);
|
||||
if ($createResult) {
|
||||
Flash::success("Action Outbox Ustunlikli Goshuldy");
|
||||
return Redirect::refresh();
|
||||
}
|
||||
} else {
|
||||
Flash::error("Данного товара нет в наличии");
|
||||
return Redirect::refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function onUpdateAction()
|
||||
{
|
||||
$user = \Auth::user();
|
||||
$data = post();
|
||||
|
||||
$updateResult = ActionModel::where('id', $data["id"])
|
||||
->update(array(
|
||||
'product_id' => $data["product_id"],
|
||||
'amount' => $data["quantity"],
|
||||
'stock_id' => $data["stock_id"],
|
||||
'user_id' => $user->id,
|
||||
));
|
||||
// $createResult = DollorModel::create([]);
|
||||
|
||||
// dd($data);
|
||||
if ($updateResult) {
|
||||
Flash::success("Action Ustunlikli Uytgedildi");
|
||||
return Redirect::refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function onGetAction()
|
||||
{
|
||||
$id = post('id');
|
||||
return ActionModel::where('id', $id)->first();
|
||||
}
|
||||
|
||||
public function onDeleteAction()
|
||||
{
|
||||
$id = post('id');
|
||||
|
||||
$item = ActionModel::Find($id);
|
||||
$item->delete();
|
||||
|
||||
if ($item) {
|
||||
Flash::success("Action Ustunlikli Pozuldy");
|
||||
return Redirect::refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// public function onDeleteSellerAction()
|
||||
// {
|
||||
// $id = post('id');
|
||||
|
||||
// $item = SellerActionModel::Find($id);
|
||||
// $item->delete();
|
||||
|
||||
// if ($item) {
|
||||
// Flash::success("Action Ustunlikli Pozuldy");
|
||||
// return Redirect::refresh();
|
||||
// }
|
||||
// }
|
||||
|
||||
// public function onGetSellerAction()
|
||||
// {
|
||||
// $id = post('id');
|
||||
// return SellerActionModel::where('id', $id)->first();
|
||||
// }
|
||||
|
||||
|
||||
// public function onCreateSellerAction()
|
||||
// {
|
||||
// $user = \Auth::user();
|
||||
|
||||
// $data = post();
|
||||
|
||||
|
||||
// $qty = ActionModel::where("product_id", $data["product_id"])
|
||||
// ->where("stock_id", $data["stock_id"])
|
||||
// ->sum("quantity");
|
||||
|
||||
|
||||
// if ($qty >= $data["quantity"]) {
|
||||
// $createResult = new ActionModel();
|
||||
// $createResult->product_id = $data["product_id"];
|
||||
// $createResult->type = 'outbox';
|
||||
// $createResult->quantity = -$data["quantity"];
|
||||
// $createResult->stock_id = $data["stock_id"];
|
||||
// $createResult->user_id = $user->id;
|
||||
|
||||
// $createResult->save();
|
||||
|
||||
|
||||
// $createSellerResult = new SellerActionModel();
|
||||
// $createSellerResult->seller_id = $data["seller_id"];
|
||||
// $createSellerResult->product_id = $data["product_id"];
|
||||
// $createSellerResult->quantity = $data["quantity"];
|
||||
// $createSellerResult->stock_id = $data["stock_id"];
|
||||
// $createSellerResult->user_id = $user->id;
|
||||
|
||||
// $createSellerResult->save();
|
||||
// // $createResult = DollorModel::create([]);
|
||||
|
||||
// // dd($data);
|
||||
// if ($createResult && $createSellerResult) {
|
||||
// Flash::success("Action Outbox Ustunlikli Goshuldy");
|
||||
// return Redirect::refresh();
|
||||
// }
|
||||
// } else {
|
||||
// Flash::error("Данного товара нет в наличии");
|
||||
// return Redirect::refresh();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// public function onUpdateSellerAction()
|
||||
// {
|
||||
// $user = \Auth::user();
|
||||
// $data = post();
|
||||
|
||||
|
||||
// $qty = ActionModel::where("product_id", $data["product_id"])
|
||||
// ->where("stock_id", $data["stock_id"])
|
||||
// ->sum("quantity");
|
||||
|
||||
|
||||
// if ($qty >= $data["quantity"]) {
|
||||
|
||||
// $updateResult = SellerActionModel::where('id', $data["id"])
|
||||
// ->update(array(
|
||||
// 'product_id' => $data["product_id"],
|
||||
// 'quantity' => $data["quantity"],
|
||||
// 'stock_id' => $data["stock_id"],
|
||||
// 'user_id' => $user->id,
|
||||
// ));
|
||||
// // $createResult = DollorModel::create([]);
|
||||
|
||||
// // dd($data);
|
||||
// if ($updateResult) {
|
||||
// Flash::success("Action Ustunlikli Uytgedildi");
|
||||
// return Redirect::refresh();
|
||||
// }
|
||||
// } else {
|
||||
// Flash::error("Данного товара нет в наличии");
|
||||
// return Redirect::refresh();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
items:
|
||||
-
|
||||
title: Главная
|
||||
title: 'Baş Sahypa'
|
||||
nesting: null
|
||||
type: url
|
||||
url: /2023
|
||||
|
|
@ -13,21 +13,106 @@ items:
|
|||
cssClass: ri-home-gear-line
|
||||
isExternal: '0'
|
||||
-
|
||||
title: Склады
|
||||
type: url
|
||||
url: /q
|
||||
title: Skladlar
|
||||
type: cms-page
|
||||
code: ''
|
||||
reference: stocks
|
||||
viewBag:
|
||||
isHidden: '0'
|
||||
cssClass: ri-store-2-line
|
||||
isExternal: '0'
|
||||
-
|
||||
title: доллар
|
||||
title: 'Sklad Hereketleri'
|
||||
type: url
|
||||
url: /w
|
||||
url: '#a'
|
||||
code: ''
|
||||
viewBag:
|
||||
isHidden: '0'
|
||||
cssClass: ri-money-dollar-circle-line
|
||||
cssClass: ri-arrow-up-down-line
|
||||
isExternal: '0'
|
||||
items:
|
||||
-
|
||||
title: Hereketler
|
||||
type: cms-page
|
||||
code: ''
|
||||
reference: product/actions
|
||||
viewBag:
|
||||
isHidden: '0'
|
||||
cssClass: ''
|
||||
isExternal: '0'
|
||||
-
|
||||
title: 'Täze Haryt Sal'
|
||||
type: url
|
||||
url: /product/actions/inbox
|
||||
code: ''
|
||||
viewBag:
|
||||
isHidden: '0'
|
||||
cssClass: ''
|
||||
isExternal: '0'
|
||||
-
|
||||
title: Önümçilik
|
||||
nesting: null
|
||||
type: url
|
||||
url: /w
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
isHidden: '0'
|
||||
cssClass: ri-bar-chart-2-line
|
||||
isExternal: '0'
|
||||
items:
|
||||
-
|
||||
title: 'Çig Mal Sarp Ediş'
|
||||
nesting: null
|
||||
type: url
|
||||
url: /ss
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
isHidden: '0'
|
||||
cssClass: ''
|
||||
isExternal: '0'
|
||||
-
|
||||
title: 'Enjamlar Boýunça'
|
||||
nesting: null
|
||||
type: url
|
||||
url: /ee
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
isHidden: '0'
|
||||
cssClass: ''
|
||||
isExternal: '0'
|
||||
-
|
||||
title: Tikinçiler
|
||||
nesting: null
|
||||
type: url
|
||||
url: /tt
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
isHidden: '0'
|
||||
cssClass: ''
|
||||
isExternal: '0'
|
||||
-
|
||||
title: Sargytlar
|
||||
nesting: null
|
||||
type: url
|
||||
url: /ss
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
viewBag:
|
||||
isHidden: '0'
|
||||
cssClass: ri-shopping-cart-2-line
|
||||
isExternal: '0'
|
||||
name: aside
|
||||
|
|
|
|||
|
|
@ -1,6 +1,132 @@
|
|||
title = "Home"
|
||||
url = "/"
|
||||
url = "/:year"
|
||||
layout = "platform_main"
|
||||
is_hidden = 0
|
||||
==
|
||||
HOME
|
||||
<?php
|
||||
function onStart(){
|
||||
|
||||
$year = $this->param("year");
|
||||
$this["year"] = $this->param("year");
|
||||
|
||||
}
|
||||
?>
|
||||
==
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-flex align-items-center justify-content-between">
|
||||
<h3 class="mb-0">GOK BAKJA</h3>
|
||||
<!--
|
||||
<div class="page-title-right">
|
||||
<form action="/year/dynamic" class="search" method="POST">
|
||||
<input type="text" class="form-control" type="number" name="year" placeholder="Введите год"
|
||||
aria-label="Введите год">
|
||||
</form>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title mb-4">Statistika hasabat {{year}} ýyl </h4>
|
||||
|
||||
<div id="line_chart_datalabel" class="apex-charts" dir="ltr"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end card-->
|
||||
</div>
|
||||
|
||||
<!-- end col -->
|
||||
</div><!-- end col -->
|
||||
|
||||
{% put scripts %}
|
||||
|
||||
<!-- apexcharts -->
|
||||
<script src="{{'assets/libs/apexcharts/apexcharts.min.js'|theme}}"></script>
|
||||
|
||||
<script>
|
||||
var options = {
|
||||
chart: {
|
||||
height: 380,
|
||||
type: "line",
|
||||
zoom: {
|
||||
enabled: !1
|
||||
},
|
||||
toolbar: {
|
||||
show: !1
|
||||
}
|
||||
},
|
||||
colors: ["#6fbe36", "#ff5d5d"],
|
||||
dataLabels: {
|
||||
enabled: !1
|
||||
},
|
||||
stroke: {
|
||||
width: [3, 3],
|
||||
curve: "straight"
|
||||
},
|
||||
series: [{
|
||||
name: "Öndürilen Önüm ",
|
||||
data: ['{{ordersAccept1}}', '{{ordersAccept2}}', '{{ordersAccept3}}', '{{ordersAccept4}}', '{{ordersAccept5}}', '{{ordersAccept6}}', '{{ordersAccept7}}', '{{ordersAccept8}}', '{{ordersAccept9}}', '{{ordersAccept10}}', '{{ordersAccept11}}', '{{ordersAccept12}}']
|
||||
}, {
|
||||
name: "Brak Önüm ",
|
||||
data: ['{{ordersCancel1}}', '{{ordersCancel2}}', '{{ordersCancel3}}', '{{ordersCancel4}}', '{{ordersCancel5}}', '{{ordersCancel6}}', '{{ordersCancel7}}', '{{ordersCancel8}}', '{{ordersCancel9}}', '{{ordersCancel10}}', '{{ordersCancel11}}', '{{ordersCancel12}}']
|
||||
}],
|
||||
title: {
|
||||
text: "Hasabat",
|
||||
align: "left"
|
||||
},
|
||||
grid: {
|
||||
row: {
|
||||
colors: ["transparent", "transparent"],
|
||||
opacity: .2
|
||||
},
|
||||
borderColor: "#f1f1f1"
|
||||
},
|
||||
markers: {
|
||||
style: "inverted",
|
||||
size: 6
|
||||
},
|
||||
xaxis: {
|
||||
categories: ['Yanwar', 'Fewral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'Awgust', 'Sentyabr', 'Oktyabr', 'Noyabr', 'Dekabr'],
|
||||
title: {
|
||||
text: "Aýlar"
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
title: {
|
||||
text: ""
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
position: "top",
|
||||
horizontalAlign: "right",
|
||||
floating: !0,
|
||||
offsetY: -25,
|
||||
offsetX: -5
|
||||
},
|
||||
responsive: [{
|
||||
breakpoint: 600,
|
||||
options: {
|
||||
chart: {
|
||||
toolbar: {
|
||||
show: !1
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: !1
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
chart = new ApexCharts(document.querySelector("#line_chart_datalabel"), options);
|
||||
chart.render();
|
||||
</script>
|
||||
{% endput %}
|
||||
|
|
@ -0,0 +1,244 @@
|
|||
title = "product/actions"
|
||||
url = "/product/actions/:type?"
|
||||
layout = "platform_main"
|
||||
is_hidden = 0
|
||||
|
||||
[builderList]
|
||||
modelClass = "Romanah\Gokbakja\Models\Product"
|
||||
scope = "-"
|
||||
scopeValue = "{{ :scope }}"
|
||||
displayColumn = "id"
|
||||
noRecordsMessage = "No records found"
|
||||
detailsPage = "-"
|
||||
detailsUrlParameter = "id"
|
||||
pageNumber = "{{ :page }}"
|
||||
sortColumn = "id"
|
||||
sortDirection = "desc"
|
||||
|
||||
[builderList builderList2]
|
||||
modelClass = "Romanah\Gokbakja\Models\Stock"
|
||||
scope = "-"
|
||||
scopeValue = "{{ :scope }}"
|
||||
displayColumn = "id"
|
||||
noRecordsMessage = "No records found"
|
||||
detailsPage = "-"
|
||||
detailsUrlParameter = "id"
|
||||
pageNumber = "{{ :page }}"
|
||||
sortColumn = "id"
|
||||
sortDirection = "desc"
|
||||
|
||||
[action]
|
||||
==
|
||||
<?php
|
||||
function onStart(){
|
||||
$type = $this->param("type");
|
||||
$this["type"] = $this->param("type");
|
||||
|
||||
//$this["products"] = '';
|
||||
//dump($catId);
|
||||
|
||||
if($type){
|
||||
$this["actions"] = Romanah\Gokbakja\Models\Action::orderBy("id", "desc")
|
||||
->with(['stock'])
|
||||
->where("type", $type)
|
||||
->get();
|
||||
}else{
|
||||
$this["actions"] = Romanah\Gokbakja\Models\Action::orderBy("id", "desc")
|
||||
->with(['stock'])
|
||||
->get();
|
||||
}
|
||||
}
|
||||
?>
|
||||
==
|
||||
{% put styles %}
|
||||
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{'assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{'assets/libs/datatables.net-select-bs4/css/select.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link href="{{'assets/libs/select2/css/select2.min.css'|theme}}" rel="stylesheet" type="text/css">
|
||||
|
||||
<link href="{{'assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css'|theme}}" rel="stylesheet">
|
||||
<link href="{{'assets/libs/spectrum-colorpicker2/spectrum.min.css'|theme}}" rel="stylesheet" type="text/css">
|
||||
<link href="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css'|theme}}" rel="stylesheet">
|
||||
{% endput %}
|
||||
|
||||
{% set products = builderList.records %}
|
||||
{% set stocks = builderList2.records %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Harytlar</h3>
|
||||
<p class="card-title-desc" style="color: #6c6ff5;">{{type}}</p>
|
||||
</div>
|
||||
<div class="col-md-6" style="text-align: right;">
|
||||
{% if type == 'inbox' %}
|
||||
<button onClick="createData();" type="button" class="btn btn-primary waves-effect waves-light"
|
||||
data-bs-toggle="offcanvas" data-bs-target="#offcanvasBottom"
|
||||
aria-controls="offcanvasBottom">
|
||||
<i class="ri-add-line align-middle ms-2" style="font-size: 17px;"></i> Täze Hereket
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
|
||||
style="border-collapse: collapse; border-spacing: 0; width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%;">№</th>
|
||||
<th>Haryt</th>
|
||||
<th>Görnüşi</th>
|
||||
<th>Mukdary</th>
|
||||
<th>Senesi</th>
|
||||
<th>Sklad</th>
|
||||
<th>Sazlamalar</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for key, record in actions %}
|
||||
<tr>
|
||||
<td style="font-weight: bold;width: 5%;">{{key + 1}}</td>
|
||||
<td><a
|
||||
style="font-weight: bold;color: #0005c5;">{{record.product.name}}</a></td>
|
||||
<td style="text-align: center;">
|
||||
<span class="badge badge-soft-{% if record.type == 'inbox' %}success {% else %}danger {% endif %}" style="font-size: 14px;">{{record.type}}</span></td>
|
||||
<td style="color: #500101;font-weight: bold;">{{record.amount}}</td>
|
||||
<td>{{record.created_at|date('d.m.Y')}}</td>
|
||||
<td>{{record.stock.name}}</td>
|
||||
<td>
|
||||
<div style="display: flex;justify-content: center;">
|
||||
<div style="margin-right: 10px;">
|
||||
<a onClick="getData({{record.id}});" type="button" class="btn btn-warning waves-effect waves-light"
|
||||
data-bs-toggle="offcanvas" data-bs-target="#offcanvasBottom"
|
||||
aria-controls="offcanvasBottom"
|
||||
style="padding-top: 5px;padding-bottom: 5px;">
|
||||
<i class="ri-pencil-line align-middle me-2"></i> Обновить
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a type="button" data-request-confirm="Вы уверены? Удалить этот продукт"
|
||||
data-request-data="id:{{record.id}}"
|
||||
data-request="onDeleteAction"
|
||||
class="btn btn-danger waves-effect waves-light"
|
||||
style="padding-top: 5px;padding-bottom: 5px;">
|
||||
<i class="ri-close-line align-middle me-2"></i> Удалить
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th style="width: 5%;">№</th>
|
||||
<th>Haryt</th>
|
||||
<th>Görnüşi</th>
|
||||
<th>Mukdary</th>
|
||||
<th>Senesi</th>
|
||||
<th>Sklad</th>
|
||||
<th>Sazlamalar</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="offcanvas offcanvas-top" id="offcanvasBottom" aria-labelledby="offcanvasBottomLabel">
|
||||
<div class="offcanvas-header">
|
||||
<h5 id="offcanvasBottomLabel">Täze Hereket</h5>
|
||||
<button onClick="createData();" type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body">
|
||||
<form class="needs-validation" novalidate data-request="onCreateAction" id="prodForm">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="mb-3">
|
||||
<label for="validationCustom01" class="form-label">Выберите продукт</label>
|
||||
<select class="form-control select2" name="product_id" id="productId">
|
||||
<option value="0">Выберите</option>
|
||||
|
||||
{% for record in products %}
|
||||
<option value="{{record.id}}" style="text-transform: capitalize;">{{record.name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="mb-3">
|
||||
<label for="validationCustom02" class="form-label">Количество</label>
|
||||
<input type="text" class="form-control" id="validationCustom02" placeholder="Количество"
|
||||
name="quantity" required>
|
||||
<div class="valid-feedback">
|
||||
Правильно
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="validationCustom03" class="form-label">Склад</label>
|
||||
<select class="form-control select2" name="stock_id" id="stockId">
|
||||
<option value="0">Выберите</option>
|
||||
|
||||
{% for record in stocks %}
|
||||
<option value="{{record.id}}" style="text-transform: capitalize;">{{record.name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<input name="id" type="hidden" value="">
|
||||
<div>
|
||||
<button class="btn btn-primary" type="submit" id="formBtn">Добавить</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% put scripts %}
|
||||
<script>
|
||||
function createData() {
|
||||
$('#prodForm').attr('data-request', 'onCreateAction');
|
||||
$('#formBtn').html('Добавить');
|
||||
|
||||
$('input[name=id]').val('');
|
||||
$("#productId").select2().val(0).trigger("change");
|
||||
$('input[name=quantity]').val('');
|
||||
$("#stockId").select2().val(0).trigger("change");
|
||||
}
|
||||
|
||||
function getData(id) {
|
||||
$(this).request('onGetAction', {
|
||||
data: {id: id},
|
||||
success: function (data) {
|
||||
|
||||
$('#prodForm').attr('data-request', 'onUpdateAction');
|
||||
$('#formBtn').html('Обновить');
|
||||
|
||||
$('input[name=id]').val(data.id);
|
||||
$("#productId").select2().val(data.product_id).trigger("change");
|
||||
$('input[name=quantity]').val(data.quantity);
|
||||
$("#stockId").select2().val(data.stock_id).trigger("change");
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
|
||||
<script src="{{'assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js'|theme}}"></script>
|
||||
<script src="{{'assets/libs/spectrum-colorpicker2/spectrum.min.js'|theme}}"></script>
|
||||
<script src="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js'|theme}}"></script>
|
||||
<script src="{{'assets/libs/admin-resources/bootstrap-filestyle/bootstrap-filestyle.min.js'|theme}}"></script>
|
||||
<script src="{{'assets/libs/bootstrap-maxlength/bootstrap-maxlength.min.js'|theme}}"></script>
|
||||
|
||||
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
|
||||
{% endput %}
|
||||
|
||||
{% partial 'dataTableJs' %}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
title = "product/stock"
|
||||
url = "/product/stock/:stockId"
|
||||
layout = "platform_main"
|
||||
is_hidden = 0
|
||||
==
|
||||
<?php
|
||||
function onStart(){
|
||||
$stockId = $this->param("stockId");
|
||||
|
||||
$this["actions"] = Romanah\Gokbakja\Models\Action::select('romanah_gokbakja_action.*')
|
||||
->where("stock_id", $stockId)
|
||||
->addSelect(DB::raw("SUM(amount) as quantity"))
|
||||
->groupBy('romanah_gokbakja_action.product_id')
|
||||
->get();
|
||||
// dd($this["actions"]);
|
||||
}
|
||||
?>
|
||||
==
|
||||
|
||||
{% put styles %}
|
||||
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{'assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{'assets/libs/datatables.net-select-bs4/css/select.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link href="{{'assets/libs/select2/css/select2.min.css'|theme}}" rel="stylesheet" type="text/css">
|
||||
|
||||
<link href="{{'assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css'|theme}}" rel="stylesheet">
|
||||
<link href="{{'assets/libs/spectrum-colorpicker2/spectrum.min.css'|theme}}" rel="stylesheet" type="text/css">
|
||||
<link href="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css'|theme}}" rel="stylesheet">
|
||||
{% endput %}
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3 class="card-title" style="font-size: 22px;color: #1e2038;text-transform: capitalize;">
|
||||
Harytlar</h3>
|
||||
<p class="card-title-desc" style="color: #6c6ff5;">sklad</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
|
||||
style="border-collapse: collapse; border-spacing: 0; width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%;">№</th>
|
||||
<th>Haryt</th>
|
||||
<th>Hereket</th>
|
||||
<th>Mukdary</th>
|
||||
<th>Sene</th>
|
||||
<th>Sklad</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for key, record in actions %}
|
||||
<tr>
|
||||
<td style="font-weight: bold;width: 5%;">{{key + 1}}</td>
|
||||
<td><a href="{{'action/product'|page({prodId:record.product_id})}}"
|
||||
style="font-weight: bold;color: #0005c5;">{{record.product.name}}</a></td>
|
||||
<td style="text-align: center;">
|
||||
<span class="badge badge-soft-{% if record.type == 'inbox' %}success {% else %}danger {% endif %}" style="font-size: 14px;">{{record.type}}</span></td>
|
||||
<td style="color: #500101;font-weight: bold;">{{record.quantity}} {{record.product.attribute.name}}</td>
|
||||
<td>{{record.created_at|date('d.m.Y')}}</td>
|
||||
<td>{{record.stock.name}}</td>
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th style="width: 5%;">№</th>
|
||||
<th>Haryt</th>
|
||||
<th>Hereket</th>
|
||||
<th>Mukdary</th>
|
||||
<th>Sene</th>
|
||||
<th>Sklad</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{% put scripts %}
|
||||
|
||||
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
|
||||
<script src="{{'assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js'|theme}}"></script>
|
||||
<script src="{{'assets/libs/spectrum-colorpicker2/spectrum.min.js'|theme}}"></script>
|
||||
<script src="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js'|theme}}"></script>
|
||||
<script src="{{'assets/libs/admin-resources/bootstrap-filestyle/bootstrap-filestyle.min.js'|theme}}"></script>
|
||||
<script src="{{'assets/libs/bootstrap-maxlength/bootstrap-maxlength.min.js'|theme}}"></script>
|
||||
|
||||
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
|
||||
{% endput %}
|
||||
|
||||
{% partial 'dataTableJs' %}
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
title = "Stocks"
|
||||
url = "/stocks"
|
||||
layout = "platform_main"
|
||||
is_hidden = 0
|
||||
|
||||
[builderList]
|
||||
modelClass = "Romanah\Gokbakja\Models\Stock"
|
||||
scope = "-"
|
||||
scopeValue = "{{ :scope }}"
|
||||
displayColumn = "id"
|
||||
noRecordsMessage = "No records found"
|
||||
detailsPage = "-"
|
||||
detailsUrlParameter = "id"
|
||||
pageNumber = "{{ :page }}"
|
||||
sortColumn = "id"
|
||||
sortDirection = "desc"
|
||||
==
|
||||
{% set records = builderList.records %}
|
||||
{% set displayColumn = builderList.displayColumn %}
|
||||
{% set noRecordsMessage = builderList.noRecordsMessage %}
|
||||
{% set detailsPage = builderList.detailsPage %}
|
||||
{% set detailsKeyColumn = builderList.detailsKeyColumn %}
|
||||
{% set detailsUrlParameter = builderList.detailsUrlParameter %}
|
||||
|
||||
{% put styles %}
|
||||
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet"
|
||||
type="text/css" />
|
||||
<link href="{{'assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'|theme}}" rel="stylesheet"
|
||||
type="text/css" />
|
||||
<link href="{{'assets/libs/datatables.net-select-bs4/css/select.bootstrap4.min.css'|theme}}" rel="stylesheet"
|
||||
type="text/css" />
|
||||
{% endput %}
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Skladlar</h3>
|
||||
<p class="card-title-desc" style="color: #6c6ff5;">Hasabat</p>
|
||||
</div>
|
||||
<!-- <div class="col-md-6" style="text-align: right;">
|
||||
<button type="button" class="btn btn-primary waves-effect waves-light"
|
||||
data-bs-toggle="offcanvas" data-bs-target="#offcanvasBottom"
|
||||
aria-controls="offcanvasBottom">
|
||||
<i class="ri-add-line align-middle ms-2" style="font-size: 17px;"></i> Добавить
|
||||
</button>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
|
||||
style="border-collapse: collapse; border-spacing: 0; width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%;">№</th>
|
||||
<th>Ady</th>
|
||||
<th>Bellik</th>
|
||||
<!-- <th>Настройки</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{% for key, record in records %}
|
||||
<tr>
|
||||
<td style="font-weight: bold;">{{key + 1}}</td>
|
||||
<td><a href="{{'product/stock'|page({stockId:record.id})}}"
|
||||
style="font-weight: bold;">{{record.name}}</a>
|
||||
</td>
|
||||
<td>{{record.note}}</td>
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th style="width: 5%;">№</th>
|
||||
<th>Ady</th>
|
||||
<th>Bellik</th>
|
||||
<!-- <th>Настройки</th> -->
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="offcanvas offcanvas-top" tabindex="-1" id="offcanvasBottom"
|
||||
aria-labelledby="offcanvasBottomLabel">
|
||||
<div class="offcanvas-header">
|
||||
<h5 id="offcanvasBottomLabel">Обновить Склады</h5>
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body">
|
||||
<form class="needs-validation" novalidate action="/stocks/update" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="mb-3">
|
||||
<label for="validationCustom01" class="form-label">Имя Склад</label>
|
||||
<input type="text" class="form-control" id="validationCustom01"
|
||||
placeholder="Имя Склад" name="name" value=""
|
||||
required>
|
||||
<div class="valid-feedback">
|
||||
Правильно
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-3">
|
||||
<label for="validationCustom02" class="form-label">Описание</label>
|
||||
<input type="text" class="form-control" name="desc"
|
||||
id="validationCustom02" placeholder="Описание"
|
||||
value="" required>
|
||||
<div class="valid-feedback">
|
||||
Правильно
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" value="" name="id">
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-primary" type="submit">Обновить</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="offcanvas offcanvas-top" tabindex="-1" id="offcanvasBottom"
|
||||
aria-labelledby="offcanvasBottomLabel">
|
||||
<div class="offcanvas-header">
|
||||
<h5 id="offcanvasBottomLabel">Добавить Склад</h5>
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body">
|
||||
<form class="needs-validation" novalidate action="/stocks/create" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="mb-3">
|
||||
<label for="validationCustom01" class="form-label">Имя Склад</label>
|
||||
<input type="text" class="form-control" id="validationCustom01"
|
||||
placeholder="Имя Склад" name="name" required>
|
||||
<div class="valid-feedback">
|
||||
Правильно
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-3">
|
||||
<label for="validationCustom02" class="form-label">Описание</label>
|
||||
<input type="text" class="form-control" name="desc" id="validationCustom02"
|
||||
placeholder="Описание" required>
|
||||
<div class="valid-feedback">
|
||||
Правильно
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-primary" type="submit">Добавить</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% partial 'dataTableJs' %}
|
||||
|
|
@ -110,7 +110,7 @@
|
|||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<script>document.write(new Date().getFullYear())</script> © Dessange.
|
||||
<script>document.write(new Date().getFullYear())</script> © Gok Bakja.
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<!-- <div class="text-sm-end d-none d-sm-block">
|
||||
|
|
|
|||
Loading…
Reference in New Issue