示例#1
0
<?php

session_start();
if (!isset($_GET['hospital_id'])) {
    header("Location: index.php");
    exit;
}
include 'php/config/autoload.inc.php';
use classes as cls;
use config as cfg;
$db = new cfg\database();
$ht = new cls\hospitals();
$pv = new cls\provinces();
$data = $ht->get_hospital_detail_by_id($_GET['hospital_id']);
// print_r($data);
$province = $pv->get_province($data['province']);
$amphur = $pv->get_amphur($data['amphur']);
$district = $pv->get_district($data['district']);
/*
Array
(
[hospital_id] => 1
[hospital_verify_code] => กก11021จ
[hospital_name] => ค่ายสรรพสิทธิประสงค์
[hospital_address] => 383 หมู่ 2 ถ.สถิตย์นิมานกาล
[province] => 1
[amphur] => 4
[district] => 31
[zipcode] => 34190
[lat] => 15.1939973
[lng] => 104.8732654
示例#2
0
<?php

session_start();
include 'php/config/autoload.inc.php';
use classes as cls;
use config as cfg;
$db = new cfg\database();
$ht = new cls\hospitals();
// print "<pre>" . print_r($ht->get(), 1) . "</pre>";
// exit;
$hospital_option = "";
$selected = "";
foreach ($ht->get() as $k => $v) {
    if (isset($_GET['hospital'])) {
        $selected = $v['hospital_id'] == $_GET['hospital'] ? "selected" : "";
    }
    $hospital_option .= "<option value='" . $v['hospital_id'] . "' " . $selected . ">" . $v['hospital_name'] . "</option>";
}
$typeofmedical_option = "";
$selected = "";
foreach ($ht->get_typeofmedical() as $k => $v) {
    if (isset($_GET['typeofmedical'])) {
        $selected = $v['medical_type_id'] == $_GET['typeofmedical'] ? "selected" : "";
    }
    $typeofmedical_option .= "<option value='" . $v['medical_type_id'] . "' " . $selected . ">" . $v['medical_name'] . "</option>";
}
?>
    <!DOCTYPE html>
    <html lang="en">

    <head>
示例#3
0
<?php

session_start();
if (isset($_SESSION['profile']) && $_SESSION['profile'] == 'logon') {
    include 'config/autoload.inc.php';
} else {
    echo "\n    <script type='text/javascript'>\n        alert('กรุณาเข้าสู่ระบบก่อนกรอกประวัติการรักษา');\n        window.location = 'signin.php';\n    </script>\n    ";
    exit;
}
use classes as cls;
use config as cfg;
$db = new cfg\database();
$ht = new cls\hospitals();
$ht->medical_detail = $_POST;
if ($ht->set_medical()) {
    header("Location: insert_success.php");
} else {
    header("Location: insert_failed.php");
}
// Array
// (
//     [hospital] => 3
//     [typeofmedical] => 6
//     [organ] => ไส้ติ่ง
//     [date_start] => 2015-11-01
//     [date_end] => 2015-11-05
//     [cost] => 14000
//     [amountofmedicine] => 2
//     [medicine_1] => 1A 656/2531
//     [medicine_2] => A6578T43
// )
示例#4
0
                    <div class="row">
                        <table class="table table-hover table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>รพ.</th>
                                    <th>ที่อยู่</th>
                                    <th>เบอร์โทรศัพท์</th>
                                    <th>อีเมล์</th>
                                    <th>แผนที่</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php 
if (isset($_GET['do']) && $_GET['do'] == 's') {
    $ht = new cls\hospitals();
    $rows = $ht->search($_GET);
    if ($rows !== false) {
        $_GET['page'] = isset($_GET['page']) ? $_GET['page'] : 1;
        $i = ($_GET['page'] - 1) * 10;
        if (count($rows) > 0) {
            foreach ($rows as $k => $v) {
                $i++;
                $province = $pv->get_province($v['province']);
                $amphur = $pv->get_amphur($v['amphur']);
                $district = $pv->get_district($v['district']);
                $address = $v['hospital_address'] . " อำเภอ" . $amphur[0]['AMPHUR_NAME'] . " ตำบล" . $district[0]['DISTRICT_NAME'] . " จังหวัด" . $province[0]['PROVINCE_NAME'] . $v['zipcode'];
                echo "\n            <tr>\n                <td>" . $i . "</td>\n                <td>" . $v['hospital_name'] . "</td>\n                <td>" . $address . "</td>\n                <td>" . $v['tel'] . "</td>\n                <td>" . $v['email'] . "</td>\n                <td><a href='hospital_detail.php?do=s&hospital_id=" . $v['hospital_id'] . "' title='ที่ตั้งโรงพยาบาล'><i class='fa fa-map'></i></a></td>\n            </tr>\n            ";
            }
        } else {
            echo '<tr>
示例#5
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start();
if (isset($_SESSION['profile']) && $_SESSION['profile'] == 'logon') {
    include 'php/config/autoload.inc.php';
} else {
    echo "\n    <script type='text/javascript'>\n        alert('กรุณาเข้าสู่ระบบก่อนกรอกประวัติการรักษา');\n        window.location = 'signin.php';\n    </script>\n    ";
    exit;
}
use classes as cls;
use config as cfg;
$db = new cfg\database();
$ht = new cls\hospitals();
$hospital_option = "";
foreach ($ht->get() as $k => $v) {
    $hospital_option .= "<option value='" . $v['hospital_id'] . "'>" . $v['hospital_name'] . "</option>";
}
$typeofmedical_option = "";
foreach ($ht->get_typeofmedical() as $k => $v) {
    $typeofmedical_option .= "<option value='" . $v['medical_type_id'] . "'>" . $v['medical_name'] . "</option>";
}
$typeofmedical_option .= "<option value='9999'>อื่นๆ</option>";
?>
    <!DOCTYPE html>
    <html lang="en">

    <head>
        <meta charset="UTF-8">
        <title>เพิ่มประวัติการรักษาพยาบาล</title>
示例#6
0
session_start();
error_reporting(E_ALL);
ini_set('display_errors', 1);
if (isset($_SESSION['profile']) && $_SESSION['profile'] == 'logon') {
    include 'php/config/autoload.inc.php';
} else {
    echo "\n    <script type='text/javascript'>\n        alert('กรุณาเข้าสู่ระบบก่อนกรอกประวัติการรักษา');\n        window.location = 'signin.php';\n    </script>\n    ";
    exit;
}
use classes as cls;
use config\database as db;
$db = new db();
$pv = new cls\provinces();
$pf = new cls\profiles();
$ht = new cls\hospitals();
$data_medical = $ht->get_medical($_SESSION['profile_detail']['profile_username']);
$data = $pf->get_profile(trim($_SESSION['profile_detail']['profile_id']));
$province = $pv->get_province($data['province'])[0];
$amphur = $pv->get_amphur($data['amphur'])[0];
$district = $pv->get_district($data['district'])[0];
// print "<pre>" . print_r($province, 1) . "</pre>";
// exit;
?>
    <!DOCTYPE html>
    <html lang="en">

    <head>
        <meta charset="UTF-8">
        <title>ข้อมูลส่วนตัว</title>
        <link rel="stylesheet" href="js/jquery-ui-1.11.4.custom/jquery-ui.min.css">
示例#7
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);
include 'config/autoload.inc.php';
use classes as cls;
use config as cfg;
$db = new cfg\database();
$ht = new cls\hospitals();
$medicines = $ht->get_medicine();
// print "<p>" . $_POST['rt'] . "</p>";
$medicine_option = "";
for ($i = 1; $i <= $_POST['s']; $i++) {
    $medicine_option .= "<select name='medicine_" . $i . "' id='medicine_" . $i . "' class='form-control sub-medicine' style='margin-bottom:5px;'>";
    foreach ($medicines as $key => $value) {
        $name = "";
        if ($value['medicine_name_th'] != "-") {
            $name = $value['medicine_name_th'];
        } else {
            $name = $value['medicine_name_end'];
        }
        $medicine_option .= "<option value='" . $value['medicine_id'] . "'>" . $name . "</option>";
    }
    $medicine_option .= "</select>";
}
echo $medicine_option;