<div class="row page-titles no-print">
    <div class="col-md-6 col-8 align-self-center">
        <h3 class="text-themecolor m-b-0 m-t-0">{{phrase.trans_vehicles}}</h3>
    </div>
    <div class="col-md-6 col-4 align-self-center">

    </div>
</div>

<div class="row" ng-show="views.list">
	<div class="col-12">
		<div class="card">
			<div class="card-block">
				<button ng-show="$root.can('trans_vehicles.add_vehicle')" ng-click="changeView('add')" class="btn pull-right btn-success card-block-input-item">{{phrase.add_vehicle}}</button>
				<div class="pull-right card-block-input-group card-block-input-item">
					<div class="input-group input-group-sm">
						<input type="text" name="table_search" ng-model="searchText" placeholder="{{phrase.Search}}" class="form-control input-sm">
						<span class="input-group-addon"><i class="fa fa-search"></i></span>
					</div>
				</div>
				<h4 class="card-title">{{phrase.list_vehicles}}</h4>
				<div class="table-responsive">

					<table class="table table-bordered table-hover">
						<tbody>
							<tr>
								<th>{{phrase.plate_numb}}</th>
								<th>{{phrase.vehicle_color}}</th>
								<th>{{phrase.vehicle_model}}</th>
								<th>{{phrase.driver_name}}</th>
								<th>{{phrase.driver_license}}</th>
								<th>{{phrase.driverContact}}</th>
								<th>{{phrase.Notes}}</th>
								<th style="width:160px;" ng-show="$root.can('trans_vehicles.edit_vehicle') || $root.can('trans_vehicles.del_vehicle')" >{{phrase.Operations}}</th>
							</tr>
							<tr ng-repeat="transport_vehicles_one in transport_vehicles | filter:searchText">
								<td>{{transport_vehicles_one.plate_number}}</td>
								<td>{{transport_vehicles_one.vehicle_color}}</td>
								<td>{{transport_vehicles_one.vehicle_model}}</td>
								<td>
									<span class="list_user_item"><img class="user-image img-circle" ng-show="transport_vehicles_one.driver_photo != ''" style="width:35px; height:35px;" ng-src="{{'uploads/transport/'+transport_vehicles_one.driver_photo}}">{{transport_vehicles_one.driver_name}}<br/></span>
								</td>
								<td>{{transport_vehicles_one.driver_license}}</td>
								<td>{{transport_vehicles_one.driver_contact}}</td>
								<td>{{transport_vehicles_one.vehicle_notes}}</td>
								<td ng-show="$root.can('trans_vehicles.edit_vehicle') || $root.can('trans_vehicles.del_vehicle')">
									<button ng-show="$root.can('trans_vehicles.edit_vehicle')" ng-click="edit(transport_vehicles_one.id)" type="button" class="btn btn-info btn-circle" title="{{phrase.Edit}}" tooltip><i class="fa fa-pencil"></i></button>
									<button ng-show="$root.can('trans_vehicles.del_vehicle')" ng-click="remove(transport_vehicles_one,$index)" type="button" class="btn btn-danger btn-circle" title="{{phrase.Remove}}" tooltip><i class="fa fa-trash-o"></i></button>
								</td>
							</tr>
							<tr ng-show="!transport_vehicles.length"><td class="noTableData" colspan="9">{{phrase.noDataAvailable}}</td></tr>
						</tbody>
					</table>
					

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

