<?php
session_start(); 
	
	/*Inquiry List page */

	include("connect.php");
	if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;
	}
	
	$coursemid1=0;
	if(isset($_POST['coursemid']))
	{
		$coursemid1=$_POST['coursemid'];
	}
	
	
				date_default_timezone_set("Asia/Kolkata");
				$mdate1= date('Y-m-d H:i:s');				
				$mdate2= date('d-m-Y');
				$mdate3= date('d-m-Y');
				
				$par1 = $_SESSION['umobile'];
				$ipaddress = "";
	
				if (getenv('HTTP_CLIENT_IP'))
					$ipaddress = getenv('HTTP_CLIENT_IP');
				else if(getenv('HTTP_X_FORWARDED_FOR'))
					$ipaddress = getenv('HTTP_X_FORWARDED_FOR');
				else if(getenv('HTTP_X_FORWARDED'))
					$ipaddress = getenv('HTTP_X_FORWARDED');
				else if(getenv('HTTP_FORWARDED_FOR'))
					$ipaddress = getenv('HTTP_FORWARDED_FOR');
				else if(getenv('HTTP_FORWARDED'))
					$ipaddress = getenv('HTTP_FORWARDED');
				else if(getenv('REMOTE_ADDR'))
					$ipaddress = getenv('REMOTE_ADDR');
				else
					$ipaddress = 'UNKNOWN';
				
				$userserver=$_SERVER['HTTP_USER_AGENT'];
				$eve1 = "insert into res_user_log (lid,mobile,lastupdatedtime,pagename,taskname,ipaddress,useragentdetail) values(NULL,'$par1','$mdate1','Product','Add Product','$ipaddress','$userserver')";
				$re1 = mysqli_query($conn, $eve1);
	
	
