<?php $__env->startSection("content"); ?>
<div>
		<div class="col-md-8 col-md-offset-1">
	<ol class="breadcrumb">
		<li><a href="<?php echo e(URL::route('mechanicalmaintenance.index')); ?>">Bio-Medical Maintenance Log</a></li>
		<li><a href="<?php echo e(URL::route('mechanicalbreakdown.index')); ?>">BIo-Medical Equipment Breakdown Log</a></li>
		<li><a  href="<?php echo URL::route('mechanicalsupplier.index'); ?>">Bio-Medical Equipment Suppliers</a></li>
		<li class="active">New Engineering/mechanical equipment</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="col-md-8 col-md-offset-3">
<div align:center; class="panel panel-default" style="width:65%">
	<div class="panel-heading ">
		<span class="glyphicon glyphicon-plus"></span>
		New Bio-Medical Asset
	</div>
	<div class="panel-body" >

		<?php echo Form::open(array('route' => 'mechanicalinventory.store', 'id' => 'form-supplier')); ?>

		<fieldset>

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

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

					<?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('epuipment_status', 'Equipment Status', array('class'=>'control-label')); ?>

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

					<?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('name', 'Asset Name', ['class' => 'col-md-2 control-label']); ?>

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

					<?php if($errors->has('name')): ?>
					<span class="text-danger">
						<strong><?php echo $errors->first('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('quantity', 'Quantity', array('class'=>'control-label')); ?>

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

				</div>
			</div>

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

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

				</div>
		</div>

			<div class="form-group">
				<?php echo Form::label('country_id', 'Country Of Origin', array('class'=>'control-label')); ?>

				<div class="col-md-4">
					<?php echo Form::select('country_id', array(null => 'Select')+ $countries, Input::old('country'), array('class' => 'form-control', 'id' => 'country_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('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">
	<?php echo Form::label('comment', 'Comment', ['class' => 'col-md-2 control-label']); ?>

	<div class="col-md-4">
		<?php echo Form::textarea('comment', Input::old('comment'),['class' => 'form-control','placeholder' => 'Comment on item']); ?>

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