
<?php $__env->startSection('title','لوحة التحكم'); ?>
<?php $__env->startSection('content'); ?>
<div class="app-content content ">
      <div class="content-overlay"></div>
      <div class="header-navbar-shadow"></div>
      <div class="content-wrapper container-xxl p-0">
        <div class="content-header row">
        </div>
        <div class="content-body">
<!-- Dashboard Ecommerce Starts -->
<section id="dashboard-ecommerce">
  <?php if(session('success')): ?>
  <div class="alert alert-success" role="alert" align="center">
    <div class="alert-body"><?php echo e(session('success')); ?></div>
</div>
<?php endif; ?>
<?php if(session('error')): ?>
<div class="alert alert-danger" role="alert" align="center">
  <div class="alert-body"><?php echo e(session('error')); ?></div>
</div>
<?php endif; ?>
  <?php if($company->created_at > now()->subDays(7)): ?>
  <div class="col-xl-12 col-md-12 col-12">
    <div class=" card-statistics row">

  <div class="  col-md-2 col-4">
<a  href="<?php echo e(route('client.capitals.create')); ?>"
class="btn btn-md btn-block btn-outline-success">
 <i class="fa fa-whatsapp"></i>
 أضف رأس المال
</a>
</div>
<div class="  col-md-2 col-4">

<a  href="<?php echo e(route('client.fixed.expenses')); ?>"
class="btn btn-md btn-block btn-outline-warning">
 <i class="fa fa-whatsapp"></i>
 أنواع المصاريف
</a>
</div>

<div class="  col-md-2 col-4">
  <a  href="<?php echo e(route('client.banks.create')); ?>"
  class="btn btn-md btn-block btn-outline-danger">
 <i class="fa fa-whatsapp"></i>
 أضف البنوك
</a>
</div>

<div class="  col-md-2 col-4">
  <a  href="<?php echo e(route('client.products.create')); ?>"
class="btn btn-md btn-block btn-outline-primary">
 <i class="fa fa-whatsapp"></i>
 أضف المنتجات 
</a>
</div>

<div class="  col-md-2 col-4">
  <a  href="<?php echo e(route('client.basic.settings.edit')); ?>"
class="btn btn-md btn-block btn-outline-info">
 <i class="fa fa-whatsapp"></i>
 إعدادات النظام
</a>
</div>
<div class="  col-md-2 col-4">
  <a  href="<?php echo e(route('screens.settings')); ?>"
class="btn btn-md btn-block btn-outline-secondary">
 <i class="fa fa-whatsapp"></i>
 شاشات البرنامج
</a>
</div>

