<?php   session_start();

if ( $_SESSION[ invcox ] == "" ) { header( "location:login.php?action=need" );} else { include( "config.php" );
   	?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="Content-Type" content="text/html;
 charset=iso-8859-1"/>
      <title>Customer Entry</title>
      <link href="style.css" rel="stylesheet" type="text/css"/>
      <?php  
?>   <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

	<!-- Select2 CSS -->

<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />



<!-- Select2 JS -->

<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>



<style type="text/css">







<!--



	.select2-selection--single{

		background: #769fa4;

		border: 1px solid #518289;

	}



        #suggestions {

            border: 1px solid #ccc;

            background: #fff;

            position: absolute;

            width: 400px;

            max-height: 200px;

            overflow-y: auto;

            display: none;

            z-index: 999;

        }

        #suggestions div {

            padding: 8px;

            cursor: pointer;

        }

        #suggestions div:hover {

            background: #f0f0f0;

        }

	
        #suggestions_ref {

            border: 1px solid #ccc;

            background: #fff;

            position: absolute;

            width: 400px;

            max-height: 200px;

            overflow-y: auto;

            display: none;

            z-index: 999;

        }

        #suggestions_ref div {

            padding: 8px;

            cursor: pointer;

        }

        #suggestions_ref div:hover {

            background: #f0f0f0;

        }

        #suggestions_room_no {

            border: 1px solid #ccc;

            background: #fff;

            position: absolute;

            width: 300px;

            max-height: 200px;

            overflow-y: auto;

            display: none;

            z-index: 999;

        }

        #suggestions_room_no div {

            padding: 8px;

            cursor: pointer;

        }

        #suggestions_room_no div:hover {

            background: #f0f0f0;

        }	

 

	

        .date-box {

            display: inline-block;

            padding: 10px 15px;

            background: #23D57A;

            border-radius: 6px;

            margin: 5px;

            cursor: pointer;

            user-select: none;

        }

	

	.date-boxBooked {

            display: inline-block;

            padding: 10px 15px;

            background: #F91115;

            border-radius: 6px;

            margin: 5px;

            cursor: pointer;

            user-select: none;

        }

.date-boxHold {

            display: inline-block;

            padding: 10px 15px;

            background: #7AA5C0;

            border-radius: 6px;

            margin: 5px;

            cursor: pointer;

            user-select: none;

        }

.date-boxCheck-in {

            display: inline-block;

            padding: 10px 15px;

            background: #13DC56;

            border-radius: 6px;

            margin: 5px;

            cursor: pointer;

            user-select: none;

        }

.date-boxCheck-out {

            display: inline-block;

            padding: 10px 15px;

            background: #4E4B4B;

            border-radius: 6px;

            margin: 5px;

            cursor: pointer;

            user-select: none;

        }	

        .date-box.selected {

            background: #4CAF50;

            color: white;

        }



        #result {

            margin-top: 20px;

            padding: 10px;

            background: #e9ffe6;

            border: 1px solid #a7ddb2;

            border-radius: 5px;

            min-height: 20px;

        }

-->







</style>
	   <link rel="stylesheet" href="stylew.css">
   </head>
   <body>
      <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="box-wrap">
         <tr>
            <td>   <?php include("top.php");
?></td>
         </tr>
         <tr>
            <td>
               <table width="100%" border="0" cellspacing="1" cellpadding="0">
                  <tr>
                     <td align="left" class="link2">&nbsp;
</td>
                  </tr>
                  
                  <tr>
                     <td align="center">&nbsp;
</td>
                  </tr>
                  <tr>
                     <td>&nbsp;</td>
                  </tr>
                  <tr>
                     <td>&nbsp;
</td>
                  </tr>
                  <tr>
                     <td align="center" class="round_box">
     <?php 
$refr_id=$_POST[refr_id];
																					  
if($_GET[refr_id]!=""){$refr_id=$_GET[refr_id];}		
if($_POST[refr_id]!=""){$refr_id=$_POST[refr_id];}																				 
																					  
