<?php //sleep(3);
?>


<?php $__env->startSection('content'); ?>
 
 
    <button type="button"  class="btn btn-warning" data-toggle="modal" data-target="#notapproved" >
      Not Approved  
    </button>

    <button type="button" class="btn btn-success"  data-toggle="modal" data-target="#notsent">
    Not Sent to Recycler
    </button>

    <button type="button" class="btn btn-primary" style="background-color:#f5f8f9; color:#000;border-color: #b3d1db9e;" data-toggle="modal" data-target="#exampleModal">
      Sent to Recycler
    </button>

      
 <a href="<?php echo e(url('/main/group_charts')); ?>"  class="btn btn-info">Groups Chart</a>
        
    <a href="<?php echo e(url('/')); ?>" style="float:right;margin-top: -15px;margin-right: 5px;">  <img   src="<?php echo e(asset('dist/img/refresh.png')); ?>"  alt="User Image" style="width: 50px;height: 50px;"></a>
    
    <a  class="tooltip0" href="<?php echo e(url('/main/add')); ?>" style="float:right;margin-top: -15px;margin-right: 5px;">  <img   src="<?php echo e(asset('dist/img/add.png')); ?>"  alt="User Image" style="width: 50px;height: 50px;">
      <span class="tooltiptext0" style="margin-left: -100px;margin-top: 56px;">Add Quick Carta ! </span>
    </a>
    
   
     


