<?php $__env->startSection('content'); ?>
  <title><?php echo e(trans('admin.StudentReserveCourse')); ?></title>
  <style>
      .box{
          position: relative;
    padding:20px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom:25px;
      }
      .box h1{
          position: absolute;
    background: white;
    top: -25px;
    padding: 5px;
      }
  </style>
    <main id="js-page-content" role="main" class="page-content">
                    <ol class="breadcrumb page-breadcrumb">
                        <li class="breadcrumb-item"><a href="javascript:void(0);"><?php echo e(trans('admin.TrainingCenters')); ?></a></li>
                        <li class="breadcrumb-item active"><?php echo e(trans('admin.StudentReserveCourse')); ?></li>
                        <li class="position-absolute pos-top pos-right d-none d-sm-block"><span
                                class="js-get-date"></span></li>
                    </ol>
        
<form action="<?php echo e(url('PostStudentReserveCourse')); ?>" method="post" enctype="multipart/form-data">
    <?php echo csrf_field(); ?>

          <?php echo view('honeypot::honeypotFormFields'); ?>
    <input type="hidden" name="ID" value="<?php echo e($item->id); ?>">
                    <div class="row">
                        <div class="col-xl-12">
                            <div  class="panel">
                                <div class="panel-container show">
                                    <div class="panel-content">
                                        <div class="panel-container show">
                                             <span id="ex"> <?php echo $__env->make('admin.layouts.messages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?></span>
                                            <div class="panel-content">
                                                <ul class="nav nav-tabs" role="tablist">
                                                    <li class="nav-item">
           <a class="nav-link active" data-toggle="tab" href="#tab_borders_icons-1" role="tab"><i class="fal fa-home mr-1"></i>   <?php echo e(trans('admin.Main_Data')); ?></a>
                                                    </li>
                                                 
                                                                           
                                                           
                                                    
                                                </ul>

                                                <div class="tab-content border border-top-0 p-3">
                              <div class="tab-pane fade show active" id="tab_borders_icons-1" role="tabpanel">
                                                        <div class="form-row">
                                                        <div class="form-group col-md-2">
                                        <label class="form-label" for="simpleinput">  <?php echo e(trans('admin.Code')); ?></label>
                                   <input type="text"  value="<?php echo e($item->Code); ?>" disabled class="form-control">
                                   <input type="hidden" name="Code" value="<?php echo e($item->Code); ?>">
                                                        </div>
                                                 
                                                            
                                                                                                                                                          
                                    <div class="form-group col-md-2">
                        <label class="form-label" for="">  <?php echo e(trans('admin.Course')); ?></label>
                                                            
                                                                   <select class="select2 form-control w-100"  name="Course" disabled >
                                          <option value=""><?php echo e(trans('admin.Course')); ?></option>
                                          <?php $__currentLoopData = $Courses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cur): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                          <option value="<?php echo e($cur->id); ?>" <?php if($item->Course == $cur->id): ?> selected <?php endif; ?>  >
                                     
                                <?php echo e(app()->getLocale() == 'ar' ?$cur->Arabic_Name :$cur->English_Name); ?>                        
                                          </option>
                                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>      
                                       </select>
                                                            </div>                                 
                                                            
                                          
                                                         <div class="form-group col-md-2">
                        <label class="form-label" for="">  <?php echo e(trans('admin.Course_Type')); ?></label>
                                                            
                                                                   <select class="select2 form-control w-100"  name="Course_Type" disabled >
                                          <option value=""><?php echo e(trans('admin.Course_Type')); ?></option>
                                          <?php $__currentLoopData = $CoursesType; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                          <option value="<?php echo e($type->id); ?>" <?php if($item->Course_Type == $type->id): ?> selected <?php endif; ?>  >
                                     
                                <?php echo e(app()->getLocale() == 'ar' ?$type->Arabic_Name :$type->English_Name); ?>                        
                                          </option>
                                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>      
                                       </select>
                                                            </div>                     
                                                            
                                                            
                                                                      <div class="form-group col-md-2">
                        <label class="form-label" for="">  <?php echo e(trans('admin.Teacher')); ?></label>
                                                            
                                                                   <select class="select2 form-control w-100"  name="Teacher" disabled >
                                          <option value=""><?php echo e(trans('admin.Teacher')); ?></option>
                                          <?php $__currentLoopData = $Teachers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tec): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                          <option value="<?php echo e($tec->id); ?>" <?php if($item->Teacher == $tec->id): ?> selected <?php endif; ?>  >
                                     
                                <?php echo e(app()->getLocale() == 'ar' ?$tec->Arabic_Name :$tec->English_Name); ?>                        
                                          </option>
                                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>      
                                       </select>
                                                            </div>                       
                                                            
                                                        <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Start_Date')); ?> </label><span class="strick">*</span>
                     <input type="date" name="Start_Date" value="<?php echo e($item->Start_Date); ?>" class="form-control" readonly>
                                                        </div>    
                                                            
                                                            <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.End_Date')); ?> </label><span class="strick">*</span>
                     <input type="date" name="End_Date" value="<?php echo e($item->End_Date); ?>" class="form-control" readonly >
                                                        </div>
                                                            
                                                            
                                                            
                                                    <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Required_Number')); ?> </label><span class="strick">*</span>
        <input type="number" name="Required_Number" id="Required_Number" value="<?php echo e($item->Required_Number); ?>" onclick="Tot()" onkeyup="Tot()" class="form-control" readonly >
                                                        </div> 
                                                            
                             
                                                            
                                              
                                               <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Total_Required')); ?> </label><span class="strick">*</span>
                     <input type="number" step="any" id="Total_Required" name="Total_Required" value="<?php echo e($item->Total_Required); ?>" class="form-control" readonly >
                                                        </div>                                        
                                   
                                                            
                                                            
                                 <div class="form-group col-md-2" style="display: none">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Time')); ?> </label><span class="strick">*</span>
                     <input type="time"  name="Time"  value="<?php echo e($item->Time); ?>" class="form-control" readonly >
                                                        </div>                                            
                                                            
                                                                                                                                             
                                    <div class="form-group col-md-2">
                        <label class="form-label" for="">  <?php echo e(trans('admin.Certificate')); ?></label>
                                                            
                                                                   <select class="select2 form-control w-100"  name="Certificate" disabled >
                                          <option value=""><?php echo e(trans('admin.Certificate')); ?></option>
                                          <option value="1" <?php if($item->Certificate == 1): ?> selected <?php endif; ?>><?php echo e(trans('admin.Yes')); ?></option>
                                          <option value="0" <?php if($item->Certificate == 0): ?> selected <?php endif; ?>><?php echo e(trans('admin.No')); ?></option>
                                      
                                       </select>
                                                            </div>      
                                                            
                                                            
                                                             
                                                      <div class="form-group col-md-12">                    
                                             <div id="mobile-overflow">
                                        <table
                                            class="table table-bordered table-hover table-striped w-100 mobile-width table-color2">
                                            <thead>
                                                <tr>
                                               
                                                 <th><?php echo e(trans('admin.Day')); ?></th>
                                                <th><?php echo e(trans('admin.From_Time')); ?></th>
                                                <th><?php echo e(trans('admin.To_Time')); ?></th>
                     
                                                </tr>
                                            </thead>
                                            <tbody>
         <?php $__currentLoopData = $Days; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $det): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>                                       
    <tr> 
                                 <td class="TCred">
                      <?php echo e(trans('admin.'.$det->Day)); ?>

                               </td>

                                <td><?php echo e($det->From_Time); ?></td>
                                <td><?php echo e($det->To_Time); ?></td>
                    
                             </tr>
                                     <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>           
                                             
                                            </tbody>
                                        </table>
                                         </div>                    
                                                            </div>          
                                      
                                                                                           
                                                                       
                                                           
                                                                                              <div class="form-group col-md-4">
                        <label class="form-label" for="">  <?php echo e(trans('admin.Safe')); ?></label>
                                                            
                                                                   <select class="select2 form-control w-100"  name="Safe" required >
                                          <option value=""><?php echo e(trans('admin.Safe')); ?></option>
                                          <?php $__currentLoopData = $Safes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $safe): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                          <option value="<?php echo e($safe->id); ?>" <?php if($item->Safe == $safe->id): ?> selected <?php endif; ?>  >
                                     
                                <?php echo e(app()->getLocale() == 'ar' ?$safe->Name :$safe->NameEn); ?>                        
                                          </option>
                                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>      
                                       </select>
                                                            </div>  
                                                            
                                                            
                                                    <div class="form-group col-md-4">
                        <label class="form-label" for="">  <?php echo e(trans('admin.Coin')); ?></label>
                                                            
                                                                   <select class="select2 form-control w-100"  name="Coin" required >
                                          <option value=""><?php echo e(trans('admin.Coin')); ?></option>
                                          <?php $__currentLoopData = $Coins; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $coin): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                          <option value="<?php echo e($coin->id); ?>" <?php if($item->Coin == $coin->id): ?> selected <?php endif; ?>  >
                                     
                                <?php echo e(app()->getLocale() == 'ar' ?$coin->Arabic_Name :$coin->English_Name); ?>                        
                                          </option>
                                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>      
                                       </select>
                                                            </div>        
                                                            
                                                                               <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Draw')); ?> </label><span class="strick">*</span>
                     <input type="number" step="any" name="Draw" value="<?php echo e($item->Draw); ?>"  class="form-control" required >
                                                        </div>                    
                                                            

                                                            
                                                            
                                                            
                                                                
                                                        <div class="form-group col-md-2">
                   <button style="margin: 22px" type="button" class="btn btn-default" data-toggle="modal" data-target="#NewClient">
                           <i class="fal fa-user"></i>          
                           </button> 
                                                            
                                      <!-- Modal New Client -->
                           <div class="modal fade" id="NewClient" tabindex="-1" role="dialog" aria-hidden="true">
                              <div class="modal-dialog modal-dialog-centered modal-xl" role="document">
                                 <div class="modal-content">
                                    <div class="modal-header">
                                       <h4 class="modal-body row">

                                                                        <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Name')); ?> </label><span class="strick">*</span>
                     <input type="text" id="Arabic_Name" value="<?php echo e(old('Arabic_Name')); ?>" class="form-control">
                                                        </div>    
                                                      <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Phone1')); ?> </label>
                        <input type="tel"  id="Phone1" value="<?php echo e(old('Phone1')); ?>" class="form-control" >    
                                                        </div>  
                                               <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Dad_Phone')); ?> </label>
                        <input type="tel"  id="Dad_Phone" value="<?php echo e(old('Dad_Phone')); ?>" class="form-control" >    
                                                        </div>   
                                                       <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Age')); ?> </label>
                        <input type="number"  id="Age" value="<?php echo e(old('Age')); ?>" class="form-control" >    
                                                        </div>  
                                                    
                                              <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Whatsapp')); ?> </label>
                        <input type="text"  id="Whatsapp" value="<?php echo e(old('Whatsapp')); ?>" class="form-control" >    
                                                        </div>     
                  <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Ntional_ID')); ?> </label>
                        <input type="text"  id="Ntional_ID" value="<?php echo e(old('Ntional_ID')); ?>" class="form-control" >    
                                                        </div>    
                        <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Address')); ?> </label>
                        <input type="text"  id="Address" value="<?php echo e(old('Address')); ?>" class="form-control" >    
                                                        </div>   
                                  
                                       </h4>
                                       <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                       <span aria-hidden="true"><i class="fal fa-times"></i></span>
                                       </button>
                                    </div>
                                    <div class="modal-footer">
                                       <button type="button" class="btn btn-secondary" data-dismiss="modal"> <?php echo e(trans('admin.No')); ?></button>
                                       <button type="button" onclick="NewClients()"  class="btn btn-primary"> <?php echo e(trans('admin.AddNew')); ?></button>
                                    </div>
                                 </div>
                              </div>
                           </div>                        
                                                            
                                                            </div>

                                                            
                                                            
                                                                                  
                                                                      <div class="form-group col-md-2">
                        <label class="form-label" for="">  <?php echo e(trans('admin.Student')); ?></label>
                                    <select  class="select2 form-control w-100" id="Student" name="Student" >                            
                                                  
                                     
                                   
                                       </select>
                                                            </div>   
                                                            
                                               <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Cost')); ?> </label><span class="strick">*</span>
                     <input type="number" step="any" name="Cost" id="Cost"  value="<?php echo e($item->Cost); ?>" class="form-control"  >
                                                        </div>                                   
                                                            
                                                            
                                                            
                                                          <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Pay')); ?> </label><span class="strick">*</span>
                     <input type="number" step="any"  id="Pay" onkeyup="Dif()" onclick="Dif()"  class="form-control" >
                                                        </div>    
                                                            
                                                            
                                                            
                                                              <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Residual')); ?> </label><span class="strick">*</span>
                     <input type="text"  id="Residual"  class="form-control"  >
                                                        </div>      
                                                            
                                                            
                                                         
                                                          <div class="form-group col-md-2">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Dollar_Value')); ?> </label><span class="strick">*</span>
                     <input type="number" step="any"  id="Dollar_Value"   class="form-control" >
                                                        </div>                                             
                                               
                                                            
                                                         <div class="form-group col-md-2">            
                                     <button type="button" class="btn btn-primary" onclick="AddToTable()">
                                                <i class="fal fa-plus"></i>         
                                                               </button> 
                                                        </div>          
                                                            
                                                            
                                                      <div class="form-group col-md-12">                    
                                             <div id="mobile-overflow">
                                        <table
                                            class="table table-bordered table-hover table-striped w-100 mobile-width table-color2">
                                            <thead>
                                                <tr>
                                               
                                                 <th><?php echo e(trans('admin.Student')); ?></th>
                                                <th><?php echo e(trans('admin.Cost')); ?></th>
                                                <th><?php echo e(trans('admin.Pay')); ?></th>
                                                <th><?php echo e(trans('admin.Residual')); ?></th>
                                                <th><?php echo e(trans('admin.Dollar_Value')); ?></th>
                                                <th><?php echo e(trans('admin.Actions')); ?></th>
                                                </tr>
                                            </thead>
                                            <tbody id="data-dt">
                                                
                                            <?php $__currentLoopData = $RSts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rs): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                              
                                                 <tr> 
                                 <td class="TCred">
                   
                   <?php if(!empty($rs->Student()->first()->Arabic_Name)): ?>                  
                            
