@extends('master')

@section('content')
<!-- marqua content -->
<div class="right_col" role="main">
  <div class="row x_panel">
    <div class="col-md-12 col-sm-12 col-xs-12">
    <h1>Edit Marqua</h1>
<?php if(isset($data)){ ?>
<form action="<?php echo url('/'); ?>/admin/marqua/edit" id="" class="form-horizontal " method="post" enctype="multipart/form-data">
{{ csrf_field() }}
<input type="hidden" name="mq_id" value="<?php echo $data->mq_id; ?>">


	<!-- Crop Start -->
    <div class="form-group">
        <label for="user_id" class="control-label col-md-3"> Crop </label>
          <div class="col-md-4">
          <select id="crop" name="crop" class="form-control select2">
            <?php
              foreach ($crops as $value) {
                $selected = $data->crop==$value->crp_id?'selected="selected"':'';
                echo '<option '.$selected.' value="'.$value->crp_id.'"> '.$value->crop.'</option>';
              }
            ?>
          </select>
        </div>
        <div class="col-sm-5">
         <div class="label label-danger">{{ $errors->first("crop") }}</div>
      </div>
    </div>
      <!-- Crop End -->



<!-- Quality Start -->
<div class="form-group">
  <label for="quality" class="col-sm-3 control-label"> Quality </label>
  <div class="col-sm-4">
    <input type="text" class="form-control" id="quality" name="quality" 
    
    value="{{{ $data->quality }}}"
    >
  </div>
  <div class="col-sm-5">
         <div class="label label-danger">{{ $errors->first("quality") }}</div>
      </div>
</div> 
<!-- Quality End -->



	<!-- Status Start -->
	 <div class="form-group">
        <label class="control-label col-md-3">Status
             
        </label>                    
         <div class=" col-md-4 switch">
                    <div class="onoffswitch">
     <input type="checkbox" class="onoffswitch-checkbox"  data-on-label="Yes" data-off-label="No"  name="status" value="{{{ $data->status }}}" id="status" <?php if($data->status == 1){echo "checked=checked";}?> style="width:20px; height:20px;"/>
                    </div>
                </div>
      </div>
      <!-- Status End -->


  <div class="form-group">
  <div class="col-sm-3">
  </div>
   <div class="col-sm-6">
    <button type="reset" class="btn btn-default ">Reset</button>
    <button type="submit" class="btn btn-info ">Update</button>
   </div>
  </div>
</form>
<?php } else{
    echo '<h2 align="center" class="text-danger">No record found!</h2>';
  } ?>
    </div>
  </div>
</div>
<!-- /marqua content -->
@endsection