<form   role="form" method="POST" action="<?php echo e(url('/main/sent_to_multi_customer')); ?>">
                        <?php echo e(csrf_field()); ?>

                        



    



    <div class="box" >
            <div class="box-header">
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <table id="example1"  class="table table-bordered table-striped" >
                <thead >
                <tr >
                     <th class="no-sort" style="max-width: 5px;text-align:center;vertical-align: middle; background-color:#2C4E71; color:#FFF;border-color:#0000003c"> 
                  <button type="submit"  style="background-color:transparent; border-width:0px;margin-bottom:10px;margin-left: -13px;"    > 
                  <img src="<?php echo e(asset('dist/img/sendd.png')); ?>"  class="user-image" alt="User Image" style="width: 40px;height: 40px; margin-top: 25px;" >
                  </button>

                  

                </th>
                
                  <th style="text-align:center;vertical-align: middle; background-color:#2C4E71; color:#FFF;border-color:#0000003c">  ساعة الخروج  </th>
                  <th style="text-align:center;vertical-align: middle; background-color:#2C4E71; color:#FFF;border-color:#0000003c"> ساعة الوصول  </th>
                  <th style="text-align:center;vertical-align: middle; background-color:#2C4E71;color:#FFF;border-color:#0000003c; width:80px" >  المورد    </th>
                  <th style="text-align:center;vertical-align: middle; background-color:#2C4E71;color:#FFF;border-color:#0000003c ;width:80px">   الـمخـلـف    </th>
                  <!--
                  <th style="text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF;"> التصنيف    </th>
                  <th style="text-align:center;vertical-align: middle;background-color:#4fc2a1;color:#FFF;"> المجموعة    </th>
                  <th style="text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF;"> الفئة    </th>
                  -->
                  <th style="max-width:5px; text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c"> الكمية    </th>
                  <th style="max-width:5px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF;border-color:#0000003c "> وحدة الوزن    </th>
                  <?php if(auth()->user()->is_superadmin ): ?> 
                  <th style="max-width:5px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c"> سعر    </th>
                  <th style="max-width:5px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c"> اجمالي السعر    </th>
                  <?php endif; ?>
                  <th style="max-width:5px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF;border-color:#0000003c "> طريقة التعبئة    </th>
                  <th style="max-width:5px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c"> الحالة الفزيائية    </th>
                  <th style="text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c"> طرق التخلص المعتمد    </th>
                  <th style="text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c;width:103px"> جهة التدوير المعتمدة    </th>

                  <th style="max-width:15px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c"> رقم السيارة    </th>
                  <th style="max-width:15px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF;border-color:#0000003c "> اسم السائق    </th>
                  <th style="max-width:30px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c"> اسم المشرف    </th>

                  <th style="max-width:30px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c">  Reviewer    </th>
                  <th style="max-width:15px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c">  Sender    </th>
                  <th style="width:30px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c">  الفرع    </th>
                                    <th style="width:30px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c">  المخزن    </th>
                  <th class="no-sort"style="max-width:5px;text-align:center;vertical-align: middle;background-color:#2C4E71;color:#FFF; border-color:#0000003c"> Actions  </th>
                </tr>
                </thead>
                <tbody>
                <?php foreach( $wastes as $waste ): ?>   
                 
                <?php 
                  $price_column_name  = "p".$waste->waste->id 
                 ?>

                <?php if( $waste->approve == NULL ): ?> 
                <tr style="background-color:#f39c12">
                <?php elseif( $waste->approve == "approved" && $waste->customer_id == NULL ): ?>
                <tr style="background-color:#92E39B">
                <?php elseif( $waste->approve == "approved" && $waste->customer_id != NULL ): ?>
                <tr style="background-color:#F5F8F9"> 
                <?php else: ?>
                <tr>
                 <?php endif; ?>
                 
                 <td style="text-align:center;vertical-align: middle;   border-color:#0000003c"> 
                  <input type="checkbox" style="    width: 20px;height: 20px;" name="checked[]" value="<?php echo e($waste->id); ?>"   <?php echo e($waste->approve != "approved"?"disabled":''); ?>>
                 </td>
                 
                 <td style="text-align:center; width:60px;word-break: break-word; font-weight:900;border-color:#0000003c" ><?php echo e($waste->created_at); ?>  <br> 
                 
                  
                 
                 <?php if(auth()->user()->is_superadmin ): ?>
                 <span style="color:blue; margin-top:5px">  
                 <a href='<?php echo e(url("/main/edit/$waste->id")); ?>' >    # <?php echo e($waste->id); ?>  </a>   
                 </span>
                 <?php else: ?>
                  <span style="color:blue; margin-top:5px">  
                      # <?php echo e($waste->id); ?>   
                 </span>
                 <?php endif; ?>
                 
                 <br> 
                 <?php if($waste->num_of_edit  > 0  ): ?>
                 <small class="label pull-center bg-red"> <?php echo e($waste->num_of_edit); ?> </small>                  
                 <?php endif; ?>
                </td>
                 
                 
                 <td style="text-align:center; width:60px;word-break: break-word; font-weight:900;border-color:#0000003c" ><?php echo e($waste->approve == "approved" ? $waste->updated_at : 'waiting...'); ?> </td>
                 
                 <td style="text-align:center; width:60px;word-break: break-word; font-weight:900;border-color:#0000003c"><?php echo e($waste->supplier->name); ?> </td>
                 <td style="text-align:center; width:60px;word-break: break-word; font-weight:900;border-color:#0000003c" ><?php echo e($waste->waste->name); ?> </td>
                 <!--
                 <td style="text-align:center; width:40px;word-break: break-word;" ><?php echo e($waste->waste->classification->name); ?> </td>
                 <td style="text-align:center; width:40px;word-break: break-word;" ><?php echo e($waste->waste->group->name); ?> </td>
                 <td style="text-align:center; width:40px;word-break: break-word;" ><?php echo e($waste->waste->class_->name); ?> </td>
                 -->
                 <td style="text-align:center; width:40px; word-break: break-word; font-weight:900;border-color:#0000003c" ><?php echo e($waste->quantity); ?> </td>
                 <td style="text-align:center; width:40px;word-break: break-word; font-weight:900;border-color:#0000003c" ><?php echo e($waste->waste->unit); ?> </td>
                 <?php if(auth()->user()->is_superadmin ): ?>
                 <td style="text-align:center; width:40px;word-break: break-word; font-weight:900;border-color:#0000003c" ><?php echo e($waste->price  ? $waste->price: ''); ?> </td>
                 <td style="text-align:center; width:40px;word-break: break-word;font-weight:900;border-color:#0000003c" ><?php echo e($waste->price ? $waste->price * $waste->quantity: ''); ?> </td>
                  <?php endif; ?>
                 <td style="text-align:center; width:40px;word-break: break-word;font-weight:900;border-color:#0000003c" ><?php echo e($waste->packingmethod->name); ?> </td>
                 <td style="text-align:center; width:40px;word-break: break-word;font-weight:900;border-color:#0000003c" ><?php echo e($waste->physicalcondition->name); ?> </td>
                 <td style="text-align:center; width:40px;word-break: break-word;font-weight:900;border-color:#0000003c" ><?php echo e($waste->waste->res_method->name); ?> </td>
                 <td style="text-align:center; height: 75px;  word-break: break-word; position: relative; font-weight:900;border-color:#0000003c" ><?php echo e($waste->customer_id ? $waste->customer->name : 'Waiting...'); ?>

                 <?php if( $waste->approve == "approved" ): ?>
                 <a href='<?php echo e(url("/main/changecustomer/$waste->id")); ?>' style="position: absolute;bottom: 0; left:0; right:0;margin-bottom:10px; text-decoration: underline;" > <strong> Change </strong>  </a>
                 <?php endif; ?>
                </td>

                 <td style="text-align:center; width:40px;word-break: break-word; font-weight:900;border-color:#0000003c" ><?php echo e($waste->vehicle->vehicle_num); ?> </td>
                 <td style="text-align:center; width:40px;word-break: break-word; font-weight:900;border-color:#0000003c" ><?php echo e($waste->driver->name); ?> </td>
                 <td style="text-align:center; width:40px;word-break: break-word; font-weight:900;border-color:#0000003c" ><?php echo e($waste->user->name); ?> </td>

                 <td style="text-align:center; width:40px;word-break: break-word; font-weight:900;border-color:#0000003c; background-color: #88B04B;" >
                 <?php echo e($waste->admin_id ? $waste->admin_approve->name: ''); ?>  
                  
                  <?php if( $waste->comment != NULL  ): ?>
                      <div class="tooltip0">
                      <img src="<?php echo e(asset('dist/img/chat.png')); ?>"  class="user-image" alt="User Image" style="width: 30px;height: 30px; margin-top: 25px;" >
                      <span class="tooltiptext0"><?php echo e($waste->comment); ?></span>
                      </div>

                 <?php endif; ?>
                </td>
                 <td style="text-align:center; width:40px;word-break: break-word; font-weight:900;border-color:#0000003c; background-color: #acca80;" ><?php echo e($waste->sent_to_recy_admin_id ? $waste->admin_sender->name: ''); ?>  </td>
                 
                 
                 <td style="text-align:center; width:40px;word-break: break-word; font-weight:900;border-color:#0000003c" ><?php echo e($waste->sell_store ? $waste->sell_store->branch->name:$waste->branch->name); ?> <br>
                 <?php if( $waste->sell_store_id == NULL  ): ?>
                 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 16 16">
  <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
  <path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/>
