<?php 
include ('../ro_head.php'); 
isauth_have("Visa category");
?>

<style type="text/css">
	h3{
		background-color: #c6deef;
		padding: 10px 0px 10px 20px;
		font-size: 18px;
	}
</style>
<!-- END PAGE LEVEL STYLES -->

<!-- BEGIN CONTAINER -->
<div class="page-container">
<?php include_once("../ro_sidebar.php"); ?>
    <!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
						
			<!-- BEGIN PAGE CONTENT-->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN EXAMPLE TABLE PORTLET-->
					<div class="portlet box grey-cascade">
						<div class="portlet-title">
							<div class="caption">
								<i class="fa fa-globe"></i>Edit Visa Category Information
							</div>
							<!-- <div class="tools"> -->
								<!-- <a href="javascript:;" class="collapse">
								</a> -->
								<!-- <a href="#portlet-config" data-toggle="modal" class="config">
								</a> -->
								<!-- <a href="javascript:;" class="reload">
								</a> -->
								<!-- <a href="javascript:;" class="remove">
								</a> -->
							<!-- </div> -->
						</div>
						<div class="portlet-body">
							<div class="table-toolbar">
								<div class="row">

								<form name="addproduct" class="form-horizontal form-row-seperated" action="visatype_crud.php" method="post">
									<div class="col-md-12">

									<?php

									$id = $_GET['id'];

									$sql = "SELECT * FROM `visatype_table` WHERE `visatype_id`=$id";

									$result = mysqli_query($con,$sql);

									$row = mysqli_fetch_array($result);

									?>
										
										<div class="form-group">
								
				                            <div class="form-group">

												<input type='hidden' name='id' value="<?php echo $row['visatype_id'];?>">
												<label class="col-md-3 control-label">
													Visa Category Name:<span class="required">* </span>
												</label>

												<div class="col-md-3">
													<input type="text" class="form-control" name="visatype_name"  value="<?php echo $row['visatype_name'];?>" required>
												</div>
											</div>
										</div>

										<div class="form-group">
								
				                            <div class="form-group">
												
												<label class="col-md-3 control-label">
													Visa Fee:<span class="required">* </span>
												</label>

												<div class="col-md-3">
													<input type="number" class="form-control" name="visatype_fee"  value="<?php echo $row['visatype_fee'];?>" required>
												</div>
											</div>
										</div>

										<div class="form-group">
							  	
											<div class="form-group">
												
												<label class="col-md-3 control-label">
													Main Visa Category: <span class="required">* </span>
												</label>

												<div class="col-md-3">
													<select name="mainvisatype" class="form-control" required>
													  	<option value=""> - Select -</option>
												
												<?php    
						                            $delrs = mysqli_query($con,"select * from main_visatype_table where mvisatype_status=1 order by mvisatype_name ASC");
				                            		while($delrow=mysqli_fetch_array($delrs)){ 
				                                
				                                 	  	echo "<option value=".$delrow["mvisatype_id"];
				                                 	  	if($delrow["mvisatype_id"]==$row['visa_cat']) echo " selected";	
				                                 	  	echo "> ".$delrow["mvisatype_name"]." </option>";
													  	
													} 
												?>	
													</select>	
                                
												</div>
											</div>
										</div>
										
                       					 <div class="form-group">
								
				                            <div class="form-group">

												<label class="col-md-3 control-label">
													Status: <span class="required">* </span>
												</label>
												<div class="col-md-3">												
													<select name="status" class="form-control">

													<?php

														if($row['visatype_status'] == 1){
															?>
																<option value="1">Active</option>
																<option value="0">inactive</option>

															<?php
														}else{
															?>
																
																<option value="0">inactive</option>
																<option value="1">Active</option>

															<?php
														}

													?>

														
													</select>
												</div>



											</div>


                       					 </div>


                       					<div class="form-group">
											<div class="form-group">

												<label class="col-sm-4 control-label" ></label>

								                	<input type='hidden' name='actionid' value='update'>

									                <div class="col-sm-8" style="padding-top: 20px;">
									                	<button class="btn green"><i class="fa fa-check"></i> Save </button>
									                </div>
									            </div>
								        </div>	

								        </form>	

									</div>
									
								</div>
							</div>
							
						</div>
					</div>
					<!-- END EXAMPLE TABLE PORTLET-->
				</div>
			</div>
				</div>
			</div>
			<!-- END PAGE CONTENT-->
		</div>
	</div>
	<!-- END CONTENT -->
	
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<?php include_once("../ro_footer.php"); ?>

<!-- END FOOTER -->
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<?php include_once("../ro_js.php"); ?>

<script src="testing_form-wizard.js"></script>

<!-- END PAGE LEVEL SCRIPTS -->
<script>
jQuery(document).ready(function() {       
   Metronic.init(); // init metronic core components
Layout.init(); // init current layout
QuickSidebar.init(); // init quick sidebar
Demo.init(); // init demo features
   
});
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>