<?php require ("header.php")?>


       <?php
session_start();
if(isset($_SESSION['SESS_ADMINLOGGEDIN']) == FALSE) {
    header("Location: " . $config_basedir."access");
}
require_once("achieved/config.php");
require_once("achieved/db.php");
require_once("achieved/functions.php");
?>
        
                <?php


    $id = pf_validate_number($_GET['id'], "redirect", $config_basedir);
    $funcsql = "UPDATE pawn SET verify = 2 WHERE id = " . $_GET['id'];
    mysql_query($funcsql);

 
 
 ?>
 
 
 <?php
 
 

 

if (isset($_POST['calaction'])) {
    $IR = mysql_real_escape_string($_POST['IR']);
    $PC = mysql_real_escape_string($_POST['PC']);
     $SP = mysql_real_escape_string($_POST['SP']);
      $PL = mysql_real_escape_string($_POST['PL']);
    $addresssql = mysql_query("UPDATE pawn SET IR='$IR', PC='$PC', SP='$SP', PL='$PL'  WHERE id='$id'");
    echo mysql_error();
    $success="<div class='alert alert-success' style='margin-bottom:20px;'>Calculator Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
}



// if (isset($_POST['PC'])) {
    
//     $PC = mysql_real_escape_string($_POST['PC']);
   
//     $addresssql = mysql_query("UPDATE pawn SET PC='$PC'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }



// if (isset($_POST['SP'])) {
   
//     $SP = mysql_real_escape_string($_POST['SP']);
   
      
//     $addresssql = mysql_query("UPDATE pawn SET SP='$SP'  WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }


// if (isset($_POST['PL'])) {
   
//     $PL = mysql_real_escape_string($_POST['PL']);
   
      
//     $addresssql = mysql_query("UPDATE pawn SET PL='$PL'  WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }






//  if (isset($_POST['pay_remark'])) {
//     $pay_remark = mysql_real_escape_string($_POST['pay_remark']);
//     $addresssql = mysql_query("UPDATE pawn SET pay_remark='$pay_remark' WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>Payment Remark Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }









// if (isset($_POST['remarks'])) {
//     $remarks = mysql_real_escape_string($_POST['remarks']);
//     $addresssql = mysql_query("UPDATE pawn SET remarks='$remarks' WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>Remarks Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }





// if (isset($_POST['closed_date'])) {
//     $closed_date = mysql_real_escape_string($_POST['closed_date']);
//     $addresssql = mysql_query("UPDATE pawn SET closed_date='$closed_date' WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }






// if (isset($_POST['appl_date'])) {
//     $appl_date = mysql_real_escape_string($_POST['appl_date']);
//     $addresssql = mysql_query("UPDATE pawn SET appl_date='$appl_date' WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }



// if (isset($_POST['amount'])) {
//      $amount = mysql_real_escape_string($_POST['amount']);
//     $addresssql = mysql_query("UPDATE pawn SET amount='$amount' WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }




// if (isset($_POST['pay_amount'])) {
    
//     $pay_amount = mysql_real_escape_string($_POST['pay_amount']);
//     $addresssql = mysql_query("UPDATE pawn SET pay_amount='$pay_amount'  WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }






// if (isset($_POST['duration'])) {
//       $duration = mysql_real_escape_string($_POST['duration']);
//     $addresssql = mysql_query("UPDATE pawn SET duration='$duration' WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }




// if (isset($_POST['nex_pay'])) {
   
//     $nex_pay = mysql_real_escape_string($_POST['nex_pay']);
   
      
//     $addresssql = mysql_query("UPDATE pawn SET nex_pay='$nex_pay'  WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }



// if (isset($_POST['nex_date'])) {
   
//     $nex_date = mysql_real_escape_string($_POST['nex_date']);
   
      
//     $addresssql = mysql_query("UPDATE pawn SET nex_date='$nex_date'  WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }





  











// if (isset($_POST['new_pay'])) {
   
//     $new_pay = mysql_real_escape_string($_POST['new_pay']);
   
      
//     $addresssql = mysql_query("UPDATE pawn SET new_pay=$new_pay  WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }






// if (isset($_POST['action'])) {
   
//     $return_pay = mysql_real_escape_string($_POST['return_pay']);
   
      
//     $addresssql = mysql_query("UPDATE pawn SET return_pay='$return_pay',new_pay='0'  WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }


// if (isset($_POST['miss_pay'])) {
   
//     $miss_pay = mysql_real_escape_string($_POST['miss_pay']);
   
      
//     $addresssql = mysql_query("UPDATE payment SET tmiss_pay=$tmiss_pay, miss_pay=$miss_pay, miss_pay=0  WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }


// if (isset($_POST['action'])) {
   
//     $total_payment = mysql_real_escape_string($_POST['total_payment']);
   
      
//     $addresssql = mysql_query("UPDATE pawn SET total_payment='$total_payment'  WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>closed_date Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }


// if (isset($_POST['cusaction'])) {
   
//   $addresssql = mysql_query("UPDATE pawn SET    WHERE id='$id'");
//     echo mysql_error();
//     $success="<div class='alert alert-success' style='margin-bottom:20px;'>Customer pawn Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
// }


