<div class="modal-header">
	<button type="button" class="close" ng-click="cancel()">×</button>
	<h3 class="modal-title" ng-if="!device.id"><i class="fa fa-plus"></i> Add a new device</h3>
	<h3 class="modal-title" ng-if="device.id"><i class="fa fa-pencil"></i> Edit device</h3>
</div>
<form class="form-horizontal" name="deviceForm" ng-submit="save()">
	<div class="modal-body">
		<div class="alert alert-danger" ng-if="!Customer.id">
			<strong><i class="fa fa-exclamation-triangle"></i> You need to select a customer before you can add a new device</strong>
		</div>

		<div class="row">
			<div class="col-sm-3">
				<i class="fa fa-laptop fa-4x"  ng-show="device.type == 'laptop'"></i>
				<i class="fa fa-desktop fa-4x" ng-show="device.type == 'pc'"></i>
				<i class="fa fa-tablet fa-4x"  ng-show="device.type == 'tablet'"></i>
				<i class="fa fa-hdd-o fa-4x"     ng-show="device.type == 'hdd'"></i>
				<i class="fa fa-apple fa-4x"   ng-show="device.type == 'mac'"></i>
			</div>
{{-- 			<div class="col-sm-9">
				<h3>{[{ device.manufacturer.name }]}</h3>
			</div> --}}
		</div>
		<div class="row">
			<div class="col-sm-5">
				<fieldset>
					<legend>Physical Details</legend>

					<div class="form-group">
						<label class="col-sm-3 control-label label-required" for="deviceType">Type:</label>
						<div class="col-sm-9">
							<select name="type" class="form-control" ng-model="device.type">
								<option value="laptop">Laptop</option>
								<option value="pc">PC</option>
								<option value="tablet">Tablet</option>
								<option value="mac">Mac</option>
								<option value="hdd">Hard Drive</option>
                                                                <option value="amplifier">Amplifier</option>
                                                                <option value="speaker_amp">Speaker Amp</option>
                                                                <option value="guitar_amp">Guitar Amp</option>
                                                                <option value="keyboard">Keyboard</option>
                                                                <option value="dj_controller">DJ Controller</option>
                                                                <option value="dj_mixer">DJ Mixer</option>
                                                                <option value="mixing_desk">Mixing Desk</option>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label for="serial_number" class="col-sm-3 control-label">Serial Number:</label>
						<div class="col-sm-9">
							<input type="text" name="serial_number" ng-model="device.serial_number" class="form-control">
						</div>
					</div>
					<div class="form-group">
						<label for="manufacturer" class="col-sm-3 control-label label-required">Manufacturer:</label>
						<div class="col-sm-9">
							<input type="hidden" class="form-control" ng-model="helper.manufacturer" ui-select2="manufacturerSearchSettings" required>
						</div>
					</div>
					<div class="form-group">
						<label for="model_number" class="col-sm-3 control-label label-required">Model Number:</label>
						<div class="col-sm-9">
							<input type="hidden" class="form-control" ng-model="helper.model_number" ui-select2="modelNumberSearchSettings" required>
						</div>
					</div>
					<div class="form-group">
						<label for="case" class="col-sm-3 control-label label-required">Case:</label>
						<div class="col-sm-9">
							<label class="radio-inline">
								<input type="radio" name="case" value="1" ng-model="device.case" required> Yes
							</label>
							<label class="radio-inline">
								<input type="radio" name="case" value="0" ng-model="device.case" required> No
							</label>
						</div>
					</div>
					<div class="form-group">
						<label for="psu" class="col-sm-3 control-label label-required">PSU:</label>
						<div class="col-sm-9">
							<label class="radio-inline">
								<input type="radio" name="psu" value="1" ng-model="device.psu" required> Yes
							</label>
							<label class="radio-inline">
								<input type="radio" name="psu" value="0" ng-model="device.psu" required> No
							</label>
						</div>
					</div>
					<div class="form-group">
						<label for="visual_inspection" class="col-sm-3 control-label label-required">Visual Inspection:</label>
						<div class="col-sm-9">
							<input type="text" name="visual_inspection" ng-model="device.visual_inspection" required class="form-control">
						</div>
					</div>
					<div class="form-group">
						<label for="other_items" class="col-sm-3 control-label">Other Items:</label>
						<div class="col-sm-9">
							<input type="text" name="other_items" ng-model="device.other_items" class="form-control">
						</div>
					</div>
				</fieldset>
				<fieldset>
					<legend>Security Details</legend>
					<div class="form-group">
						<label for="has_antivirus" class="col-sm-3 control-label">Has Antivirus:</label>
						<div class="col-sm-9">
							<label class="radio-inline">
								<input type="radio" name="has_antivirus" value="1" ng-model="device.has_antivirus"> Yes
							</label>
							<label class="radio-inline">
								<input type="radio" name="has_antivirus" value="0" ng-model="device.has_antivirus"> No
							</label>
						</div>
					</div>
					<div class="form-group" ng-show="device.has_antivirus == 1">
						<label class="col-sm-3 control-label" for="deviceType">Antivirus:</label>
						<div class="col-sm-9">
							<select name="type" class='form-control' ng-model="device.antivirus">
								@foreach( App\Modules\Bookings\Device::antiviruses() as $antivirus)
									<option value='{{ $antivirus }}'>{{ $antivirus }}</option>
								@endforeach
							</select>
						</div>
					</div>
					<div class="form-group" ng-show="device.has_antivirus == 1">
						<label for="antivirus_expiration_date" class="col-sm-3 control-label">Antivirus Expiry Date:</label>
						<div class="col-sm-9">
							<div class="input-group">
								<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
								<input type="text" ng-model="helper.antivirus_expiration_date" class="form-control" data-date-type="iso" data-date-format="dd-mm-yyyy" bs-datepicker>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label for="is_secure" class="col-sm-3 control-label">Is the Device Secure:</label>
						<div class="col-sm-9">
							<label class="radio-inline">
								<input type="radio" name="is_secure" value="1" ng-model="device.is_secure"> Yes
							</label>
							<label class="radio-inline">
								<input type="radio" name="is_secure" value="0" ng-model="device.is_secure"> No
							</label>
						</div>
					</div>
					<div class="form-group" >
						<label for="num_viruses" class="col-sm-3 control-label">Number of Viruses</label>
						<div class="col-sm-9">
							<input type="number" name="num_viruses" ng-model="device.num_viruses" class="form-control">
						</div>
					</div>
				</fieldset>
			</div>
			<div class="col-sm-5 col-sm-offset-1">
				<fieldset>
					<legend>Technical Details</legend>
					<div class="form-group">
						<label class="col-sm-3 control-label" for="deviceType">RAM Model:</label>
						<div class="col-sm-9">
							<select name="type" class='form-control' ng-model="device.ram_model">
								@foreach( App\Modules\Bookings\Device::RAMModels() as $ram_model)
									<option value='{{ $ram_model }}'>{{ $ram_model }}</option>
								@endforeach
							</select>
						</div>
					</div>
					<div class="form-group">
						<label for="ram_speed" class="col-sm-3 control-label">RAM Speed:</label>
						<div class="col-sm-9">
							<div class="input-group">
								<input type="number" name="ram_speed" ng-model="device.ram_speed" class="form-control">
								<span class="input-group-addon">GHz</span>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label for="ram_status" class="col-sm-3 control-label">RAM Status:</label>
						<div class="col-sm-9">
							<label class="radio-inline">
								<input type="radio" name="ram_status" value="1" ng-model="device.ram_status"> Healthy
							</label>
							<label class="radio-inline">
								<input type="radio" name="ram_status" value="0" ng-model="device.ram_status"> Failed
							</label>
						</div>
					</div>
					<div class="form-group">
						<label for="ram_size" class="col-sm-3 control-label">RAM Size:</label>
						<div class="col-sm-9">
							<div class="input-group">
								<input type="number" name="ram_size" ng-model="device.ram_size" class="form-control" step="any">
								<span class="input-group-addon">GB</span>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label for="recommended_ram_size" class="col-sm-3 control-label">Recommended RAM Size:</label>
						<div class="col-sm-9">
							<div class="input-group">
								<input type="number" name="recommended_ram_size" ng-model="device.recommended_ram_size" class="form-control" step="any">
								<span class="input-group-addon">GB</span>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label" for="deviceType">HDD Model:</label>
						<div class="col-sm-9">
							<select name="type" class='form-control' ng-model="device.hdd_model">
								@foreach( App\Modules\Bookings\Device::HDDModels() as $hdd_model)
									<option value='{{ $hdd_model }}'>{{ $hdd_model }}</option>
								@endforeach
							</select>
						</div>
					</div>
					<div class="form-group">
						<label for="hdd_size" class="col-sm-3 control-label">HDD Size:</label>
						<div class="col-sm-9">
							<div class="input-group">
								<input type="number" name="hdd_size" ng-model="device.hdd_size" class="form-control" step="any">
								<span class="input-group-addon">GB</span>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label for="hdd_status" class="col-sm-3 control-label">HDD Status:</label>
						<div class="col-sm-9">
							<label class="radio-inline">
								<input type="radio" name="hdd_status" value="1" ng-model="device.hdd_status"> Healthy
							</label>
							<label class="radio-inline">
								<input type="radio" name="hdd_status" value="0" ng-model="device.hdd_status"> Failed
							</label>
						</div>
					</div>

				</fieldset>
			</div>
		</div>


	</div>
	<div class="modal-footer">
		<span class="btn btn-default" ng-click="cancel()">Close</span>
		<button class="btn btn-primary" ng-hide="device.id" ng-disabled="!Customer.id"><i ng-show="loading" class="fa fa-spinner fa-spin"></i> Save</button>
		<button class="btn btn-warning" ng-if="device.id"><i ng-show="loading" class="fa fa-spinner fa-spin"></i> Update</button>
	</div>
</form>
