Files
2026-09-16 23:20:08 +07:00

72 lines
3.3 KiB
PHP

<?php
session_start();
if (empty($_SESSION['sess_userid']) || $_SESSION['sess_userid'] !== session_id()) {
header("Location: index.php");
exit();
}
$account = $_SESSION['account'];
$name = $_SESSION['name'];
$position = $_SESSION['position'];
$ip = $_SESSION['ip'];
$page_link = "hosxp_cost.php";
$chk1 = preg_match('/itcenter/', $account);
if (!$chk1) {
echo "<center><font color='red'>ไม่มีสิทธิ์เข้าถึงหน้านี้</font></center>";
exit();
}
require_once("config/db.php");
?>
<!DOCTYPE html>
<html lang="th">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HOSxP Web Service | แก้ไขข้อมูลค่าใช้จ่าย</title>
<link href="https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/style.css" type="text/css" />
</head>
<body>
<div class="app-container">
<?php require_once("includes/sidebar.php"); ?>
<main class="main-content">
<?php require_once("includes/header.php"); ?>
<div class="content-wrapper animate-fade-in">
<div class="card" style="max-width: 700px; margin: 0 auto;">
<div class="card-title">แบบฟอร์มแก้ไขราคาค่าใช้จ่าย HOSxP</div>
<form method="post" action="edit_cost.php">
<div class="form-group">
<label style="display:block; margin-bottom:0.5rem; font-weight:600;">ราคาทุน</label>
<input type="number" step="0.01" name="unitcost" id="unitcost" class="form-control" required />
</div>
<div class="form-group">
<label style="display:block; margin-bottom:0.5rem; font-weight:600;">ราคาที่เบิกได้</label>
<input type="number" step="0.01" name="sks_coverage_price" id="sks_coverage_price" class="form-control" required />
</div>
<div class="form-group">
<label style="display:block; margin-bottom:0.5rem; font-weight:600;">ช่วงของรหัสที่ต้องการแก้ไข (icode)</label>
<textarea rows="4" name="icode" id="icode" class="form-control" placeholder="ระบุ icode ที่ต้องการแก้ไข คั่นด้วยเครื่องหมายคอมม่า เช่น 10001, 10002" required></textarea>
</div>
<div class="form-group">
<label style="display:block; margin-bottom:0.5rem; font-weight:600;">Safety Code</label>
<input type="password" name="safety_code" id="safety_code" class="form-control" required />
</div>
<div style="margin-top: 1.5rem;">
<button type="submit" class="btn btn-primary">แก้ไขราคา</button>
<button type="reset" class="btn" style="background:#f3f4f6; color:var(--text-main); margin-left:0.5rem;">ล้างค่า</button>
</div>
</form>
</div>
</div>
</main>
</div>
</body>
</html>