<?php $__env->startSection("content"); ?>
<div>
	<ol class="breadcrumb">
		 <li><a href="<?php echo e(URL::route('ictmaintenance.index')); ?>">Maintenance</a></li>
	  <li><a href="<?php echo e(URL::route('ictbreakdown.index')); ?>">Equipment Breakdown</a></li>
		 <li><a  href="<?php echo URL::route('ictsupplier.index'); ?>">ICT equipment suppliers</a></li>
		  <li class="active">New ICT asset</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 align:center; class="panel panel-default" style="width:50%">
	<div class="panel-heading ">
		<span class="glyphicon glyphicon-plus"></span>
		New ICT Asset
	</div>
	<div class="panel-body" >


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


                            <fieldset>


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

                                  <div class="col-md-3">
                                        <?php echo Form::text('equipment_name',null,['class' => 'form-control','placeholder' => 'Name', 'required' => 'true']); ?>


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

                                  </div>
                                </div>

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

                                  <div class="col-md-3">
                                        <?php echo Form::text('description',null,['class' => 'form-control','placeholder' => 'Asset Description', 'required' => 'true']); ?>


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

                                  </div>
                                </div>

															  <div class="form-group">
                                <?php echo Form::label('type', 'Type/Category', ['class' => 'col-md-2 control-label']); ?>

                                  <div class="col-md-3">
                                        <?php echo Form::text('type',null,['class' => 'form-control','placeholder' => 'type/category', 'required' => 'true']); ?>


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

                                  </div>
                                </div>

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

																	<div class="col-md-4">
																		<?php echo Form::text('serial_number',null,['class' => 'form-control','placeholder' => 'Serial number', 'required' => 'true']); ?>


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

																	</div>
																</div>

																<div class="form-group">
                                <?php echo Form::label('model', 'Model/Manufacturer', ['class' => 'col-md-2 control-label']); ?>

                                  <div class="col-md-3">
                                        <?php echo Form::text('model',null,['class' => 'form-control','placeholder' => 'Model', 'required' => 'true']); ?>


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

                                  </div>
                                </div>

                                <div class="form-group">
                                <?php echo Form::label('location', 'User/Location', array('class'=>'control-label')); ?>

                                  <div class="col-md-4">
                                        <?php echo Form::text('location',null,['class' => 'form-control','placeholder' => 'location/user']); ?>

                                  </div>
                                </div>

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

																	<div class="col-md-4">
																				<?php echo Form::select('location', array_merge(array(null => 'Select'), $location_list), Input::old('location'), array('class' => 'form-control', 'id' => 'location_id')); ?>


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

																	</div>
																</div>

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

																	<div class="col-md-4">
																		<?php echo Form::select('supplier_id', array(null => 'Select')+ $supplier_list, Input::old('supplier'), array('class' => 'form-control', 'id' => 'service_contract_id')); ?>


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

																	</div>
																</div>
																
                                <div class="form-group">
                                <?php echo Form::label('procurement_type', 'Procurement type', array('class'=>'control-label')); ?>

                                  <div class="col-md-4">
                                        <?php echo Form::select('procurement_type', array(null => 'Select')+ array('0' => 'Placement', '1' => 'Procured', '2' => 'Donation'), Input::old('procurement_type'), array('class' => 'form-control', 'id' => 'procurement_type_id')); ?>


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

                                  </div>
                                </div>

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

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


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

                                  </div>
                                </div>


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

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


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

                                  </div>
                                </div>


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

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


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

                                  </div>
                                </div>


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

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


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

                                  </div>
                                </div>

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

                                  <div class="col-md-4">
                                        <?php echo Form::select('spare_parts', array(null => 'Select')+ $yes_no_list, Input::old('spare_parts'), array('class' => 'form-control', 'id' => 'spare_parts_id','required'=>'required')); ?>


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

                                  </div>
                                </div>

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

                                  <div class="col-md-4">
                                        <?php echo Form::select('warranty', array(null => 'Select')+ $warranty_list, Input::old('warranty'), array('class' => 'form-control', 'id' => 'warranty_id','required'=>'required')); ?>


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

                                  </div>
                                </div>

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

                                  <div class="col-md-2">
                                        <div class="input-group">
                                            <?php echo Form::number('life_time',null,['class' => 'form-control','placeholder' => 'Lifetime', 'required' => '']); ?>

                                              <span class="input-group-addon">Years</span>
                                        </div>


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

                                  </div>
                                </div>

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

                                  <div class="col-md-4">
                                        <?php echo Form::select('service_frequency', array(null => 'Select')+ $service_frequency_list, Input::old('service_frequency'), array('class' => 'form-control', 'id' => 'service_frequency_id','required'=>'required')); ?>


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

                                  </div>
                                </div>

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

                                  <div class="col-md-4">
                                        <?php echo Form::select('service_contract', array(null => 'Select')+ $yes_no_list, Input::old('service_contract'), array('class' => 'form-control', 'id' => 'service_contract_id','required'=>'required')); ?>


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

                                  </div>
                                </div>



                                    <div class="form-group">
                                      <div class="col-lg-10 col-lg-offset-2">
                                        <a href="<?php echo url('/equipmentinventory'); ?>" 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>

$(".purchase-date").datepicker({
    maxDate: 0,
    dateFormat:"yy-mm-dd",
    onSelect: function(dateText, inst){
     $(".verification-date,.delivery-date").datepicker("option","minDate",
     $("#purchase_date").datepicker("getDate"));

  }
});


    $(".delivery-date").datepicker({
        maxDate: 0,
        dateFormat:"yy-mm-dd",
        onSelect: function(dateText, inst){
         $(".installation-date").datepicker("option","minDate",
         $("#delivery_date").datepicker("getDate"));
      }

    });


$(".verification-date").datepicker({
    maxDate: 0,
    dateFormat:"yy-mm-dd",
});



$(".installation-date").datepicker({
    maxDate: 0,
    dateFormat:"yy-mm-dd",
});
</script>
<?php $__env->stopSection(); ?>

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