crud forms ajax

This commit is contained in:
Shohrat 2023-10-05 01:51:27 +05:00
parent 0ed8496a32
commit 3bfaf68222
46 changed files with 1211 additions and 100 deletions

View File

@ -9,6 +9,8 @@ class Plugin extends PluginBase
return [
'Romanah\Gokbakja\Components\Action' => 'action',
'Romanah\Gokbakja\Components\Production' => 'production',
'Romanah\Gokbakja\Components\Sewer' => 'sewer',
'Romanah\Gokbakja\Components\Order' => 'order',
];
}

View File

@ -0,0 +1,118 @@
<?php
namespace Romanah\Gokbakja\Components;
use Cms\Classes\ComponentBase;
use Romanah\Gokbakja\Models\Production as ProductionModel;
use Romanah\Gokbakja\Models\PivotProduction as PivotProductionModel;
use Romanah\Gokbakja\Models\Order as OrderModel;
use Romanah\Gokbakja\Models\Shipping as ShippingModel;
use Redirect;
use Carbon\Carbon;
use Flash;
use DB;
class Order extends ComponentBase
{
public function componentDetails()
{
return [
'name' => 'Order',
'description' => 'Order settings'
];
}
public function onRender(){
$html_data = '';
$orderDatas = OrderModel::with(["client", "shipping"])->orderBy('id', 'DESC')->get();
for ($x = 0; $x < count($orderDatas); $x++) {
$html_data .= '<tr>
<td style="font-weight: bold;">'.($x+1).'</td>
<td><a href="#" style="font-weight: bold;">'.$orderDatas[$x]->client->name.'</a></td>
<td>'.$orderDatas[$x]->client->country.'</td>
<td>'.$orderDatas[$x]->amount.' kg</td>
<td><span class="badge badge-soft-success"
style="font-size: 14px;">'.$orderDatas[$x]->price.'</span>
</td>
<td><span class="badge badge-soft-primary"
style="font-size: 14px;">'.$orderDatas[$x]->shipping->status.'</span>
</td>
<td>'.$orderDatas[$x]->note.'</td>
</tr>';
}
return $html_data;
}
public function onCreateOrder()
{
$currentDate = Carbon::now()->timezone('UTC +05:00');
$currentDateFormat = $currentDate->format('Y-m-d');
$data = post();
$createOrder = new OrderModel();
$createOrder->client_id = $data["client_id"];
$createOrder->amount = $data["amount"];
$createOrder->price = $data["price"];
$createOrder->note = $data["note"];
$createOrder->shipping_id = 0;
$createOrder->save();
$createShipping = new ShippingModel();
$createShipping->order_id = $createOrder->id;
$createShipping->status = 'note_loaded';
$createShipping->employee_id = 0;
$createShipping->place_now = "Aşgabat";
$createShipping->loaded_amount = 0;
$createShipping->note = "";
$createShipping->save();
$createOrder->shipping_id = $createShipping->id;
$createOrder->save();
$html_data = '';
$orderDatas = OrderModel::with(["client", "shipping"])->orderBy('id', 'DESC')->get();
for ($x = 0; $x < count($orderDatas); $x++) {
// dd($orderDatas[$x]->shipping->status);
$html_data .= '<tr>
<td style="font-weight: bold;">'.($x+1).'</td>
<td><a href="#" style="font-weight: bold;">'.$orderDatas[$x]->client->name.'</a></td>
<td>'.$orderDatas[$x]->client->country.'</td>
<td>'.$orderDatas[$x]->amount.' kg</td>
<td><span class="badge badge-soft-success"
style="font-size: 14px;">'.$orderDatas[$x]->price.'</span>
</td>
<td><span class="badge badge-soft-primary"
style="font-size: 14px;">'.$orderDatas[$x]->shipping->status.'</span>
</td>
<td>'.$orderDatas[$x]->note.'</td>
</tr>';
}
if($createOrder){
Flash::success("Sargyt Ustunlikli Goşuldy");
return [
'#order_datas' => $html_data,
];
}else{
return Flash::error("Yalnyshlyk bar!!");
}
}
}

View File

