<?php
session_start();
if(!isset ($_SESSION['user_id'])){
	header("Location:../login.php?msg=Log in first");
    exit();
}else{
	include('includes/session.php');
    include('../Server/connection.php');
	echo "<div class='div-request div-hide'>editOrd</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>
	
  <!-- jquery ui -->  
  <link rel="stylesheet" href="assests/jquery-ui/jquery-ui.min.css">
  <script src="assests/jquery-ui/jquery-ui.min.js"></script>
	
  <!-- Must Bootstrap -->
    <script src="../vendors/bootstrap/dist/js/bootstrap.min.js"></script>
	
	
	
  </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">
				  
				  <?php
				$client_id = $_GET['i'];
				$assign_id = $_GET['assign_id'];
				?>
				  
                    <a href="returnedCustomers.php?assign_id=<?php echo $assign_id;  ?>">  <h2><span class="glyphicon glyphicon-step-backward"></span> Back</h2></a>
					
					<?php
				$sql81 = "SELECT * FROM clients WHERE client_id = {$client_id}";
				$result81 = $conn->query($sql81);
				while($data81 = mysqli_fetch_array($result81))
							{
							$clientcate_id = $data81['clientcate_id'];
							$clientFname = $data81['client_fname'];
							$clientLname = $data81['client_lname'];
							$client_tin = $data81['client_tin'];
							$client_phone = $data81['client_phone'];
							$client_email = $data81['client_email'];
							$client_address = $data81['client_address'];
							$client_source_id = $data81['client_source_id'];
				            }

                        $n = substr($client_phone,3);
                        $n1 = '0';	
                        $clientPhone = 	$n1.$n;					
				      ?>
					
					
					
                    <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" action="php_action/approveCustomer.php" enctype="multipart/form-data">
			   
			    <input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
				<input type="hidden" name="assign_id" value="<?php echo $assign_id; ?>">
				
				<?php
				if($clientcate_id==1){
				?>
				
				
			  <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Customer FirstName: </label>
                 
			<input type="text" class="form-control"  value="<?php echo $clientFname; ?>" readonly="readonly"  autocomplete="off"/>
			
                      
                </div>
			   </div>
			   
			   
			    <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Customer LastName: </label>
                
				<input type="text" class="form-control"  value="<?php echo $clientLname; ?>" readonly="readonly" autocomplete="off"/>
                      
                </div>
			   </div>
				
				
			  </div>	  
              </div>
			  
			  
			  <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Customer TIN: </label>
                 
			<input type="text" class="form-control" value="<?php echo $client_tin; ?>" readonly="readonly" autocomplete="off" />
			
                </div>
			   </div>
			   
			   
			    <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Customer Phone: </label>
                
				<input type="text" class="form-control" value="<?php echo $clientPhone; ?>" readonly="readonly" autocomplete="off" />
				
                      
                </div>
			   </div>
				
				
			  </div>	  
              </div>
			  
			  
			  <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Customer Email: </label>
                 
			<input type="text" class="form-control" value="<?php echo $client_email; ?>" readonly="readonly" autocomplete="off"/>
			
			
                      
                </div>
			   </div>
			   
			   
			    <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Customer Address: </label>
                
				<input type="text" class="form-control" value="<?php echo $client_address; ?>" readonly="readonly" autocomplete="off"/>
	
                      
                </div>
			   </div>
				
				
			  </div>	  
              </div>
				
				 
			  
			  <?php
                }else{
			  ?>
			  
			  <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Company Name: </label>
                 
			<input type="text" class="form-control"  value="<?php echo $clientFname; ?>" readonly="readonly"  autocomplete="off"/>
			
                      
                </div>
			   </div>
			   
			   
			    <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Company TIN: </label>
                
				<input type="text" class="form-control"  value="<?php echo $client_tin; ?>" readonly="readonly" autocomplete="off"/>
                      
                </div>
			   </div>
				
				
			  </div>	  
              </div>
			  
			  
			  <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Company Phone: </label>
                 
			<input type="text" class="form-control" value="<?php echo $clientPhone; ?>" readonly="readonly" autocomplete="off" />
			
                </div>
			   </div>
			   
			   
			    <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Company Email: </label>
                
				<input type="text" class="form-control" value="<?php echo $client_email; ?>" readonly="readonly" autocomplete="off" />
				
                      
                </div>
			   </div>
				
				
			  </div>	  
              </div>
			  
			  
			  <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Company Address: </label>
                 
			<input type="text" class="form-control" value="<?php echo $client_address; ?>" readonly="readonly" autocomplete="off"/>
			
			
                      
                </div>
			   </div>
			   
			   
			    <div class="col-sm-6">
			  <div class="form-group">
                 
	
                      
                </div>
			   </div>
				
				
			  </div>	  
              </div>
			  
			  
			  <?php
               }
			  ?>
			  
			
			   
			  <div class="controls">
			  <div class="row">
			  
			  <div class="col-sm-6">
			  <div class="form-group">
                 <label for="form_name">Foward To: </label>
                 
			
			 <select class="form-control" name="fowardedto_id" id="fowardedto_id" autocomplete="off" required />
			  						<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>
			
                      
                </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>	  
              </div>
			
			  <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>
			  
			  
			</form>                  
					
				</div>  
               
				
				
				
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->
		
		
		<?php
		include 'includes/footer.php';
		?>
		
        
      </div>
    </div>
	
	
	
    <!-- 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
}
?>