if (isset($_POST['cusaction'])) {
   
    $status = mysql_real_escape_string($_POST['status']);
     $bemail = mysql_real_escape_string($_POST['bemail']);
      $bphone = mysql_real_escape_string($_POST['bphone']);
       $bname = mysql_real_escape_string($_POST['bname']);
        $wallet_id = mysql_real_escape_string($_POST['wallet_id']);
       $pawn_bal = mysql_real_escape_string($_POST['pawn_bal']);
        $total_payment = mysql_real_escape_string($_POST['total_payment']);
    $nex_pay = mysql_real_escape_string($_POST['nex_pay']);
       $amount = mysql_real_escape_string($_POST['amount']);
        $pay_amount = mysql_real_escape_string($_POST['pay_amount']);
        
         $nex_date = mysql_real_escape_string($_POST['nex_date']);
          $closed_date = mysql_real_escape_string($_POST['closed_date']);
           $appl_date = mysql_real_escape_string($_POST['appl_date']);
      
      
      
      $cname = mysql_real_escape_string($_POST['cname']);
       $cemail = mysql_real_escape_string($_POST['cemail']);
        $caddress = mysql_real_escape_string($_POST['caddress']);
      $copyright = mysql_real_escape_string($_POST['copyright']);
      $cphone = mysql_real_escape_string($_POST['cphone']);
      $remarks = mysql_real_escape_string($_POST['remarks']);
   
     
    $addresssql = mysql_query("UPDATE pawn SET status='$status',pawn_bal='$pawn_bal', nex_pay='$nex_pay', return_pay=0, miss_pay=0, pay_amount='$pay_amount', total_payment='$total_payment',nex_date='$nex_date',closed_date='$closed_date' ,appl_date='$appl_date'    WHERE id=$id ");
    echo mysql_error();
    $success="<div class='alert alert-success' style='margin-bottom:20px;'>Customer Information Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
    
    
    
     $addresssql = mysql_query("UPDATE payment SET remarks='$remarks' WHERE id=$id ");
    echo mysql_error();
    $success="<div class='alert alert-success' style='margin-bottom:20px;'>Customer Information Set Successfully<meta http-equiv='refresh' content='5; url=' /></div>";
}



         





         {
         
   
  //   =============TO==USER=================  
       
       

   $cmail = $row['cemail'];
     
        
       if (isset($status))
       {
            $to = $bemail;
            $subject = 'PAWW APPLICATION';
       
        $body ='
    
 <table cellpadding="0" cellspacing="0" color="" style="color: rgb(116, 120, 126); font-family: -apple-system, BlinkMacSystemFont, ;" width="100%">
    <tbody>
        <tr>
            <td cellpadding="0" cellspacing="0" color="" style="font-family: -apple-system, BlinkMacSystemFont, ;" width="100%">
                <table align="center" cellpadding="0" cellspacing="0" color="" style="font-family: -apple-system, BlinkMacSystemFont, ;" width="570">
                    <tbody>
                        <tr>
                            <td color="" style="font-family: -apple-system, BlinkMacSystemFont, ;">
                                <table cellpadding="0" cellspacing="0" color="" style="font-family: -apple-system, BlinkMacSystemFont, ;" width="100%">
                                    <tbody>
                                        <tr>
                                            <td color="" style="font-family: -apple-system, BlinkMacSystemFont, ;">
                                                <table cellpadding="0" cellspacing="0" color="" style="font-family: -apple-system, BlinkMacSystemFont, ;" width="100%">
                                                    <tbody>
                                                        <tr>
                                                            <td color="" style="font-family: -apple-system, BlinkMacSystemFont, ;">
                                                                <p color="" style="font-family: -apple-system, BlinkMacSystemFont, ;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size: 20px;"><strong>&nbsp;PAWN APPLICATION</strong></span></p>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                
                                
                                <p>Welcome to '.$cname.'</p>
                                <p color="" style="font-family: -apple-system, BlinkMacSystemFont, ;">Your pawn Request has been approved &nbsp;Successfully.</p>
                                <p color="" style="font-family: -apple-system, BlinkMacSystemFont, ;">Below are your pawn informations.</p>
                                BORROWER NAME : '.$bname.'<br>
                                ACCOUNT NUMBER : '.$wallet_id.' <br>
                                 PAWN AMOUNT : NGN'.number_format($amount,2).'<br>
                                TOTAL RETURN : NGN'.number_format($pay_amount,2).'<br>
                                <p color="" style="font-family: -apple-system, BlinkMacSystemFont, ;"> Thank you for your patronage..</p>
                                <p color="" style="font-family: -apple-system, BlinkMacSystemFont, ;">'.$cname.' Services</p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
        <tr>
            <td color="" style="font-family: -apple-system, BlinkMacSystemFont, ;">
                <table align="center" cellpadding="0" cellspacing="0" color="" style="font-family: -apple-system, BlinkMacSystemFont, ;" width="570">
                    <tbody>
                        <tr>
                            <td align="center" color="" style="font-family: -apple-system, BlinkMacSystemFont, ;">
                                <p color="" style="font-family: -apple-system, BlinkMacSystemFont, ;">&copy;'.$copyright.'</p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
    </tbody>
</table>
    
    
    <hr style="border-top: 1px solid #00B9CD;" >
    
    FOR MORE INFORMATION : <br> CONTACT THE CUSTOMER CARE SERVICE ('.$cemail.') or DIAL THE NUMBER TO SPEAK WITH ONE OF OUR AGENTS : ('.$cphone.'),or Visit '.$url.', Thank You.
       
       
      
      
       
     
      
      
       ';
      
        $header = "From:". $cemail."\r\n";
       
        $header .= "MIME-Version: 1.0\r\n";
       
        $header .= "Content-Type: text/html; charset=UTF-8\r\n";
       
        if(@mail($to, $subject, $body, $header)){
            
             $sender = "$cname";
                        $mobile = validate_phone_number($bphone);
                        $msg = 'Welcome to '.$cname.', Your Pawn of NGN'.number_format($amount,2).' has been approved and your current Loan Balance is NGN'.number_format($loan_bal,2).' Please check your Email for your Loan Information. Contact Us for any further Enquries @ '.$cphone.'.. Thank You.
                                ';
                        sendBulkSMS($sender,$mobile, $msg);


}
}


}
?>     
   
 
 
 
 
 
 
  <div class='page-wrapper'>
           
            <div class='page-breadcrumb'>
                <div class='row'>
                    <div class='col-12 d-flex no-block align-items-center'>
                       
                       
                    </div>
                </div>
            </div>
           
            <div class='container-fluid'>
               
                <div class='row'>
                    <div class='col-12'>
                        <div class='card'>
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
 
     <!-- Content Wrapper. Contains page content -->
      <div class='content-wrapper'>
      
        <!-- Main content -->
        <section class='content'>

          <div class='row'>
            <!-- /.col -->
            <div class='col-md-12'>
              <div class='nav-tabs-custom'>
                <ul class='nav nav-tabs'>
                    <li class='active'>
                          <a href='index.php' class='rowtab'><strong>HOME</strong></a>
                          
                          </li>