</div>
</div>
<br>
<?php endif; ?>
    <div class="col-xl-12 col-md-12 col-12">
      <div class="card card-statistics">

        <div class="card-body statistics-body">
          <div class="row">
        <?php if(empty($package) || $package->banks_safes == "1"): ?>
        <?php $__currentLoopData = Auth::user()->getRoleNames(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

          <div class="col-xl-3 col-sm-6 col-12 mb-2 mb-xl-0">
            <div class="d-flex flex-row">
              <div class="avatar bg-light-primary me-2">
                <div class="avatar-content">
                  <i  style="font-size:30px" class="las la-money-bill"></i>
                </div>
              </div>
              <div class="my-auto">
                <h4 class="fw-bolder mb-0"><?php if($role == "مدير النظام" || $role == "محاسب"): ?><?php echo e(number_format($safes_balances)); ?><?php else: ?>***********<?php endif; ?></h4>
                <p class="card-text font-small-3 mb-0">رصيد نقدي </p>
              </div>
            </div>
          </div>
        
          <div class="col-xl-3 col-sm-6 col-12 mb-2 mb-xl-0">
            <div class="d-flex flex-row">
              <div class="avatar bg-light-info me-2">
                <div class="avatar-content">
                  <i style="font-size: 30px" class="las la-wallet"></i>
                </div>
              </div>
              <div class="my-auto">
                <h4 class="fw-bolder mb-0"><?php if($role == "مدير النظام" || $role == "محاسب"): ?><?php echo e(number_format($banks_balances)); ?><?php else: ?>***********<?php endif; ?></h4>
                <p class="card-text font-small-3 mb-0">رصيد البنك</p>
              </div>
            </div>
          </div>

        <?php endif; ?>

          <div class="col-xl-3 col-sm-6 col-12 mb-2 mb-sm-0">
            <div class="d-flex flex-row">
              <div class="avatar bg-light-danger me-2">
                <div class="avatar-content">
                  <i style="font-size: 30px" class="las la-arrow-left"></i>
                </div>
              </div>
              <div class="my-auto">
                <h4 class="fw-bolder mb-0"><?php if($role == "مدير النظام" || $role == "محاسب"): ?> <?php echo e(number_format($total_clients_balances_minus + $total_suppliers_balances_plus)); ?> <?php else: ?> *********** <?php endif; ?></h4>
                <p class="card-text font-small-3 mb-0">الديون التي علينا</p>
              </div>
            </div>
          </div>
          <div class="col-xl-3 col-sm-6 col-12">
            <div class="d-flex flex-row">
              <div class="avatar bg-light-success me-2">
                <div class="avatar-content">
                  <i style="font-size: 30px" class="las la-arrow-right"></i>
                </div>
              </div>
              <div class="my-auto">
                <h4 class="fw-bolder mb-0"><?php if($role == "مدير النظام" || $role == "محاسب"): ?> <?php echo e(number_format($total_clients_balances_plus + $total_suppliers_balances_minus)); ?> <?php else: ?> *********** <?php endif; ?></h4>
                <p class="card-text font-small-3 mb-0">الديون التي لينا</p>
                
              </div>
            </div>
          </div>
          
        </div>
        </div>
      </div>
    </div>
    
    <!--/ Statistics Card -->
  </div>

  <div class="row match-height">
    <div class="col-lg-12 col-12">
      <div class="row match-height">
        <!-- Bar Chart - Orders -->
        <div class="col-lg-2 col-md-2 col-6">
          <div class="card">
            <div class="card-body pb-50" style="position: relative;">
              <h6>المبيعات</h6>
              <h2 class="fw-bolder mb-1"><?php if($role == "مدير النظام" || $role == "محاسب"): ?> <?php echo e(number_format($sale_bills->sum('final_total'))); ?> <?php else: ?> *********** <?php endif; ?></h2>
              <div id="statistics-order-chart" style="min-height: 85px;"><div id="apexcharts21ehz9ft" class="apexcharts-canvas apexcharts21ehz9ft apexcharts-theme-light" style="width: 105px; height: 70px;"><svg id="SvgjsSvg2485" width="105" height="70" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="apexcharts-svg apexcharts-zoomable" xmlns:data="ApexChartsNS" transform="translate(0, 0)" style="background: transparent;"><g id="SvgjsG2487" class="apexcharts-inner apexcharts-graphical" transform="translate(12.5, 15)"><defs id="SvgjsDefs2486"><linearGradient id="SvgjsLinearGradient2490" x1="0" y1="0" x2="0" y2="1"><stop id="SvgjsStop2491" stop-opacity="0.4" stop-color="rgba(216,227,240,0.4)" offset="0"></stop><stop id="SvgjsStop2492" stop-opacity="0.5" stop-color="rgba(190,209,230,0.5)" offset="1"></stop><stop id="SvgjsStop2493" stop-opacity="0.5" stop-color="rgba(190,209,230,0.5)" offset="1"></stop></linearGradient><clipPath id="gridRectMask21ehz9ft"><rect id="SvgjsRect2495" width="109" height="55" x="-10.5" y="0" rx="0" ry="0" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#fff"></rect></clipPath><clipPath id="gridRectMarkerMask21ehz9ft"><rect id="SvgjsRect2496" width="92" height="59" x="-2" y="-2" rx="0" ry="0" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#fff"></rect></clipPath></defs><rect id="SvgjsRect2494" width="4.4" height="55" x="0" y="0" rx="0" ry="0" opacity="1" stroke-width="0" stroke-dasharray="3" fill="url(#SvgjsLinearGradient2490)" class="apexcharts-xcrosshairs" y2="55" filter="none" fill-opacity="0.9"></rect><g id="SvgjsG2510" class="apexcharts-xaxis" transform="translate(0, 0)"><g id="SvgjsG2511" class="apexcharts-xaxis-texts-g" transform="translate(0, -4)"></g></g><g id="SvgjsG2513" class="apexcharts-grid"><g id="SvgjsG2514" class="apexcharts-gridlines-horizontal" style="display: none;"><line id="SvgjsLine2516" x1="-8.5" y1="0" x2="96.5" y2="0" stroke="#e0e0e0" stroke-dasharray="0" class="apexcharts-gridline"></line><line id="SvgjsLine2517" x1="-8.5" y1="11" x2="96.5" y2="11" stroke="#e0e0e0" stroke-dasharray="0" class="apexcharts-gridline"></line><line id="SvgjsLine2518" x1="-8.5" y1="22" x2="96.5" y2="22" stroke="#e0e0e0" stroke-dasharray="0" class="apexcharts-gridline"></line><line id="SvgjsLine2519" x1="-8.5" y1="33" x2="96.5" y2="33" stroke="#e0e0e0" stroke-dasharray="0" class="apexcharts-gridline"></line><line id="SvgjsLine2520" x1="-8.5" y1="44" x2="96.5" y2="44" stroke="#e0e0e0" stroke-dasharray="0" class="apexcharts-gridline"></line><line id="SvgjsLine2521" x1="-8.5" y1="55" x2="96.5" y2="55" stroke="#e0e0e0" stroke-dasharray="0" class="apexcharts-gridline"></line></g><g id="SvgjsG2515" class="apexcharts-gridlines-vertical" style="display: none;"></g><line id="SvgjsLine2523" x1="0" y1="55" x2="88" y2="55" stroke="transparent" stroke-dasharray="0"></line><line id="SvgjsLine2522" x1="0" y1="1" x2="0" y2="55" stroke="transparent" stroke-dasharray="0"></line></g><g id="SvgjsG2497" class="apexcharts-bar-series apexcharts-plot-series"><g id="SvgjsG2498" class="apexcharts-series" seriesName="2020" rel="1" data:realIndex="0"><rect id="SvgjsRect2500" width="4.4" height="55" x="-2.2" y="0" rx="5" ry="5" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#f3f3f3" class="apexcharts-backgroundBar"></rect><path id="SvgjsPath2501" d="M -2.2 53.9L -2.2 30.25L 2.2 30.25L 2.2 30.25L 2.2 53.9Q 0 56.1 -2.2 53.9z" fill="rgba(255,159,67,0.85)" fill-opacity="1" stroke-opacity="1" stroke-linecap="square" stroke-width="0" stroke-dasharray="0" class="apexcharts-bar-area" index="0" clip-path="url(#gridRectMask21ehz9ft)" pathTo="M -2.2 53.9L -2.2 30.25L 2.2 30.25L 2.2 30.25L 2.2 53.9Q 0 56.1 -2.2 53.9z" pathFrom="M -2.2 53.9L -2.2 55L 2.2 55L 2.2 55L 2.2 55L -2.2 55" cy="30.25" cx="2.200000000000001" j="0" val="45" barHeight="24.75" barWidth="4.4"></path><rect id="SvgjsRect2502" width="4.4" height="55" x="19.8" y="0" rx="5" ry="5" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#f3f3f3" class="apexcharts-backgroundBar"></rect><path id="SvgjsPath2503" d="M 19.8 53.9L 19.8 8.25L 24.200000000000003 8.25L 24.200000000000003 8.25L 24.200000000000003 53.9Q 22 56.1 19.8 53.9z" fill="rgba(255,159,67,0.85)" fill-opacity="1" stroke-opacity="1" stroke-linecap="square" stroke-width="0" stroke-dasharray="0" class="apexcharts-bar-area" index="0" clip-path="url(#gridRectMask21ehz9ft)" pathTo="M 19.8 53.9L 19.8 8.25L 24.200000000000003 8.25L 24.200000000000003 8.25L 24.200000000000003 53.9Q 22 56.1 19.8 53.9z" pathFrom="M 19.8 53.9L 19.8 55L 24.200000000000003 55L 24.200000000000003 55L 24.200000000000003 55L 19.8 55" cy="8.25" cx="24.199999999999996" j="1" val="85" barHeight="46.75" barWidth="4.4"></path><rect id="SvgjsRect2504" width="4.4" height="55" x="41.8" y="0" rx="5" ry="5" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#f3f3f3" class="apexcharts-backgroundBar"></rect><path id="SvgjsPath2505" d="M 41.8 53.9L 41.8 19.25L 46.199999999999996 19.25L 46.199999999999996 19.25L 46.199999999999996 53.9Q 44 56.1 41.8 53.9z" fill="rgba(255,159,67,0.85)" fill-opacity="1" stroke-opacity="1" stroke-linecap="square" stroke-width="0" stroke-dasharray="0" class="apexcharts-bar-area" index="0" clip-path="url(#gridRectMask21ehz9ft)" pathTo="M 41.8 53.9L 41.8 19.25L 46.199999999999996 19.25L 46.199999999999996 19.25L 46.199999999999996 53.9Q 44 56.1 41.8 53.9z" pathFrom="M 41.8 53.9L 41.8 55L 46.199999999999996 55L 46.199999999999996 55L 46.199999999999996 55L 41.8 55" cy="19.25" cx="46.199999999999996" j="2" val="65" barHeight="35.75" barWidth="4.4"></path><rect id="SvgjsRect2506" width="4.4" height="55" x="63.8" y="0" rx="5" ry="5" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#f3f3f3" class="apexcharts-backgroundBar"></rect><path id="SvgjsPath2507" d="M 63.8 53.9L 63.8 30.25L 68.2 30.25L 68.2 30.25L 68.2 53.9Q 66 56.1 63.8 53.9z" fill="rgba(255,159,67,0.85)" fill-opacity="1" stroke-opacity="1" stroke-linecap="square" stroke-width="0" stroke-dasharray="0" class="apexcharts-bar-area" index="0" clip-path="url(#gridRectMask21ehz9ft)" pathTo="M 63.8 53.9L 63.8 30.25L 68.2 30.25L 68.2 30.25L 68.2 53.9Q 66 56.1 63.8 53.9z" pathFrom="M 63.8 53.9L 63.8 55L 68.2 55L 68.2 55L 68.2 55L 63.8 55" cy="30.25" cx="68.2" j="3" val="45" barHeight="24.75" barWidth="4.4"></path><rect id="SvgjsRect2508" width="4.4" height="55" x="85.8" y="0" rx="5" ry="5" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#f3f3f3" class="apexcharts-backgroundBar"></rect><path id="SvgjsPath2509" d="M 85.8 53.9L 85.8 19.25L 90.2 19.25L 90.2 19.25L 90.2 53.9Q 88 56.1 85.8 53.9z" fill="rgba(255,159,67,0.85)" fill-opacity="1" stroke-opacity="1" stroke-linecap="square" stroke-width="0" stroke-dasharray="0" class="apexcharts-bar-area" index="0" clip-path="url(#gridRectMask21ehz9ft)" pathTo="M 85.8 53.9L 85.8 19.25L 90.2 19.25L 90.2 19.25L 90.2 53.9Q 88 56.1 85.8 53.9z" pathFrom="M 85.8 53.9L 85.8 55L 90.2 55L 90.2 55L 90.2 55L 85.8 55" cy="19.25" cx="90.2" j="4" val="65" barHeight="35.75" barWidth="4.4"></path></g><g id="SvgjsG2499" class="apexcharts-datalabels" data:realIndex="0"></g></g><line id="SvgjsLine2524" x1="-8.5" y1="0" x2="96.5" y2="0" stroke="#b6b6b6" stroke-dasharray="0" stroke-width="1" class="apexcharts-ycrosshairs"></line><line id="SvgjsLine2525" x1="-8.5" y1="0" x2="96.5" y2="0" stroke-dasharray="0" stroke-width="0" class="apexcharts-ycrosshairs-hidden"></line><g id="SvgjsG2526" class="apexcharts-yaxis-annotations"></g><g id="SvgjsG2527" class="apexcharts-xaxis-annotations"></g><g id="SvgjsG2528" class="apexcharts-point-annotations"></g><rect id="SvgjsRect2529" width="0" height="0" x="0" y="0" rx="0" ry="0" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#fefefe" class="apexcharts-zoom-rect"></rect><rect id="SvgjsRect2530" width="0" height="0" x="0" y="0" rx="0" ry="0" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#fefefe" class="apexcharts-selection-rect"></rect></g><g id="SvgjsG2512" class="apexcharts-yaxis" rel="0" transform="translate(-18, 0)"></g><g id="SvgjsG2488" class="apexcharts-annotations"></g></svg><div class="apexcharts-legend" style="max-height: 35px;"></div><div class="apexcharts-tooltip apexcharts-theme-light"><div class="apexcharts-tooltip-series-group" style="order: 1;"><span class="apexcharts-tooltip-marker" style="background-color: rgb(255, 159, 67);"></span><div class="apexcharts-tooltip-text" style="font-family: Helvetica, Arial, sans-serif; font-size: 12px;"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-label"></span><span class="apexcharts-tooltip-text-value"></span></div><div class="apexcharts-tooltip-z-group"><span class="apexcharts-tooltip-text-z-label"></span><span class="apexcharts-tooltip-text-z-value"></span></div></div></div></div><div class="apexcharts-yaxistooltip apexcharts-yaxistooltip-0 apexcharts-yaxistooltip-left apexcharts-theme-light"><div class="apexcharts-yaxistooltip-text"></div></div></div></div>
            <div class="resize-triggers"><div class="expand-trigger"><div style="width: 148px; height: 176px;"></div></div><div class="contract-trigger"></div></div></div>
          </div>
        </div>
        <!--/ Bar Chart - Orders -->

        <!-- Line Chart - Profit -->
        <div class="col-lg-2 col-md-2 col-6">
          <div class="card card-tiny-line-stats">
            <div class="card-body pb-50" style="position: relative;">
              <h6>الربح</h6>
              <h2 class="fw-bolder mb-1"><?php if($role == "مدير النظام" || $role == "محاسب" ): ?> <?php echo e(number_format($profit)); ?> <?php else: ?> *********** <?php endif; ?></h2>
              <div id="statistics-profit-chart" style="min-height: 85px;"><div id="apexcharts7slve0h7" class="apexcharts-canvas apexcharts7slve0h7 apexcharts-theme-light" style="width: 105px; height:70px;"><svg id="SvgjsSvg2531" width="105" height="70" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="apexcharts-svg" xmlns:data="ApexChartsNS" transform="translate(0, 0)" style="background: transparent;"><g id="SvgjsG2533" class="apexcharts-inner apexcharts-graphical" transform="translate(12, 0)"><defs id="SvgjsDefs2532"><clipPath id="gridRectMask7slve0h7"><rect id="SvgjsRect2538" width="90" height="68" x="-3.5" y="-1.5" rx="0" ry="0" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#fff"></rect></clipPath><clipPath id="gridRectMarkerMask7slve0h7"><rect id="SvgjsRect2539" width="95" height="77" x="-6" y="-6" rx="0" ry="0" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#fff"></rect></clipPath></defs><line id="SvgjsLine2537" x1="0" y1="0" x2="0" y2="65" stroke="#b6b6b6" stroke-dasharray="3" class="apexcharts-xcrosshairs" x="0" y="0" width="1" height="65" fill="#b1b9c4" filter="none" fill-opacity="0.9" stroke-width="1"></line><g id="SvgjsG2556" class="apexcharts-xaxis" transform="translate(0, 0)"><g id="SvgjsG2557" class="apexcharts-xaxis-texts-g" transform="translate(0, -4)"><text id="SvgjsText2559" font-family="Helvetica, Arial, sans-serif" x="0" y="94" text-anchor="middle" dominant-baseline="auto" font-size="0px" font-weight="400" fill="#373d3f" class="apexcharts-text apexcharts-xaxis-label " style="font-family: Helvetica, Arial, sans-serif;"><tspan id="SvgjsTspan2560">1</tspan><title>1</title></text><text id="SvgjsText2562" font-family="Helvetica, Arial, sans-serif" x="16.6" y="94" text-anchor="middle" dominant-baseline="auto" font-size="0px" font-weight="400" fill="#373d3f" class="apexcharts-text apexcharts-xaxis-label " style="font-family: Helvetica, Arial, sans-serif;"><tspan id="SvgjsTspan2563">2</tspan><title>2</title></text><text id="SvgjsText2565" font-family="Helvetica, Arial, sans-serif" x="33.2" y="94" text-anchor="middle" dominant-baseline="auto" font-size="0px" font-weight="400" fill="#373d3f" class="apexcharts-text apexcharts-xaxis-label " style="font-family: Helvetica, Arial, sans-serif;"><tspan id="SvgjsTspan2566">3</tspan><title>3</title></text><text id="SvgjsText2568" font-family="Helvetica, Arial, sans-serif" x="49.8" y="94" text-anchor="middle" dominant-baseline="auto" font-size="0px" font-weight="400" fill="#373d3f" class="apexcharts-text apexcharts-xaxis-label " style="font-family: Helvetica, Arial, sans-serif;"><tspan id="SvgjsTspan2569">4</tspan><title>4</title></text><text id="SvgjsText2571" font-family="Helvetica, Arial, sans-serif" x="66.4" y="94" text-anchor="middle" dominant-baseline="auto" font-size="0px" font-weight="400" fill="#373d3f" class="apexcharts-text apexcharts-xaxis-label " style="font-family: Helvetica, Arial, sans-serif;"><tspan id="SvgjsTspan2572">5</tspan><title>5</title></text><text id="SvgjsText2574" font-family="Helvetica, Arial, sans-serif" x="83.00000000000001" y="94" text-anchor="middle" dominant-baseline="auto" font-size="0px" font-weight="400" fill="#373d3f" class="apexcharts-text apexcharts-xaxis-label " style="font-family: Helvetica, Arial, sans-serif;"><tspan id="SvgjsTspan2575">6</tspan><title>6</title></text></g></g><g id="SvgjsG2577" class="apexcharts-grid"><g id="SvgjsG2578" class="apexcharts-gridlines-horizontal"></g><g id="SvgjsG2579" class="apexcharts-gridlines-vertical"><line id="SvgjsLine2580" x1="0" y1="0" x2="0" y2="65" stroke="#ebebeb" stroke-dasharray="5" class="apexcharts-gridline"></line><line id="SvgjsLine2581" x1="16.6" y1="0" x2="16.6" y2="65" stroke="#ebebeb" stroke-dasharray="5" class="apexcharts-gridline"></line><line id="SvgjsLine2582" x1="33.2" y1="0" x2="33.2" y2="65" stroke="#ebebeb" stroke-dasharray="5" class="apexcharts-gridline"></line><line id="SvgjsLine2583" x1="49.800000000000004" y1="0" x2="49.800000000000004" y2="65" stroke="#ebebeb" stroke-dasharray="5" class="apexcharts-gridline"></line><line id="SvgjsLine2584" x1="66.4" y1="0" x2="66.4" y2="65" stroke="#ebebeb" stroke-dasharray="5" class="apexcharts-gridline"></line><line id="SvgjsLine2585" x1="83" y1="0" x2="83" y2="65" stroke="#ebebeb" stroke-dasharray="5" class="apexcharts-gridline"></line></g><line id="SvgjsLine2587" x1="0" y1="65" x2="83" y2="65" stroke="transparent" stroke-dasharray="0"></line><line id="SvgjsLine2586" x1="0" y1="1" x2="0" y2="65" stroke="transparent" stroke-dasharray="0"></line></g><g id="SvgjsG2540" class="apexcharts-line-series apexcharts-plot-series"><g id="SvgjsG2541" class="apexcharts-series" seriesName="seriesx1" data:longestSeries="true" rel="1" data:realIndex="0"><path id="SvgjsPath2555" d="M 0 65L 16.6 39L 33.2 58.5L 49.8 26L 66.4 45.5L 83 6.5" fill="none" fill-opacity="1" stroke="rgba(0,207,232,0.85)" stroke-opacity="1" stroke-linecap="butt" stroke-width="3" stroke-dasharray="0" class="apexcharts-line" index="0" clip-path="url(#gridRectMask7slve0h7)" pathTo="M 0 65L 16.6 39L 33.2 58.5L 49.8 26L 66.4 45.5L 83 6.5" pathFrom="M -1 65L -1 65L 16.6 65L 33.2 65L 49.8 65L 66.4 65L 83 65"></path><g id="SvgjsG2542" class="apexcharts-series-markers-wrap" data:realIndex="0"><g id="SvgjsG2544" class="apexcharts-series-markers" clip-path="url(#gridRectMarkerMask7slve0h7)"><circle id="SvgjsCircle2545" r="2" cx="0" cy="65" class="apexcharts-marker no-pointer-events wgnizay6al" stroke="#00cfe8" fill="#00cfe8" fill-opacity="1" stroke-width="2" stroke-opacity="1" rel="0" j="0" index="0" default-marker-size="2"></circle><circle id="SvgjsCircle2546" r="2" cx="16.6" cy="39" class="apexcharts-marker no-pointer-events wngzlh18hi" stroke="#00cfe8" fill="#00cfe8" fill-opacity="1" stroke-width="2" stroke-opacity="1" rel="1" j="1" index="0" default-marker-size="2"></circle></g><g id="SvgjsG2547" class="apexcharts-series-markers" clip-path="url(#gridRectMarkerMask7slve0h7)"><circle id="SvgjsCircle2548" r="2" cx="33.2" cy="58.5" class="apexcharts-marker no-pointer-events wjk5ne029f" stroke="#00cfe8" fill="#00cfe8" fill-opacity="1" stroke-width="2" stroke-opacity="1" rel="2" j="2" index="0" default-marker-size="2"></circle></g><g id="SvgjsG2549" class="apexcharts-series-markers" clip-path="url(#gridRectMarkerMask7slve0h7)"><circle id="SvgjsCircle2550" r="2" cx="49.8" cy="26" class="apexcharts-marker no-pointer-events wsh3lziug" stroke="#00cfe8" fill="#00cfe8" fill-opacity="1" stroke-width="2" stroke-opacity="1" rel="3" j="3" index="0" default-marker-size="2"></circle></g><g id="SvgjsG2551" class="apexcharts-series-markers" clip-path="url(#gridRectMarkerMask7slve0h7)"><circle id="SvgjsCircle2552" r="2" cx="66.4" cy="45.5" class="apexcharts-marker no-pointer-events wyizl6o7mh" stroke="#00cfe8" fill="#00cfe8" fill-opacity="1" stroke-width="2" stroke-opacity="1" rel="4" j="4" index="0" default-marker-size="2"></circle></g><g id="SvgjsG2553" class="apexcharts-series-markers" clip-path="url(#gridRectMarkerMask7slve0h7)"><circle id="SvgjsCircle2554" r="5" cx="83" cy="6.5" class="apexcharts-marker no-pointer-events w0v8mzua1" stroke="#00cfe8" fill="#ffffff" fill-opacity="1" stroke-width="2" stroke-opacity="1" rel="5" j="5" index="0" default-marker-size="5"></circle></g></g></g><g id="SvgjsG2543" class="apexcharts-datalabels" data:realIndex="0"></g></g><line id="SvgjsLine2588" x1="0" y1="0" x2="83" y2="0" stroke="#b6b6b6" stroke-dasharray="0" stroke-width="1" class="apexcharts-ycrosshairs"></line><line id="SvgjsLine2589" x1="0" y1="0" x2="83" y2="0" stroke-dasharray="0" stroke-width="0" class="apexcharts-ycrosshairs-hidden"></line><g id="SvgjsG2590" class="apexcharts-yaxis-annotations"></g><g id="SvgjsG2591" class="apexcharts-xaxis-annotations"></g><g id="SvgjsG2592" class="apexcharts-point-annotations"></g></g><rect id="SvgjsRect2536" width="0" height="0" x="0" y="0" rx="0" ry="0" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#fefefe"></rect><g id="SvgjsG2576" class="apexcharts-yaxis" rel="0" transform="translate(-18, 0)"></g><g id="SvgjsG2534" class="apexcharts-annotations"></g></svg><div class="apexcharts-legend" style="max-height: 35px;"></div><div class="apexcharts-tooltip apexcharts-theme-light"><div class="apexcharts-tooltip-series-group" style="order: 1;"><span class="apexcharts-tooltip-marker" style="background-color: rgb(0, 207, 232);"></span><div class="apexcharts-tooltip-text" style="font-family: Helvetica, Arial, sans-serif; font-size: 12px;"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-label"></span><span class="apexcharts-tooltip-text-value"></span></div><div class="apexcharts-tooltip-z-group"><span class="apexcharts-tooltip-text-z-label"></span><span class="apexcharts-tooltip-text-z-value"></span></div></div></div></div><div class="apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom apexcharts-theme-light"><div class="apexcharts-xaxistooltip-text" style="font-family: Helvetica, Arial, sans-serif; font-size: 12px;"></div></div><div class="apexcharts-yaxistooltip apexcharts-yaxistooltip-0 apexcharts-yaxistooltip-left apexcharts-theme-light"><div class="apexcharts-yaxistooltip-text"></div></div></div></div>
            <div class="resize-triggers"><div class="expand-trigger"><div style="width: 148px; height: 176px;"></div></div><div class="contract-trigger"></div></div></div>
          </div>
        </div>


        <div class="col-lg-4 col-md-4 col-12">
          <div class="card card-tiny-line-stats">
            <div class="card-body pb-50" style="position: relative;">
              <div class="row">
              <h6 class="col-lg-5">المصاريف</h6>
              <div class="btn-group col-lg-6">
               <select class="form-select text-capitalize mb-md-0 mb-2" id="expenses">
                <option value="thisDay"> اليوم</option>
                <option value="thisWeek">هذا الأسبوع</option>
                <option value="thisMonth">هذا الشهر</option>
                <option value="thisYear">هذة النسة</option>
              </select>                
              </div>
              </div>
              
              <h2 class="fw-bolder mb-1">
                  
                <div id="thisDay" class="expenses"><?php echo e(number_format( abs($expenses->where('created_at',Illuminate\Support\Carbon::now()->today())->sum('amount')))); ?></div>
                 <div id="thisWeek" style="display: none"class="expenses" ><?php echo e(number_format( abs($expenses->whereBetween('created_at',[Illuminate\Support\Carbon::now()->startofweek(Illuminate\Support\Carbon::SATURDAY),Illuminate\Support\Carbon::now()->endofweek(Illuminate\Support\Carbon::FRIDAY)])->sum('amount')),)); ?></div>
                 <div id="thisMonth" style="display: none" class="expenses"><?php echo e(number_format( abs($expensesThisMonth = $expenses->whereBetween('created_at',[Illuminate\Support\Carbon::now()->startofmonth(),Illuminate\Support\Carbon::now()->endofmonth()])->sum('amount')) )); ?></div>
                 <div id="thisYear" style="display: none" class="expenses"><?php echo e(number_format( abs($expenses->whereBetween('created_at',[Illuminate\Support\Carbon::now()->startofyear(),Illuminate\Support\Carbon::now()->endofyear()])->sum('amount')) )); ?></div>
              </h2>
              <svg id="SvgjsSvg2572" width="270" height="80" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="apexcharts-svg" xmlns:data="ApexChartsNS" transform="translate(0, 0)" style="background: transparent;"><g id="SvgjsG2574" class="apexcharts-inner apexcharts-graphical" transform="translate(0, 0)"><defs id="SvgjsDefs2573"><clipPath id="gridRectMaskwjau8u7u"><rect id="SvgjsRect2579" width="246" height="82" x="-3" y="-1" rx="0" ry="0" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#fff"></rect></clipPath><clipPath id="gridRectMarkerMaskwjau8u7u"><rect id="SvgjsRect2580" width="244" height="84" x="-2" y="-2" rx="0" ry="0" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#fff"></rect></clipPath></defs><line id="SvgjsLine2578" x1="0" y1="0" x2="0" y2="80" stroke="#b6b6b6" stroke-dasharray="3" class="apexcharts-xcrosshairs" x="0" y="0" width="1" height="80" fill="#b1b9c4" filter="none" fill-opacity="0.9" stroke-width="1"></line><g id="SvgjsG2590" class="apexcharts-xaxis" transform="translate(0, 0)"><g id="SvgjsG2591" class="apexcharts-xaxis-texts-g" transform="translate(0, -4)"></g></g><g id="SvgjsG2593" class="apexcharts-grid"><g id="SvgjsG2594" class="apexcharts-gridlines-horizontal" style="display: none;"><line id="SvgjsLine2596" x1="0" y1="0" x2="240" y2="0" stroke="#e0e0e0" stroke-dasharray="0" class="apexcharts-gridline"></line><line id="SvgjsLine2597" x1="0" y1="20" x2="240" y2="20" stroke="#e0e0e0" stroke-dasharray="0" class="apexcharts-gridline"></line><line id="SvgjsLine2598" x1="0" y1="40" x2="240" y2="40" stroke="#e0e0e0" stroke-dasharray="0" class="apexcharts-gridline"></line><line id="SvgjsLine2599" x1="0" y1="60" x2="240" y2="60" stroke="#e0e0e0" stroke-dasharray="0" class="apexcharts-gridline"></line><line id="SvgjsLine2600" x1="0" y1="80" x2="240" y2="80" stroke="#e0e0e0" stroke-dasharray="0" class="apexcharts-gridline"></line></g><g id="SvgjsG2595" class="apexcharts-gridlines-vertical" style="display: none;"></g><line id="SvgjsLine2602" x1="0" y1="80" x2="240" y2="80" stroke="transparent" stroke-dasharray="0"></line><line id="SvgjsLine2601" x1="0" y1="1" x2="0" y2="80" stroke="transparent" stroke-dasharray="0"></line></g><g id="SvgjsG2581" class="apexcharts-line-series apexcharts-plot-series"><g id="SvgjsG2582" class="apexcharts-series" seriesName="seriesx1" data:longestSeries="true" rel="1" data:realIndex="0"><path id="SvgjsPath2585" d="M 0 19C 8.399999999999999 19 15.600000000000001 32 24 32C 32.4 32 39.6 11 48 11C 56.4 11 63.6 28 72 28C 80.4 28 87.6 20 96 20C 104.4 20 111.6 40 120 40C 128.4 40 135.6 1 144 1C 152.4 1 159.6 20 168 20C 176.4 20 183.6 21 192 21C 200.4 21 207.6 37 216 37C 224.4 37 231.6 18 240 18" fill="none" fill-opacity="1" stroke="rgba(115,103,240,0.85)" stroke-opacity="1" stroke-linecap="butt" stroke-width="2" stroke-dasharray="0" class="apexcharts-line" index="0" clip-path="url(#gridRectMaskwjau8u7u)" pathTo="M 0 19C 8.399999999999999 19 15.600000000000001 32 24 32C 32.4 32 39.6 11 48 11C 56.4 11 63.6 28 72 28C 80.4 28 87.6 20 96 20C 104.4 20 111.6 40 120 40C 128.4 40 135.6 1 144 1C 152.4 1 159.6 20 168 20C 176.4 20 183.6 21 192 21C 200.4 21 207.6 37 216 37C 224.4 37 231.6 18 240 18" pathFrom="M -1 80L -1 80L 24 80L 48 80L 72 80L 96 80L 120 80L 144 80L 168 80L 192 80L 216 80L 240 80"></path><g id="SvgjsG2583" class="apexcharts-series-markers-wrap" data:realIndex="0"></g></g><g id="SvgjsG2586" class="apexcharts-series" seriesName="seriesx2" data:longestSeries="true" rel="2" data:realIndex="1"><path id="SvgjsPath2589" d="M 0 60C 8.399999999999999 60 15.600000000000001 70 24 70C 32.4 70 39.6 50 48 50C 56.4 50 63.6 65 72 65C 80.4 65 87.6 57 96 57C 104.4 57 111.6 80 120 80C 128.4 80 135.6 55 144 55C 152.4 55 159.6 65 168 65C 176.4 65 183.6 60 192 60C 200.4 60 207.6 75 216 75C 224.4 75 231.6 53 240 53" fill="none" fill-opacity="1" stroke="rgba(220,218,227,0.85)" stroke-opacity="1" stroke-linecap="butt" stroke-width="1" stroke-dasharray="5" class="apexcharts-line" index="1" clip-path="url(#gridRectMaskwjau8u7u)" pathTo="M 0 60C 8.399999999999999 60 15.600000000000001 70 24 70C 32.4 70 39.6 50 48 50C 56.4 50 63.6 65 72 65C 80.4 65 87.6 57 96 57C 104.4 57 111.6 80 120 80C 128.4 80 135.6 55 144 55C 152.4 55 159.6 65 168 65C 176.4 65 183.6 60 192 60C 200.4 60 207.6 75 216 75C 224.4 75 231.6 53 240 53" pathFrom="M -1 80L -1 80L 24 80L 48 80L 72 80L 96 80L 120 80L 144 80L 168 80L 192 80L 216 80L 240 80"></path><g id="SvgjsG2587" class="apexcharts-series-markers-wrap" data:realIndex="1"></g></g><g id="SvgjsG2584" class="apexcharts-datalabels" data:realIndex="0"></g><g id="SvgjsG2588" class="apexcharts-datalabels" data:realIndex="1"></g></g><line id="SvgjsLine2603" x1="0" y1="0" x2="240" y2="0" stroke="#b6b6b6" stroke-dasharray="0" stroke-width="1" class="apexcharts-ycrosshairs"></line><line id="SvgjsLine2604" x1="0" y1="0" x2="240" y2="0" stroke-dasharray="0" stroke-width="0" class="apexcharts-ycrosshairs-hidden"></line><g id="SvgjsG2605" class="apexcharts-yaxis-annotations"></g><g id="SvgjsG2606" class="apexcharts-xaxis-annotations"></g><g id="SvgjsG2607" class="apexcharts-point-annotations"></g></g><rect id="SvgjsRect2577" width="0" height="0" x="0" y="0" rx="0" ry="0" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#fefefe"></rect><g id="SvgjsG2592" class="apexcharts-yaxis" rel="0" transform="translate(-18, 0)"></g><g id="SvgjsG2575" class="apexcharts-annotations"></g></svg>
          </div>
        </div>
        
      </div>

      <div class="col-lg-4 col-md-4 col-12">
        <div class="card earnings-card">
          <div class="card-body">
            <div class="row">
              <div class="col-6">
                <h4 class="card-title mb-1">صافي الأرباح</h4>
                <div class="font-small-2"> الشهر الحالي</div>
                <h5 class="mb-1"><?php echo e(number_format($netProfitThisMonth = $profit_this_month-$expensesThisMonth)); ?></h5>
                <div class="font-small-2"> الشهر السابق</div>
                <?php $expensesLastMonth = $expenses->whereBetween('created_at',[Illuminate\Support\Carbon::now()->subMonth()->startofmonth(),Illuminate\Support\Carbon::now()->subMonth()->endofmonth()])->sum('amount')?>
                <h5 class="mb-1"><?php echo e(number_format($netProfitLastMonth = $profit_last_month-$expensesLastMonth)); ?></h5>
              </div>
              <?php  
                        if($netProfitThisMonth == 0  ){$netRate=0;}
                         elseif($netProfitLastMonth ==0 && $netProfitThisMonth !== 0 ){$netRate = 100;}
                         else{$netRate=($netProfitThisMonth-$netProfitLastMonth)/$netProfitLastMonth*100; }
                         ?>
              <div class="col-6" style="position: relative;">
                <div id="earnings-chart" style="min-height: 126.8px;"><div id="apexchartsaz9ig3m2f" class="apexcharts-canvas apexchartsaz9ig3m2f apexcharts-theme-light" style="width: 127px; height: 126.8px;"><svg id="SvgjsSvg1532" width="127" height="126.8" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="apexcharts-svg" xmlns:data="ApexChartsNS" transform="translate(0, 0)" style="background: transparent;"><g id="SvgjsG1534" class="apexcharts-inner apexcharts-graphical" transform="translate(-16.5, 0)"><defs id="SvgjsDefs1533"><clipPath id="gridRectMaskaz9ig3m2f"><rect id="SvgjsRect1536" width="164" height="128" x="-2" y="0" rx="0" ry="0" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#fff"></rect></clipPath><clipPath id="gridRectMarkerMaskaz9ig3m2f"><rect id="SvgjsRect1537" width="164" height="132" x="-2" y="-2" rx="0" ry="0" opacity="1" stroke-width="0" stroke="none" stroke-dasharray="0" fill="#fff"></rect></clipPath></defs><g id="SvgjsG1538" class="apexcharts-pie"><g id="SvgjsG1539" transform="translate(0, 0) scale(1)"><circle id="SvgjsCircle1540" r="37.98536585365854" cx="80" cy="64" fill="transparent"></circle><g id="SvgjsG1541" class="apexcharts-slices"><g id="SvgjsG1542" class="apexcharts-series apexcharts-pie-series" seriesName="App" rel="1" data:realIndex="0"><path id="SvgjsPath1543" d="M 69.85216991000085 6.448795702018273 A 58.43902439024391 58.43902439024391 0 1 1 79.1840638026197 122.43332798844617 L 79.46964147170281 101.98166319249002 A 37.98536585365854 37.98536585365854 0 1 0 73.40391044150056 26.591717206311877 L 69.85216991000085 6.448795702018273 z" fill="#28c76f66" fill-opacity="1" stroke-opacity="1" stroke-linecap="butt" stroke-width="0" stroke-dasharray="0" class="apexcharts-pie-area apexcharts-donut-slice-0" index="0" j="0" data:angle="190.8" data:startAngle="-10" data:strokeWidth="0" data:value="53" data:pathOrig="M 69.85216991000085 6.448795702018273 A 58.43902439024391 58.43902439024391 0 1 1 79.1840638026197 122.43332798844617 L 79.46964147170281 101.98166319249002 A 37.98536585365854 37.98536585365854 0 1 0 73.40391044150056 26.591717206311877 L 69.85216991000085 6.448795702018273 z"></path></g><g id="SvgjsG1544" class="apexcharts-series apexcharts-pie-series" seriesName="Service" rel="2" data:realIndex="1"><path id="SvgjsPath1545" d="M 79.1840638026197 122.43332798844617 A 58.43902439024391 58.43902439024391 0 0 1 30.22590892178677 94.6212251391295 L 47.646840799161396 83.90379634043418 A 37.98536585365854 37.98536585365854 0 0 0 79.46964147170281 101.98166319249002 L 79.1840638026197 122.43332798844617 z" fill="<?php if($netRate>=0): ?>#54d98f <?php else: ?>#e96767 <?php endif; ?>" fill-opacity="1" stroke-opacity="1" stroke-linecap="butt" stroke-width="0" stroke-dasharray="0" class="apexcharts-pie-area apexcharts-donut-slice-1" index="0" j="1" data:angle="57.599999999999994" data:startAngle="180.8" data:strokeWidth="0" data:value="16" data:pathOrig="M 79.1840638026197 122.43332798844617 A 58.43902439024391 58.43902439024391 0 0 1 30.22590892178677 94.6212251391295 L 47.646840799161396 83.90379634043418 A 37.98536585365854 37.98536585365854 0 0 0 79.46964147170281 101.98166319249002 L 79.1840638026197 122.43332798844617 z"></path></g><g id="SvgjsG1546" class="apexcharts-series apexcharts-pie-series" seriesName="Product" rel="3" data:realIndex="2"><path id="SvgjsPath1547" d="M 30.22590892178677 94.6212251391295 A 58.43902439024391 58.43902439024391 0 0 1 69.84212548457727 6.4505677090342814 L 73.39738156497522 26.592869010872285 A 37.98536585365854 37.98536585365854 0 0 0 47.646840799161396 83.90379634043418 L 30.22590892178677 94.6212251391295 z" fill="<?php if($netRate>=0): ?>rgba(40,199,111,1)<?php else: ?>#f52020 <?php endif; ?>" fill-opacity="1" stroke-opacity="1" stroke-linecap="butt" stroke-width="0" stroke-dasharray="0" class="apexcharts-pie-area apexcharts-donut-slice-2" index="0" j="2" data:angle="111.6" data:startAngle="238.4" data:strokeWidth="0" data:value="31" data:pathOrig="M 30.22590892178677 94.6212251391295 A 58.43902439024391 58.43902439024391 0 0 1 69.84212548457727 6.4505677090342814 L 73.39738156497522 26.592869010872285 A 37.98536585365854 37.98536585365854 0 0 0 47.646840799161396 83.90379634043418 L 30.22590892178677 94.6212251391295 z"></path></g></g></g><g id="SvgjsG1548" class="apexcharts-datalabels-group" transform="translate(0, 0) scale(1)"><text id="SvgjsText1549" font-family="Helvetica, Arial, sans-serif" x="80" y="79" text-anchor="middle" dominant-baseline="auto" font-size="12px" font-weight="400" fill="#373d3f" class="" style="font-family:Tajawal, sans-serif ;">نمو الربح</text><text id="SvgjsText1550" font-family="Helvetica, Arial, sans-serif" x="80" y="65" text-anchor="middle" dominant-baseline="auto" font-size="20px" font-weight="400" fill="#373d3f" class="apexcharts-text apexcharts-datalabel-value" style="font-family: Helvetica, Arial, sans-serif;">
                          <?php echo e((number_format($netRate,1))); ?> 
                         </text></g></g><line id="SvgjsLine1551" x1="0" y1="0" x2="160" y2="0" stroke="#b6b6b6" stroke-dasharray="0" stroke-width="1" class="apexcharts-ycrosshairs"></line><line id="SvgjsLine1552" x1="0" y1="0" x2="160" y2="0" stroke-dasharray="0" stroke-width="0" class="apexcharts-ycrosshairs-hidden"></line></g><g id="SvgjsG1535" class="apexcharts-annotations"></g></svg><div class="apexcharts-legend"></div><div class="apexcharts-tooltip apexcharts-theme-dark"><div class="apexcharts-tooltip-series-group" style="order: 1;"><span class="apexcharts-tooltip-marker" style="background-color: rgba(40, 199, 111, 0.4);"></span><div class="apexcharts-tooltip-text" style="font-family: Helvetica, Arial, sans-serif; font-size: 12px;"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-label"></span><span class="apexcharts-tooltip-text-value"></span></div><div class="apexcharts-tooltip-z-group"><span class="apexcharts-tooltip-text-z-label"></span><span class="apexcharts-tooltip-text-z-value"></span></div></div></div><div class="apexcharts-tooltip-series-group" style="order: 2;"><span class="apexcharts-tooltip-marker" style="background-color: rgba(40, 199, 111, 0.2);"></span><div class="apexcharts-tooltip-text" style="font-family: Helvetica, Arial, sans-serif; font-size: 12px;"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-label"></span><span class="apexcharts-tooltip-text-value"></span></div><div class="apexcharts-tooltip-z-group"><span class="apexcharts-tooltip-text-z-label"></span><span class="apexcharts-tooltip-text-z-value"></span></div></div></div><div class="apexcharts-tooltip-series-group" style="order: 3;"><span class="apexcharts-tooltip-marker" style="background-color: rgb(40, 199, 111);"></span><div class="apexcharts-tooltip-text" style="font-family: Helvetica, Arial, sans-serif; font-size: 12px;"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-label"></span><span class="apexcharts-tooltip-text-value"></span></div><div class="apexcharts-tooltip-z-group"><span class="apexcharts-tooltip-text-z-label"></span><span class="apexcharts-tooltip-text-z-value"></span></div></div></div></div></div></div>
              <div class="resize-triggers"><div class="expand-trigger"><div style="width: 156px; height: 128px;"></div></div><div class="contract-trigger"></div></div></div>
            </div>
          </div>
        </div>
      </div>

    </div>
    </div>
    </div>
    <div class="col-xl-12 col-md-12 col-12">
      <div class="card card-statistics">

        <div class="card-body statistics-body">
          <div class="row">
        <?php if(empty($package) || $package->products == "1"): ?>

        <div class="col-xl-3 col-sm-6 col-12 mb-2 mb-xl-0">
          <div class="d-flex flex-row">
              <div class="avatar bg-light-success me-2">
                <div class="avatar-content">
                  <i  style="font-size:30px" class="las la-boxes"></i>
                </div>
              </div>
              <div class="my-auto">
                <h4 class="fw-bolder mb-0"> <?php if($role == "مدير النظام" || $role == "محاسب"): ?><?php echo e(number_format($total_purchase_prices)); ?><?php else: ?>***********<?php endif; ?></h4>
                <p class="card-text font-small-3 mb-0">إجمالي المخزون</p>
              </div>
            </div>
          </div>
          <?php endif; ?>

          <div class="col-xl-3 col-sm-6 col-12 mb-2 mb-xl-0">
            <div class="d-flex flex-row">
              <div class="avatar bg-light-warning me-2">
                <div class="avatar-content">
                  <i style="font-size: 30px"  class="las la-store-alt"></i>
                </div>
              </div>
              <div class="my-auto">
                <h4 class="fw-bolder mb-0"><?php echo e(number_format($buy_bills->sum('final_total'))); ?></h4>
                <p class="card-text font-small-3 mb-0">إجمالي المشتريات</p>
              </div>
            </div>
          </div>
          <div class="col-xl-3 col-sm-6 col-12 mb-2 mb-sm-0">
            <div class="d-flex flex-row">
              <div class="avatar bg-light-primary me-2">
                <div class="avatar-content">
                  <i style="font-size: 30px" class="las la-dolly-flatbed"></i>
                </div>
              </div>
              <div class="my-auto">
                <h4 class="fw-bolder mb-0"><?php echo e(number_format($products_limited->count())); ?></h4>
                <p class="card-text font-small-3 mb-0">منتجات أوشكت علي النقاذ</p>
              </div>
            </div>
          </div>
          <div class="col-xl-3 col-sm-6 col-12">
            <div class="d-flex flex-row">
              <div class="avatar bg-light-danger me-2">
                <div class="avatar-content">
                  <i style="font-size: 30px" class="las la-cart-arrow-down"></i>
                </div>
              </div>
              <div class="my-auto">
                <h4 class="fw-bolder mb-0"><?php echo e(number_format($products_finished->count())); ?></h4>
                <p class="card-text font-small-3 mb-0">المنتجات التي نفذت</p>
              </div>
            </div>
          </div>
          
        </div>
        </div>
      </div>
    </div>

    <div class="divider divider-primary">
      <div class="divider-text" > <h4>الإختصارات</h4></div>
    </div>  
    <div class="row match-height">
        <div class="row match-height">
          <!-- Bar Chart - Orders -->
          <div class="col-lg-3 col-md-3 col-6">
            <div class="card card-tiny-line-stats">
              <div class="card-body " align="center">
                <span class="las la-cart-plus" style="font-size:40px ; color :rgb(0, 207, 232)"></span>
              <a href="<?php echo e(route('client.sale_bills.create')); ?>">
                <h6 style="font-weight: bold">فاتورة مبيعات جديدة</h6>
              </a>
              </div>
            </div>
          </div>
  
          <!-- Line Chart - Profit -->
          <div class="col-lg-3 col-md-3 col-6">
            <div class="card card-tiny-line-stats">
              <div class="card-body " align="center">
                <i class="las la-cart-arrow-down" style="font-size:40px ; color :rgb(0, 207, 232)"></i>
            <a href="<?php echo e(route('client.buy_bills.create')); ?>">
                <h6 style="font-weight: bold">فاتورة مشتريات جديدة</h6>
              </a>

              </div>
            </div>
          </div>
  
          <div class="col-lg-3 col-md-3 col-6">
            <div class="card card-tiny-line-stats">
              <div class="card-body " align="center">
                <i class="las la-file-invoice-dollar" style="font-size:40px ; color :rgb(0, 207, 232)"></i>
            <a href="<?php echo e(route('client.expenses.create')); ?>">
                <h6 style="font-weight: bold">مصروف أو إيراد جديد</h6>
            </a>
              </div>
            </div>
          </div>
  
          <div class="col-lg-3 col-md-3 col-6">
            <div class="card card-tiny-line-stats">
              <div class="card-body " align="center">
                <i class="las la-hand-holding-usd" style="font-size:40px ; color :rgb(0, 207, 232)"></i>
                <a href="javascript:;" class="role-edit-modal" data-bs-toggle="modal" data-bs-target="#addClientPayCash">
                  <h6 style="font-weight: bold">دفعة  من عميل</h6>
                </a>
              </div>
            </div>
          </div>

          <div class="col-lg-3 col-md-3 col-6">
            <div class="card card-tiny-line-stats">
              <div class="card-body " align="center">
                <span class="las la-money-bill" style="font-size:40px ; color :rgb(65, 211, 89)"></span>
                <a href="javascript:;" class="role-edit-modal" data-bs-toggle="modal" data-bs-target="#addClientAdvance">
                <h6 style="font-weight: bold">سلفة إلي عميل</h6>
              </a>
            
              </div>
            </div>
          </div>

          <div class="col-lg-3 col-md-3 col-6">
            <div class="card card-tiny-line-stats">
              <div class="card-body " align="center">
                <span class="las la-money-bill" style="font-size:40px ; color :rgb(65, 211, 89) "></span>
                <a href="javascript:;" class="role-edit-modal" data-bs-toggle="modal" data-bs-target="#addEmployeePay">
                  <h6 style="font-weight: bold">دفعة لموظف</h6>
              </a>
              </div>
            </div>
          </div>
          <div class="col-lg-3 col-md-3 col-6">
            <div class="card card-tiny-line-stats">
              <div class="card-body " align="center">
                <i class="las la-user-plus" style="font-size:40px ;  color :rgb(65, 211, 89) "></i>
            <a href="<?php echo e(route('client.suppliers.create')); ?>">
                <h6 style="font-weight: bold">مورد جديد</h6>
            </a>
              </div>
            </div>
          </div>

          <div class="col-lg-3 col-md-3 col-6">
            <div class="card card-tiny-line-stats">
              <div class="card-body " align="center">
                <i class="las la-user-plus" style="font-size:40px ; color :rgb(65, 211, 89) "></i>
            <a href="<?php echo e(route('client.outer_clients.create')); ?>">
                <h6 style="font-weight: bold">عميل جديد</h6>
            </a>
              </div>
            </div>
          </div>

     
        </div>
      
  
      <!-- Revenue Report Card -->
      
      <!--/ Revenue Report Card -->
    </div>
  
</section>
<!-- Dashboard Ecommerce ends -->

        </div>
      </div>
    </div>

    <div class="modal fade show" id="addClientAdvance" tabindex="-1" style="display: none;" aria-modal="true" role="dialog">
      <div class="modal-dialog modal-lg modal-dialog-centered modal-add-new-role">
          <div class="modal-content">
              <div class="modal-header bg-transparent">
                  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
              </div>
              <div class="modal-body px-5 pb-5">
                  <div class="text-center mb-4">
                      <h2 class="role-title">إضافة سلفة إلي عميل</h2>
                  </div>
                  <!-- Add role form -->
                  <form class="form" id="addClientAdvanceForm" action="#">
                  <input type="hidden" name="company_id" value="<?php echo e($company->id); ?>">
                  <input type="hidden" name="cash_number" value="">

                  <?php echo csrf_field(); ?>
                <div class="row">
                  <div class="col-md-4 col-12">
                      <div class="mb-1">                    
                          <b class="form-label">  العميل </b>
                          <select  name="outer_client_id" class="form-control search" id="outer_client_id" >
                            <option value="">اختر العميل</option>
                            <?php $__currentLoopData = $all_outer_clients; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $outer_client): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                  <option value="<?php echo e($outer_client->id); ?>"><?php echo e($outer_client->client_name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          </select>
          
                      </div>
                  </div>
                  <div class="col-md-4 col-12">
                      <div class="mb-1">  
                         <b class="form-label"> المبلغ المدفوع </b>
                          <input  class="form-control"
                                 name="amount" type="number" step="any" placeholder="مبلغ السلفة">
                      </div>
                  </div>
                  <div class="col-md-4 col-12">
                      <div class="mb-1">  
                          <b class="form-label"> التاريخ </b>
                          <input  class="form-control"
                                 name="date" type="date"  value="<?php echo e(date('Y-m-d')); ?>">
                      </div>
                   </div>
                      <div class="col-md-4 col-12">
                          <div class="mb-1">  
                          <b class="form-label"> الوقت </b>
                          <input  class="form-control"
                                 name="time" type="time"  value="<?php echo e(date('H:i:s')); ?>">
                                 
                      </div>
                  </div>
                  <div class="col-md-4 col-12">
                      <div class="mb-1">  
                          <b class="form-label"> خزنة الدفع </b>
                          <select name="safe_id" class="form-control">
                              <option value="">اختر خزنة الدفع</option>
                              <?php $__currentLoopData = $safes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $safe): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                  <option
                                      value="<?php echo e($safe->id); ?>"><?php echo e($safe->safe_name); ?></option>
                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          </select>
                          </div>
                      </div>   
      
                  <div class="col-12" align="center">
                  <br>
                  <button type="submit" class="btn btn-success me-1 waves-effect waves-float waves-light">إضافة</button>
                  <button type="reset" class="btn btn-outline-secondary waves-effect" data-bs-dismiss="modal" aria-label="Close">إلغاء</button>
                  </div>
                </div>
                
              </form>
              </div>
          </div>
      </div>
  </div>

  <!-- add client pay-->
  <div class="modal fade show" id="addClientPayCash" tabindex="-1" style="display: none;" aria-modal="true" role="dialog">
    <div class="modal-dialog modal-lg modal-dialog-centered modal-add-new-role">
        <div class="modal-content">
            <div class="modal-header bg-transparent">
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body px-5 pb-5">
                <div class="text-center mb-4">
                    <h2 class="role-title">إضافة دفعة نقدية لعميل</h2>
                </div>
            <form class="form" id="addClientPayCashForm" action="#">
              <input type="hidden" name="company_id" value="<?php echo e($company->id); ?>">
              <input type="hidden" name="cash_number" value="" class="form-control">
            <?php echo csrf_field(); ?>
          <div class="row">
            <div class="col-md-4 col-12">
                <div class="mb-1">                    
                    <b class="form-label">  العميل </b>
                    <select  name="outer_client_id" class="form-control selectpicker search" id="outer_client_id" >
                      <option value="">اختر العميل</option>
                      <?php $__currentLoopData = $all_outer_clients; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $outer_client): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($outer_client->id); ?>"><?php echo e($outer_client->client_name); ?></option>
                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                  </div>
            </div>
            <div class="col-md-4 col-12">
                <div class="mb-1">  
                   <b class="form-label"> المبلغ المدفوع </b>
                    <input  class="form-control"
                           name="amount" type="number" step="any"placeholder="مبلغ الدفعة" >
                </div>
            </div>
            <div class="col-md-4 col-12">
                <div class="mb-1">  
                    <b class="form-label"> التاريخ </b>
                    <input  class="form-control"
                           name="date" type="date"  value="<?php echo e(date('Y-m-d')); ?>">
                </div>
             </div>
                <div class="col-md-4 col-12">
                    <div class="mb-1">  
                    <b class="form-label"> الوقت </b>
                    <input  class="form-control"
                           name="time" type="time"  value="<?php echo e(date('H:i:s')); ?>">
                           
                </div>
            </div>
            <div class="col-md-4 col-12">
                <div class="mb-1">  
                    <b class="form-label"> خزنة الدفع </b>
                    <select name="safe_id" class="form-control">
                        <option value="">اختر خزنة الدفع</option>
                        <?php $__currentLoopData = $safes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $safe): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option
                                value="<?php echo e($safe->id); ?>"><?php echo e($safe->safe_name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                    </div>
                </div>   

            <div class="col-12" align="center">
            <br>
            <button type="submit" class="btn btn-success me-1 waves-effect waves-float waves-light">إضافة</button>
            <button type="reset" class="btn btn-outline-secondary waves-effect" data-bs-dismiss="modal" aria-label="Close">إلغاء</button>
            </div>
          </div>
          
        </form>
                
            </div>
        </div>
    </div>
</div>
<!-- employee pay-->
<div class="modal fade show" id="addEmployeePay" tabindex="-1" style="display: none;" aria-modal="true" role="dialog">
    <div class="modal-dialog modal-lg modal-dialog-centered modal-add-new-role">
        <div class="modal-content">
            <div class="modal-header bg-transparent">
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body px-5 pb-5">
                <div class="text-center mb-4">
                    <h2 class="role-title"> دفعة نقدية لموظف</h2>
                </div>
            <form class="form" id="addEmployeePayForm" action="#">
                 <?php echo csrf_field(); ?>
                <input type="hidden" name="company_id" value="<?php echo e($company->id); ?>">
                <div class="row ">
                    <div class="col-md-4 col-12">
                      <div class="mb-1">
                        <b> اسم الموظف </b>
                        <select  name="employee_id" id="employee_id" class="form-control search" >
                          <option value="">اختر الموظف</option>
                          <?php $__currentLoopData = $employees; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $employee): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($employee->id); ?>"><?php echo e($employee->name); ?></option>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                           </select>
                      </div>
                    </div>
                    <div class="col-md-4 col-12">
                      <div class="mb-1">
                        <b>  قيمة الدفعة </b>
                        <input   class="form-control" name="amount" type="text" placeholder="قيمة الدفعة">
                      </div>
                    </div> 
                    <div class="col-md-4 col-12">
                      <div class="mb-1">
                        <b> التاريخ  </b>
                        <input required class="form-control" value="<?php echo e(date('Y-m-d')); ?>" dir="ltr" name="date" type="date">
                        </div>
                    </div>


                </div>
                <div class="row ">
                  <div class="col-md-4 col-12">
                      <div class="mb-1">
                        <b> خزنة الدفع </b>
                        <select  name="safe_id" id="safe_id" class="form-control">
                            <option value="">اختر خزنة </option>
                            <?php $__currentLoopData = $safes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $safe): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($safe->id); ?>"><?php echo e($safe->safe_name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                      </div>
                    </div>
                    <div class="col-md-4 col-12">
                      <div class="mb-1">
                        <b> ملاحظات </b>
                        <input  class="form-control" name="notes" type="text" placeholder="ملاحظات">
                      </div>
                    </div>
                </div>
                <div class="col-12" align="center">
                  <br>
                    <button type="submit" class="btn btn-success me-1">إضافة</button>
                    <button type="reset" class="btn btn-outline-secondary waves-effect" data-bs-dismiss="modal" aria-label="Close">إلغاء</button>
                  </div>
            </form>
            </div>
        </div>
    </div>
</div>
    <?php $__env->stopSection(); ?>
    <?php $__env->startSection('script'); ?>
<script src="<?php echo e(asset('app-assets/js/select2.min.js')); ?>"></script>
    <script>


$(document).ready(function () {
    $('#expenses').change('keyup',function(){
          $('.expenses').hide()
          $('#'+this.value).show();
        });
        
        $('.search').select2();

  ajaxForm("addClientAdvanceForm","<?php echo e(route('client.store2.cash.clients')); ?>");
  ajaxForm("addClientPayCashForm","<?php echo e(route('client.store.cash.clients')); ?>");
  ajaxForm("addEmployeePayForm","<?php echo e(route('employees.post.cash')); ?>");


  

  


});
    </script>
    <?php $__env->stopSection(); ?>
<?php echo $__env->make('client.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\xampp\htdocs\sales\resources\views/client/home.blade.php ENDPATH**/ ?>