<?php echo e(app()->getLocale() == 'ar' ?$rs->Student()->first()->Arabic_Name :$rs->Student()->first()->English_Name); ?>        
                                     
                        <?php endif; ?>             
                               </td>

                                <td><?php echo e($rs->Cost); ?></td>
                                <td><?php echo e($rs->Pay); ?></td>
                                <td>
                                    
                                    <?php echo e($rs->Residual); ?>

             <input type="hidden" class="costt"  name="Cost[]" value="<?php echo e($rs->Cost); ?>">
    <input type="hidden" class="pay"  name="Pay[]" value="<?php echo e($rs->Pay); ?>">
    <input type="hidden" class="count" name="Student[]" value="<?php echo e($rs->Student); ?>">
    <input type="hidden" name="Residual[]" value="<?php echo e($rs->Residual); ?>">
    <input type="hidden" name="Dollar_Value[]" value="<?php echo e($rs->Dollar_Value); ?>">
    <input type="hidden" name="Constraint[]" value="1">
                                 </td>
                                         <td><?php echo e($rs->Dollar_Value); ?></td>                     
                                <td>
                    <button id="Del" type="button" class="btn btn-default"><i class="fal fa-trash"></i></button>
                                </td>




                             </tr>
                                                
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>    
                                                
                                             
                                            </tbody>
                                            <tfoot>
                                                <tr>
                                                <th><?php echo e(trans('admin.Student')); ?></th>
                                                <th><?php echo e(trans('admin.Cost')); ?></th>
                                                <th><?php echo e(trans('admin.Pay')); ?></th>
                                                <th><?php echo e(trans('admin.Residual')); ?></th>
                                                <th><?php echo e(trans('admin.Actions')); ?></th>
                                                </tr>
                                            </tfoot>
                                        </table>
                                         </div>                    
                                                            </div>          
                                      
                                                                                        
                                                              <div class="form-group col-md-4">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Total_Cost')); ?> </label><span class="strick">*</span>
                     <input type="text"  name="Total_Cost" id="totalCost"  class="form-control" readonly >
                                                        </div>  
                                                            
                                                            
                                                                    <div class="form-group col-md-4">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Total_Paid')); ?> </label><span class="strick">*</span>
                     <input type="text"  name="Total_Paid" id="totalPay"  class="form-control" readonly >
                                                        </div>    
                                                            
                                                            
                                                                                                    <div class="form-group col-md-4">
              <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Total_Num')); ?> </label><span class="strick">*</span>
                     <input type="text"  name="Total_Num" id="totalNum"  class="form-control" readonly >
                                                        </div>    
                                                            
                                                    
                                                    </div>
                                                  
                                                    </div>      
                  
                                    
                                                </div>
                                                 <div class="form-row">
                                                           <div class="buttons mt-3">
                           <button type="submit" class="btn btn-primary"><i class="fal fa-save"></i> 
                                                    <?php echo e(trans('admin.Save')); ?>           
                                                               </button>
                                                          </div>
                                                          </div>
                                            </div>
                                        </div>
                            </div>
                        </div>
                    </div>
                    </div>
                    </div>
                  
        </form>
                </main>



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