?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
    <!--<![endif]-->
    <!-- BEGIN HEAD -->

    <head>
        <meta charset="utf-8" />
        <title>College Add : LinkArise Visa Consultant</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta content="width=device-width, initial-scale=1" name="viewport" />
        <meta content="" name="description" />
        <meta content="" name="author" />
        <!-- BEGIN GLOBAL MANDATORY STYLES -->
        <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css" />
        <link href="../assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css" />
        <link href="../assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
        <!-- END GLOBAL MANDATORY STYLES -->
        <!-- BEGIN THEME GLOBAL STYLES -->
        <link href="../assets/global/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
        <link href="../assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
        <!-- END THEME GLOBAL STYLES -->
        <!-- BEGIN THEME LAYOUT STYLES -->
        <link href="../assets/layouts/layout/css/layout.min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/layouts/layout/css/themes/darkblue.min.css" rel="stylesheet" type="text/css" id="style_color" />
        <link href="../assets/layouts/layout/css/custom.min.css" rel="stylesheet" type="text/css" />
        <!-- END THEME LAYOUT STYLES -->
		<link href="../assets/global/plugins/bootstrap-toastr/toastr.min.css" rel="stylesheet" type="text/css" />
        <link rel="shortcut icon" href="favicon.ico" /> 
		
		<link href="../assets/global/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/global/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
		
		<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
		
		</head>
    <!-- END HEAD -->

    <body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white">
        <!-- BEGIN HEADER -->
        <div class="page-header navbar navbar-fixed-top">
            <!-- BEGIN HEADER INNER -->
            <div class="page-header-inner ">
                <!-- BEGIN LOGO -->
                <div class="page-logo">
                    <a href="#">
                        <img src="../assets/layouts/layout/img/logo.png" alt="logo" class="logo-default" /> </a>
                    <div class="menu-toggler sidebar-toggler"> </div>
                </div>
                <!-- END LOGO -->
                <!-- BEGIN RESPONSIVE MENU TOGGLER -->
                <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse"> </a>
                <!-- END RESPONSIVE MENU TOGGLER -->
                <!-- BEGIN TOP NAVIGATION MENU -->
                <div class="top-menu">
                    <ul class="nav navbar-nav pull-right">
                        <!-- BEGIN NOTIFICATION DROPDOWN -->
                        <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
                        
						<?php
							require ('notification.php');
						?>
						
                        <!-- END NOTIFICATION DROPDOWN -->
                        <!-- BEGIN INBOX DROPDOWN -->
                        <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
                        
                        <!-- END INBOX DROPDOWN -->
                        <!-- BEGIN TODO DROPDOWN -->
                        <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
                        
                        <!-- END TODO DROPDOWN -->
                        <!-- BEGIN USER LOGIN DROPDOWN -->
                        <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
                        <li class="dropdown dropdown-user">
                            <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                                <img alt="" class="img-circle" src="../assets/layouts/layout/img/avatar3_small.png" />
                                <span class="username username-hide-on-mobile"> <?php echo $_SESSION['ufullname']?> </span>
                                <i class="fa fa-angle-down"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-default">
                               
                                <li>
                                    <a href="changepassword.php">
                                        <i class="icon-lock"></i> Change Password </a>
                                </li>
                               
                                <li>
                                    <a href="logout.php">
                                        <i class="icon-logout"></i> Log Out </a>
                                </li>
                            </ul>
                        </li>
                        <!-- END USER LOGIN DROPDOWN -->
                        <!-- BEGIN QUICK SIDEBAR TOGGLER -->
                        <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
                       
                        <!-- END QUICK SIDEBAR TOGGLER -->
                    </ul>
                </div>
                <!-- END TOP NAVIGATION MENU -->
            </div>
            <!-- END HEADER INNER -->
        </div>
        <!-- END HEADER -->
        <!-- BEGIN HEADER & CONTENT DIVIDER -->
        <div class="clearfix"> </div>
        <!-- END HEADER & CONTENT DIVIDER -->
        <!-- BEGIN CONTAINER -->
        <div class="page-container">
            <!-- BEGIN SIDEBAR -->
			<?php
            require ('sidebar.php');
			?>
            <!-- END SIDEBAR -->
            <!-- BEGIN CONTENT -->
            <div class="page-content-wrapper">
                <!-- BEGIN CONTENT BODY -->
                <div class="page-content">
                    <!-- BEGIN PAGE HEADER-->
                    <!-- BEGIN THEME PANEL -->
                   
                    <!-- END THEME PANEL -->
                    <!-- BEGIN PAGE BAR -->
                   
                    <!-- END PAGE BAR -->
                    <!-- BEGIN PAGE TITLE-->
					
				
				
					
					<div class="portlet box blue-hoki green">
					<div class="portlet-title green">
						<div class="caption">
							<i class="fa fa-university"></i>Add College</div>
						<div class="actions">
							
						</div>
					</div>
					
                    <!-- END PAGE TITLE-->
                    <!-- END PAGE HEADER-->
					
					<div class="portlet-body form">
					<?php
					$coremarks="";
					$coursefees="";
					?>
					
					
				<!--<div class="alert alert-block alert-info fade in">
					<button type="button" class="close" data-dismiss="alert"></button>
					<h4 class="alert-heading"> Add New Product </h4>
					<p>Using following form you can add your product. This product will be used when you create quotation.</p>
					
				</div>-->
					<?php 
					
					$imid=$_GET['id'];
					?>
						<!-- BEGIN FORM-->
						<form action="clgapplication.php" method="POST" class="form-horizontal" enctype="multipart/form-data" id="myForm">
						<div class="form-body">	
								

						<div class="form-body">	
							<input type="hidden" name="imid1" value="<?php echo $imid; ?>">
							<input type="hidden" name="coursemid" value="<?php echo $coursemid1; ?>">
							<div class="form-group">
								<label class="col-md-3 control-label">Visa Type<span class="required">*</span></label>
								<div class="col-md-4">
									<select class="form-control select2" name="visatmid" >
										<option value="0">Select Visa Type</option>
												<?php	
												$eve_category22 = "select * from res_visatype_master";
												$re_category22 = mysqli_query($conn, $eve_category22);												
													while($rt_category22 = mysqli_fetch_assoc($re_category22))
													{
														echo "<option value='$rt_category22[visatmid]'>$rt_category22[visatype]</option>";
													}		
												?>	
												</select>
								</div>
							</div>	

								<div class="form-group">
								<label class="col-md-3 control-label">Country<span class="required">*</span></label>
								<div class="col-md-4">
									<select class="form-control select2" name="countrymid" id="countrymid" required>
										<option value="0">Select Country</option>
										<?php
										$eve_main = "select * from res_country_master";
										$re_main = mysqli_query($conn, $eve_main);
										while($rt_main = mysqli_fetch_assoc($re_main))
										{

											$countrymid=$rt_main['countrymid'];
											$countryname=$rt_main['countryname'];
											if($countrymid1==$countrymid)
											{
												echo "<option value='$countrymid' selected>$countryname</option>";
											}
											else
											{
												echo "<option value='$countrymid'>$countryname</option>";
											}

										}
									?>
									</select>
								</div>
							</div>

							<div class="form-group">
								<label class="col-md-3 control-label">Course<span class="required">*</span></label>
								<div class="col-md-4">
									<select class="form-control select2" name="coursemid" id="coursemid">
										<option value="0">Select Course</option>
									</select>
								</div>
							</div>
							</div>
						
										
					<div class="form-group">
								<label class="col-md-3 control-label">College<span class="required">*</span></label>
								<div class="col-md-4">
									<select class="form-control select2" name="collegemid" id="collegemid" required>
										<option value="0">Select College</option>
										
									</select>
									<?php //if(isset($_SESSION['selectedcourse']))
									//{?>
									<a data-toggle='modal' data-target='#view-modal' data-id='<?php echo $_SESSION['selectedcourse'];?>' id='getUser'>View Detail</i></a>
									<?php //}else{}?>
								</div>
						</div>
										
										
							<div class="form-group">
								<label class="col-md-3 control-label">Remark</label>
								<div class="col-md-4">
									<input type="text" name="coremarks" value="<?php echo $coremarks; ?>" class="form-control" aria-required="true" aria-invalid="false" aria-describedby="name-error" >
								</div>
							</div>		
									
								<div class="form-group">
								<label class="col-md-3 control-label">Course Fees</label>
								<div class="col-md-4">
									<input type="number" name="coursefees" value="<?php echo $coursefees; ?>" class="form-control" aria-required="true" aria-invalid="false" aria-describedby="name-error" >
								</div>
							</div>

						<div class="form-group">
								<label class="col-md-3 control-label">Status<span class="required">*</span></label>
								<div class="col-md-4">
									<select class="form-control select2" name="statusmid" id="statusmid">
										<option value="0">Select Status</option>
										<?php
										$eve_main = "select * from res_status_master where statustype='College Application'";
										$re_main = mysqli_query($conn, $eve_main);
										while($rt_main = mysqli_fetch_assoc($re_main))
										{

											$statusmid=$rt_main['statusmid'];
											$statusname=$rt_main['statusname'];
											if($statusmid1==$statusmid)
											{
												echo "<option value='$statusmid' selected>$statusname</option>";
											}
											else
											{
												echo "<option value='$statusmid'>$statusname</option>";
											}

										}
									?>
									</select>
								</div>
							</div>
								<div class="form-group">
									<label class="col-md-3 control-label">Inquiry Date<span class="required">  </span></label>
									<div class="col-md-9">
										<div class="input-group input-medium date date-picker " data-date-format="dd-mm-yyyy" data-provide="datepicker" >
											<input type="text" name="doapplication" class="form-control" value="<?php echo $mdate3;?>">
											<span class="input-group-btn">
											<button class="btn default " style="margin-left:10px" type="button">
												<i class="fa fa-calendar"></i>
											</button>
											</span>
										</div>
									</div>
								</div>
									
                             <div class="form-actions">
							   <div class="row">
									<div class="col-md-offset-3 col-md-9">
										<button type="submit" class="btn green">Submit <i class="fa fa-check"></i></button>
										<button type="button" class="btn grey-salsa btn-outline" onclick="document.location.href='inquirystatus.php?id=<?php echo $imid; ?>#portlet_tab2_3'">Cancel <i class="fa fa-arrow-left"></i></button>
									</div>
								</div>
							</div>
						</form>
                                      <!-- END FORM-->
                                            </div>
                                        </div>
					
                </div>
				<!-- Course Detail Popup-->
				<div id="view-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
			<div class="modal-dialog">
			  <div class="modal-content">

				   <div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title">
							<i class="glyphicon glyphicon-user"></i> Course Detail     
						</h4>
				   </div>
					 <form name="form1" method="post" action="" enctype="multipart/form-data">
				   <div class="modal-body">
					 <div id="modal-loader"  style="display: none; text-align: center;">
						<img src="ajax-loader.gif">
					   </div>

					   <!-- content will be load here -->
					   <div id="dynamic-content"></div>

					</div>
					<div class="modal-footer">
						  <button type="button" class="btn btn-default" data-dismiss="modal">Close <i class="fa fa-close"></i></button>
					</div>
				</form>
			 </div>
		  </div>
	</div>
	<!-- End Popup-->
                <!-- END CONTENT BODY -->
            </div>
            <!-- END CONTENT -->
            <!-- BEGIN QUICK SIDEBAR -->
            		   <!-- END QUICK SIDEBAR -->
        </div>
        <!-- END CONTAINER -->
        <!-- BEGIN FOOTER -->
        <div class="page-footer">
            <div class="page-footer">
            <div class="page-footer-inner">&copy; Arth Technology
               
            </div>
            <div class="scroll-to-top">
                <i class="icon-arrow-up"></i>
            </div>
        </div>
        </div>
        <!-- END FOOTER -->
        <!--[if lt IE 9]>
