/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
main
/
jobs
/
ajax
/
job
/
up file
home
<?php include('../../../../config/main_function.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); $sql = "SELECT * FROM tbl_job "; $res = mysqli_query($connection, $sql) or die($connection->error); if ($connection) { $member_id = mysqli_real_escape_string($connection, $_POST['member_id']); $temp_id = explode(".", $member_id); $member_id = bigsara_decode($temp_id[0], $temp_id[1]); ///ถอด xapi $password = 'sd32f43q5we'; $xapi = 'CXgvsdf542sdfg'; $encryptedMessage = mysqli_real_escape_string($connection, $_POST['encryptedMessage']); if (decryptMessage($encryptedMessage, $password) == $xapi) { $sql = "SELECT * FROM tbl_job WHERE create_user_id = '$member_id' ORDER BY create_datetime DESC LIMIT 0,4"; $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'], "salary" => $row['salary'], "job_location" => $row['job_location'], "job_description" => $row['job_description'], "benefits" => $row['benefits'], "position_period" => $row['position_period'], "active_status" => $row['active_status'] ]; array_push($list, $temp_array); } } else { $arr['result'] = 0; $arr['message'] = "xapi is valid"; } } else { $arr['result'] = 9; $arr['message'] = "Connection Error"; } ?> <table class="table table-striped table-responsive text-center"> <thead class="thead-inverse"> <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 '0': $status_label = 'ปิดประกาศ'; $class_btn = 'btn-danger'; break; case '9': $status_label = 'รออนุมัติ'; $class_btn = 'btn-warning'; 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'] ?></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']; ?>')" > <?php echo $status_label ?> </button> </td> <td style="width: 10%;"> <a href="job?job=<?php echo $row['job_id']; ?>" target="_blank" class="btn btn-xs w-100 mb-2 btn-info">รายละเอียด</a> <a href="job_edit?job=<?php echo $row['job_id']; ?>" target="_blank" class="btn btn-xs w-100 mb-2 btn-warning">แก้ไข</a> <button class="btn btn-xs w-100 mb-2 btn-danger" onclick="DeleteJob('<?php echo $row['job_id']; ?>')">ลบ</button> </td> </tr> <?php } ?> </tbody> </table>