<?php $__env->startSection('content'); ?>
<?php if(session()->has('message')): ?>
<div class="row">
        <!-- left column -->
        <div class="col-md-2"></div>
<div class="col-md-4 alert alert-success alert-dismissible" style="font-size:18px;font-weight:bold;width:950px;margin-left:15px">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                <?php echo session('message'); ?>

              </div>
              </div> 
<?php endif; ?>

<div class="row">
        <!-- left column -->
        <div class="col-md-2"></div>
        <div class="col-md-8">
          <!-- general form elements -->
          <div class="box box-primary" style="border-top-color: #ff9800;">
            <div class="box-header with-border" style="text-align: center; background-color: #ff9800;">
              <h3 class="box-title " style="font-weight: bold;">  
              تعديل الكارتة رقم   
              <?php echo e($main->id); ?>

              الموجودة في 
              &nbsp; &nbsp; &nbsp; 
              <?php if( $main->sell_store ): ?>
              <span style="color:white"><?php echo e($main->sell_store->store->store_name); ?>-- </span>
              <span style="color:white"><?php echo e($main->sell_store->branch->name); ?>--</span>
              <span style="color:white">  مخزن بيع   ( <?php echo e($main->sell_store_id); ?> ) </span>
              <?php else: ?>
              <span style="color:#953922"> لا يوجد مخزن بيع </span>
              <?php endif; ?>
            </h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form   role="form" method="POST" action="<?php echo e(url('/main/advancededit')); ?>">
                        <?php echo e(csrf_field()); ?>

              <div class="box-body">
                
            
              <div class="form-group col-md-6">
                <label>Choosw Supplier </label>
                <select class="form-control select2" onchange="showWasteOfSupplier(this.value)" style="width: 100%;" name="supplier_id" id="supplier_id" required>
                  <?php foreach( $suppliers as $supplier ): ?> 
                  <option value="<?php echo e($supplier->id); ?>" <?php echo e($main->supplier->id == $supplier->id ? 'selected' : ''); ?> ><?php echo e($supplier->name); ?></option>
                  <?php endforeach; ?>
                </select>
                </div>

                <div class="form-group col-md-6">
                <label>Choosw Wastes </label>
                <select class="form-control select2"    onchange="getPrice(this.value)"  style="width: 100%;" name="waste_id" id="waste_id" required>
                <option value="0" >Choose Waste ...!</option>
                  <?php foreach( $wastes as $waste ): ?> 
                  <option value="<?php echo e($waste->id); ?>" <?php echo e($main->waste->id == $waste->id ? 'selected' : ''); ?> ><?php echo e($waste->name); ?></option>
                  <?php endforeach; ?>
                </select>
                </div>

 


                
                <div class="form-group col-md-6">
                <label> Branches - الفروع   </label>
                <select class="form-control select2" style="width: 100%;" 
                name="branch_id" id="branch_id" required>
                  <?php foreach( $branches as $branch ): ?>
                  <option value="<?php echo e($branch->id); ?>" <?php echo e($main->branch->id == $branch->id ? 'selected' : ''); ?> ><?php echo e($branch->name); ?></option>
                  <?php endforeach; ?>
                </select>
                </div>
                
                


                <div class="form-group col-md-6">
                  <label for="exampleInputPassword1">quantity</label>
                  <input type="text" name="quantity"  value="<?php echo e($main->quantity); ?>" class="form-control"  placeholder="quantity " required>
                </div>

                 <div class="form-group col-md-6">
                  <label for="exampleInputPassword1">Price</label>
                  <input type="number" step="0.01" name="price"  id="priceprice" value="<?php echo e($main->price); ?>" class="form-control"  placeholder="Price " required>
                </div>

                
               <input type="hidden" name="main_id" value="<?php echo e($main->id); ?>" class="form-control"  placeholder="" required>
              </div>
              <!-- /.box-body -->

              <div class="box-footer">
                <?php if($expired_supplier_waste=="no"): ?>
                <button type="submit" class="btn btn-success">Save</button>
                <?php else: ?>
                <h2 class="btn btn-success"> expired supplier waste </h2>
                <?php endif; ?>
                
                
              </div>
            </form>

          </div>    


        </div>
         
      </div>



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