
<div class="col-lg-10 col-lg-offset-1">
	<section class="panel">
		<header class="panel-heading" style="min-height:120px">
			<div class="col-lg-3"> <span> &nbsp; </span> </div>
			<div class="col-lg-6">
			<!-- <?php if (in_array("1", $aurl_list)){echo "selected=selected";}?> -->
				<h4 class="text-center"><i class="fa fa-user truck_icon"></i><br/> <b> <?php echo $view_type;?> User </b></h4>
			</div>
			<div class="col-lg-3"><span> &nbsp; </span></div>
		</header>
		<div class="clear"></div> 
		<div class="panel-body">
			<form class="form-horizontal"method="post" action="<?php echo base_url();?>users_ctrl/insert_users/<?php if(isset($ul_data['ul_id'])){ echo $ul_data['ul_id'];}?>">
				<div class="col-lg-12">
					<?php
						if(isset($ul_data['ul_id'])){
					?>
							<div class="form-group col-md-6">
								<label class="col-lg-4 col-sm-4">User Name</label>
								<div class="col-lg-8">
									<input type="text" class="form-control" name="ul_code" value="<?php if(isset($ul_data['ul_code'])){ echo $ul_data['ul_code'];}?>" readonly required>
								</div>
							</div>
					<?php
						}
					?>
					<div class="form-group col-md-6">
						<label class="col-lg-4 col-sm-4">User Name</label>
						<div class="col-lg-8">
							<input type="text" class="form-control" name="ul_name" value="<?php if(isset($ul_data['ul_name'])){ echo $ul_data['ul_name'];}?>" required>
						</div>
					</div>
					<div class="form-group col-md-6" style="display:none;">
						<label  class="col-lg-4 col-sm-4">Designation</label>
						<div class="col-lg-8">
							<select class="form-control" name="ul_designation" required>
                                <!-- <option value="">-- Select--</option> -->
								<option value="1" <?php if(isset($ul_data['ul_designation']) && $ul_data['ul_designation']=='1'){ echo "selected=selected";}?> > Entry Officer</option>
								<option value="2" <?php if(isset($ul_data['ul_designation']) && $ul_data['ul_designation']=='2'){ echo "selected=selected";}?> > Authorizing Officer</option>
								<option value="3" <?php if(isset($ul_data['ul_designation']) && $ul_data['ul_designation']=='3'){ echo "selected=selected";}?> > Despatch Officer </option>
								<option value="5" <?php if(isset($ul_data['ul_designation']) && $ul_data['ul_designation']=='5'){ echo "selected=selected";}?> > Loading Officer </option>
								<option value="6" <?php if(isset($ul_data['ul_designation']) && $ul_data['ul_designation']=='6'){ echo "selected=selected";}?> > Authorized Vehilce Slip Officer </option>
								<option value="20" <?php if(isset($ul_data['ul_designation']) && $ul_data['ul_designation']=='20'){ echo "selected=selected";}?> > Reports Manager </option>
                            </select>
						</div>
					</div> 

					<div class="form-group col-md-6">
						<label class="col-lg-4 col-sm-4">Operation Level</label>
						<div class="col-lg-8">
							<input type="text" class="form-control" name="ul_operation_level" value="<?php if(isset($ul_data['ul_operation_level'])){ echo $ul_data['ul_operation_level'];}?>" required>
						</div>
					</div>

					<div class="form-group col-md-6">
						<label  class="col-lg-4 col-sm-4">Mobile Number</label>
						<div class="col-lg-8">
							<input type="text" class="form-control" name="ul_mobile" value="<?php if(isset($ul_data['ul_mobile'])){ echo $ul_data['ul_mobile'];}?>" required>
						</div>
					</div>
					<div class="form-group col-md-6">
						<label  class="col-lg-4 col-sm-4">Email id</label>
						<div class="col-lg-8">
							<input type="email" class="form-control" name="ul_email" value="<?php if(isset($ul_data['ul_email'])){ echo $ul_data['ul_email'];}?>" required>
						</div>
					</div>
					<div class="form-group col-md-6">
						<label class="col-lg-4 col-sm-4">Country</label>
						<div class="col-lg-8">
							<input type="text" class="form-control" name="ul_state" value="<?php if(isset($ul_data['ul_state'])){ echo $ul_data['ul_state'];}?>" required>
						</div>
					</div>
					<div class="form-group col-md-6">
						<label class="col-lg-4 col-sm-4 ">Province</label>
						<div class="col-lg-8">
							<input type="text" class="form-control" name="ul_district" value="<?php if(isset($ul_data['ul_district'])){ echo $ul_data['ul_district'];}?>" required>
						</div>
					</div>
					<div class="form-group col-md-6">
						<label class="col-lg-4 col-sm-4 ">Place</label>
						<div class="col-lg-8">
							<input type="text" class="form-control" name="ul_place" value="<?php if(isset($ul_data['ul_place'])){ echo $ul_data['ul_place'];}?>" required>
						</div>
					</div>
					<div class="form-group col-md-6">
						<label class="col-lg-4 col-sm-4 ">Postal Code</label>
						<div class="col-lg-8">
							<input type="text" class="form-control" name="ul_pincode" value="<?php if(isset($ul_data['ul_pincode'])){ echo $ul_data['ul_pincode'];}?>" required>
						</div>
					</div>
					<div class="form-group col-md-6">
						<label class="col-lg-4 col-sm-4 ">Address</label>
						<div class="col-lg-8">
							<textarea rows="1" class="form-control"  name="ul_address" required> <?php if(isset($ul_data['ul_address'])){ echo $ul_data['ul_address'];}?> </textarea>
						</div>
					</div>

					

					<div class="form-group col-md-12" style="padding-left: 28px;">
						<h3>Assigned Roles</h3><br>
						<div class="form-group col-md-8">
							<input type="checkbox" name="aurl_roles[]" value="1" <?php if (isset($aurl_list) && in_array("1", array_column($aurl_list, 'aurl_roles'))){echo "checked=checked";}?> > &nbsp;&nbsp; Gate Entry Officer	<br>
							<input type="checkbox" name="aurl_roles[]" value="2" <?php if (isset($aurl_list) && in_array("2", array_column($aurl_list, 'aurl_roles'))){echo "checked=checked";}?> > &nbsp;&nbsp; Authorization Manager	<br>
							<input type="checkbox" name="aurl_roles[]" value="3" <?php if (isset($aurl_list) && in_array("3", array_column($aurl_list, 'aurl_roles'))){echo "checked=checked";}?> > &nbsp;&nbsp; WeighBridge Officer	<br>
							<input type="checkbox" name="aurl_roles[]" value="20" <?php if (isset($aurl_list) && in_array("20", array_column($aurl_list, 'aurl_roles'))){echo "checked=checked";}?> > &nbsp;&nbsp; Reports Manager	<br>
							
							<!-- <input type="checkbox" name="aurl_roles[]" value="5" <?php if (isset($aurl_list) && in_array("5", array_column($aurl_list, 'aurl_roles'))){echo "checked=checked";}?> > &nbsp;&nbsp; Vehicle slip entry Officer	<br> -->
							
						</div>
					</div>
					<div class="form-group col-md-12">
						<div class="col-lg-offset-10 col-lg-2">
                            <button type="submit" class="btn btn-success pull-right">Save</button>
                        </div>
					</div>
				</div>
				
			</form>
		</div>
	</section>
</div>