<a href='list_pawn.php'  class='btn btn-primary' value='log in'>List PAWN</a>
                   
                   </li>
                </ul>
                <div class='tab-content'>
                  <div class='active tab-pane' id='activity'>
                    <!-- Post -->
                    <div class='post'>
      
      
          
    <section class='content-header'>
      <h1>
        Borrower's Details
        <small>Customer's panel</small>
      </h1>
      <ol class='breadcrumb'>
        <li><a href='index.php'><i class='fa fa-dashboard'></i> Home</a></li>
        <li class='active'> <a href='list_pawn.php'>List PAWN</a></li>
        <li class='active'>Add</li>
      </ol>
    </section>
	
	
    <section class='content'>
	<div class='row'>	
		
	 <section class='content'>
     
	<div class='alert alert-warning fade in' >
			<p><a href = '#' class = 'close' data-dismiss= 'alert'> &times;</a>
  				<strong>Please Note that&nbsp;</strong> &nbsp;&nbsp;You Must Tick All Added Checkbox Before Clicking on update button below</p>
				</div>	
				
				
				
				<div class='box box-success'>
            <div class='box-body'>
              <div class='table-responsive'>
             <div class='box-body'>

			 <!--<div class='col-md-14'>-->
           <div class='container'>
             <ul class='nav nav-tabs'>
              <li class='active'><a href='#tab_1' data-toggle='tab'>CUSTOMER INFORMATION</a></li>
             
              
             <li><a href='#tab_4' data-toggle='tab'>COLLATERAL</a></li>
              
              <li><a href='#tab_5' data-toggle='tab'>CALCULATOR</a></li>

              <li>
                  
                   <!--====================================-->
<button onclick='myFunction()' class='btn btn-success btn-flat'>
<i class='fa fa-print'>&nbsp;Print</i></button>

<!--<button onclick='window.print()'><i class='fa fa-print'>&nbsp;Print</i></button>-->


<!--===================================-->
                  
              </li>
              
              
              </ul>
              
              
            <?php 
if(isset($success)){
    echo $success;
}
?>
   
            
            
            
             <div class='tab-content'>
            
            
     




            
            <?php
 $ordsql = "SELECT * from pawn WHERE id = " . $id; 
$ordres = mysql_query($ordsql);
$ordrow = mysql_fetch_assoc($ordres);

echo "<div class='tab-pane fade in active' id='tab_1'>
             <hr>	