@ -0,0 +1,105 @@
<?php
namespace Romanah\Gokbakja\Components;
use Cms\Classes\ComponentBase;
use Romanah\Gokbakja\Models\Production as ProductionModel;
use Romanah\Gokbakja\Models\PivotProduction as PivotProductionModel;
use Romanah\Gokbakja\Models\SewerProduction as SewerModel;
use Redirect;
use Carbon\Carbon;
use Flash;
use DB;
class Sewer extends ComponentBase
{
public $sewers;
public function componentDetails()
{
return [
'name' => 'Sewer',
'description' => 'Sewer settings'
];
}
// public function onRun() {
// $this->sewers = $this->loadSewers();
// }
public function onRender(){
$html_data = '';
$sewerDatas = SewerModel::with("employee")->orderBy('id', 'DESC')->get();
for ($x = 0; $x < count($sewerDatas); $x++) {
$html_data .= '<tr>
<td style="font-weight: bold;">'.($x+1).'</td>
<td><a href="#" style="font-weight: bold;">'.$sewerDatas[$x]->employee->name.'</a></td>
<td>'.$sewerDatas[$x]->created_at->format('m.d.Y').'</td>
<td><span class="badge badge-soft-success"
style="font-size: 14px;">'.$sewerDatas[$x]->amount.' kg</span>
</td>
<td>'.$sewerDatas[$x]->produced_bag_qty.'</td>
<td>'.$sewerDatas[$x]->note.'</td>
</tr>';
}
return $html_data;
}
public function onCreateSewerProduction()
{
$currentDate = Carbon::now()->timezone('UTC +05:00');
$currentDateFormat = $currentDate->format('Y-m-d');
$data = post();
$createSewer = new SewerModel();
$createSewer->employee_id = $data["employee_id"];
$createSewer->amount = $data["amount"];
$createSewer->produced_bag_qty = $data["produced_bag_qty"];
$createSewer->note = $data["note"];
$createSewer->save();
$html_data = '';
$sewerDatas = SewerModel::with("employee")->orderBy('id', 'DESC')->get();
for ($x = 0; $x < count($sewerDatas); $x++) {
$html_data .= '<tr>
<td style="font-weight: bold;">'.($x+1).'</td>
<td><a href="#" style="font-weight: bold;">'.$sewerDatas[$x]->employee->name.'</a></td>
<td>'.$sewerDatas[$x]->created_at->format('m.d.Y').'</td>
<td><span class="badge badge-soft-success"
style="font-size: 14px;">'.$sewerDatas[$x]->amount.' kg</span>
</td>
<td>'.$sewerDatas[$x]->produced_bag_qty.'</td>
<td>'.$sewerDatas[$x]->note.'</td>
</tr>';
}
if($createSewer){
Flash::success("Hasabat Ustunlikli Goşuldy");
return [
'#sewer_datas' => $html_data,
];
}else{
return Flash::error("Yalnyshlyk bar!!");
}
}
}

View File

@ -0,0 +1,18 @@
<?php namespace Romanah\Gokbakja\Controllers;
use Backend\Classes\Controller;
use BackendMenu;
class Client extends Controller
{
public $implement = [ 'Backend\Behaviors\ListController', 'Backend\Behaviors\FormController' ];
public $listConfig = 'config_list.yaml';
public $formConfig = 'config_form.yaml';
public function __construct()
{
parent::__construct();
BackendMenu::setContext('Romanah.Gokbakja', 'main-menu-item', 'side-menu-item5');
}
}

View File

@ -0,0 +1,18 @@
<div data-control="toolbar">
<a href="<?= Backend::url('romanah/gokbakja/client/create') ?>" class="btn btn-primary oc-icon-plus"><?= e(trans('backend::lang.form.create')) ?></a>
<button
class="btn btn-default oc-icon-trash-o"
disabled="disabled"
onclick="$(this).data('request-data', {
checked: $('.control-list').listWidget('getChecked')
})"
data-request="onDelete"
data-request-confirm="<?= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
data-trigger-action="enable"
data-trigger=".control-list input[type=checkbox]"
data-trigger-condition="checked"
data-request-success="$(this).prop('disabled', true)"
data-stripe-load-indicator>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>
</div>

View File

@ -0,0 +1,10 @@
name: Client
form: $/romanah/gokbakja/models/client/fields.yaml
modelClass: Romanah\Gokbakja\Models\Client
defaultRedirect: romanah/gokbakja/client
create:
redirect: 'romanah/gokbakja/client/update/:id'
redirectClose: romanah/gokbakja/client
update:
redirect: romanah/gokbakja/client
redirectClose: romanah/gokbakja/client

