@extends('master')



@section('content')

<!-- sells 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 Sells</h1>

<?php if(isset($data)){ ?>

<form action="<?php echo url('/'); ?>/admin/sells/edit" id="" class="form-horizontal " method="post" enctype="multipart/form-data">

{{ csrf_field() }}

<input type="hidden" name="sell_id" value="<?php echo $data->sell_id; ?>">





	<!-- Tc_id Start -->

    <div class="form-group">

        <label for="user_id" class="control-label col-md-3"> Trader Company </label>

          <div class="col-md-4">

          <select id="tc_id" name="tc_id" class="form-control select2">

            <?php

              foreach ($trader_company as $value) {

                $selected = $data->tc_id==$value->tc_id?'selected="selected"':'';

                echo '<option '.$selected.' value="'.$value->tc_id.'"> '.$value->company_name.'</option>';

              }

            ?>

          </select>

        </div>

        <div class="col-sm-5">

         <div class="label label-danger">{{ $errors->first("tc_id") }}</div>

      </div>

    </div>

      <!-- Tc_id End -->







	<!-- Trader Start -->

    <div class="form-group">

        <label for="user_id" class="control-label col-md-3"> Trader </label>

          <div class="col-md-4">

          <select id="trader" name="trader" class="form-control select2">

            <?php

              foreach ($traders as $value) {

                $selected = $data->trader==$value->tl_id?'selected="selected"':'';

                echo '<option '.$selected.' value="'.$value->tl_id.'"> '.$value->name.'</option>';

              }

            ?>

          </select>

        </div>

        <div class="col-sm-5">

         <div class="label label-danger">{{ $errors->first("trader") }}</div>

      </div>

    </div>

      <!-- Trader End -->







	<!-- Buyer Start -->

    <div class="form-group">

        <label for="user_id" class="control-label col-md-3"> Buyer </label>

          <div class="col-md-4">

          <select id="buyer" name="buyer" class="form-control select2">

            <?php

              foreach ($buyers as $value) {

                $selected = $data->buyer==$value->b_id?'selected="selected"':'';

                echo '<option '.$selected.' value="'.$value->b_id.'"> '.$value->name.'</option>';

              }

            ?>

          </select>

        </div>

        <div class="col-sm-5">

         <div class="label label-danger">{{ $errors->first("buyer") }}</div>

      </div>

    </div>

      <!-- Buyer End -->







<!-- Transporter_name Start -->

<div class="form-group">

  <label for="transporter_name" class="col-sm-3 control-label"> Transporter Name </label>

  <div class="col-sm-4">

    <input type="text" class="form-control" id="transporter_name" name="transporter_name" 

    

    value="{{{ $data->transporter_name }}}"

    >

  </div>

  <div class="col-sm-5">

         <div class="label label-danger">{{ $errors->first("transporter_name") }}</div>

      </div>

</div> 

<!-- Transporter_name End -->







<!-- Truck_no Start -->

<div class="form-group">

  <label for="truck_no" class="col-sm-3 control-label"> Truck no. </label>

  <div class="col-sm-4">

    <input type="text" class="form-control" id="truck_no" name="truck_no" 

    

    value="{{{ $data->truck_no }}}"

    >

  </div>

  <div class="col-sm-5">

         <div class="label label-danger">{{ $errors->first("truck_no") }}</div>

      </div>

</div> 

<!-- Truck_no 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>

<!-- /sells content -->

@endsection