@extends('panel.master') @section('title') مدیریت ارسال‌ها @endsection @section('content') @php // Initialize access level variables $B1 = $B2 = $B3 = $B4 = $B5 = $B6 = $B7 = $B8 = $B9 = $B10 = $B11 = $B12 = 0; // Check user access levels $modirpanel = session()->get('modirpanel'); $Status = session()->get('Status'); if ($Status == "clerk") { $accesslevels = DB::select("SELECT * FROM accesslevels WHERE PhoneMonshis='$modirpanel'"); foreach ($accesslevels as $value1) { $B1 = $value1->B1; $B2 = $value1->B2; $B3 = $value1->B3; $B4 = $value1->B4; $B5 = $value1->B5; $B6 = $value1->B6; $B7 = $value1->B7; $B8 = $value1->B8; $B9 = $value1->B9; $B10 = $value1->B10; $B11 = $value1->B11; } } // Check for unfinished persal for the given factor ID $persalsval = null; if (!empty($_GET['IdPfactorId'])) { $persalsval = DB::table('persals') ->whereNull('Etmam') ->where('IdPfactorId', $_GET['IdPfactorId']) ->value('Idpersal'); } @endphp

مدیریت ارسال‌ها

@if(empty($persalsval) && !empty($_GET['IdPfactorId']))

ایجاد ارسال جدید

@endif

آمار ارسال‌ها

@for ($i = 0; $i < 7; $i++) @php $date = date('Y-m-d', strtotime("+$i days")); $dayName = jdate($date)->format('Y-m-d'); $dayNameShort = jdate($date)->format('l'); @endphp @endfor @php // Calculate for previous days $date = date('Y-m-d', strtotime("+0 days")); $dayName = jdate($date)->format('Y-m-d'); $IdForsatForoshestwos = DB::table('persals') ->whereNull('Etmam') ->where('Tarikh', '<', $dayName) ->pluck('IdForsatForoshestwos') ->toArray(); $sellproductforsats2 = DB::table('sellproductforsats') ->whereIn('IdForsatForoshestwos', $IdForsatForoshestwos) ->join('sabtkalas', 'sellproductforsats.CodeKala', '=', 'sabtkalas.CodeKala') ->select('sabtkalas.TedadCtn', 'sabtkalas.Cbm1Ctn', 'sellproductforsats.NumberProduct') ->get(); $CtnKol = $CBmKol = 0; foreach($sellproductforsats2 as $sellproductforsat) { if (!empty($sellproductforsat->TedadCtn)) { $CtnKol += ($sellproductforsat->NumberProduct / $sellproductforsat->TedadCtn); $CBmKol += ($sellproductforsat->NumberProduct / $sellproductforsat->TedadCtn * $sellproductforsat->Cbm1Ctn); } } $CtnKol = round($CtnKol, 2); $CBmKol = round($CBmKol, 2); @endphp @for ($i = 0; $i < 7; $i++) @php $date = date('Y-m-d', strtotime("+$i days")); $dayName = jdate($date)->format('Y-m-d'); $IdForsatForoshestwos = DB::table('persals') ->whereNull('Etmam') ->where('Tarikh', $dayName) ->pluck('IdForsatForoshestwos') ->toArray(); $sellproductforsats2 = DB::table('sellproductforsats') ->whereIn('IdForsatForoshestwos', $IdForsatForoshestwos) ->join('sabtkalas', 'sellproductforsats.CodeKala', '=', 'sabtkalas.CodeKala') ->select('sabtkalas.TedadCtn', 'sabtkalas.Cbm1Ctn', 'sellproductforsats.NumberProduct') ->get(); $CtnKol = $CBmKol = 0; foreach($sellproductforsats2 as $sellproductforsat) { if (!empty($sellproductforsat->TedadCtn)) { $CtnKol += ($sellproductforsat->NumberProduct / $sellproductforsat->TedadCtn); $CBmKol += ($sellproductforsat->NumberProduct / $sellproductforsat->TedadCtn * $sellproductforsat->Cbm1Ctn); } } $CtnKol = round($CtnKol, 2); $CBmKol = round($CBmKol, 2); @endphp @endfor
از قبل {{ $dayNameShort }}
{{ $dayName }}
کارتن {{ $CtnKol }} متراژ {{ $CBmKol }} m³
کارتن {{ $CtnKol }} متراژ {{ $CBmKol }} m³

برنامه زمانی ارسال‌ها

@for ($i = 0; $i < 7; $i++) @php $date = date('Y-m-d', strtotime("+$i days")); $dayName = jdate($date)->format('Y-m-d'); $dayNameShort = jdate($date)->format('l'); @endphp @endfor @for ($i = 0; $i < 7; $i++) @php $date = date('Y-m-d', strtotime("+$i days")); $dayName = jdate($date)->format('Y-m-d'); $persals = DB::table('persals') ->whereNull('Etmam') ->where('Tarikh', $dayName) ->orderBy('Time', 'asc') ->get(); @endphp @endfor
ارسال‌های قبلی {{ $dayNameShort }}
{{ $dayName }}
@php $date = date('Y-m-d', strtotime("+0 days")); $dayName = jdate($date)->format('Y-m-d'); $persals = DB::table('persals') ->whereNull('Etmam') ->where('Tarikh', '<', $dayName) ->orderBy('Time', 'asc') ->get(); @endphp @foreach ($persals as $persal) @include('panel.factor.shipping_card', ['persal' => $persal]) @endforeach @foreach ($persals as $persal) @include('panel.factor.shipping_card', ['persal' => $persal]) @endforeach
@include('panel.factor.modals.new_persal') @include('panel.factor.modals.edit_persal') @include('panel.factor.modals.complete_persal') @endsection @section('styles') @endsection @section('scripts') @endsection