View File

@ -0,0 +1,12 @@
list: $/romanah/gokbakja/models/client/columns.yaml
modelClass: Romanah\Gokbakja\Models\Client
title: Client
noRecordsMessage: 'backend::lang.list.no_records'
showSetup: true
showCheckboxes: true
recordsPerPage: 20
toolbar:
buttons: list_toolbar
search:
prompt: 'backend::lang.list.search_prompt'
recordUrl: 'romanah/gokbakja/client/update/:id'

View File

@ -0,0 +1,46 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('romanah/gokbakja/client') ?>">Client</a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
<?php if (!$this->fatalError): ?>
<?= Form::open(['class' => 'layout']) ?>
<div class="layout-row">
<?= $this->formRender() ?>
</div>
<div class="form-buttons">
<div class="loading-indicator-container">
<button
type="submit"
data-request="onSave"
data-hotkey="ctrl+s, cmd+s"
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
class="btn btn-primary">
<?= e(trans('backend::lang.form.create')) ?>
</button>
<button
type="button"
data-request="onSave"
data-request-data="close:1"
data-hotkey="ctrl+enter, cmd+enter"
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
class="btn btn-default">
<?= e(trans('backend::lang.form.create_and_close')) ?>
</button>
<span class="btn-text">
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('romanah/gokbakja/client') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
</span>
</div>
</div>
<?= Form::close() ?>
<?php else: ?>
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
<p><a href="<?= Backend::url('romanah/gokbakja/client') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
<?php endif ?>

View File

@ -0,0 +1 @@
<?= $this->listRender() ?>

View File

@ -0,0 +1,22 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('romanah/gokbakja/client') ?>">Client</a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
<?php if (!$this->fatalError): ?>
<div class="form-preview">
<?= $this->formRenderPreview() ?>
</div>
<?php else: ?>
<p class="flash-message static error"><?= e($this->fatalError) ?></p>
<?php endif ?>
<p>
<a href="<?= Backend::url('romanah/gokbakja/client') ?>" class="btn btn-default oc-icon-chevron-left">
<?= e(trans('backend::lang.form.return_to_list')) ?>
</a>
</p>

View File

@ -0,0 +1,54 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('romanah/gokbakja/client') ?>">Client</a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
<?php if (!$this->fatalError): ?>
<?= Form::open(['class' => 'layout']) ?>
<div class="layout-row">
<?= $this->formRender() ?>
</div>
<div class="form-buttons">
<div class="loading-indicator-container">
<button
type="submit"
data-request="onSave"
data-request-data="redirect:0"
data-hotkey="ctrl+s, cmd+s"
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
class="btn btn-primary">
<?= e(trans('backend::lang.form.save')) ?>
</button>
<button
type="button"
data-request="onSave"
data-request-data="close:1"
data-hotkey="ctrl+enter, cmd+enter"
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
class="btn btn-default">
<?= e(trans('backend::lang.form.save_and_close')) ?>
</button>
<button
type="button"
class="oc-icon-trash-o btn-icon danger pull-right"
data-request="onDelete"
data-load-indicator="<?= e(trans('backend::lang.form.deleting')) ?>"
data-request-confirm="<?= e(trans('backend::lang.form.confirm_delete')) ?>">
</button>
<span class="btn-text">
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('romanah/gokbakja/client') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
</span>
</div>
</div>
<?= Form::close() ?>
<?php else: ?>
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
<p><a href="<?= Backend::url('romanah/gokbakja/client') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
<?php endif ?>

View File

@ -0,0 +1,33 @@
<?php namespace Romanah\Gokbakja\Models;
use Model;
/**
* Model
*/
class Client extends Model
{
use \October\Rain\Database\Traits\Validation;
use \October\Rain\Database\Traits\SoftDelete;
protected $dates = ['deleted_at'];
public $hasMany = [
'order' => [
'Romanah\Gokbakja\Models\Order',
'key' => 'client_id'
]
];
/**
* @var string The database table used by the model.
*/
public $table = 'romanah_gokbakja_client';
/**
* @var array Validation rules
*/
public $rules = [
];
}

View File

