Server : Apache System : Linux host44.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64 User : vapecompany ( 2719) PHP Version : 7.4.33 Disable Function : NONE Directory : /home/vapecompany/demo.vapecompany.com.bd/resources/views/backend/reports/tables/ |
Upload File : |
<style type="text/css"> .transition (@animation: ease-in, @time: 1s) { transition: width @animation @time; -webkit-transition: width @animation @time; -moz-transition: width @animation @time; -o-transition: width @animation @time; } .bar-con{ background-color:#ccc; height:1.5em; /*margin-bottom:1em;*/ } .bar{ float:left; height:100%; width:0%; } .bar-one .bar{ background-color:#03AB70; .transition; } .bar-two .bar{ background-color:#1975FF; .transition(@time:3s, @animation:ease-in-out); } .bar-three .bar{ background-color:#FF9900; .transition(@time:4s, @animation:cubic-bezier(.72,.45,.9,.12)); } </style> <!-- Column --> <div class="card"> <div class="card-body"> <h4 class="card-title">Target vs Achievement</h4> <div style="padding: 10px;margin-bottom: 10px;" role="group" class="btn-group btn-group-sm filter-pdf-btn"> <form action="{{url('reports/target_pdf')}}" method="get"> <input type="hidden" name="action_type" value="download"> <input type="hidden" name="employee" value="{{$employee}}"> <input type="hidden" name="designation" value="{{$designation_id}}"> <input type="hidden" name="startyear" value="{{$startyear}}"> <input type="hidden" name="startmonth" value="{{$startmonth}}"> <input type="hidden" name="year" value="{{$year}}"> <input type="hidden" name="month" value="{{$month}}"> <button style="padding: 10px" type="submit" class="btn btn-secondary rounded-0 btn-sm pl-2 pr-2"><i class="fas fa-file-pdf mr-2"></i> PDF </button> </form> <form action="{{url('reports/target_pdf')}}" method="get" target="_blank"> <input type="hidden" name="action_type" value="print"> <input type="hidden" name="employee" value="{{$employee}}"> <input type="hidden" name="designation" value="{{$designation_id}}"> <input type="hidden" name="startyear" value="{{$startyear}}"> <input type="hidden" name="startmonth" value="{{$startmonth}}"> <input type="hidden" name="year" value="{{$year}}"> <input type="hidden" name="month" value="{{$month}}"> <button style="padding: 10px" type="submit" class="btn btn-warning btn-sm rounded-0 pl-2 pr-2"><i class="fa fa-print mr-2"></i> Print </button> </form> <form action="{{url('reports/target_pdf')}}" method="get"> <input type="hidden" name="action_type" value="excel"> <input type="hidden" name="employee" value="{{$employee}}"> <input type="hidden" name="designation" value="{{$designation_id}}"> <input type="hidden" name="startyear" value="{{$startyear}}"> <input type="hidden" name="startmonth" value="{{$startmonth}}"> <input type="hidden" name="year" value="{{$year}}"> <input type="hidden" name="month" value="{{$month}}"> <button style="padding: 10px" type="submit" class="btn btn-secondary btn-sm rounded-0 pl-2 pr-2"><i class="fas fa-file-excel mr-2"></i> Excel </button> </form> </div> <div class="table-responsive"> <table id="dtables" class="table table-striped table-bordered dt-responsive nowrap" style="width:100%"> <thead> <tr> <th class="min-mobile">SL</th> <th class="not-mobile">Month</th> <th class="min-mobile">Employee Name</th> <th class="not-mobile">Designation</th> <th class="not-mobile">Region</th> <th class="not-mobile">Division</th> <th class="not-mobile">District</th> <th class="not-mobile">Target Product</th> <th class="not-mobile">Target Quantity</th> <th class="not-mobile">Total Target Quantity</th> <th class="not-mobile">Target Value</th> <th class="not-mobile">Total Target Value</th> <th class="not-mobile">Sales Quantity</th> <th class="not-mobile">Total Sales Quantity</th> <th class="not-mobile">Sales Value</th> <th class="not-mobile">Total Sales Value</th> <th class="not-mobile">Progress</th> </tr> </thead> <tbody> @foreach($sales_target as $sales) @php $m=str_split($sales->month,4); $d=date('M',strtotime($m[0].'-'.$m[1].'-01')); @endphp @foreach($sales->details as $k=>$detail) @php if($detail->target_quantity > $detail->sales_quantity){ $percentage=($detail->sales_quantity/$detail->target_quantity)*100; }else{ $percentage=100; } @endphp @if($k == 0) <tr > @else <tr> @endif @if($k == 0) <td rowspan="{{$sales->details->count()}}">{{$sales->sale_target_id}}</td> <td rowspan="{{$sales->details->count()}}">{{$d.','.$m[0]}}</td> <td rowspan="{{$sales->details->count()}}">{{$sales->employee->employee_name}}</td> <td rowspan="{{$sales->details->count()}}">{{$sales->designation ? $sales->designation->designation_name : ''}}</td> <td rowspan="{{$sales->details->count()}}">{{$sales->region->region_name}}</td> <td rowspan="{{$sales->details->count()}}">@php $c=json_decode($sales->division_id); $division=""; $i=0; foreach($c as $key => $value){ if($i == 0){ $division .= \App\Models\Division::where('division_id',$value)->first()->division_name; }else{ $division .= ','; $division .=\App\Models\Division::where('division_id',$value)->first()->division_name; } $i++; } @endphp {{$division}}</td> <td rowspan="{{$sales->details->count()}}">@php $c=json_decode($sales->district); $district=""; $i=0; foreach ($c as $key => $value) { if($i == 0){ $district .= \App\Models\District::where('district_id',$value)->first()->district_name; }else{ $district .= ','; $district .=\App\Models\District::where('district_id',$value)->first()->district_name; } $i++; } @endphp {{$district}} </td> @endif <td >{{$detail->product->product_name}}</td> <td>{{$detail->target_quantity}}</td> @if($k == 0) <td rowspan="{{$sales->details->count()}}">{{$sales->details->sum('target_quantity')}}</td> @endif <td>{{number_format($detail->target_amount,2)}}</td> @if($k == 0) <td rowspan="{{$sales->details->count()}}">{{number_format($sales->details->sum('target_amount'),2)}}</td> @endif <td>{{$detail->sales_quantity}}</td> @if($k == 0) <td rowspan="{{$sales->details->count()}}">{{$sales->details->sum('sales_quantity')}}</td> @endif <td>{{number_format($detail->sales_amount,2)}}</td> @if($k == 0) <td rowspan="{{$sales->details->count()}}">{{number_format($sales->details->sum('sales_amount'),2)}}</td> @endif <td> <div class="bar-one bar-con"> <div class="bar" data-percent="{{$percentage}}">{{$percentage}}%</div> </div> </td> </tr> @endforeach @endforeach </tbody> </table> </div> </div> </div> </div> <script src="http://maktelonline.com/public/js/jquery.min.js"></script> <script type="text/javascript"> function progress(arg){ // console.log(arg.dataset.percent); var percent = arg.dataset.percent; arg.style.width= percent+"%"; } $(".bar-one .bar").each(function(){ progress(this); }) </script>