Ejemplo n.º 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
Ejemplo n.º 2
0
                                    <h3>โรงพยาบาล <a href="create-hospital.php"><i style="color: white;" class="fa fa-plus"></i></a></h3>
                                </div>
                                <div class="panel-body">
                                    <table class="table table-hover">
                                        <tr>
                                            <th>ใบอนุญาติ</th>
                                            <th>ชื่อ</th>
                                            <th>ที่ตั้ง</th>
                                            <th colspan="2">จัดการ</th>
                                        </tr>
                                        <?php 
$sql = "select * from hospital order by hospital_id DESC limit 5;";
$result = $db->query($sql, $rows, $num_rows);
if ($result) {
    foreach ($rows as $k => $v) {
        $province = $pv->get_province($v['province']);
        $provine_name = $province[0]['PROVINCE_NAME'];
        $amphur = $pv->get_amphur($v['amphur']);
        $amphur_name = $amphur[0]['AMPHUR_NAME'];
        $district = $pv->get_district($v['district']);
        $district_name = $district[0]['DISTRICT_NAME'];
        print "\n        <tr>\n            <td>" . $v['hospital_verify_code'] . "</td>\n            <td>โรงพยาบาล" . $v['hospital_name'] . "</td>\n            <td>\n                " . $v['hospital_address'] . " อำเภอ" . $amphur_name . " ตำบล" . $district_name . " จังหวัด" . $provine_name . $v['zipcode'] . "\n            </td>\n            <td><a href='delete-hospital.php?id=" . $v['hospital_id'] . "' onclick='return confirm(\"ยืนยันการลบข้อมูล ?\");'><i class='fa fa-trash-o'></i></a></td>\n            <td><a href='edit-hospital.php?id=" . $v['hospital_id'] . "'><i class='fa fa-pencil'></i></a></td>\n        </tr>\n        ";
    }
}
$result = null;
$rows = null;
$num_rows = null;
?>
                                    </table>
                                </div>
                                <div class="panel-footer text-right">
Ejemplo n.º 3
0
                                <input type="text" class="form-control" id="company_address" name="company_address" aria-describedby="company_address-helpBox" required value="<?php 
echo $data['company_address'];
?>
">
                                <span id="company_address-helpBox" class="help-block">เลขที่, หมู่, ถนน, ซอย ฯลฯ</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="province" class="control-label col-md-4">จังหวัด</label>
                            <div class="col-md-8">
                                <select name="province" id="province" class="form-control" aria-describedby="province-helpBox">
                                    <option value="">เลือกจังหวัด</option>
                                </select>
                                <?php 
$pv = new cls\provinces();
$province = $pv->get_province($data['company_province']);
/*
Array
(
[0] => Array
(
[PROVINCE_ID] => 1
[PROVINCE_CODE] => 10
[PROVINCE_NAME] => กรุงเทพมหานคร
[GEO_ID] => 2
)

)
*/
?>
                                    <span id="province-helpBox" class="help-block">จังหวัดเดิมคือ <?php 
Ejemplo n.º 4
0
                        </div>
                        <div class="form-group">
                            <label for="address" class="control-label col-md-4">ที่อยู่ *</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="address" value="<?php 
echo $_SESSION['profile_detail']['address'];
?>
" name="address" required="" aria-describedby="address-helpBox">
                                <span id="address-helpBox" class="help-block">บ้านเลขที่ / หมู่ ถนน ซอย ฯลฯ</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="province" class="control-label col-md-4">จังหวัด</label>
                            <div class="col-md-8">
                                <?php 
$province = $pv->get_province($_SESSION['profile_detail']['province']);
?>
                                    <select name="province" id="province" class="form-control" aria-describedby="province-helpBox">
                                        <option value="">เลือกจังหวัด</option>
                                    </select>
                                    <span id="province-helpBox" class="help-block">จังหวัดเดิมคือ <?php 
echo $province[0]['PROVINCE_NAME'];
?>
</span>
                                    <input type="hidden" name="hidden_province_id" value="<?php 
echo $province[0]['PROVINCE_ID'];
?>
">
                            </div>
                        </div>
                        <div class="form-group">