NG1NDEX
Server IP : 150.95.80.236  /  Your IP : 18.190.217.139
Web Server : Apache
System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : social-telecare ( 10000)
PHP Version : 7.4.33
Disable Function : opcache_get_status
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/vhosts/pcu.in.th/uat.pcu.in.th/export_excel/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/vhosts/pcu.in.th/uat.pcu.in.th/export_excel/ex_case_fwsi.php
<?php
session_start();
if (!isset($_SESSION['sess_id']) && !isset($_SESSION['user_id'])) {
    // If the session is not set, redirect to the sign-in page
    echo "<script>window.location.replace('../signin.php');</script>";
    exit; // Ensure the script stops execution after redirecting
}
ob_start();

require '../connect.php';
require '../function.php';

?>

<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">

<html>
<?php 
$name = $_SESSION['user_fname']." ".$_SESSION['user_lname'];
  //title
$table = "<table>
<thead>
<tr>
<th></th>
<th>แบบฟอร์มการส่งต่อข้อมูลทางสังคม</th>
<th>ชื่อนักสังคมสงเคราะห์ $name</th>
</tr>
</thead>
</table>";


$result_point = array();
$result_pointname = array();
$result_count = array();
        // $query = $conn->query("SELECT * FROM selfass_point"); 
        // while ($fet = $query->fetch_object()) {
        //     array_push($result_point, $fet->selfpoint_value);
        //     array_push($result_pointname, $fet->selfpoint_show);
        // }
        //คำถาม


    //header
$table .= "<table border='1'>
<thead>
<tr >
<th>ลำดับ</th>
<th>ผู้ป่วย</th>
<th>ผู้ประเมิน</th>
<th>วันที่ประเมิน</th>
<th>ความสัมพันธ์ในครอบครัว</th>
<th>บทบาทของสมาชิกในครอบครัวในการตูแลผู้ป่วย </th>
<th>บทบาทของผู้ป่วยในครอบครัว</th>
<th>หน้าที่ของผู้ป่วยในครอบครัว</th>
<th>รายได้ของครอบครัว</th>
<th>ค่าน้ำ-ไฟ</th>
<th>ค่าอาหาร</th>
<th>ค่าเช่าบ้าน</th>
<th>ภาระหนี้สิน</th>
<th>ลักษณะที่อยู่อาศัย</th>
<th>ความสะดวกในการเดินทาง</th>
<th>โรคอาการปัจจุบัน	</th>
<th>โรคประจำตัว	</th>
<th>สถานพยาบาลที่รับการรักษาเป็นประจำ</th>
<th>ความร่วมมือในการตูแลสุขภาพ</th>
<th>ผลกระทบของความเจ็บป่วยต่อสภาพจิตใจ</th>
<th>ทรัพยากรอื่นๆ</th>
<th>การช่วยเหลือผู้ป่วยที่ได้ดำเนินการไปแล้ว</th>
<th>ข้อมูลอื่น ๆ</th>
<th>วัตถุประสงค์การส่งต่อ</th>
<th>ข้อมูลญาติ</th>
"
;



$table .= "
</tr>
</thead>
<tbody>";
$count_i=1;
$query_ansmain = $conn->query("SELECT form_fwsi.*, user_data.fname, user_data.lname, case_data.case_tname, case_data.case_name
    FROM form_fwsi
    LEFT JOIN case_data ON case_data.user_id = form_fwsi.case_id
    LEFT JOIN user_data ON user_data.user_id = form_fwsi.doctor_id
    WHERE form_fwsi.doctor_id = '".$_SESSION['user_id']."' ");
while ($fet_ansmain = $query_ansmain->fetch_assoc()) {
    $table .= "
    <tr> 
    <td> ".($count_i)." </td>
    <td> ".$fet_ansmain['case_tname']." ".$fet_ansmain['case_name']." </td>
    <td> ".$fet_ansmain['fname']." ".$fet_ansmain['lname']." </td>
    <td>". thaidate($fet_form['fwsi_date']) ."</td>
    <td>". ($fet_ansmain['rel_family']) ."</td>
    <td>". ($fet_ansmain['role_patient_family']) ."</td>
    <td>". ($fet_ansmain['case_role']) ."</td>
    <td>". ($fet_ansmain['case_duties']) ."</td>
    <td>". ($fet_ansmain['family_income']."/".$fet_ansmain['income_of']) ."</td>
    <td>". ($fet_ansmain['cost_wt_el']) ."</td>
    <td>". ($fet_ansmain['cost_food']) ."</td>
    <td>". ($fet_ansmain['cost_rent_house']) ."</td>
    <td>". ($fet_ansmain['case_debt']) ."</td>
    <td>". ($fet_ansmain['style_house']) ."</td>
    <td>". ($fet_ansmain['con_travel']) ."</td>
    <td>". ($fet_ansmain['now_dis']) ."</td>
    <td>". ($fet_ansmain['cong_dis']) ."</td>
    <td>". ($fet_ansmain['hos_regular']) ."</td>
    <td>". ($fet_ansmain['health_care']) ."</td>
    <td>". ($fet_ansmain['impact_mind']) ."</td>
    <td>". ($fet_ansmain['other_resoure']) ."</td>
    <td>". ($fet_ansmain['help_case']) ."</td>
    <td>". ($fet_ansmain['other_data']) ."</td>
    <td>". ($fet_ansmain['forwarding_purpose']) ."</td>
    ";
    $rel_show = "";
    $query_rel = $conn->query("SELECT * FROM case_relative WHERE user_id = '" . $fet_ansmain['case_id'] . "' ");
    while ($fet_rel = $query_rel->fetch_object()) {
        
        
           
        $rel_show .= ("ชื่อ : ".$fet_rel->re_name ."ความสัมพันธ์ : ". $fet_rel->re_relevant ."การศึกษา : ". $fet_rel->re_education."อาชีพ : ".$fet_rel->re_job ."รายได้ : ". number_format($fet_rel->re_income,2)."โทร :".$fet_rel->re_phone);
    }
    $table .= "<td>".$rel_show."</td>";

   $table .= "</tr>";
   $count_i++;
}




//end


$table .= " </tbody>
</table>";









?>

<?php 
header("Content-Type: application/vnd.ms-excel");
header('Content-Disposition: attachment; filename="case_fwsi.xls"');
header("Content-Type: application/force-download"); 
header("Content-Type: application/octet-stream"); 
header("Content-Type: application/download"); 
header("Content-Transfer-Encoding: binary"); 
// header("Content-Length: ".filesize("myexcel.xls"));  
@readfile($filename);    

echo $table;

?>

Anon7 - 2022
AnonSec Team