<?php $__env->startPush('js'); ?>

<link rel="stylesheet" media="screen, print" href="<?php echo e(asset('Admin/css/datagrid/datatables/datatables.bundle.css')); ?>">
<link rel="stylesheet" media="screen, print" href="<?php echo e(asset('Admin/css/formplugins/summernote/summernote.css')); ?>">
<link rel="stylesheet" media="screen, print" href="<?php echo e(asset('Admin/css/formplugins/select2/select2.bundle.css')); ?>">
<script src="<?php echo e(asset('Admin/js/datagrid/datatables/datatables.bundle.js')); ?>"></script>
<script src="<?php echo e(asset('Admin/js/datagrid/datatables/datatables.export.js')); ?>"></script>
<script src="<?php echo e(asset('Admin/js/formplugins/summernote/summernote.js')); ?>"></script>
<script src="<?php echo e(asset('Admin/js/formplugins/select2/select2.bundle.js')); ?>"></script>
<!-- Search Selecet -->
<script>
   $(document).ready(function () {
       $(function () {
           $(".select2").select2();
   
           $(".select2-placeholder-multiple").select2({
               placeholder: "Select State",
           });
           $(".js-hide-search").select2({
               minimumResultsForSearch: 1 / 0,
           });
           $(".js-max-length").select2({
               maximumSelectionLength: 2,
               placeholder: "Select maximum 2 items",
           });
           $(".select2-placeholder").select2({
               placeholder: "Select a state",
               allowClear: true,
           });
   
           $(".js-select2-icons").select2({
               minimumResultsForSearch: 1 / 0,
               templateResult: icon,
               templateSelection: icon,
               escapeMarkup: function (elm) {
                   return elm;
               },
           });
   
           function icon(elm) {
               elm.element;
               return elm.id ? "<i class='" + $(elm.element).data("icon") + " mr-2'></i>" + elm.text : elm.text;
           }
   

   

     
           $("#Student").select2({
               placeholder: "select...",
               ajax: {
                   type: "GET",
                   dataType: "json",
                   url: "AllStudent",
                   processResults: function (data) {
                       return {
                           results: $.map(data, function (obj, index) {
                               return { id: index, text: obj };
                           }),
                       };
   
                       console.log(data);
                   },
                  data: function (params) {  
   
           
                  var query = {
                           search: params.term,
                       };
                               
           
             $.ajax({
                             url: 'AllStudentJ/'+params.term,
                             type:"GET",
                             dataType:"json",
                             beforeSend: function(){
                                 $('#loader').css("visibility", "visible");
                             },
   
                             success:function(data) {
                                         $('#Student').empty();  
                                 $.each(data, function(key, value){
   
                        $('#Student').append('<option value="'+ key +'">' + value + '</option>');
                  
                                 });
                             },
                             complete: function(){
                                 $('#loader').css("visibility", "hidden");
                             }
                         });
           
           
           
       }
               },
           });
   
           $("#Student").on("select2:select", function (e) {
               console.log("select done", e.params.data);
           });
                
           
           
           
           
           
       });
   });