$result=mysql_query("select * from hr_employee where id='$refr_id' limit 1");
$row=mysql_fetch_array($result);
if($row!=""){
							
					?>
     <table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" class="list_table">
       
       <tr>
         <th height="30">Employee Profile</th>
         <th height="30">&nbsp;</th>
         <th height="30" align="center">Nid / Pic</th>
         </tr>
       <?php 

$result=mysql_query("select * from hr_employee where id='$refr_id' limit 1");
$row=mysql_fetch_array($result);

$sr=0;
 

							

							$sr++;?>
       <tr>
         <td align="center" valign="top" class="link">Employee  Name </td>
         <td align="center" valign="top" class="link"><?php    echo $row[customer_name];

            ?></td>
         <td width="542" rowspan="9" align="center" valign="top" class="link "><?php if($row[file1]!=""){ ?>
           <img src="uploads_hr/<?php echo $row[file1];?>" id="myImg<?php echo $row[id];?>" class="thumb" />
           <?php }?>
           <?php if($row[file2]!=""){ ?>
           <img src="uploads_hr/<?php echo $row[file2];?>" id="myImg<?php echo $row[id];?>2" class="thumb" />
           <?php }?></td>
         </tr>
       <tr>
         <td align="center" valign="top" class="link">Salary</td>
         <td align="center" valign="top" class="link"><span class="link "><?php echo $row[contact_person];

   ?></span></td>
         </tr>
       <tr>
         <td align="center" valign="top" class="link">Mobile</td>
         <td align="center" valign="top" class="link"><span class="link "><?php echo $row[personal_phn];

?></span></td>
         </tr>
       <tr>
         <td align="center" valign="top" class="link">Email </td>
         <td align="center" valign="top" class="link"><span class="link "><?php echo $row[personal_email];

?></span></td>
         </tr>
       <tr>
         <td align="center" valign="top" class="link">Address</td>
         <td align="center" valign="top" class="link"><span class="link "><?php echo $row[address];

 ?></span></td>
         </tr>
       <tr>
         <td align="center" valign="top" class="link">Nid</td>
         <td align="center" valign="top" class="link"><span class="link "><?php echo $row[nid];

 ?></span></td>
         </tr>
       <tr>
         <td align="center" valign="top" class="link">Joining Date</td>
         <td align="center" valign="top" class="link"><span class="link "><?php echo dtformat($row[date1]);

 ?></span></td>
         </tr>
       <tr>
         <td align="center" valign="top" class="link">Resign Date</td>
         <td align="center" valign="top" class="link"><span class="link "><?php echo dtformat($row[date2]);

 ?></span></td>
         </tr>
       <tr>
         <td width="506" align="center" valign="top" class="link">&nbsp;</td>
         <td width="703" align="center" valign="top" class="link">&nbsp;</td>
         </tr>
        
     </table>
     <?php }else{echo 'No Info Found';}?>					 
						 
                    <td width="25" align="center" class="paiging">&nbsp;
</td>
                  </tr>
               </table><div id="imgModal" class="modal">
  <span class="close">&times;</span>
  <img class="modal-img" id="modalImg">
</div><script src="script.js"></script>
            </td>
         </tr>
         <tr>
           <td height="28" align="center">&nbsp;</td>
         </tr>
         <tr>
           <td height="28" align="center"><table width="100%" border="0" cellspacing="2" cellpadding="2">
             <tbody>
               <tr>
                 <td width="50%" valign="top" class="round_box">Salary
                   
                   <?php 
 					  

		  $dresult=mysql_query("SELECT cdate, salary AS amount, 'salary' AS type
FROM hr_salary
WHERE employee = '$refr_id'

UNION ALL

SELECT cdate, salary AS amount, 'paid' AS type
FROM hr_salary_paid
WHERE employee = '$refr_id'

ORDER BY cdate ASC");
 
          $drow=mysql_fetch_array($dresult);

if($drow!=""){ 

					 ?>
                   <table width="100%" border="0" cellpadding="3" cellspacing="1" class="list_table">
                     <tr>
                       <th align="center" >Date </th>
                       <th align="center" >Salary</th>
                       <th align="center" >Salary Paid</th>
                       <th align="center" >Balance </th>
                       </tr>
                     <?php 





		  $total=0;







		  do{







		  ?>
                     <tr>
                       <td width="12%" align="center" class="link"><?php 







			 echo dtformat($drow[cdate]);







			?> </td>
                       <td width="12%" align="center" class="link"><?php  
			  if($drow[type] == 'salary'){echo $drow[amount]; 
							
$balnce=$balnce+$drow[amount];			 
										 
										 }
			 

			?></td>
                       <td width="10%" align="center" class="link"><?php 



  if($drow[type] == 'paid'){echo $drow[amount]; 
							
$balnce=$balnce-$drow[amount];			 
										 
										 }


 

			 
 


			?></td>
                       <td width="10%" align="center" class="link"><?php 







			 echo number_format($balnce);







			?></td>
                       </tr>
                     <?php 







		  }while($drow=mysql_fetch_array($dresult));







		 







		  ?>
                   </table>
                   
                   <?php }?>
                   
                 </td>
               </tr>
             </tbody>
           </table></td>
         </tr>
         <tr>
            <td height="28" align="center">&nbsp;</td>
         </tr>
         <tr>
            <td height="28"><?php include("bot.php");
?></td>
         </tr>
      </table>
   </body>
</html>
<?php }?>