<div class="row" ng-show="views.add">
	<div class="col-12">
		<div class="card">
			<div class="card-block">
				<button ng-click="changeView('list')" class="btn btn-danger btn-flat pull-right card-block-input-item">{{phrase.cancelAdd}}</button>
				<h4 class="card-title">{{phrase.add_vehicle}}</h4>
				<div class="table-responsive">

					<form class="form-horizontal" name="transport_vehicles_add_form" role="form" ng-submit="saveAdd()" novalidate>
						<div class="form-group row" ng-class="{'has-error': transport_vehicles_add_form.plate_number.$invalid}">
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.plate_numb}} *</label>
							<div class="col-sm-10">
								<input type="text" name="plate_number" ng-model="form.plate_number" class="form-control" placeholder="{{phrase.plate_numb}}" required>
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.vehicle_color}} </label>
							<div class="col-sm-10">
								<input type="text" name="vehicle_color" ng-model="form.vehicle_color" class="form-control" placeholder="{{phrase.vehicle_color}}" >
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.vehicle_model}} </label>
							<div class="col-sm-10">
								<input type="text" name="vehicle_model" ng-model="form.vehicle_model" class="form-control" placeholder="{{phrase.vehicle_model}}" >
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.driver_name}} </label>
							<div class="col-sm-10">
								<input type="text" name="driver_name" ng-model="form.driver_name" class="form-control" placeholder="{{phrase.driver_name}}" >
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.driver_photo}} </label>
							<div class="col-sm-10">
								<input type="file" name="driver_photo" file-model="form.driver_photo">
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.driver_license}} </label>
							<div class="col-sm-10">
								<input type="text" name="driver_license" ng-model="form.driver_license" class="form-control" placeholder="{{phrase.driver_license}}" >
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.driverContact}} </label>
							<div class="col-sm-10">
								<textarea name="driver_contact" class="form-control" ng-model="form.driver_contact" placeholder="{{phrase.driverContact}}" ></textarea>
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.Notes}} </label>
							<div class="col-sm-10">
								<textarea name="vehicle_notes" class="form-control" ng-model="form.vehicle_notes" placeholder="{{phrase.Notes}}" ></textarea>
							</div>
						</div>
						<div class="form-group m-b-0">
							<div class="offset-sm-2 col-sm-10">
								<button type="submit" class="btn btn-info waves-effect waves-light" ng-disabled="transport_vehicles_add_form.$invalid">{{phrase.add_vehicle}}</button>
							</div>
						</div>
					</form>

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

<div class="row" ng-show="views.edit">
	<div class="col-12">
		<div class="card">
			<div class="card-block">
				<button ng-click="changeView('list')" class="btn btn-danger btn-flat pull-right card-block-input-item">{{phrase.cancelEdit}}</button>
				<h4 class="card-title">{{phrase.edit_vehicle}}</h4>
				<div class="table-responsive">

					<form class="form-horizontal" name="transport_vehicles_edit_form" role="form" ng-submit="saveEdit()" novalidate>
                    						<div class="form-group row" ng-class="{'has-error': transport_vehicles_edit_form.plate_number.$invalid}">
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.plate_numb}} *</label>
							<div class="col-sm-10">
								<input type="text" name="plate_number" ng-model="form.plate_number" class="form-control" placeholder="{{phrase.plate_numb}}" required>
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.vehicle_color}} </label>
							<div class="col-sm-10">
								<input type="text" name="vehicle_color" ng-model="form.vehicle_color" class="form-control" placeholder="{{phrase.vehicle_color}}" >
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.vehicle_model}} </label>
							<div class="col-sm-10">
								<input type="text" name="vehicle_model" ng-model="form.vehicle_model" class="form-control" placeholder="{{phrase.vehicle_model}}" >
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.driver_name}} </label>
							<div class="col-sm-10">
								<input type="text" name="driver_name" ng-model="form.driver_name" class="form-control" placeholder="{{phrase.driver_name}}" >
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.driver_photo}} </label>
							<div class="col-sm-10">
								<a ng-show="form.driver_photo != ''" href="index.php/transport_vehicles/download/{{form.id}}">{{phrase.viewFile}}</a><span style="margin-right:10px;" ng-show="form.driver_photo != ''">, {{phrase.orUpNew}}</span><input type="file" name="driver_photo" file-model="form.driver_photo">
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.driver_license}} </label>
							<div class="col-sm-10">
								<input type="text" name="driver_license" ng-model="form.driver_license" class="form-control" placeholder="{{phrase.driver_license}}" >
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.driverContact}} </label>
							<div class="col-sm-10">
								<textarea name="driver_contact" class="form-control" ng-model="form.driver_contact" placeholder="{{phrase.driverContact}}" ></textarea>
							</div>
						</div>
						<div class="form-group row" >
							<label class="col-sm-2 text-right control-label col-form-label">{{phrase.Notes}} </label>
							<div class="col-sm-10">
								<textarea name="vehicle_notes" class="form-control" ng-model="form.vehicle_notes" placeholder="{{phrase.Notes}}" ></textarea>
							</div>
						</div>
						<div class="form-group m-b-0">
							<div class="offset-sm-2 col-sm-10">
								<button type="submit" class="btn btn-info waves-effect waves-light" ng-disabled="transport_vehicles_edit_form.$invalid">{{phrase.edit_vehicle}}</button>
							</div>
						</div>
					</form>

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