</script>

    <script>
        /* demo scripts for change table color */
        /* change background */


        $(document).ready(function () {

            $('#dt-basic-example thead tr').clone(true).appendTo('#dt-basic-example thead');
            $('#dt-basic-example thead tr:eq(1) th').each(function (i) {
                var title = $(this).text();
                $(this).html('<input type="text" class="form-control form-control-sm" placeholder="Search ' + title + '" />');

                $('input', this).on('keyup change', function () {
                    if (table.column(i).search() !== this.value) {
                        table
                            .column(i)
                            .search(this.value)
                            .draw();
                    }
                });
            });

            var table = $('#dt-basic-example').dataTable(
                {
                    responsive: true,
                    orderCellsTop: true,
                    fixedHeader: true,
                    lengthChange: false,

                    dom: "<'row mb-3'<'col-sm-12 col-md-6 d-flex align-items-center justify-content-start'f><'col-sm-12 col-md-6 d-flex align-items-center justify-content-end'B>>" +
                        "<'row'<'col-sm-12'tr>>" +
                        "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
                    buttons: [
                        {
                            extend: 'colvis',
                            text: 'Column Visibility',
                            titleAttr: 'Col visibility',
                            className: 'btn-outline-default'
                        },
                        {
                            extend: 'pdfHtml5',
                            text: 'PDF',
                            titleAttr: 'Generate PDF',
                            className: 'btn-outline-danger btn-sm mr-1'
                        },
                        {
                            extend: 'excelHtml5',
                            text: 'Excel',
                            titleAttr: 'Generate Excel',
                            className: 'btn-outline-success btn-sm mr-1'
                        },
                        {
                            extend: 'csvHtml5',
                            text: 'CSV',
                            titleAttr: 'Generate CSV',
                            className: 'btn-outline-primary btn-sm mr-1'
                        },
                        {
                            extend: 'copyHtml5',
                            text: 'Copy',
                            titleAttr: 'Copy to clipboard',
                            className: 'btn-outline-primary btn-sm mr-1'
                        },
                        {
                            extend: 'print',
                            text: 'Print',
                            titleAttr: 'Print Table',
                            className: 'btn-outline-primary btn-sm'
                        }
                    ],
                });

            $('.js-thead-colors a').on('click', function () {
                var theadColor = $(this).attr("data-bg");
                console.log(theadColor);
                $('#dt-basic-example thead').removeClassPrefix('bg-').addClass(theadColor);
            });

            $('.js-tbody-colors a').on('click', function () {
                var theadColor = $(this).attr("data-bg");
                console.log(theadColor);
                $('#dt-basic-example').removeClassPrefix('bg-').addClass(theadColor);
            });

        });

    </script>