<div class='alert-danger'>&nbsp; (" . $ordrow['bname'] . ") INFORMATION</div>
<hr>";	

           
           
            
            
           
            echo" <form class='form-horizontal' method='post' enctype='multipart/form-data' action=''>
			
			
			
			
			
						<div class='box-body'>
				
			
			 <div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Borrower</label>
				 <div class='col-sm-10'>
									<input name='bname' type='text' class='form-control' value='" . $ordrow['bname'] . "' readonly>
				              </div>
			  </div>
			  
			  
			  
			   <div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Email</label>
				 <div class='col-sm-10'>
									<input name='bemail' type='text' class='form-control' value='" . $ordrow['bemail'] . "' readonly>
				              </div>
			  </div>
			  
			  
			<div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Account Number</label>
                  <div class='col-sm-10'>
                  <input name='wallet_id' type='text' class='form-control' value='" . $ordrow['wallet_id'] . "' readonly>
                  </div>
                  </div>
                  
                  
                  	<div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Phone Number</label>
                  <div class='col-sm-10'>
                  <input name='bphone' type='text' class='form-control' value='" . $ordrow['bphone'] . "' >
                  </div>
                  </div>";
                  
                  
                  
        if($ordrow['status'] == 1)
          {
         
               echo "<div class='form-group'>
                 <label for='' class='col-sm-2 control-label' style='color:#009900'>Total Payment</label>
                 <div class='col-sm-10'>
                 <div class='input-group date'>
                  <div class='input-group-addon'>
                    NGN </div>
                 <input name='total_payment' type='number' class='form-control' value='".(($ordrow['total_payment'])+$ordrow['return_pay'])."' readonly>
                 </div>
                 </div></div>";
  } 
               
                elseif($ordrow['status'] == 4)
          {
          	
                  
                  
                   echo "	<div class='form-group'>
                 <label for='' class='col-sm-2 control-label' style='color:#009900'>Total Payment</label>
                 <div class='col-sm-10'>
                 <div class='input-group date'>
                  <div class='input-group-addon'>
                    NGN </div>
                 <input name='total_payment' type='number' class='form-control' value='".(($ordrow['total_payment'])+$ordrow['miss_pay'])."' readonly>
                 </div>
                 </div></div>";
          } 
      
      
                   
 echo"<input name='' type='hidden' class='form-control' value='".(($ordrow['pay_amount']-$ordrow['return_pay']))."'readonly>
	<div class='form-group'>";
      
      
    echo" <label for='' class='col-sm-2 control-label' style='color:#00990</div>0'>Pawn Balance</label>
                  <div class='col-sm-10'>
                  <div class='input-group date'>
                  <div class='input-group-addon'>
                    NGN</div>
                  <input name='pawn_bal'  type='number' class='form-control' value='".((($ordrow['amount']*$ordrow['IR']/100)*($ordrow['PL']/$ordrow['SP'])+$ordrow['amount'])-($ordrow['return_pay']+$ordrow['total_payment']))."'readonly>
                  </div>
                  </div>
                  </div> ";   
	
	
                       
                  
                
                
                
                
                  
             
            echo" <input name='' type='hidden' class='form-control' value='".(($ordrow['amount']*$ordrow['IR']/100)*($ordrow['PL']/$ordrow['SP'])+$ordrow['amount'])."'readonly> 
     
                  
                  
                  
				 <input name='' type='hidden' class='form-control' value='".(($ordrow['amount']*$ordrow['IR']/100)*($ordrow['PL']/$ordrow['SP'])+$ordrow['amount'])."'readonly> 



		<div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Pawn Amount</label>
                  <div class='col-sm-10'>
                  <div class='input-group date'>
                  <div class='input-group-addon'>
                    NGN</div>
                  <input name='amount' type='text' class='form-control' value='" . $ordrow['amount'] . "' readonly>
                  </div>
                  </div> </div>
                  
                  
                  
    	<div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Return Pawn</label>
                  <div class='col-sm-10'>
                  <div class='input-group date'>
                  <div class='input-group-addon'>
                    NGN</div>
                  <input name='pay_amount' type='number' class='form-control' value='".(($ordrow['amount']*$ordrow['IR']/100)*($ordrow['PL']/$ordrow['SP'])+$ordrow['amount'])."'readonly>
                  </div>
                  </div></div>
                  
                  
                   <input name='' type='hidden' class='form-control' value='".(($ordrow['amount']*$ordrow['IR']/100)*($ordrow['PL']/$ordrow['SP'])+$ordrow['amount'])."'readonly>";
                  
          
          
          if($ordrow['status'] == 1)
          {
         
               echo "<div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Return Payment</label>
                  <div class='col-sm-10'>
                  <div class='input-group date'>
                  <div class='input-group-addon'>
                    NGN</div>
                  <input name='nex_pay' type='number' class='form-control' value='".($ordrow['return_pay'])."' readonly>
                  </div> 
                  </div></div>";
  } 
               
                elseif($ordrow['status'] == 4)
          {
          	
                  
                  
                   echo "	<div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Missed Payment</label>
                  <div class='col-sm-10'>
                  <div class='input-group date'>
                  <div class='input-group-addon'>
                    NGN</div>
                  <input name='nex_pay' type='number' class='form-control' value='".($ordrow['miss_pay'])."' readonly>
                  </div> 
                  </div></div>";
          } 
                  
                  
    echo"	<div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Next Payment</label>
                  <div class='col-sm-10'>
                  <div class='input-group date'>
                  <div class='input-group-addon'>
                    NGN</div>
                  <input name='' type='number' class='form-control' value='".((($ordrow['amount']*$ordrow['IR']/100)*($ordrow['PL']/$ordrow['SP'])+$ordrow['amount'])/($ordrow['PL']/$ordrow['SP']))."' readonly>
                  </div> 
                  </div></div>";
                  
               
		
		
		
		
		
		
		
		
		
		
		
		
		echo" <div class='form-group'>
                  	<label for='' class='col-sm-2 control-label' style='color:#009900'>Type of pawn</label>
                  	<div class='col-sm-10'>
					<input name='pawntype' type='text' class='form-control' value='" . $ordrow['pawntype'] . "' readonly>
           			 </div>
					 </div>
					 
					 
					  <div class='form-group'>
                  	<label for='' class='col-sm-2 control-label' style='color:#009900'>Duration</label>
                  	<div class='col-sm-10'>
					<input name='duration' type='text' class='form-control' value='" . $ordrow['duration'] . "' readonly>
           			 </div>
					 </div>
		
		 
			  
			<div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Agent</label>
                  <div class='col-sm-10'>
                  <input name='agent' type='text' class='form-control' value='ADMIN' readonly>
                  </div>
                  </div>";
                  
                  
        //  =================Applied==date==========================     
    
    
               echo"   <div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Date Applied</label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input name='appl_date' type='text' class='form-control pull-right' value='" . $ordrow['appl_date'] . "' eneble>
                </div>
              </div>
			  </div>";

// ================END=============================			  
	