</svg><?php endif; ?>
                </td>
                 <td style="text-align:center; width:40px;word-break: break-word; font-weight:900;border-color:#0000003c" ><?php echo e($waste->sell_store ? $waste->sell_store->store->store_name:''); ?> 
                 <br>
                 <?php if( $waste->sell_store_id == NULL  ): ?>
                 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 16 16">
  <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
  <path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/>
</svg><?php endif; ?>
                </td>
       
                        
                        
                        
                 <td style="text-align:center; width:60px;word-break: break-word; font-weight:900;border-color:#0000003c" > 
                 <?php if( $waste->approve != "approved"): ?> 
                 <a href='<?php echo e(url("/main/approve/$waste->id")); ?>'  style="float:left"> <i class="fa fa-check" aria-hidden="true" style="font-size:24px; color:green;margin-top:50%"></i> </a> 
                 <?php endif; ?>

                 <?php if( $waste->approve != "approved"  ): ?>
               <a href='<?php echo e(url("/main/edit/$waste->id")); ?>'  style="float:right"> <i class="fa fa-edit" style="font-size:24px; color:red;margin-top:50%"></i>    </a> 
                 <?php elseif( $waste->approve == "approved" && auth()->user()->is_superadmin ): ?>
                 <a href='<?php echo e(url("/main/edit/$waste->id")); ?>' > <i class="fa fa-edit" style="font-size:24px; color:red;margin-top:50%"></i>  </a>
                 <?php endif; ?>
                
                </td>

               </tr>
               <?php endforeach; ?>
                </tbody>
                
              </table>
            </div>
            <!-- /.box-body -->
          
          
                
                 
          </div>