<!-- Filter Governrate and City !-->
<script>
   $(document).ready(function() {
   
       $('#Governrate').on('change', function(){
           var countryId = $(this).val();
       
           if(countryId) {
               $.ajax({
                   url: 'GovernrateFilter/'+countryId,
                   type:"GET",
                   dataType:"json",
                   beforeSend: function(){
                       $('#loader').css("visibility", "visible");
                   },
   
                   success:function(data) {
   
                       $('#City').empty();
   
                       $.each(data, function(key, value){
   
             $('#City').append('<option value="'+ key +'">' + value + '</option>');
                           
                       });
                       
                      var CIITY = $('#City').val();  
                         $.ajax({
                   url: 'CityFilter/'+CIITY,
                   type:"GET",
                   dataType:"json",
                   beforeSend: function(){
                       $('#loader').css("visibility", "visible");
                   },
   
                   success:function(data) {
   
                       $('#Place').empty();
   
                       $.each(data, function(key, value){
   
             $('#Place').append('<option value="'+ key +'">' + value + '</option>');
                           
                       });
                       
       
                   },
                   complete: function(){
                       $('#loader').css("visibility", "hidden");
                   }
               });
                       
                       
                       
                   },
                   complete: function(){
                       $('#loader').css("visibility", "hidden");
                   }
               });
           } else {
   
               $('select[name="states"]').empty();
           }
   
       });
   
   });
    
   $(document).ready(function() {
   
   
           var countryId = $('#Governrate').val();
           if(countryId) {
               $.ajax({
                   url: 'GovernrateFilter/'+countryId,
                   type:"GET",
                   dataType:"json",
                   beforeSend: function(){
                       $('#loader').css("visibility", "visible");
                   },
   
                   success:function(data) {
   
                       $('#City').empty();
   
                       $.each(data, function(key, value){
   
             $('#City').append('<option value="'+ key +'">' + value + '</option>');
                           
                       });
                       
                     var CIITY = $('#City').val();  
                         $.ajax({
                   url: 'CityFilter/'+CIITY,
                   type:"GET",
                   dataType:"json",
                   beforeSend: function(){
                       $('#loader').css("visibility", "visible");
                   },
   
                   success:function(data) {
   
                       $('#Place').empty();
   
                       $.each(data, function(key, value){
   
             $('#Place').append('<option value="'+ key +'">' + value + '</option>');
                           
                       });
                       
       
                   },
                   complete: function(){
                       $('#loader').css("visibility", "hidden");
                   }
               });
                              
                       
                       
                       
                   },
                   complete: function(){
                       $('#loader').css("visibility", "hidden");
                   }
               });
           } else {
   
               $('select[name="states"]').empty();
           }
   
   
   });  
    
    
 $('#City').on('change', function(){
      var CIITY = $('#City').val();  
                         $.ajax({
                   url: 'CityFilter/'+CIITY,
                   type:"GET",
                   dataType:"json",
                   beforeSend: function(){
                       $('#loader').css("visibility", "visible");
                   },
   
                   success:function(data) {
   
                       $('#Place').empty();
   
                       $.each(data, function(key, value){
   
             $('#Place').append('<option value="'+ key +'">' + value + '</option>');
                           
                       });
                       
       
                   },
                   complete: function(){
                       $('#loader').css("visibility", "hidden");
                   }
               });
                       
     
 });
    
    
    
       $(document).ready(function() {
   
       $('.Governrate').on('change', function(){
           var countryId = $(this).val();
       
           if(countryId) {
               $.ajax({
                   url: 'GovernrateFilter/'+countryId,
                   type:"GET",
                   dataType:"json",
                   beforeSend: function(){
                       $('#loader').css("visibility", "visible");
                   },
   
                   success:function(data) {
   
                       $('.City').empty();
   
                       $.each(data, function(key, value){
   
             $('.City').append('<option value="'+ key +'">' + value + '</option>');
                           
                       });
                       
                      var CIITY = $('.City').val();  
                         $.ajax({
                   url: 'CityFilter/'+CIITY,
                   type:"GET",
                   dataType:"json",
                   beforeSend: function(){
                       $('#loader').css("visibility", "visible");
                   },
   
                   success:function(data) {
   
                       $('.Place').empty();
   
                       $.each(data, function(key, value){
   
             $('.Place').append('<option value="'+ key +'">' + value + '</option>');
                           
                       });
                       
       
                   },
                   complete: function(){
                       $('#loader').css("visibility", "hidden");
                   }
               });
                       
                       
                       
                   },
                   complete: function(){
                       $('#loader').css("visibility", "hidden");
                   }
               });
           } else {
   
               $('select[name="states"]').empty();
           }
   
       });
   
   });
    
   $(document).ready(function() {
   
   
           var countryId = $('.Governrate').val();
           if(countryId) {
               $.ajax({
                   url: 'GovernrateFilter/'+countryId,
                   type:"GET",
                   dataType:"json",
                   beforeSend: function(){
                       $('#loader').css("visibility", "visible");
                   },
   
                   success:function(data) {
   
                       $('.City').empty();
   
                       $.each(data, function(key, value){
   
             $('.City').append('<option value="'+ key +'">' + value + '</option>');
                           
                       });
                       
                     var CIITY = $('.City').val();  
                         $.ajax({
                   url: 'CityFilter/'+CIITY,
                   type:"GET",
                   dataType:"json",
                   beforeSend: function(){
                       $('#loader').css("visibility", "visible");
                   },
   
                   success:function(data) {
   
                       $('.Place').empty();
   
                       $.each(data, function(key, value){
   
             $('.Place').append('<option value="'+ key +'">' + value + '</option>');
                           
                       });
                       
       
                   },
                   complete: function(){
                       $('#loader').css("visibility", "hidden");
                   }
               });
                              
                       
                       
                       
                   },
                   complete: function(){
                       $('#loader').css("visibility", "hidden");
                   }
               });
           } else {
   
               $('select[name="states"]').empty();
           }
   
   
   });  
    
    
 $('.City').on('change', function(){
      var CIITY = $('.City').val();  
                         $.ajax({
                   url: 'CityFilter/'+CIITY,
                   type:"GET",
                   dataType:"json",
                   beforeSend: function(){
                       $('#loader').css("visibility", "visible");
                   },
   
                   success:function(data) {
   
                       $('.Place').empty();
   
                       $.each(data, function(key, value){
   
             $('.Place').append('<option value="'+ key +'">' + value + '</option>');
                           
                       });
                       
       
                   },
                   complete: function(){
                       $('#loader').css("visibility", "hidden");
                   }
               });
                       
     
 });
    

