Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $HOST = 'localhost';
- $USERNAME = 'root';
- $PASSWORD = '';
- $DB = 'orangehrm';
- $link = mysqli_connect($HOST,$USERNAME,$PASSWORD,$DB);
- if($_GET['action'] == 'add'){
- $aid = $_GET['id'];
- $query4 = 'SELECT * FROM hs_hr_employee_leave_quota WHERE employee_id = $aid';
- $result4 = mysqli_query($link,$query4) or die (mysqli_query_error($link));
- while($row=mysqli_fetch_assoc($result)){
- $days = $row['no_of_days_allotted'];
- }
- }
- $query = 'SELECT * FROM hs_hr_employee';
- $result = mysqli_query($link,$query) or die (mysqli_query_error($link));
- ?>
- <table border='1' cellpadding='0' cellspacing='0'>
- <?php
- echo "<tr>";
- echo "<td>Emp Number</td>";
- echo "<td>Name</td>";
- echo "</tr>";
- while($row=mysqli_fetch_assoc($result)){
- if ($row['emp_gender'] == 1 && $row['emp_marital_status'] == 'Married'){
- $id = $row['emp_number'];
- $name = $row['emp_firstname'];
- $count = 0;
- $query2 = 'SELECT * FROM hs_hr_emp_children WHERE emp_number ="'.$id.'"';
- $result2 = mysqli_query($link,$query2) or die (mysqli_query_error($link));
- while($row2=mysqli_fetch_assoc($result2)){
- $count++;
- }
- if ($count > 0){
- echo "<tr>";
- echo "<td>".$row['emp_number']."</td>";
- echo "<td>".$row['emp_firstname']."</td>";
- echo "<td><a href='marriageleave.php?id=".$row['emp_number']."&action=add'>Add Leave</a></td>";
- echo "</tr>";
- }
- }
- }
- echo "</table>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement