<?php
session_start();
if(!isset ($_SESSION['user_id'])){
    header("Location:../login.php?msg=Log in first");
    exit();
}else{
	include('../Server/connection.php');
	include('includes/session.php');
	$st = 'add';
	if($st == 'add'){ 
	echo "<div class='div-request div-hide'>add</div>";
      }		
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

	<?php
	include 'title.php';
	?>
	
	<link type = "image/png" rel="icon" href="images/brvision.png"/>
	
    <!-- Bootstrap must-->
    <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
	
    <!-- Font Awesome must-->
    <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
	
	<!-- custom css -->
    <link rel="stylesheet" href="custom/css/custom.css">
	
    <!-- NProgress must-->
    <link href="../vendors/nprogress/nprogress.css" rel="stylesheet">
	
    <!-- Custom Theme Style must-->
    <link href="../build/css/custom.min.css" rel="stylesheet">
	
	<!-- must-->
	<script src="assests/jquery/jquery.min.js"></script>
	
	<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js"></script>
    <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/additional-methods.min.js"></script>
	
  <!-- jquery ui must-->  
  <link rel="stylesheet" href="assests/jquery-ui/jquery-ui.min.css">
  <script src="assests/jquery-ui/jquery-ui.min.js"></script>
	
  <!-- Must Bootstrap must-->
    <script src="../vendors/bootstrap/dist/js/bootstrap.min.js"></script>
	
	<style>
  .error {
    color: #F00;
}  

</style>
	

	
  </head>

  <body class="nav-md">
  
    <div class="container body">
	
      <div class="main_container">
        <div class="col-md-3 left_col">
          <div class="left_col scroll-view">
		  
            <?php  
		include 'includes/role.php';
               ?>

            <div class="clearfix"></div>
            
			<?php
            include 'includes/profile.php';
			print '</br></br>';
			include 'includes/menu.php';
			?>

           

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
		  
			
			
            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
				  
                    <a href="dashboard.php">  <h2><span class="glyphicon glyphicon-step-backward"></span> Back</h2></a>
					</br></br>
					<font color="green">Foward Customer</font>
					
					
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
				  
				
				  
                 <div class="x_content" style="overflow: auto;">
				 
				  <?php if (isset($_SESSION['success_message']) && !empty($_SESSION['success_message'])) { ?>
                        <div class="success-message" style="margin-bottom: 20px;font-size: 20px;color: green;"><?php echo $_SESSION['success_message']; ?></div>
                        <?php
                        unset($_SESSION['success_message']);
                    }
                    ?>	
				 
			  <div class="success-messages"></div> <!--/success-messages-->

               <form class="form-horizontal" id="id_frm" method="POST" enctype="multipart/form-data" action="php_action/fowardMaintananceRequest.php">
			  	
			 
			  
			 <div class="controls">
			  <div class="row">
			  
			   <div class="col-sm-3">
			  <div class="form-group">
			  
			  </div>
			  </div>
			  
			  
			  <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Customer Name: </label>
                 
			 <select class="form-control" name="client_id" id="client_id" autocomplete="off">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql410 = "SELECT * FROM clients";
			  							$productData410 = $conn->query($productSql410);
			  							while($row410 = $productData410->fetch_array()){									 		
			  								echo "<option value='".$row410['client_id']."'>".$row410['client_fname']."&nbsp&nbsp&nbsp&nbsp".$row410['client_lname']."&nbsp&nbspTIN Number&nbsp&nbsp(".$row410['client_tin'].")&nbsp&nbsp"."</option>";
										 	} // /while 

			  						?>
		  						</select>
								</br>
                         <label for="client_id" class="error" generated="true"></label>
                      
                </div>
			   </div>
			   
			   
			    <div class="col-sm-3">
			  <div class="form-group">
			  
			  </div>
			  </div>
			  
			   
			   
			   
			  </div>	  
              </div>
			  
			  <div class="controls">
			  <div class="row">
			  
			   <div class="col-sm-3">
			  <div class="form-group">
			  
			  </div>
			  </div>
			  
			  
			   <div class="col-sm-6">
			  <div class="form-group">
			  <label for="form_name">Remarks: </label>
               <textarea id="remarks" rows="10" cols="50" name="remarks" class="form-control" style="margin-left:0%;" autocomplete="off"> </textarea>    
                </div>
			   </div>
			   
			    <div class="col-sm-3">
			  <div class="form-group">
			  
			  </div>
			  </div>
			  
			  
			  
			  </div>	  
              </div>
			  
			  <div class="controls">
			  <div class="row">
			  
			   <div class="col-sm-3">
			  <div class="form-group">
			  
			  </div>
			  </div>
			  
			  
			   <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Assign To: </label>
				 
				 <select class="form-control" name="fowardedto_id" id="fowardedto_id" autocomplete="off">
			  						<option value="">~~SELECT~~</option>
			  						<?php
			  							$productSql41 = "SELECT staff.firstname,staff.lastname,users.user_id,designation.des_short_name,designation.des_name FROM users,staff,designation where role_id=1 and users.staff_id=staff.staff_id and staff.des_id=designation.des_id";
			  							$productData41 = $conn->query($productSql41);
			  							while($row41 = $productData41->fetch_array()){									 		
			  								echo "<option value='".$row41['user_id']."'>".$row41['firstname']."&nbsp&nbsp&nbsp&nbsp".$row41['lastname']."&nbsp&nbsp&nbsp&nbsp(".$row41['des_name'].")&nbsp&nbsp"."</option>";
										 	} // /while 

			  						?>
		  						</select>
								<br/>
            <label for="fowardedto_id" class="error" generated="true"></label>
                
				
                </div>
			   </div>
			   
			   
			    <div class="col-sm-3">
			  <div class="form-group">
			  
			  </div>
			  </div>
			  
			  
			  
			  </div>	  
              </div>
			  
			  <div class="controls">
			  <div class="row">
			  
			   <div class="col-sm-3">
			  <div class="form-group">
			  
			  </div>
			  </div>
			  
			  
			  <div class="col-sm-6">
			  <div class="form-group">
			  
			  <label for="form_name">Upload Document (s): </label>
				 </br>
				 <label class="radio-inline">
          <input type="radio" name="upl_status" value="Yes" id="upl_status"> Yes
         </label>&nbsp&nbsp&nbsp&nbsp
         <label class="radio-inline">
          <input type="radio" name="upl_status" value="No" id="upl_status" checked> No
         </label>&nbsp&nbsp&nbsp&nbsp
		 
		
		
		<div id="textboxes3" style="display: none">		
		     
			 <label for="form_name">Upload Document(s) </label>
			  <input  type="file" name="file[]"  id="file" class="form-control" style="width:100%;margin-left:0%;" multiple>
			  
			   <br/>
        <label for="file" class="error" generated="true"></label>
			 
			</div>
              
				  
                </div>
			   </div>
			   
			   
			  <div class="col-sm-3">
			  <div class="form-group">
			  
			  </div>
			  </div>
			  
			  
			  
			  </div>
			  </div>
			 
			 
			 <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-3">
			  <div class="form-group">
			  
			  </div>
			  </div>
			  
			 <div class="col-sm-6">
			  <div class="form-group">
			  <div class="form-group submitButtonFooter">
			    <div class="col-sm-offset-0 col-sm-12">
			  <button type="submit" id="createOrderBtn" data-loading-text="Loading..." class="btn btn-success"><i class="glyphicon glyphicon-ok-sign"></i> Submit </button>  
			  </div>
			  </div>
			  </div>
			  </div>
			  
			  <div class="col-sm-3">
			  <div class="form-group">
			  
			  </div>
			  </div>
			  
			  </div>
			  </div>
			 
			</form>                    
					
				</div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->
		
		
		<?php
		include 'includes/footer.php';
		?>
		
        
      </div>
    </div>
	
				<script>
//$(function(){
	
$(document).ready(function(){
    $('input[name="client_type"]').on('click', function(){
        if ($(this).val() == 1){
			 $('#textboxes1').show();
			 $('#textboxes2').hide();
        }else {
			$('#textboxes2').show();
			$('#textboxes1').hide();
		}
	
		
    });
});	
	
	

$(document).ready(function(){
    $('input[name="upl_status"]').on('click', function(){
        if ($(this).val() == 'Yes'){
			 $('#textboxes3').show();
        }else {
			$('#textboxes3').hide();
		}
	
		
    });
});


 $("#id_frm").validate({
        rules: {
			
			"client_id": {
                required: true
            },
			
			
			
			"fowardedto_id": {
                required: true
            }
			
			
			
            
        },
        messages: {
			
			"client_id": {
                required: "Please Select Customer."
            },
			
		
			
			"fowardedto_id": {
                required: "Please Select Someone to foward to"
            }
			
			
			
			
        },
        // for demo
        //submitHandler: function(form) {
            //alert('valid form');
            //return false;
        //}
 });


</script>
	
	<script>
	// order date picker
		$("#eta").datepicker();
		
		// delivery date picker
		//$("#dueDate").datepicker();
	
	</script>

    
     <!-- Must -->
    <script src="custom/js/createCustomer.js"></script>
	
    <!-- Must Custom Theme Scripts -->
    <script src="../build/js/custom.min.js"></script>
	
	<!-- file input -->
	<script src="assests/plugins/fileinput/js/plugins/canvas-to-blob.min.js'); ?>" type="text/javascript"></script>	
	<script src="assests/plugins/fileinput/js/plugins/sortable.min.js" type="text/javascript"></script>	
	<script src="assests/plugins/fileinput/js/plugins/purify.min.js" type="text/javascript"></script>
	<script src="assests/plugins/fileinput/js/fileinput.min.js"></script>	


	<!-- DataTables -->
	<script src="assests/plugins/datatables/jquery.dataTables.min.js"></script>

  </body>
</html>



<?php
}
?>