diff --git a/config/database.php b/config/database.php index 30db3e9..cd32e88 100644 --- a/config/database.php +++ b/config/database.php @@ -57,9 +57,9 @@ return [ 'engine' => 'InnoDB', 'host' => 'localhost', 'port' => 3306, - 'database' => 'gok_bakja', + 'database' => 'gok_bakja_from_server', 'username' => 'root', - 'password' => '', + 'password' => 'bt110226', 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', diff --git a/themes/gokbakja/meta/menus/aside.yaml b/themes/gokbakja/meta/menus/aside.yaml index 1f10617..1d42329 100644 --- a/themes/gokbakja/meta/menus/aside.yaml +++ b/themes/gokbakja/meta/menus/aside.yaml @@ -250,6 +250,15 @@ items: isHidden: '0' cssClass: '' isExternal: '0' + - + title: 'Hasabat 2' + type: cms-page + code: extrudorProduction + reference: production/daily-seperate + viewBag: + isHidden: '0' + cssClass: '' + isExternal: '0' - title: 'Aýlar Boýunça' nesting: null @@ -344,9 +353,13 @@ items: isExternal: '0' - title: 'Rulon Halta Hasabaty' + nesting: null type: cms-page + url: null code: productionRulon reference: machine/rulon-bags + cmsPage: null + replace: null viewBag: isHidden: '0' cssClass: '' @@ -406,9 +419,13 @@ items: isExternal: '0' - title: 'Görnüş Hasabaty' + nesting: null type: cms-page + url: null code: sewerProduction reference: actions/bag-report + cmsPage: null + replace: null viewBag: isHidden: '0' cssClass: '' diff --git a/themes/gokbakja/pages/production/daily-seperate.htm b/themes/gokbakja/pages/production/daily-seperate.htm new file mode 100644 index 0000000..42b82a5 --- /dev/null +++ b/themes/gokbakja/pages/production/daily-seperate.htm @@ -0,0 +1,286 @@ +title = "production/daily-seperate" +url = "/production/daily-seperate/:month/:year?" +layout = "platform_main" +is_hidden = 0 +== +param("month"); + $year = $this->param("year"); + + + + if($this["month"] == 'default'){ + $this["month"] = $currentDate->month; + } + + $reportDatas = []; + + $productionDates = Romanah\Gokbakja\Models\production::select('date', 'excruiter_id') + ->whereMonth('date', $this["month"]) + ->whereYear('date', $currentDate->year) + ->with('excruiter') + ->groupBy('date') + ->groupBy('excruiter_id') + ->orderBy('date', 'ASC') + ->distinct() + ->get(); + + + + for ($x = 0; $x < count($productionDates); $x++) { + + $sumDiff = Romanah\Gokbakja\Models\ProductionCalculate::where('date', $productionDates[$x]->date)->where('excruiter_id', $productionDates[$x]->excruiter_id); + $sumDiff2 = Romanah\Gokbakja\Models\ProductionCalculate::where('date', $productionDates[$x]->date)->where('excruiter_id', $productionDates[$x]->excruiter_id); + + $shift1 = $sumDiff->where('shift_id', 1)->sum('amount_calc'); + $shift2 = $sumDiff2->where('shift_id', 2)->sum('amount_calc'); + + $reportDatas[$x]["date"] = $productionDates[$x]->date; + $reportDatas[$x]["shift1"] = $shift1; + $reportDatas[$x]["shift2"] = $shift2; + $reportDatas[$x]["extrudor"] = $productionDates[$x]->excruiter->name; + $reportDatas[$x]["all_shift_calc"] = ($shift1 + $shift2); + + + + $products_all = $sumDiff->with('product')->groupBy('product_id')->get(); + + for ($xx = 0; $xx < count($products_all); $xx++) { + $sumDiffq = Romanah\Gokbakja\Models\ProductionCalculate::whereDate('date', $productionDates[$x]->date)->where('shift_id', 1)->where('excruiter_id', $productionDates[$x]->excruiter_id); + + $sumDiff2q = Romanah\Gokbakja\Models\ProductionCalculate::whereDate('date', $productionDates[$x]->date)->where('shift_id', 2)->where('excruiter_id', $productionDates[$x]->excruiter_id); + + $products_amount1 = $sumDiffq->where('product_id', $products_all[$xx]->product_id)->sum('amount_calc'); + $products_amount2 = $sumDiff2q->where('product_id', $products_all[$xx]->product_id)->sum('amount_calc'); + + $reportDatas[$x]["products_shift1"][$xx]["product_code"] = $products_all[$xx]->product->code; + $reportDatas[$x]["products_shift1"][$xx]["product_value"] = $products_amount1; + + $reportDatas[$x]["products_shift2"][$xx]["product_code"] = $products_all[$xx]->product->code; + $reportDatas[$x]["products_shift2"][$xx]["product_value"] = $products_amount2; + + } + + + $reportDatas[$x]["count_change1"] = $sumDiff->where('shift_id', 1)->groupBy('product_id')->count(); + $reportDatas[$x]["count_change2"] = $sumDiff2->where('shift_id', 2)->groupBy('product_id')->count(); + + } + + $this["reportDatas"] = $reportDatas; + + //dd($reportDatas); + + if($year){ + + + + }else{ + $reportDatas = []; + + + } +} +?> +== +{% put styles %} + + + +{% endput %} + +
+ + +
+
+
+

Aýlar Boýunça {{year}}

+ +
+
+
+ + +
+
+ + + + + + + + +
+
+ +
+ + +{% partial 'dataTableJs' %} diff --git a/themes/gokbakja/pages/production/report-dynamic.htm b/themes/gokbakja/pages/production/report-dynamic.htm index bff48cc..bd84132 100644 --- a/themes/gokbakja/pages/production/report-dynamic.htm +++ b/themes/gokbakja/pages/production/report-dynamic.htm @@ -123,7 +123,7 @@ function onStart(){ № Senesi Smen - Ekskruiter + Ekstrudor Hemmesi HARYTLAR Bellik @@ -142,7 +142,7 @@ function onStart(){ № Senesi Smen - Ekskruiter + Ekstrudor Hemmesi HARYTLAR Bellik