Example #1
0
[hidden_amphur_id] => 312
[district] =>
[hidden_district_id] => 2788
[zipcode] => 34000
[latlng] => 1
)
*/
$data = array();
foreach ($_POST as $k => $v) {
    $data[$k] = trim($v);
}
$latlng = explode(",", $data['latlng']);
$data['lat'] = trim($latlng[0]);
if (count($latlng) > 1) {
    $data['lng'] = trim($latlng[1]);
} else {
    $data['lng'] = "";
}
$pf->pf = $data;
$result = $pf->update();
if ($result) {
    $data = $pf->get_profile($_SESSION['profile_detail']['profile_id']);
    foreach ($data as $key => $value) {
        $_SESSION['profile_detail'][$key] = $value;
    }
    // print "<pre>" . print_r($_SESSION, 1) . "</pre>";
    // exit;
    header("Location: update_success.php");
} else {
    header("Location: update_failed.php");
}
Example #2
0
    session_unset();
    session_destroy();
    header("Location: index.php");
    exit;
} else {
    include '../php/config/autoload.inc.php';
}
if (!isset($_GET['id']) || empty($_GET['id'])) {
    header("Location: main.php");
}
use classes as cls;
use config\database as db;
$db = new db();
$pv = new cls\provinces();
$pf = new cls\profiles();
$data = $pf->get_profile(trim($_GET['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>Admin Management</title>
        <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
    </head>