// 	==============SRT==NEXT=DATE=======================		  
			  
		
   if($ordrow['SP'] < 1)
          {
         
               echo "<p>SELECT DATE</p>";
  } 
               
                elseif($ordrow['SP'] == 1)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("1 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Next Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='nex_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 
                     
       
        elseif($ordrow['SP'] == 7)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("7 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Next Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='nex_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  }           
				  
				
	 elseif($ordrow['SP'] == 30)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("30 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Next Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='nex_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 
 
 
 
//  ===========END==============================



//  ===================CLODE==DATE================================              



                  
                 if($ordrow['PL'] < 30)
          {
         
               echo "<p>SELECT DATE</p>";
  } 
               
                elseif($ordrow['PL'] == 30)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("30 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Closed Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='closed_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 
                     
       
        elseif($ordrow['PL'] == 60)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("60 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Closed Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='closed_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  }           
				  
				
	 elseif($ordrow['PL'] == 90)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("90 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Closed Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='closed_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 
  
  
  
   elseif($ordrow['PL'] == 120)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("120 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Closed Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='closed_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 
  
				  

		 elseif($ordrow['PL'] == 150)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("150 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Closed Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='closed_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 		  
	
	
	
	 elseif($ordrow['PL'] == 180)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("180 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Closed Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='closed_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 
	
	
	
	
	
	
	 elseif($ordrow['PL'] == 210)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("210 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Closed Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='closed_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 
	
	
	 elseif($ordrow['PL'] == 240)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("240 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Closed Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='closed_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 
	
	
	
 elseif($ordrow['PL'] == 270)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("270 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Closed Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='closed_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 	
	
			
			
			
			 elseif($ordrow['PL'] == 300)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("300 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Closed Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='closed_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 	  
	
	
	 elseif($ordrow['PL'] == 330)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("330 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Closed Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='closed_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 
	
	
	
 elseif($ordrow['PL'] == 360)
          {
              
               $date=date_create($ordrow['appl_date']);
date_add($date,date_interval_create_from_date_string("360 days"));
         
               echo"	<div class='form-group'>
                <label for='' class='col-sm-2 control-label' style='color:#009900'>Closed Date </label>
			 <div class='col-sm-10'>
              <div class='input-group date'>
                  <div class='input-group-addon'>
                    <i class='fa fa-calendar'></i>
                  </div>
                  <input id=datepicker name='closed_date' type='text' class='form-control pull-right' value='". date_format($date,'jS F Y g.iA')."' >
                </div>
              </div>
			  </div>";
  } 
	
// ==========END==CLOSED=DATE==============================	
	
	
	
	
	
	
				  
			echo"<div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Select Status</label>
                  <div class='col-sm-10'>
                  
                   <select name='status'>
  <option value='" . $ordrow['status'] . "' > ";
 
 if($ordrow['status'] == 0)
         {
         
               echo "<td class='danger'>Pending </td>";
 }
         elseif ($ordrow['status'] == 1)
         {
        echo "<td class='danger'> Processing </td>";
         }
         elseif ($ordrow['status'] == 2)
         {
        echo "<td class='danger'> Declined </td>";
         }
         elseif ($ordrow['status'] == 3)
         {
        echo "<td class='danger'> Completed </td>";
         }
         elseif ($ordrow['status'] == 4)
         {
        echo "<td class='danger'> Missed Payment </td>";
         }
     echo" </option>
           <option value='0' >Pending</option>
            <option value='1' >Processng</option>
            <option value='2' >Declined</option>
            <option value='3' >Completed</option>
            <option value='4' >Missed Payment</option>
            </select>
                  </div>
                  </div>
				  					
			<div class='form-group'>
                  	<label for='' class='col-sm-2 control-label' style='color:#009900'>Remarks</label>
                  	<div class='col-sm-10'>
					<textarea name='remarks'  class='form-control' rows='4' cols='80'>" . $ordrow['remarks'] . "</textarea>
           			 </div>
          	</div>





			

           			 </div>
           			 <div align='right'>
              <div class='box-footer'>";
           			               ?>
               
               
               
               <?php
  $orderssql = "SELECT * from settings  ORDER BY id DESC";
    $ordersres = mysql_query($orderssql);
    $numrows = mysql_num_rows($ordersres);
   

 while($row = mysql_fetch_assoc($ordersres))
     {


echo"<input type='hidden' class='form-control' name='cname' id='details'  value='".$row['domain_name']."'>

<input type='hidden' class='form-control' name='cemail' id='details'  value='".$row['email2']."'>

<input type='hidden' class='form-control' name='cphone' id='details'  value='".$row['phone']."'>

<input type='hidden' class='form-control' name='caddress' id='details'  value='".$row['address']."'>

<input type='hidden' class='form-control' name='copyright' id='details'  value='".$row['copyright']."'>
      
      
       
";

}
?>  
               
               
               
               
               
               <button type='submit' class='btn btn-info btn-flat' name='cusaction'><i class='fa fa-save'>&nbsp;Update Information</i></button>

              </div>
			  </div>
			  </form>
           			               </div>
           			               
           			               
           			               
           			               
           			               
           			               
           			               
           			               
           			  
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
       
			
			
			<?php
 $ordsql = "SELECT * from pawn WHERE id = " . $id; 
$ordres = mysql_query($ordsql);
$ordrow = mysql_fetch_assoc($ordres);

echo "<div class='tab-pane fade' id='tab_4'>
		
		
		
 <hr>	
<div class='alert-danger'>&nbsp;COLLATERAL INFORMATION</div>
<hr>	

				<div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Name:</label>
                  <div class='col-sm-10'>
                  <input name='cname' type='text' class='form-control' value='" . $ordrow['cname'] . "' readonly>
                  </div>
                  </div>
				  
				  <div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Type of Collateral:</label>
                  <div class='col-sm-10'>
                  <input name='ctype' type='text' class='form-control' value='" . $ordrow['ctype'] . "' readonly>
                  </div>
                  </div>
				  
				  <div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Model:</label>
                  <div class='col-sm-10'>
                  <input name='cmodel' type='text' class='form-control' value='" . $ordrow['cmodel'] . "' readonly>
                  </div>
                  </div>
				
				  
				  <div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Serial Number:</label>
                  <div class='col-sm-10'>
                  <input name='serial_number' type='text' class='form-control' value='" . $ordrow['cserial'] . "' readonly>
                  </div>
                  </div>
				  
				  <div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Estimated Price:</label>
                  <div class='col-sm-10'>
                  <input name='cprice' type='text' class='form-control' value='NGN " . $ordrow['cprice'] . "' readonly>
                  </div>
                  </div>
				  
				  
				  <div class='form-group'>
				      <label for='' class='col-sm-2 control-label' style='color:#009900'>Collateral Photos & Documents:</label>
				      <div class='container-fluid'>
				  <div class='row el-element-overlay'>
				      
				 
				   
				    <div class='col-lg-3 col-md-6'>
                        <div class='card'>
                            <div class='el-card-item'>";
                                 if($ordrow['photo1'] == 0)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' >";
    }
    else if($ordrow['photo1'] == 1)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/photo1/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'>
         ";
         }
                                   echo"<div class='el-overlay'>
                                        <ul class='list-style-none el-info'>
                                            <li class='el-item'>";
                                             if($ordrow['photo1'] == 0)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' ><i class='mdi mdi-magnify-plus'></i></a>";
    }
    elseif($ordrow['photo1'] == 1)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/photo1/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'><i class='mdi mdi-magnify-plus'></i></a>";
         }
                                            
                                           echo" </li>
                                            <li class='el-item'>
                                            <a class='btn default btn-outline el-link' href='javascript:void(0);'><i class='mdi mdi-link'></i></a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                
                                <div class='el-card-content'>
                                    <h4 class='m-b-0'>" . $ordrow['cname'] . "</h4> <span class='text-muted'>" . $ordrow['ctype'] . "</span>
                                </div>
                            </div>
                        </div>
                    </div> 
                    
      
      
      
      
       <div class='col-lg-3 col-md-6'>
                        <div class='card'>
                            <div class='el-card-item'>";
                                 if($ordrow['photo2'] == 0)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' >";
    }
    else if($ordrow['photo2'] == 1)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/photo2/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'>
         ";
         }
                                   echo"<div class='el-overlay'>
                                        <ul class='list-style-none el-info'>
                                            <li class='el-item'>";
                                             if($ordrow['photo2'] == 0)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' ><i class='mdi mdi-magnify-plus'></i></a>";
    }
    elseif($ordrow['photo2'] == 1)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/photo2/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'><i class='mdi mdi-magnify-plus'></i></a>";
         }
                                            
                                           echo" </li>
                                            <li class='el-item'>
                                            <a class='btn default btn-outline el-link' href='javascript:void(0);'><i class='mdi mdi-link'></i></a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                
                                <div class='el-card-content'>
                                    <h4 class='m-b-0'>" . $ordrow['cname'] . "</h4> <span class='text-muted'>" . $ordrow['ctype'] . "</span>
                                </div>
                            </div>
                        </div>
                    </div> 
                    
       
       
       
        <div class='col-lg-3 col-md-6'>
                        <div class='card'>
                            <div class='el-card-item'>";
                                 if($ordrow['photo3'] == 0)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' >";
    }
    else if($ordrow['photo3'] == 1)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/photo3/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'>
         ";
         }
                                   echo"<div class='el-overlay'>
                                        <ul class='list-style-none el-info'>
                                            <li class='el-item'>";
                                             if($ordrow['photo3'] == 0)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' ><i class='mdi mdi-magnify-plus'></i></a>";
    }
    elseif($ordrow['photo3'] == 1)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/photo3/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'><i class='mdi mdi-magnify-plus'></i></a>";
         }
                                            
                                           echo" </li>
                                            <li class='el-item'>
                                            <a class='btn default btn-outline el-link' href='javascript:void(0);'><i class='mdi mdi-link'></i></a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                
                                <div class='el-card-content'>
                                    <h4 class='m-b-0'>" . $ordrow['cname'] . "</h4> <span class='text-muted'>" . $ordrow['ctype'] . "</span>
                                </div>
                            </div>
                        </div>
                    </div>              
                    
                    
                    
                    
                    
         <div class='col-lg-3 col-md-6'>
                        <div class='card'>
                            <div class='el-card-item'>";
                                 if($ordrow['photo4'] == 0)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' >";
    }
    else if($ordrow['photo4'] == 1)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/photo4/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'>
         ";
         }
                                   echo"<div class='el-overlay'>
                                        <ul class='list-style-none el-info'>
                                            <li class='el-item'>";
                                             if($ordrow['photo4'] == 0)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' ><i class='mdi mdi-magnify-plus'></i></a>";
    }
    elseif($ordrow['photo4'] == 1)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/photo4/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'><i class='mdi mdi-magnify-plus'></i></a>";
         }
                                            
                                           echo" </li>
                                            <li class='el-item'>
                                            <a class='btn default btn-outline el-link' href='javascript:void(0);'><i class='mdi mdi-link'></i></a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                
                                <div class='el-card-content'>
                                    <h4 class='m-b-0'>" . $ordrow['cname'] . "</h4> <span class='text-muted'>" . $ordrow['ctype'] . "</span>
                                </div>
                            </div>
                        </div>
                    </div>             
                    
                    
                    
                    
        <div class='col-lg-3 col-md-6'>
                        <div class='card'>
                            <div class='el-card-item'>";
                                 if($ordrow['photo5'] == 0)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' >";
    }
    else if($ordrow['photo5'] == 1)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/photo5/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'>
         ";
         }
                                   echo"<div class='el-overlay'>
                                        <ul class='list-style-none el-info'>
                                            <li class='el-item'>";
                                             if($ordrow['photo5'] == 0)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' ><i class='mdi mdi-magnify-plus'></i></a>";
    }
    elseif($ordrow['photo5'] == 1)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/photo5/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'><i class='mdi mdi-magnify-plus'></i></a>";
         }
                                            
                                           echo" </li>
                                            <li class='el-item'>
                                            <a class='btn default btn-outline el-link' href='javascript:void(0);'><i class='mdi mdi-link'></i></a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                
                                <div class='el-card-content'>
                                    <h4 class='m-b-0'>" . $ordrow['cname'] . "</h4> <span class='text-muted'>" . $ordrow['ctype'] . "</span>
                                </div>
                            </div>
                        </div>
                    </div>              
     
     
     
      <div class='col-lg-3 col-md-6'>
                        <div class='card'>
                            <div class='el-card-item'>";
                                 if($ordrow['doc1'] == 0)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' >";
    }
    else if($ordrow['doc1'] == 1)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/doc1/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'>
         ";
         }
                                   echo"<div class='el-overlay'>
                                        <ul class='list-style-none el-info'>
                                            <li class='el-item'>";
                                             if($ordrow['doc1'] == 0)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' ><i class='mdi mdi-magnify-plus'></i></a>";
    }
    elseif($ordrow['doc1'] == 1)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/doc1/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'><i class='mdi mdi-magnify-plus'></i></a>";
         }
                                            
                                           echo" </li>
                                            <li class='el-item'>
                                            <a class='btn default btn-outline el-link' href='javascript:void(0);'><i class='mdi mdi-link'></i></a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                
                                <div class='el-card-content'>
                                    <h4 class='m-b-0'>" . $ordrow['cname'] . "</h4> <span class='text-muted'>" . $ordrow['ctype'] . "</span>
                                </div>
                            </div>
                        </div>
                    </div>                
                    
                    
      <div class='col-lg-3 col-md-6'>
                        <div class='card'>
                            <div class='el-card-item'>";
                                 if($ordrow['doc2'] == 0)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' >";
    }
    else if($ordrow['doc2'] == 1)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/doc2/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'>
         ";
         }
                                   echo"<div class='el-overlay'>
                                        <ul class='list-style-none el-info'>
                                            <li class='el-item'>";
                                             if($ordrow['doc2'] == 0)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' ><i class='mdi mdi-magnify-plus'></i></a>";
    }
    elseif($ordrow['doc2'] == 1)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/doc2/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'><i class='mdi mdi-magnify-plus'></i></a>";
         }
                                            
                                           echo" </li>
                                            <li class='el-item'>
                                            <a class='btn default btn-outline el-link' href='javascript:void(0);'><i class='mdi mdi-link'></i></a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                
                                <div class='el-card-content'>
                                    <h4 class='m-b-0'>" . $ordrow['cname'] . "</h4> <span class='text-muted'>" . $ordrow['ctype'] . "</span>
                                </div>
                            </div>
                        </div>
                    </div>                
            
            
             <div class='col-lg-3 col-md-6'>
                        <div class='card'>
                            <div class='el-card-item'>";
                                 if($ordrow['doc3'] == 0)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' >";
    }
    else if($ordrow['doc3'] == 1)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/doc3/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'>
         ";
         }
                                   echo"<div class='el-overlay'>
                                        <ul class='list-style-none el-info'>
                                            <li class='el-item'>";
                                             if($ordrow['doc3'] == 0)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' ><i class='mdi mdi-magnify-plus'></i></a>";
    }
    elseif($ordrow['doc3'] == 1)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/doc3/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'><i class='mdi mdi-magnify-plus'></i></a>";
         }
                                            
                                           echo" </li>
                                            <li class='el-item'>
                                            <a class='btn default btn-outline el-link' href='javascript:void(0);'><i class='mdi mdi-link'></i></a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                
                                <div class='el-card-content'>
                                    <h4 class='m-b-0'>" . $ordrow['cname'] . "</h4> <span class='text-muted'>" . $ordrow['ctype'] . "</span>
                                </div>
                            </div>
                        </div>
                    </div>         
        
        
        
         <div class='col-lg-3 col-md-6'>
                        <div class='card'>
                            <div class='el-card-item'>";
                                 if($ordrow['doc4'] == 0)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' >";
    }
    else if($ordrow['doc4'] == 1)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/doc4/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'>
         ";
         }
                                   echo"<div class='el-overlay'>
                                        <ul class='list-style-none el-info'>
                                            <li class='el-item'>";
                                             if($ordrow['doc4'] == 0)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' ><i class='mdi mdi-magnify-plus'></i></a>";
    }
    elseif($ordrow['doc4'] == 1)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/doc4/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'><i class='mdi mdi-magnify-plus'></i></a>";
         }
                                            
                                           echo" </li>
                                            <li class='el-item'>
                                            <a class='btn default btn-outline el-link' href='javascript:void(0);'><i class='mdi mdi-link'></i></a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                
                                <div class='el-card-content'>
                                    <h4 class='m-b-0'>" . $ordrow['cname'] . "</h4> <span class='text-muted'>" . $ordrow['ctype'] . "</span>
                                </div>
                            </div>
                        </div>
                    </div>     
                    
                    
                    
                    
                     <div class='col-lg-3 col-md-6'>
                        <div class='card'>
                            <div class='el-card-item'>";
                                 if($ordrow['doc5'] == 0)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' >";
    }
    else if($ordrow['doc5'] == 1)
         { 
        echo "<div class='el-card-avatar el-overlay-1'><img src='https://plamscircuit.com/accounts/upload/pawn/collateral/doc5/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'>
         ";
         }
                                   echo"<div class='el-overlay'>
                                        <ul class='list-style-none el-info'>
                                            <li class='el-item'>";
                                             if($ordrow['doc5'] == 0)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/pawn.png' alt='" . $ordrow['username'] . "' ><i class='mdi mdi-magnify-plus'></i></a>";
    }
    elseif($ordrow['doc5'] == 1)
         { 
        echo "<a class='btn default btn-outline image-popup-vertical-fit el-link' href='https://plamscircuit.com/accounts/upload/pawn/collateral/doc5/" . $ordrow['id'] . "front.jpg' alt='" . $ordrow['username'] . "'><i class='mdi mdi-magnify-plus'></i></a>";
         }
                                            
                                           echo" </li>
                                            <li class='el-item'>
                                            <a class='btn default btn-outline el-link' href='javascript:void(0);'><i class='mdi mdi-link'></i></a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                
                                <div class='el-card-content'>
                                    <h4 class='m-b-0'>" . $ordrow['cname'] . "</h4> <span class='text-muted'>" . $ordrow['ctype'] . "</span>
                                </div>
                            </div>
                        </div>
                    </div> 
                    
                    
                    
                    </div></div></div>
		
	  
	  
	   
              </div>";
              ?>
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
              
     
				          
			  
			<?php
 $ordsql = "SELECT * from pawn WHERE id = " . $id; 
