/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
backoffice
/
ajax
/
job_post
/
up file
home
<?php include('../../../config/main_function.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); if ($connection) { $approve_status = mysqli_real_escape_string($connection, $_POST['approve_status']); if ($approve_status != 'x') { $con_div = "job.active_status = '$approve_status'"; } else { $con_div = "1"; } $sql = "SELECT job.* ,mem.member_name ,mem.phone ,mem.email FROM tbl_job job LEFT JOIN tbl_member_detail mem ON mem.member_id = job.create_user_id WHERE $con_div ORDER BY create_datetime"; $res = mysqli_query($connection, $sql) or die($connection->error); $list = array(); while ($row = mysqli_fetch_assoc($res)) { $temp_array = [ "job_id" => $row['job_id'], "create_user_id" => $row['create_user_id'], "announcement_date" => $row['announcement_date'], "company_name" => $row['company_name'], "job_title" => $row['job_title'], "member_name" => $row['member_name'], "phone" => $row['phone'], "email" => $row['email'], "salary" => $row['salary'], "job_location" => $row['job_location'], "position_period" => $row['position_period'], "job_description" => $row['job_description'], "benefits" => $row['benefits'], "active_status" => $row['active_status'] ]; array_push($list, $temp_array); } } ?> <div class="table-responsive"> <table class="table table-striped dataTables-example table-bordered"> <thead> <tr> <th>วันที่ประกาศ</th> <th>ชื่อบริษัท</th> <th>ตำแหน่ง</th> <th>เงินเดือน</th> <th>สถานที่ทำงาน</th> <th>จำนวน</th> <th>สถานะ</th> <th>จัดการ</th> </tr> </thead> <tbody> <?php foreach ($list as $row) { switch ($row['active_status']) { case '1': $status_label = 'ประกาศ'; $class_btn = 'btn-primary'; break; case '2': $status_label = 'ปิดประกาศ'; $class_btn = 'btn-danger'; break; case '9': $status_label = 'รออนุมัติ'; $class_btn = 'btn-warning'; break; case '0': $status_label = 'ปฎิเสธ'; $class_btn = 'btn-danger'; break; default: $status_label = ''; $class_btn = ''; break; } ?> <tr> <td><?php echo date('d/m/Y', strtotime($row['announcement_date'])); ?></td> <td> <?php echo $row['company_name'] ?><br> <?php echo $row['member_name'] ?><br> <?php echo $row['phone'] ?><br> <?php echo $row['email'] ?> </td> <td><?php echo $row['job_title'] ?></td> <td><?php echo number_format($row['salary']); ?></td> <td><?php echo $row['job_location'] ?></td> <td><?php echo $row['position_period'] ?> ตำแหน่ง</td> <td style="width: 10%;"> <button class="btn btn-xs w-100 mb-2 <?php echo $class_btn ?>" onclick="ChangeSta('<?php echo $row['job_id']; ?>')" disabled> <?php echo $status_label ?> </button> </td> <td style="width: 10%;"> <a href="https://efa.or.th/job-detail?job=<?php echo $row['job_id']; ?>" target="_blank" class="btn btn-sm w-100 mb-2 btn-info">รายละเอียด</a> <button class="btn btn-xs w-100 mb-2 btn-success" onclick="ApprovePost('<?php echo $row['job_id']; ?>','1')">อนุมัติ</button> <button class="btn btn-xs w-100 mb-2 btn-danger" onclick="ApprovePost('<?php echo $row['job_id']; ?>','0')">ไม่อนุมัติ</button> </td> </tr> <?php } ?> </tbody> </table> </div>