<?php $__env->startSection("content"); ?>
<div>
    <ol class="breadcrumb">
      <li><a href="<?php echo e(URL::route('user.home')); ?>"><?php echo trans('messages.home'); ?></a></li>
      <li><a href="<?php echo e(URL::route('order.index')); ?>">Orders</a></li>
      <li class="active">Update Requisition</li>
    </ol>
</div>
<?php if(Session::has('message')): ?>
    <div class="alert alert-info"><?php echo trans(Session::get('message')); ?></div>
<?php endif; ?>
<?php if($errors->all()): ?>
                <div class="alert alert-danger">
                    <?php echo HTML::ul($errors->all()); ?>

                </div>
            <?php endif; ?>
<div class="panel panel-default">
    <div class="panel-heading ">
        <span class="glyphicon glyphicon-user"></span>
      Update Requisition
    </div>
    <div class="panel-body">
          <?php echo Form::model($facilityrequest, array('route' => array('facilityrequest.update', $facilityrequest->id), 'method' => 'PUT', 'id' => 'form-edit-inhouse')); ?>

           <?php echo Form::open(array('url' => 'facilityrequest', 'id' => 'form-facilityrequest', 'method' => 'POST')); ?>

           <div class="form-group">
              <?php echo Form::label('commodity_id', 'Item/Commodity'); ?>

              <?php echo Form::select('commodity_id', $commodities, Input::old('commodity_id'), array('class' => 'form-control')); ?>

          </div>
          <div class="form-group">
              <?php echo Form::label('quantity', 'Quantity'); ?>

              <?php echo Form::text('quantity', Input::old('quantity'),array('class' => 'form-control', 'rows' => '2', 'id'=>'quantity')); ?>


          </div>
          <div class="form-group">
          <?php echo Form::label('department', 'Requesting Facility', array('class'=>'control-label')); ?>

                  <?php echo Form::select('facility', array_merge(array(null => 'Select facility...	'), $facility), Input::old('facility_id'), array('class' => 'form-control', 'id' => 'location_id')); ?>

                  <?php if($errors->has('department')): ?>
                      <span class="text-danger">
                          <strong><?php echo $errors->first('department'); ?></strong>
                      </span>
                  <?php endif; ?>
            </div>
          <div class="form-group actions-row">

                  <?php echo Form::button("<span class='glyphicon glyphicon-save'></span> ".trans('messages.save'),
                      array('class' => 'btn btn-primary', 'onclick' => 'submit()')); ?>


          </div>
      <?php echo Form::close(); ?>

  <?php Session::put('SOURCE_URL', URL::full());?>
</div>
</div>

<script>
$(".standard-datepicker-nofuture").datepicker({
  minDate: 0
});
$("#quantity").keyup(function() {

  if( $.isNumeric( parseInt( $("#quantity").val() ) ))
  {
      $("#total_cost").val( parseInt($("#unit_cost").val())*parseInt($("#quantity").val()) );
  }

});
</script>
<?php $__env->stopSection(); ?>

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