$ordres = mysql_query($ordsql);
$ordrow = mysql_fetch_assoc($ordres);

echo "  <div class='tab-pane fade' id='tab_5'>
		
	 <form class='form-horizontal' method='post' enctype='multipart/form-data' action=''>
			<div class='box-body'>	
				
			
<div align='center'>
    <h4>CALCULATOR</h4></div>
				
			
			<div class='form-group'>
	
					 
	
                  <input name='amount' type='hidden' class='form-control' value='" . $ordrow['amount'] . "' readonly>
                 
                  
                  
                  	
                  <input name='' type='hidden' class='form-control' value='".($ordrow['amount']+($ordrow['amount']*$ordrow['IR']/100)*($ordrow['PL']/30))."'readonly>
                 
                 
                 
                 
                 
                   <input name='' type='hidden' class='form-control' value='".(($ordrow['amount']*$ordrow['IR']/100)*($ordrow['PL']/$ordrow['SP'])+$ordrow['amount'])."'readonly> 
            
                  
                  
                  <input name='' type='hidden' class='form-control' value='" . ($ordrow['amount']+($ordrow['amount']*$ordrow['IR']/100)*($ordrow['PL']/30))/($ordrow['PL']/30). "' readonly>
                 
                  
                  
                  
                  	
                  <input name='' type='hidden' class='form-control' value='".(($ordrow['amount'])+($ordrow['amount']+($ordrow['amount']*$ordrow['IR']/100)*($ordrow['PL']/30)))."'readonly>
                 
                  
                  
                
                  
                  	 
					 
					<input name='' type='hidden' class='form-control' value='" . $ordrow['duration'] . "' readonly>
           			 
		 
			
			
			
			 <div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Interest Rate:</label>
                  <div class='col-sm-10'>
				   <input name='IR' type='text' value='" . $ordrow['IR'] . "' class='form-control'>%
                  </div>
                  </div>
                  
                  
				  
				  <div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Penalty Charge:</label>
                  <div class='col-sm-10'>
				   <input name='PC' type='text' value='" . $ordrow['PC'] . "' class='form-control'>%
                  </div>
                  </div>
			
			
                  
                  <div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Schedule of Payment:</label>
                  <div class='col-sm-10'>
				  <select name='SP' class='col-sm-10'>
				 <option value='" . $ordrow['SP'] . "'>" . $ordrow['SP'] . "</option>
				  <option value='1'>Daily</option>
				  <option value='7'>Weekly</option>
				  <option value='30'>Monthly</option>
				  </select>
                  </div>
                  </div>
				  
				 
				  
				   <div class='form-group'>
                  <label for='' class='col-sm-2 control-label' style='color:#009900'>Period of Contract:</label>
                  <div class='col-sm-10'>
				  <select name='PL' class='col-sm-10'>
				  <option value='" . $ordrow['PL'] . "'>" . $ordrow['PL'] . "</option>
				 
				  <option value='30'>1 Months</option>
				  <option value='60'>2 Months</option>
				  <option value='90'>3 Months</option>
				   <option value='120'>4 Months</option>
				    <option value='150'>5 Months</option>
				  <option value='180'>6 Months</option>
				  <option value='210'>7 Months</option>
				  <option value='240'>8 Months</option>
				  <option value='270'>9 Months</option>
				  <option value='300'>10 Months</option>
				  <option value='330'>11 Months</option>
				  <option value='360'>12 Months</option>
				  </select>
                  </div>
                  </div>
				  
				  
				  
			
				  
				
				  
				 
				  
				 
				  
              </div>

			  </div>
			  
			  
			  <div align='right'>
              <div class='box-footer'>
               <button type='submit' class='btn btn-info btn-flat' name='calaction'><i class='fa fa-save'>&nbsp;Auto Calculator</i></button>

              </div>
			  </div>
			  </form> 
			  
			  
             
             
            </div>
           
           
           
           
           
            <!-- /.tab-content -->
          </div>
				 
					
					
				
				
				</div>
				

              </div>
			 

	
</div>	
</div>
</div></div>	
</div>
</div></div>	
</div>
</div></div>	
</div>
</div></div>	
</div>
</div>	
</div>		</section>
        
        
        
        
        
        
        
        
        
        
                    </div><!-- /.post -->

                
                  </div>
                  <!-- /.tab-pane -->
                  
                  
                  
                  

                  <!-- /.tab-pane -->
                </div><!-- /.tab-content -->
              </div><!-- /.nav-tabs-custom -->
            </div><!-- /.col -->
          </div><!-- /.row -->

        </section><!-- /.content -->
      </div>
                </div>
               
            </div>"
            ;
       
            ?>
           
           <?php require ("footer.php")?>
           
           <script>
function myFunction() {
  window.print(); }
</script>