<?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('equipmentsupplier.index')); ?>"><?php echo trans('messages.equipment-breakdown-list'); ?></a></li>
        <li class="active"><?php echo Lang::choice('messages.equipment-breakdown',2); ?></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="ion-gear-a"></span>
		<?php echo Lang::choice('messages.equipment-breakdown',2); ?>

	</div>
	<div class="panel-body">

	
      <?php echo Form::open(array('url' => 'equipmentbreakdown/store', 'autocomplete' => 'off', 'class' => 'form-horizontal', 'data-toggle' => 'validator')); ?>


                            <fieldset> 


                               
                                <div class="form-group">
                                <?php echo Form::label('equipment_id', 'Equipment', array('class'=>'control-label')); ?>

                                  <div class="col-md-4">
                                        <?php echo Form::select('equipment_id', array(null => 'Select')+UNHLSEquipmentInventory::lists('name','id'), Input::old('equipment_id'), array('class' => 'form-control', 'id' => 'equipment_id', 'required'=>'required')); ?>  
                                      
                                        <?php if($errors->has('equipment_id')): ?>
                                            <span class="text-danger">
                                                <strong><?php echo $errors->first('equipment_id'); ?></strong>
                                            </span>
                                        <?php endif; ?>

                                  </div>
                                </div>  

                                <div class="form-group">
                                <?php echo Form::label('breakdown_type', 'Type of breakdown', array('class'=>'control-label')); ?>

                                  <div class="col-md-4">
                                        <?php echo Form::select('breakdown_type', array(null => 'Select')+ $breakdown_type, Input::old('supplier'), array('class' => 'form-control', 'id' => 'service_contract_id','required'=>'required')); ?>  
                                      
                                        <?php if($errors->has('breakdown_type')): ?>
                                            <span class="text-danger">
                                                <strong><?php echo $errors->first('breakdown_type'); ?></strong>
                                            </span>
                                        <?php endif; ?>

                                  </div>
                                </div>  

                                <div class="form-group">
                                <?php echo Form::label('description_problem', 'Description of problem', ['class' => 'col-lg-2 control-label']); ?>

                                  <div class="col-lg-7">
                                        <?php echo Form::textarea('description_problem',null,['class' => 'form-control','placeholder' => 'Description of problem', 'rows'=>'5','required' => 'required']); ?>


                                        <?php if($errors->has('description_problem')): ?>
                                            <span class="text-danger">
                                                <strong><?php echo $errors->first('description_problem'); ?></strong>
                                            </span>
                                        <?php endif; ?>

                                  </div>
                                </div>


                                <div class="form-group">
                                <?php echo Form::label('action_taken', 'Actions taken', ['class' => 'col-lg-2 control-label']); ?>

                                  <div class="col-lg-7">
                                        <?php echo Form::textarea('action_taken',null,['class' => 'form-control','placeholder' => 'Actions taken', 'rows'=>'5','required' => 'required']); ?>


                                        <?php if($errors->has('action_taken')): ?>
                                            <span class="text-danger">
                                                <strong><?php echo $errors->first('action_taken'); ?></strong>
                                            </span>
                                        <?php endif; ?>

                                  </div>
                                </div>


                                <div class="form-group">
                                <?php echo Form::label('request_hsd', 'Request of HSD', ['class' => 'col-lg-2 control-label']); ?>

                                  <div class="col-lg-7">
                                        <?php echo Form::textarea('request_hsd',null,['class' => 'form-control','placeholder' => 'Request of HSD', 'rows'=>'5','required' => 'required']); ?>


                                        <?php if($errors->has('request_hsd')): ?>
                                            <span class="text-danger">
                                                <strong><?php echo $errors->first('request_hsd'); ?></strong>
                                            </span>
                                        <?php endif; ?>

                                  </div>
                                </div>        


                                <div class="form-group">
                                <?php echo Form::label('breakdown_date', 'Breakdown date', ['class' => 'col-md-2 control-label']); ?>

                                  <div class="col-md-4">
                                        <?php echo Form::text('breakdown_date', Input::old('breakdown_date'),array('class' => 'form-control standard-datepicker','required'=>'required')); ?>


                                        <?php if($errors->has('breakdown_date')): ?>
                                            <span class="text-danger">
                                                <strong><?php echo $errors->first('breakdown_date'); ?></strong>
                                            </span>
                                        <?php endif; ?>

                                  </div>
                                </div>

                                <div class="form-group">
                                <?php echo Form::label('reported_by', 'Reported by', ['class' => 'col-lg-2 control-label']); ?>

                                  <div class="col-lg-7">
                                        <?php echo Form::text('reported_by',null,['class' => 'form-control','placeholder' => 'Reported by', 'required' => 'true']); ?>


                                        <?php if($errors->has('reported_by')): ?>
                                            <span class="text-danger">
                                                <strong><?php echo $errors->first('reported_by'); ?></strong>
                                            </span>
                                        <?php endif; ?>

                                  </div>
                                </div>


                                <div class="form-group">
                                <?php echo Form::label('priority', 'Priority', array('class'=>'control-label')); ?>

                                  <div class="col-md-4">
                                        <?php echo Form::select('priority', [''=>'Select','1'=>'High','2'=>'Moderate','3'=>'Low'], Input::old('priority'), array('class' => 'form-control', 'id' => 'priority', 'required'=>'required')); ?>  
                                      
                                        <?php if($errors->has('priority')): ?>
                                            <span class="text-danger">
                                                <strong><?php echo $errors->first('priority'); ?></strong>
                                            </span>
                                        <?php endif; ?>

                                  </div>
                                </div>  



                                <div class="form-group">
                                <?php echo Form::label('in_charge', 'In - charge', array('class'=>'control-label')); ?>

                                  <div class="col-md-4">
                                        <?php echo Form::select('in_charge', array('' => 'Select in charge') + UNHLSStaff::select(DB::raw('concat (firstName," ",lastName) as full_name,id'))->lists('full_name', 'id'), Input::old('in_charge'), array('class' => 'form-control', 'id' => 'in_charge', 'required'=>'required')); ?>  
                                      
                                        <?php if($errors->has('in_charge')): ?>
                                            <span class="text-danger">
                                                <strong><?php echo $errors->first('in_charge'); ?></strong>
                                            </span>
                                        <?php endif; ?>

                                  </div>
                                </div>                                                       


                                <div class="form-group">
                                <?php echo Form::label('report_date', 'Date reported', array('class'=>'control-label col-lg-2')); ?>

                                  <div class="col-lg-7">
                                        <?php echo Form::text('report_date', Input::old('report_date'), array('class' => 'form-control standard-datepicker', 'id' => 'report_date','required'=>'required')); ?> 

                                      
                                        <?php if($errors->has('report_date')): ?>
                                            <span class="text-danger">
                                                <strong><?php echo $errors->first('report_date'); ?></strong>
                                            </span>
                                        <?php endif; ?>

                                  </div>
                                </div>                                                          

                                    <div class="form-group">
                                      <div class="col-lg-7 col-lg-offset-2">
                                        <a href="<?php echo url('/equipmentbreakdown'); ?>" class="btn btn-default">Cancel</a>
                                        <button type="submit" class="btn btn-primary">Submit</button>
                                      </div>
                                    </div>
                                </div>                                

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


		<?php  
		Session::put('SOURCE_URL', URL::full());?>
	</div>
	
</div>
<script>
$(".standard-datepicker").datepicker({
    maxDate: 0
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make("layout", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>