</script>


<script>
    function Tot(){
        var Required_Number=$('#Required_Number').val();
        var Cost=$('#Cost').val();
        
        
        var z= parseFloat(Required_Number) * parseFloat(Cost) ;
        
        $('#Total_Required').val(parseFloat(z));
        
    }
    
    
    function Dif(){
        var Pay=$('#Pay').val();
        var Cost=$('#Cost').val();
        
        


        
        var z= parseFloat(Cost) - parseFloat(Pay) ;
        
        $('#Residual').val(parseFloat(z));
        
    }


   function AddToTable(){
         var Cost = document.getElementById('Cost').value;
        var Student = document.getElementById('Student').value;
        var StudentName =    $( "#Student option:selected" ).text();
        var Pay = document.getElementById('Pay').value;
        var Residual = document.getElementById('Residual').value;
        var Dollar_Value = document.getElementById('Dollar_Value').value;


            



        var table =  ` <tr> 
                                 <td class="TCred">
                                ${StudentName}
                               </td>

                                <td>${Cost}</td>
                                <td>${Pay}</td>
                                <td>${Residual}
             <input type="hidden" class="costt"  name="Cost[]" value="${Cost}">
    <input type="hidden" class="pay"  name="Pay[]" value="${Pay}">
    <input type="hidden" class="count" name="Student[]" value="${Student}">
    <input type="hidden" name="Residual[]" value="${Residual}">  
<input type="hidden" name="Dollar_Value[]" value="${Dollar_Value}">
    <input type="hidden" name="Constraint[]" value="0">
                                 </td>
                            <td>${Dollar_Value}</td>
                                <td>
                    <button id="Del" type="button" class="btn btn-default"><i class="fal fa-trash"></i></button>
                                </td>




                             </tr>`;
            
    
                             document.getElementById('data-dt').innerHTML += table;
       
            
            
    var sumcost = 0;        
$('.costt').each(function(){
  sumcost += parseFloat($(this).val());
});    
            
            
    var sumpay = 0;        
$('.pay').each(function(){
  sumpay += parseFloat($(this).val());
});    
            
            
    var sumcount = 0;        
$('.count').each(function(){
  sumcount += parseFloat($(this).val());
});                
         
            
            


            
            
   $('#totalCost').val(sumcost);        
    $('#totalPay').val(sumpay);     
    $('#totalNum').val(sumcount);     
  
 
 
     
            
$('#data-dt').on('click', '#Del', function(e){
   $(this).closest('tr').remove();
    
    
        var sumcost = 0;        
$('.costt').each(function(){
  sumcost += parseFloat($(this).val());
});    
            
            
    var sumpay = 0;        
$('.pay').each(function(){
  sumpay += parseFloat($(this).val());
});    
            
            
    var sumcount = 0;        
$('.count').each(function(){
  sumcount += parseFloat($(this).val());
});                
         
            
            


            
            
   $('#totalCost').val(sumcost);        
    $('#totalPay').val(sumpay);     
    $('#totalNum').val(sumcount);     
  
 
    
})    
            
            
         
   
            
        }
    
                