<script src="../assets/global/plugins/respond.min.js"></script>
<script src="../assets/global/plugins/excanvas.min.js"></script> 
<![endif]-->
        <!-- BEGIN CORE PLUGINS -->
        <script src="../assets/global/plugins/jquery.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
		<script src="../assets/global/plugins/counterup/jquery.counterup.min.js" type="text/javascript"></script>
        <!-- END CORE PLUGINS -->
        <!-- BEGIN THEME GLOBAL SCRIPTS -->
        <script src="../assets/global/scripts/app.min.js" type="text/javascript"></script>
        <!-- END THEME GLOBAL SCRIPTS -->
		
		
		  <script src="../assets/global/plugins/moment.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/bootstrap-daterangepicker/daterangepicker.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/morris/morris.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/morris/raphael-min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/counterup/jquery.waypoints.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/counterup/jquery.counterup.min.js" type="text/javascript"></script>
       
      
        <script src="../assets/global/plugins/flot/jquery.flot.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/flot/jquery.flot.resize.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/flot/jquery.flot.categories.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/jquery-easypiechart/jquery.easypiechart.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/jquery.sparkline.min.js" type="text/javascript"></script>
		<script src="../assets/pages/scripts/ui-toastr.min.js" type="text/javascript"></script>
		<script src="../assets/global/plugins/bootstrap-toastr/toastr.min.js" type="text/javascript"></script>

		 <!-- BEGIN PAGE LEVEL SCRIPTS -->
       
        <!-- END PAGE LEVEL SCRIPTS -->
        <!-- BEGIN THEME LAYOUT SCRIPTS -->
        <script src="../assets/layouts/layout/scripts/layout.min.js" type="text/javascript"></script>
        <script src="../assets/layouts/layout/scripts/demo.min.js" type="text/javascript"></script>
        <script src="../assets/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>
        <!-- END THEME LAYOUT SCRIPTS -->
		<script type="text/javascript" src="js/notification.js"/></script>	
		
		<script src="../assets/global/plugins/bootstrap-timepicker/js/bootstrap-timepicker.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
		<script src="../assets/pages/scripts/components-date-time-pickers.min.js" type="text/javascript"></script>
		
		<script src="../assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="js/notification.js"/></script>	
		
		<script src="../assets/global/plugins/bootstrap-timepicker/js/bootstrap-timepicker.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
		<script src="../assets/pages/scripts/components-date-time-pickers.min.js" type="text/javascript"></script>
		
		<script src="../assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js" type="text/javascript"></script>
		<script src="../assets/global/plugins/select2/js/select2.full.min.js" type="text/javascript"></script>
		<script src="../assets/pages/scripts/components-select2.min.js" type="text/javascript"></script>
		
		<!--<script src="code.jquery.com/jquery-1.10.2.js"></script>
		<script src="code.jquery.com/ui/1.11.4/jquery-ui.js"></script>-->
		
		<script language="JavaScript">
		function onlyNumbers(evt)
		{
			var e = event || evt; // for trans-browser compatibility
			var charCode = e.which || e.keyCode;

			if (charCode > 31 && (charCode < 48 || charCode > 57))
				return false;

			return true;

		}
	
		
		
		$('.datepicker').datepicker({
    format: 'mm/dd/yyyy',
    startDate: '-3d'
});

	</script>
	
	<script>
			$( function() 
			{
				$( "#datepicker" ).datepicker({ dateFormat: 'dd-mm-yy' }).val();
				$( "#datepicker1" ).datepicker({ dateFormat: 'dd-mm-yy' }).val();
			} );
		</script>
		
	
	
			
 <script type="text/javascript">
	$(function()
	{
		$('#myForm').submit(function(e)
		{
			if($('#countrymid').val() == '0')
			{
				alert('Select Country!');
				e.preventDefault();
			}

		});
	});
	</script>
    


		<script type="text/javascript">
			$(document).ready(function(){
				$('#countrymid').on('change',function(){
					var countrymid = $(this).val();
					if(countrymid){
						$.ajax({
							type:'POST',
							url:'countrydata.php',
							data:'countrymid='+countrymid,
							success:function(html){
								$('#coursemid').html(html);
							}
						});
					}else{
						$('#coursemid').html('<option value=""></option>');
					}
				});
			});
	</script>
	
	<script type="text/javascript">
	$(function()
	{
		$('#myForm').submit(function(e)
		{
			if($('#coursemid').val() == '0')
			{
				alert('Select Course!');
				e.preventDefault();
			}

		});
	});
	</script>
    
	<script type="text/javascript">
	$(function()
	{
		$('#myForm').submit(function(e)
		{
			if($('#statusmid').val() == '0')
			{
				alert('Select Status!');
				e.preventDefault();
			}

		});
	});
	</script>
    


		<script type="text/javascript">
			$(document).ready(function(){
				$('#coursemid').on('change',function(){
					var coursemid = $(this).val();
					if(coursemid){
						$.ajax({
							type:'POST',
							url:'collegedata.php',
							data:'coursemid='+coursemid,
							success:function(html){
								$('#collegemid').html(html);
							}
						});
					}else{
						$('#collegemid').html('<option value=""></option>');
					}
				});
			});
	</script>
	
	<script>
	$(document).ready(function(){

		$(document).on('click', '#getUser', function(e){

			e.preventDefault();

			var uid = $(this).data('id');   // it will get id of clicked row

			$('#dynamic-content').html(''); // leave it blank before ajax call
			$('#modal-loader').show();      // load ajax loader

			$.ajax({
				url: 'coursedetailpopup.php',
				type: 'POST',
				data: 'id='+uid,
				dataType: 'html'
			})
			.done(function(data){
				console.log(data);
				$('#dynamic-content').html('');
				$('#dynamic-content').html(data); // load response
				$('#modal-loader').hide();		  // hide ajax loader
			})
			.fail(function(){
				$('#dynamic-content').html('<i class="glyphicon glyphicon-info-sign"></i> Something went wrong, Please try again...');
				$('#modal-loader').hide();
			});

		});

	});

</script>	
    </body>

</html>