</form> 
   



<!-- Modal -->
<div>
  <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h2 class="modal-title" id="exampleModalLabel" style="text-align:center">Get Sent to Recycler Carts</h2>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
        <form   role="form" method="POST" action="<?php echo e(url('/main/sent_to_customer')); ?>">
                          <?php echo e(csrf_field()); ?>

              <div class="box-body">
                  <div class="form-group">
                    <label for="exampleInputPassword1">From</label>
                    <input type="date" name="from"  class="form-control"  placeholder="Time Out " required>
                  </div>
                  <div class="form-group">
                    <label for="exampleInputPassword1">To</label>
                    <input type="date" name="to"   class="form-control"  placeholder="Time Out " required>
                  </div>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="submit"  class="btn btn-primary">Show</button>
              </div>
        </form>
      </div>
    </div>
  </div>
</div>    
 <!-- End modal --> 




 <!-- Modal -->
<div >
  <div class="modal fade" id="notapproved" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel1" aria-hidden="true">
    <div class="modal-dialog" role="document" >
      <div class="modal-content">
        <div class="modal-header"  style="background-color:orange">
          <h2 class="modal-title" id="exampleModalLabel1" style="text-align:center">Get Not Approved Carts</h52>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body" >   
        <form   role="form" method="GET" action="<?php echo e(url('/main/not_approved')); ?>">
                        <!--  <?php echo e(csrf_field()); ?> -->
              <div class="box-body">
                  <div class="form-group">
                    <label for="exampleInputPassword1">From</label>
                    <input type="date" name="from"  class="form-control"  placeholder="Time Out " required>
                  </div>
                  <div class="form-group">
                    <label for="exampleInputPassword1">To</label>
                    <input type="date" name="to"   class="form-control"  placeholder="Time Out " required>
                  </div>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="submit"  class="btn btn-primary">Show</button>
              </div>
        </form>
      </div>
    </div>
  </div>
</div>    
 <!-- End modal --> 

 <!-- Modal -->
 <div >
  <div class="modal fade" id="notsent" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel11" aria-hidden="true">
    <div class="modal-dialog" role="document" >
      <div class="modal-content">
        <div class="modal-header"  style="background-color:green;">
          <h2 class="modal-title" id="exampleModalLabel11" style="text-align:center">Get Not Sent To Recycler</h52>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body" >   
        <form   role="form" method="POST" action="<?php echo e(url('/main/not_sent_to_customer')); ?>">
                          <?php echo e(csrf_field()); ?>

              <div class="box-body">
                  <div class="form-group">
                    <label for="exampleInputPassword1">From</label>
                    <input type="date" name="from"  class="form-control"  placeholder="Time Out " required>
                  </div>
                  <div class="form-group">
                    <label for="exampleInputPassword1">To</label>
                    <input type="date" name="to"   class="form-control"  placeholder="Time Out " required>
                  </div>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="submit"  class="btn btn-primary">Show</button>
              </div>
        </form>
      </div>
    </div>
  </div>
</div>    
 <!-- End modal --> 

<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>