$('#data-dt').on('click', '#Del', function(e){
   $(this).closest('tr').remove();
    
    
        var sumcost = 0;        
$('.costt').each(function(){
  sumcost += parseFloat($(this).val());
});    
            
            
    var sumpay = 0;        
$('.pay').each(function(){
  sumpay += parseFloat($(this).val());
});    
            
            
    var sumcount = 0;        
$('.count').each(function(){
  sumcount += parseFloat($(this).val());
});                
         
            
            


            
            
   $('#totalCost').val(sumcost);        
    $('#totalPay').val(sumpay);     
    $('#totalNum').val(sumcount);     
  
 
    
})    
            
$(document).ready(function(){    
    
       var sumcost = 0;        
$('.costt').each(function(){
  sumcost += parseFloat($(this).val());
});    
            
            
    var sumpay = 0;        
$('.pay').each(function(){
  sumpay += parseFloat($(this).val());
});    
            
            
    var sumcount = 0;        
$('.count').each(function(){
  sumcount += parseFloat($(this).val());
});                
         
            
            


            
            
   $('#totalCost').val(sumcost);        
    $('#totalPay').val(sumpay);     
    $('#totalNum').val(sumcount);     
  
               });
        
</script>


<!-- Add New Stuent -->
<script>
   function NewClients(){
       
   var Arabic_Name = $('#Arabic_Name').val();    
   var Phone1 = $('#Phone1').val();  
   var Dad_Phone = $('#Dad_Phone').val();  
   var Age = $('#Age').val();  
   var Whatsapp = $('#Whatsapp').val();  
   var Ntional_ID = $('#Ntional_ID').val();  
   var Address = $('#Address').val();  
      
          
                        $.ajax({
                            url: 'AddNewStudent',
                            type:"GET",
                            data:{
                                Arabic_Name:Arabic_Name,
                                Phone1:Phone1,
                                Dad_Phone:Dad_Phone,
                                Age:Age,
                                Whatsapp:Whatsapp,
                                Ntional_ID:Ntional_ID,
                                Address:Address
                            },
                            dataType:"json",
                            beforeSend: function(){
                                $('#loader').css("visibility", "visible");
                            },
   
                            success:function(data) {
                                $.each(data, function(key, value){
                                    
                 
                            alert('تم الاضافه بنجاح');
            
    $('#Arabic_Name').val('');  
    $('#Phone1').val('');               
    $('#Dad_Phone').val('');               
    $('#Age').val('');               
    $('#Whatsapp').val('');               
    $('#Ntional_ID').val('');               
    $('#Address').val('');               
                                    
                                    
                                });
                            },
                            complete: function(){
                                $('#loader').css("visibility", "hidden");
                            }
                        });
                    
       
       
       
   }
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('admin.index', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Applications/MAMP/htdocs/laravel/ERP/resources/views/admin/Centers/StudentReserveCourse.blade.php ENDPATH**/ ?>