@ -13,11 +13,18 @@ class Order extends Model
protected $dates = ['deleted_at'];
public $hasMany = [
'shipping' => [
'Romanah\Gokbakja\Models\Order',
'key' => 'order_id'
public $belongsTo = [
'client' => [
'Romanah\Gokbakja\Models\Client',
'key' => 'client_id'
],
'shipping' => [
'Romanah\Gokbakja\Models\Shipping',
'key' => 'shipping_id'
],
];
public $hasMany = [
'order_items' => [
'Romanah\Gokbakja\Models\OrderItem',
'key' => 'order_id'

View File

@ -0,0 +1,22 @@
columns:
id:
label: id
type: number
name:
label: name
type: text
country:
label: country
type: text
city:
label: city
type: text
phone:
label: phone
type: text
email:
label: email
type: text
note:
label: note
type: text

View File

@ -0,0 +1,26 @@
fields:
name:
label: Ady
span: auto
type: text
country:
label: Ýurdy
span: auto
type: text
city:
label: Şäher
span: auto
type: text
phone:
label: Telefon
span: auto
type: text
email:
label: Email
span: auto
type: text
note:
label: Bellik
span: auto
size: ''
type: textarea

View File

@ -28,3 +28,7 @@ fields:
nameFrom: name
descriptionFrom: description
type: relation
is_sewer:
label: Tikinçimi
span: auto
type: switch

View File

@ -7,12 +7,14 @@ fields:
label: Bahasy
span: auto
type: number
client:
label: Alyjy
span: auto
type: text
note:
label: Bellik
span: auto
size: ''
type: textarea
client:
label: Klent
span: auto
nameFrom: name
descriptionFrom: description
type: relation

View File

@ -26,6 +26,10 @@ navigation:
label: Tölegler
url: romanah/gokbakja/payment
icon: icon-money
side-menu-item5:
label: Klentlar
url: romanah/gokbakja/client
icon: icon-user
main-menu-item2:
label: 'Giriş we Çykyş'
url: romanah/gokbakja/action

View File

@ -0,0 +1,30 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateRomanahGokbakjaClient extends Migration
{
public function up()
{
Schema::create('romanah_gokbakja_client', function($table)
{
$table->engine = 'InnoDB';
$table->increments('id')->unsigned();
$table->timestamp('created_at')->nullable();
$table->timestamp('updated_at')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->string('name');
$table->string('country')->nullable();
$table->string('city')->nullable();
$table->string('phone')->nullable();
$table->string('email')->nullable();
$table->text('note')->nullable();
});
}
public function down()
{
Schema::dropIfExists('romanah_gokbakja_client');
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaEmployee4 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_employee', function($table)
{
$table->boolean('is_sewer')->default(0);
});
}
public function down()
{
Schema::table('romanah_gokbakja_employee', function($table)
{
$table->dropColumn('is_sewer');
});
}
}

View File

@ -0,0 +1,25 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaOrder3 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_order', function($table)
{
$table->integer('client_id');
$table->dropColumn('client');
});
}
public function down()
{
Schema::table('romanah_gokbakja_order', function($table)
{
$table->dropColumn('client_id');
$table->string('client', 191)->nullable();
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaOrder4 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_order', function($table)
{
$table->integer('shipping_id');
});
}
public function down()
{
Schema::table('romanah_gokbakja_order', function($table)
{
$table->dropColumn('shipping_id');
});
}
}

View File

@ -162,3 +162,15 @@
1.0.55:
- 'Updated table romanah_gokbakja_pivot_production'
- builder_table_update_romanah_gokbakja_pivot_production_8.php
1.0.56:
- 'Created table romanah_gokbakja_client'
- builder_table_create_romanah_gokbakja_client.php
1.0.57:
- 'Updated table romanah_gokbakja_order'
- builder_table_update_romanah_gokbakja_order_3.php
1.0.58:
- 'Updated table romanah_gokbakja_employee'
- builder_table_update_romanah_gokbakja_employee_4.php
1.0.59:
- 'Updated table romanah_gokbakja_order'
- builder_table_update_romanah_gokbakja_order_4.php

View File

@ -18,7 +18,7 @@ items:
type: cms-page
url: null
code: ''
reference: stocks
reference: stock/stocks
cmsPage: null
replace: null
viewBag:
@ -81,9 +81,26 @@ items:
items:
-
title: 'Täze Hasabat'
nesting: null
type: cms-page
url: null
code: ''
reference: excruiters
reference: production/excruiters
cmsPage: null
replace: null
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Hasabat
nesting: null
type: cms-page
url: null
code: ''
reference: production/report-dynamic
cmsPage: null
replace: null
viewBag:
isHidden: '0'
cssClass: ''
@ -94,7 +111,7 @@ items:
type: cms-page
url: null
code: ''
reference: all-productions
reference: production/all-production-month
cmsPage: null
replace: null
viewBag:
@ -107,7 +124,7 @@ items:
type: cms-page
url: null
code: ''
reference: report-production
reference: production/report-production
cmsPage: null
replace: null
viewBag:
@ -129,38 +146,21 @@ items:
isExternal: '0'
items:
-
title: 'Täze Hasabat'
nesting: null
title: 'Hasabat Sanawy'
type: cms-page
url: null
code: ''
reference: machine
cmsPage: null
replace: null
reference: machine/machine
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: 'Aýlar boýunca'
title: Hasabat
nesting: null
type: cms-page
url: null
code: ''
reference: all-production-machine-month
cmsPage: null
replace: null
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: 'Ýyl Boýunça'
nesting: null
type: cms-page
url: null
code: ''
reference: report-production-machine
reference: machine/report
cmsPage: null
replace: null
viewBag:
@ -173,7 +173,7 @@ items:
type: cms-page
url: null
code: ''
reference: machine-production-mechanic
reference: machine/machine-production-mechanic
cmsPage: null
replace: null
viewBag:
@ -195,12 +195,21 @@ items:
isExternal: '0'
items:
-
title: 'Taze hasabat'
nesting: null
type: url
url: /s
title: 'Hasabat Sanawy'
type: cms-page
code: ''
reference: null
reference: sewer/new
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Hasabat
nesting: null
type: cms-page
url: null
code: ''
reference: sewer/month
cmsPage: null
replace: null
viewBag:
@ -220,4 +229,40 @@ items:
isHidden: '0'
cssClass: ri-shopping-cart-2-line
isExternal: '0'
items:
-
title: 'Sargytlar Sanawy'
type: cms-page
code: ''
reference: orders/new
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Logitstika
nesting: null
type: cms-page
url: null
code: ''
reference: orders/shipping
cmsPage: null
replace: null
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: Hasabat
nesting: null
type: cms-page
url: null
code: ''
reference: orders/report
cmsPage: null
replace: null
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
name: aside

View File

@ -134,4 +134,4 @@ function onStart() {
</div>
{% partial 'dataTableJs' %}
{% partial 'dataTableJs' %}

View File

@ -137,4 +137,4 @@ function onStart() {
</div>
{% partial 'dataTableJs' %}
{% partial 'dataTableJs' %}

View File

@ -147,4 +147,4 @@ function onStart() {
</div>
{% partial 'dataTableJs' %}
{% partial 'dataTableJs' %}

View File

@ -84,6 +84,53 @@ function onStart(){
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="collapse multi-collapse" id="multiCollapseExample1">
<div class="card card-body">
<form data-request="onCreateMachineProduction">
<div class="row">
<div class="col">
<select class="form-control select2" name="machine_id">
<option>Enjam Saýla</option>
{% for machine in machines %}
<option value="{{machine.id}}">{{machine.name}}</option>
{% endfor %}
</select>
</div>
<div class="col">
<select class="form-control select2" name="size_id">
<option>Ölçeg Saýla</option>
{% for size in sizes %}
<option value="{{size.id}}">{{size.name}}</option>
{% endfor %}
</select>
</div>
<div class="col">
<select class="form-control select2" name="type_id">
<option>Görnüş Saýla</option>
{% for type in types %}
<option value="{{type.id}}">{{type.name}}</option>
{% endfor %}
</select>
</div>
<div class="col">
<input type="number" name="produced_weight" class="form-control"
placeholder="Mukdar (kg)">
</div>
<div class="col">
<input type="text" name="note" class="form-control" placeholder="Bellik">
</div>
<div class="col">
<button type="submit" class="btn btn-primary waves-effect waves-light" style="width: 100%;">Goş</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="col-md-12">
<div class="card">
<div class="card-body">
@ -93,59 +140,15 @@ function onStart(){
({{currentDate|date('d.m.Y | H:i')}})</h3>
<p class="card-title-desc" style="color: #6c6ff5;">Hasabat</p>
</div>
<div class="col-md-6" style="text-align: right;">
<a class="btn btn-primary" data-bs-toggle="collapse" href="#multiCollapseExample1"
role="button" aria-expanded="false" aria-controls="multiCollapseExample1">Täze
Maglumat</a>
</div>
</div>
<!-- <h1>{{machineProductions}}</h1> -->
<div class="table-responsive" style="margin-bottom: 20px;">
<table class="table mb-0">
<thead class="table-light">
<form data-request="onCreateMachineProduction">
<tr>
<th style="background: #daddff;padding-bottom: 20px;">Täze maglumat</th>
<th style="background: #daddff;">
<select class="form-control select2" name="machine_id">
<option>Enjam Saýla</option>
{% for machine in machines %}
<option value="{{machine.id}}">{{machine.name}}</option>
{% endfor %}
</select>
</th>
<th style="background: #daddff;">
<select class="form-control select2" name="size_id">
<option>Ölçeg Saýla</option>
{% for size in sizes %}
<option value="{{size.id}}">{{size.name}}</option>
{% endfor %}
</select>
</th>
<th style="background: #daddff;">
<select class="form-control select2" name="type_id">
<option>Görnüş Saýla</option>
{% for type in types %}
<option value="{{type.id}}">{{type.name}}</option>
{% endfor %}
</select>
</th>
<th style="background: #daddff;">
<input type="number" name="produced_weight" class="form-control"
placeholder="Mukdar (kg)">
</th>
<th style="background: #daddff;">
<input type="text" name="note" class="form-control" placeholder="Bellik">
</th>
<th style="background: #daddff;">
<button type="submit"
class="btn btn-primary waves-effect waves-light">Goş</button>
</th>
</tr>
</form>
</thead>
</table>
</div>
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
style="border-collapse: collapse; border-spacing: 0; width: 100%;">
@ -174,7 +177,8 @@ function onStart(){
<td>{{machine.bag_size.name}}</td>
<td>{{machine.bag_type.name}}</td>
<td><span class="badge badge-soft-success"
style="font-size: 14px;">{{machine.produced_weight|number_format}} kg</span></td>
style="font-size: 14px;">{{machine.produced_weight|number_format}} kg</span>
</td>
<td>{{machine.employee_name}}</td>
<td>{{machine.mechanic_name}}</td>
<td>{{machine.note}}</td>

View File

@ -95,4 +95,4 @@ function onStart(){
</div>
{% partial 'dataTableJs' %}
{% partial 'dataTableJs' %}

View File

@ -0,0 +1,5 @@
title = "machine/report"
url = "/machinereport"
layout = "platform_main"
is_hidden = 0
==

View File

@ -0,0 +1,139 @@
title = "orders/new"
url = "/orders/new"
layout = "platform_main"
is_hidden = 0
[order]
==
<?php
function onStart(){
$this["employees"] = Romanah\Gokbakja\Models\Employee::where('status', 1)->get();
$this["clients"] = Romanah\Gokbakja\Models\Client::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">
{% endput %}
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="collapse multi-collapse" id="multiCollapseExample1">
<form data-request="onCreateOrder" data-request-flash>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col">
<label class="form-label">Klent Saýlaň</label>
<select class="form-control select2" name="client_id">
<option value="0">Saýla</option>
{% for client in clients %}
<option value="{{client.id}}">{{client.name}} ({{client.country}})</option>
{% endfor %}
</select>
</div>
<div class="col">
<div>
<label class="form-label">Mukdary (kg)</label>
<input type="number" name="amount" step="0.01" class="form-control"
placeholder="Sargyt edilen halta kg-da">
</div>
</div>
<div class="col">
<div>
<label class="form-label">Bahasy</label>
<input type="number" name="price" step="0.01" class="form-control"
placeholder="Bahasy">
</div>
</div>
<div class="col">
<div>
<label class="form-label">Bellik</label>
<input type="text" name="note" class="form-control" placeholder="Bellik">
</div>
</div>
<div class="col">
<button type="submit" class="btn btn-primary waves-effect waves-light"
style="margin-top: 30px;width: 100%;">Goş</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<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;">Sargytlar</h3>
<p class="card-title-desc" style="color: #6c6ff5;">Hasabat</p>
</div>
<div class="col-md-6" style="text-align: right;">
<a class="btn btn-primary" data-bs-toggle="collapse" href="#multiCollapseExample1"
role="button" aria-expanded="false" aria-controls="multiCollapseExample1">Täze
Maglumat</a>
</div>
</div>
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
style="border-collapse: collapse; border-spacing: 0; width: 100%;" data-page-length='13'>
<thead>
<tr>
<th style="width: 5%;"></th>
<th>Klent</th>
<th>Ýurdy</th>
<th>Mukdary</th>
<th>Bahasy</th>
<th>Logistika</th>
<th>Bellik</th>
</tr>
</thead>
<tbody id="order_datas">
{% component 'order' %}
</tbody>
<tfoot>
<tr>
<th style="width: 5%;"></th>
<th>Klent</th>
<th>Ýurdy</th>
<th>Mukdary</th>
<th>Bahasy</th>
<th>Logistika</th>
<th>Bellik</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/js/pages/form-advanced.init.js'|theme}}"></script>
{% endput %}
{% partial 'dataTableJs' %}

View File

@ -0,0 +1,6 @@
title = "orders/report"
url = "/orders/report"
layout = "platform_main"
is_hidden = 0
==
list order

View File

@ -0,0 +1,6 @@
title = "orders/shipping"
url = "/orders/shipping"
layout = "platform_main"
is_hidden = 0
==
shipping order

View File

@ -181,4 +181,4 @@ function onStart() {
</div>
{% partial 'dataTableJs' %}
{% partial 'dataTableJs' %}

View File

@ -154,4 +154,4 @@ function onStart() {
</div>
{% partial 'dataTableJs' %}
{% partial 'dataTableJs' %}

View File

@ -26,4 +26,4 @@ function onStart(){
{% endfor %}
</div>
</div>
</div>

View File

@ -140,4 +140,4 @@ function onStart() {
</div>
{% partial 'dataTableJs' %}
{% partial 'dataTableJs' %}

View File

@ -0,0 +1,138 @@
title = "production/report-dynamic"
url = "/production/report-dynamic"
layout = "platform_main"
is_hidden = 0
==
<?php
function onStart(){
$this["shifts"] = Romanah\Gokbakja\Models\Shift::get();
$this["excruiters"] = Romanah\Gokbakja\Models\Excruiter::all();
}
?>
==
{% 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">
<div>
<label class="form-label">Seneleri Saýlaň</label>
<div class="input-daterange input-group" id="datepicker6" data-date-format="dd M, yyyy"
data-date-autoclose="true" data-provide="datepicker"
data-date-container='#datepicker6'>
<input type="text" class="form-control" name="start" placeholder="Başlanýan sene" />
<input type="text" class="form-control" name="end" placeholder="Gutarýan sene" />
</div>
</div>
</div>
<div class="col">
<label class="form-label">Ekstruiter Saýlaň</label>
<select class="form-control" name="shift_id" id="shift_id">
<option value="0">Saýla</option>
{% for excruiter in excruiters %}
<option value="{{excruiter.id}}">{{excruiter.name}}</option>
{% endfor %}
</select>
</div>
<div class="col">
<label class="form-label">Smen Saýlaň</label>
<select class="form-control" name="shift_id" id="shift_id">
<option value="0">Saýla</option>
{% for shift in shifts %}
<option value="{{shift.id}}">{{shift.desc}} - ({{shift.start}} -
{{shift.end}})</option>
{% endfor %}
</select>
</div>
<div class="col">
<button type="submit" class="btn btn-primary waves-effect waves-light" style="margin-top: 30px;width: 100%;">Hasabat</button>
</div>
</div>
</div>
</div>
</div>
</div>
<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;">Çig Mallar Boýunça Umumy
({{year}} ýyl)</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%;" data-page-length='13'>
<thead>
<tr>
<th style="width: 5%;"></th>
<th>Aýlar</th>
<th>Ortaça Işlenen</th>
{% for key, record in reportProducts %}
<th>{{record.name}}</th>
{% endfor %}
<th>Bellik</th>
<!-- <th>Настройки</th> -->
</tr>
</thead>
<tbody>
{% partial 'report/row' products=reportProducts title="Ýanwar" no=1 %}
</tbody>
<tfoot>
<tr>
<th style="width: 5%;"></th>
<th>Senesi</th>
<th>Hemmesi</th>
{% for key, record in reportProducts %}
<th>{{record.name}}</th>
{% endfor %}
<th>Bellik</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
{% partial 'dataTableJs' %}
{% put scripts %}
<script src="{{'assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js'|theme}}"></script>
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
{% endput %}

View File

@ -3,6 +3,7 @@ url = "/report-production/:year?"
layout = "platform_main"
is_hidden = 0
==
<?php
function onStart(){
$currentDate = Carbon\Carbon::now()->timezone('UTC +05:00');
@ -16,6 +17,7 @@ function onStart(){
$this["reportProducts"] = Romanah\Gokbakja\Models\Product::where("report", "simple")->get();
}
?>
==
{% put styles %}
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet"
@ -101,4 +103,4 @@ function onStart(){
</div>
{% partial 'dataTableJs' %}
{% partial 'dataTableJs' %}

View File

@ -0,0 +1,6 @@
title = "sewer/month"
url = "/sewer/month"
layout = "platform_main"
is_hidden = 0
==
seweer month

View File

@ -0,0 +1,143 @@
title = "sewer/new"
url = "/sewer/new"
layout = "platform_main"
is_hidden = 0
[sewer]
==
<?php
function onStart(){
$this["employees"] = Romanah\Gokbakja\Models\Employee::where("status", 1)->where("is_sewer", 1)->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">
{% endput %}
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="collapse multi-collapse" id="multiCollapseExample1">
<form data-request="onCreateSewerProduction" data-request-flash>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col">
<label class="form-label">Tikinçi Saýlaň</label>
<select class="form-control select2" name="employee_id">
<option value="0">Saýla</option>
{% for employee in employees %}
<option value="{{employee.id}}">{{employee.name}}</option>
{% endfor %}
</select>
</div>
<div class="col">
<div>
<label class="form-label">Çig mal mukdary</label>
<input type="number" name="amount" class="form-control"
placeholder="Çig mal mukdary kg">
</div>
</div>
<div class="col">
<div>
<label class="form-label">Tikilen Halta</label>
<input type="number" name="produced_bag_qty" class="form-control"
placeholder="tikilen halta sany">
</div>
</div>
<div class="col">
<div>
<label class="form-label">Bellik</label>
<input type="text" name="note" class="form-control"
placeholder="Bellik">
</div>
</div>
<div class="col">
<button type="submit" class="btn btn-primary waves-effect waves-light"
style="margin-top: 30px;width: 100%;">Goş</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<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;">Tikinçiler boýunça</h3>
<p class="card-title-desc" style="color: #6c6ff5;">Hasabat</p>
</div>
<div class="col-md-6" style="text-align: right;">
<a class="btn btn-primary" data-bs-toggle="collapse" href="#multiCollapseExample1"
role="button" aria-expanded="false" aria-controls="multiCollapseExample1">Täze
Maglumat</a>
</div>
</div>
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
style="border-collapse: collapse; border-spacing: 0; width: 100%;" data-page-length='13'>
<thead>
<tr>
<th style="width: 5%;"></th>
<th>Tikinçi</th>
<th>Senesi</th>
<th>Çig mal mukdary</th>
<th>Tikilen Halta</th>
<th>Bellik</th>
<!-- <th>Настройки</th> -->
</tr>
</thead>
<tbody id="sewer_datas">
{% component 'sewer' %}
</tbody>
<tfoot>
<tr>
<th style="width: 5%;"></th>
<th>Tikinçi</th>
<th>Senesi</th>
<th>Çig mal mukdary</th>
<th>Tikilen Halta</th>
<th>Bellik</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/js/pages/form-advanced.init.js'|theme}}"></script>
{% endput %}
{% partial 'dataTableJs' %}

View File

@ -174,4 +174,4 @@ sortDirection = "desc"
</div>
{% partial 'dataTableJs' %}
{% partial 'dataTableJs' %}

View File

@ -7,7 +7,7 @@
<div class="modal-header">
<h5 class="modal-title" id="exampleModalFullscreenLabel">
<font style="color: darkgreen;text-decoration: underline;font-weight: bold;">{{currentDate|date('d.m.Y')}}</font> senesi
boýunça günü jemi
boýunça güni jemi
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"
aria-label="Close"></button>