ช่วยแก้ไขคำสั่ง SQLของ MySQL ในการconnect หน่อยค่ะ
พอ run แล้วขึ้นข้อความ
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
CODE ดังนี้ค่ะ PHP script 4.4.4,PHPmyadmin 2.9,MySQL5.0.24
<?php require_once('Connections/moo.php'); ?>
<?php
$FamilyPerson_ID=$_GET['FamilyPerson_ID'];
//MX Widgets3 include
require_once('includes/wdg/WDG.php');
// Load the common classes
require_once('includes/common/KT_common.php');
// Require the MXI classes
require_once ('includes/mxi/MXI.php');
// Load the required classes
require_once('includes/tfi/TFI.php');
require_once('includes/tso/TSO.php');
require_once('includes/nav/NAV.php');
// Load the KT_back class
require_once('includes/nxt/KT_back.php');
// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("");
// Load the tNG classes
require_once('includes/tng/tNG.inc.php');
// Make unified connection variable
$conn_moo = new KT_connection($moo, $database_moo);
//Start Restrict Access To Page
$restrict = new tNG_RestrictAccess($conn_moo, "");
//Grand Levels: Level
$restrict->addLevel("Admin");
$restrict->addLevel("Member");
$restrict->Execute();
//End Restrict Access To Page
// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("Ill_Name", true, "text", "", "", "", "โปรดระบุชื่อโรค");
$formValidation->addField("Hos_ID", true, "numeric", "", "", "", "โปรดเลือกโรงพยาบาลที่รักษา");
$formValidation->addField("date_illness", true, "date", "", "", "", "โปรดระบุวันที่รับการรักษา");
$tNGs->prepareValidation($formValidation);
// End trigger
// Filter
$tfi_listillness1 = new TFI_TableFilter($conn_moo, "tfi_listillness1");
$tfi_listillness1->addColumn("illness.Ill_Name", "STRING_TYPE", "Ill_Name", "%");
$tfi_listillness1->addColumn("hospital.Hos_ID", "NUMERIC_TYPE", "Hos_ID", "=");
$tfi_listillness1->addColumn("illness.date_illness", "DATE_TYPE", "date_illness", "=");
$tfi_listillness1->Execute();
// Sorter
$tso_listillness1 = new TSO_TableSorter("rsillness1", "tso_listillness1");
$tso_listillness1->addColumn("illness.Ill_Name");
$tso_listillness1->addColumn("hospital.Hos_name");
$tso_listillness1->addColumn("illness.date_illness");
$tso_listillness1->setDefault("illness.date_illness");
$tso_listillness1->Execute();
// Navigation
$nav_listillness1 = new NAV_Regular("nav_listillness1", "rsillness1", "", $_SERVER['PHP_SELF'], 1000);
mysql_select_db($database_moo, $moo);
$query_Recordset2 = "SELECT Hos_ID, Hos_name, type FROM hospital ORDER BY Hos_name ASC";
$Recordset2 = mysql_query($query_Recordset2, $moo) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
$colname_rs_personfamily = "-1";
if (isset($_GET['FamilyPerson_ID'])) {
$colname_rs_personfamily = (get_magic_quotes_gpc()) ? $_GET['FamilyPerson_ID'] : addslashes($_GET['FamilyPerson_ID']);
}
mysql_select_db($database_moo, $moo);Tag : PHP
Date :
2010-08-29 22:29:38
By :
sppkmoo
View :
1120
Reply :
4
ส่ง Code ให้ดูเพื่อช่วยแก้ไขค่ะ เพราะว่า แก้ไขจาก type เป็น category แล้วค่ะ แต่ ยังขึ้น เหมือนเดิมเลย
<?php require_once('Connections/moo.php');?>
<?php
$FamilyPerson_ID=$_GET['FamilyPerson_ID'];
//MX Widgets3 include
require_once('includes/wdg/WDG.php');
// Load the common classes
require_once('includes/common/KT_common.php');
// Require the MXI classes
require_once ('includes/mxi/MXI.php');
// Load the required classes
require_once('includes/tfi/TFI.php');
require_once('includes/tso/TSO.php');
require_once('includes/nav/NAV.php');
// Load the KT_back class
require_once('includes/nxt/KT_back.php');
// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("");
// Load the tNG classes
require_once('includes/tng/tNG.inc.php');
// Make unified connection variable
$conn_moo = new KT_connection($moo, $database_moo);
//Start Restrict Access To Page
$restrict = new tNG_RestrictAccess($conn_moo, "");
//Grand Levels: Level
$restrict->addLevel("Admin");
$restrict->addLevel("Member");
$restrict->Execute();
//End Restrict Access To Page
// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("Ill_Name", true, "text", "", "", "", "โปรดระบุชื่อโรค");
$formValidation->addField("Hos_ID", true, "numeric", "", "", "", "โปรดเลือกโรงพยาบาลที่รักษา");
$formValidation->addField("date_illness", true, "date", "", "", "", "โปรดระบุวันที่รับการรักษา");
$tNGs->prepareValidation($formValidation);
// End trigger
// Filter
$tfi_listillness1 = new TFI_TableFilter($conn_moo, "tfi_listillness1");
$tfi_listillness1->addColumn("illness.Ill_Name", "STRING_TYPE", "Ill_Name", "%");
$tfi_listillness1->addColumn("hospital.Hos_ID", "NUMERIC_TYPE", "Hos_ID", "=");
$tfi_listillness1->addColumn("illness.date_illness", "DATE_TYPE", "date_illness", "=");
$tfi_listillness1->Execute();
// Sorter
$tso_listillness1 = new TSO_TableSorter("rsillness1", "tso_listillness1");
$tso_listillness1->addColumn("illness.Ill_Name");
$tso_listillness1->addColumn("hospital.Hos_name");
$tso_listillness1->addColumn("illness.date_illness");
$tso_listillness1->setDefault("illness.date_illness");
$tso_listillness1->Execute();
// Navigation
$nav_listillness1 = new NAV_Regular("nav_listillness1", "rsillness1", "", $_SERVER['PHP_SELF'], 1000);
mysql_select_db($database_moo, $moo);
$query_Recordset2 = "SELECT Hos_ID, Hos_name, category FROM hospital ORDER BY Hos_name ASC";
$Recordset2 = mysql_query($query_Recordset2, $moo) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
$colname_rs_personfamily = "-1";
if (isset($_GET['FamilyPerson_ID'])) {
$colname_rs_personfamily = (get_magic_quotes_gpc()) ? $_GET['FamilyPerson_ID'] : addslashes($_GET['FamilyPerson_ID']);
}
mysql_select_db($database_moo, $moo);
$query_rs_personfamily = sprintf("SELECT family.FamilyPerson_ID, family.Person_ID, family.Status_person_ID, rankfamily.Rank_Name, family.F_Name, family.L_Name, family.Sex_ID, sex.Sex_Name, family.Birthdate, YEAR(CURDATE())-YEAR(Birthdate) AS age, married.Married_Name, code.Code_Name, family.email FROM ((((family LEFT JOIN rankfamily ON family.Rank_ID = rankfamily.Rank_ID) LEFT JOIN sex ON sex.Sex_ID=family.Sex_ID) LEFT JOIN married ON married.Married_ID=family.Married_ID) LEFT JOIN code ON code.Code_ID=family.Code_ID) WHERE family.FamilyPerson_ID = %s", $colname_rs_personfamily);
$rs_personfamily = mysql_query($query_rs_personfamily, $moo) or die(mysql_error());
$row_rs_personfamily = mysql_fetch_assoc($rs_personfamily);
$totalRows_rs_personfamily = mysql_num_rows($rs_personfamily);
$Person_ID=$row_rs_personfamily['Person_ID'];
mysql_select_db($database_moo, $moo);
$query_rs_person = "SELECT soldier.Person_ID, rank.Rank_Name, soldier.F_Name, soldier.L_Name FROM soldier LEFT JOIN rank ON rank.Rank_ID=soldier.Rank_ID WHERE soldier.Person_ID = $Person_ID";
$rs_person = mysql_query($query_rs_person, $moo) or die(mysql_error());
$row_rs_person = mysql_fetch_assoc($rs_person);
$totalRows_rs_person = mysql_num_rows($rs_person);
// Make an insert transaction instance
$ins_illness = new tNG_multipleInsert($conn_moo);
$tNGs->addTransaction($ins_illness);
// Register triggers
$ins_illness->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
$ins_illness->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$ins_illness->registerTrigger("END", "Trigger_Default_Redirect", 99, "illness_family.php?FamilyPerson_ID=$FamilyPerson_ID");
// Add columns
$ins_illness->setTable("illness");
$ins_illness->addColumn("Ill_Name", "STRING_TYPE", "POST", "Ill_Name");
$ins_illness->addColumn("Hos_ID", "NUMERIC_TYPE", "POST", "Hos_ID");
$ins_illness->addColumn("Person_ID", "STRING_TYPE", "POST", "Person2_ID");
$ins_illness->addColumn("date_illness", "DATE_TYPE", "POST", "date_illness");
$ins_illness->setPrimaryKey("Ill_ID", "NUMERIC_TYPE");
// Make an update transaction instance
$upd_illness = new tNG_multipleUpdate($conn_moo);
$tNGs->addTransaction($upd_illness);
// Register triggers
$upd_illness->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1");
$upd_illness->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$upd_illness->registerTrigger("END", "Trigger_Default_Redirect", 99, "illness_family.php?FamilyPerson_ID=$FamilyPerson_ID");
// Add columns
$upd_illness->setTable("illness");
$upd_illness->addColumn("Ill_Name", "STRING_TYPE", "POST", "Ill_Name");
$upd_illness->addColumn("Hos_ID", "NUMERIC_TYPE", "POST", "Hos_ID");
$upd_illness->addColumn("Person_ID", "STRING_TYPE", "POST", "Person2_ID");
$upd_illness->addColumn("date_illness", "DATE_TYPE", "POST", "date_illness");
$upd_illness->setPrimaryKey("Ill_ID", "NUMERIC_TYPE", "GET", "Ill_ID");
// Make an instance of the transaction object
$del_illness = new tNG_multipleDelete($conn_moo);
$tNGs->addTransaction($del_illness);
// Register triggers
$del_illness->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Delete1");
$del_illness->registerTrigger("END", "Trigger_Default_Redirect", 99, "illness_family.php?FamilyPerson_ID=$FamilyPerson_ID");
// Add columns
$del_illness->setTable("illness");
$del_illness->setPrimaryKey("Ill_ID", "NUMERIC_TYPE", "GET", "Ill_ID");
// Execute all the registered transactions
$tNGs->executeTransactions();
//NeXTenesio3 Special List Recordset
$maxRows_rsillness1 = $_SESSION['max_rows_nav_listillness1'];
$pageNum_rsillness1 = 0;
if (isset($_GET['pageNum_rsillness1'])) {
$pageNum_rsillness1 = $_GET['pageNum_rsillness1'];
}
$startRow_rsillness1 = $pageNum_rsillness1 * $maxRows_rsillness1;
$colname_rsillness1 = "-1";
if (isset($_GET['FamilyPerson_ID'])) {
$colname_rsillness1 = $_GET['FamilyPerson_ID'];
}
$NXTSort_rsillness1 = "illness.date_illness";
if (isset($_SESSION['sorter_tso_listillness1'])) {
$NXTSort_rsillness1 = $_SESSION['sorter_tso_listillness1'];
}
mysql_select_db($database_moo, $moo);
$query_rsillness1 = sprintf("SELECT illness.Ill_Name, hospital.Hos_name AS Hos_ID, illness.date_illness, illness.Ill_ID, hospital.type FROM illness LEFT JOIN hospital ON illness.Hos_ID = hospital.Hos_ID WHERE illness.Person_ID=%s ORDER BY %s", $colname_rsillness1,$NXTSort_rsillness1);
$query_limit_rsillness1 = sprintf("%s LIMIT %d, %d", $query_rsillness1, $startRow_rsillness1, $maxRows_rsillness1);
$rsillness1 = mysql_query($query_limit_rsillness1, $moo) or die(mysql_error());
$row_rsillness1 = mysql_fetch_assoc($rsillness1);
if (isset($_GET['totalRows_rsillness1'])) {
$totalRows_rsillness1 = $_GET['totalRows_rsillness1'];
} else {
$all_rsillness1 = mysql_query($query_rsillness1);
$totalRows_rsillness1 = mysql_num_rows($all_rsillness1);
}
$totalPages_rsillness1 = ceil($totalRows_rsillness1/$maxRows_rsillness1)-1;
//End NeXTenesio3 Special List Recordset
$nav_listillness1->checkBoundries();
// Get the transaction recordset
$rsillness = $tNGs->getRecordset("illness");
$row_rsillness = mysql_fetch_assoc($rsillness);
$totalRows_rsillness = mysql_num_rows($rsillness);
?>
<html>
<head>
<title>ข้อมูลสุขภาพข้าราชการทหารและครอบครัว กองพันสารวัตรทหารที่ ๑๑</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<link rel="StyleSheet" href="corporatestyle.css" type="text/css">
<script language="JavaScript" type="text/javascript" src="javascripts.js"></script>
<script language="JavaScript" type="text/javascript" src="pop-closeup.js"></script>
<script language="JavaScript" type="text/javascript" src="mouseover.js"></script>
<script language="JavaScript" type="text/javascript" src="scroller/scroll.js"></script>
<style type="text/css">
<!--
.style1 {
font-family: Tahoma;
font-size: 18px;
font-weight: bold;
}
.style23 {font-family: "MS Sans Serif"; font-size: 14px; }
-->
</style>
<?php
function datethai ($date)
{
$day = substr("$date",8,2);
$month = substr("$date",5,2);
$month = (int)$month - 1;
$year = substr("$date",0,4);
$year = $year + 543;
$thaimonth = array("มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม");
$month = $thaimonth[$month];
return (int)$day." ".$month." ".$year;
}
?>
<script type="text/javascript" src="includes/common/js/sigslot_core.js"></script>
<script src="includes/common/js/base.js" type="text/javascript"></script>
<script src="includes/common/js/utility.js" type="text/javascript"></script>
<script type="text/javascript" src="includes/wdg/classes/MXWidgets.js"></script>
<script type="text/javascript" src="includes/wdg/classes/MXWidgets.js.php"></script>
<link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<style type="text/css">
<!--
.style26 {
color: #3300FF;
font-weight: bold;
font-family: Tahoma;
font-size: 18px;
}
.style27 {color: #3300FF}
.style28 {color: #FF6633}
.style29 {color: #000000}
-->
</style>
<script type="text/javascript" src="includes/wdg/classes/MaskedInput.js"></script>
<script src="includes/skins/style.js" type="text/javascript"></script>
<script src="includes/nxt/scripts/list.js" type="text/javascript"></script>
<script src="includes/nxt/scripts/list.js.php" type="text/javascript"></script>
<script type="text/javascript">
$NXT_LIST_SETTINGS = {
duplicate_buttons: false,
duplicate_navigation: false,
row_effects: true,
show_as_buttons: true,
record_counter: true
}
</script>
<style type="text/css">
/* NeXTensio3 List row settings */
.KT_col_Ill_Name {width:150px; overflow:hidden;}
.KT_col_Hos_ID {width:280px; overflow:hidden;}
.KT_col_date_illness {width:140px; overflow:hidden;}
.style30 {color: #009900}
</style>
<?php echo $tNGs->displayValidationRules();?>
<script src="includes/nxt/scripts/form.js" type="text/javascript"></script>
<script src="includes/nxt/scripts/form.js.php" type="text/javascript"></script>
<script type="text/javascript">
$NXT_FORM_SETTINGS = {
duplicate_buttons: false,
show_as_grid: false,
merge_down_value: false
}
</script>
<script type="text/javascript" src="includes/wdg/classes/Calendar.js"></script>
<script type="text/javascript" src="includes/wdg/classes/SmartDate.js"></script>
<script type="text/javascript" src="includes/wdg/calendar/calendar_stripped.js"></script>
<script type="text/javascript" src="includes/wdg/calendar/calendar-setup_stripped.js"></script>
<script src="includes/resources/calendar.js"></script>
</head>
<BODY BGCOLOR="#FFFFFF" background="picts/background-main.gif" TEXT="#000000" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginheight="0" marginwidth="0">
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"><tr><td ALIGN="LEFT" VALIGN="TOP">
<script language="JavaScript" type="text/javascript" src="header.js"></script>
<span class="printhide">
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%" background="picts/main.jpg"><tr><td>
<a href="index.html"><IMG SRC="picts/spacer.gif" border="0" width="720" height="80"></a><br>
</td></tr></table>
<img src="picts/stretchbar.jpg" width="100%" height="28"><br>
<script language="JavaScript" type="text/javascript" src="menu.js"></script>
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%" background="picts/shadow1.gif"><tr><td width="227">
<IMG SRC="picts/corner.gif" height="40" width="227"><br>
</td><td><br>
<div align="center"><span class="style1">ข้อมูลสุขภาพครอบครัวทหาร กองพันสารวัตรทหารที่ ๑๑</span><br>
</div></td></tr></table>
</span>
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td ALIGN="left" VALIGN="top">
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="195" colspan="3" ALIGN="LEFT" VALIGN="TOP">
<?php
mxi_includes_start("login.php");
require(basename("login.php"));
mxi_includes_end();
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1"><IMG SRC="picts/spacer.gif" height="10" width="15" border="0"></td>
<td><script language="JavaScript" type="text/javascript" src="sidebar.js"></script></td>
<td><img src="picts/spacer.gif" width="30" height="10"></td>
</tr>
<tr>
<td><IMG SRC="picts/spacer.gif" height="10" width="15" border="0"></td>
<td><IMG SRC="picts/spacer.gif" height="5" width="150" border="0"></td>
<td width="15"> </td>
</tr>
</table></td>
<td width="100%" ALIGN="CENTER" VALIGN="TOP"><span class="style1 style31 style30">ครอบครัว <?php echo $row_rs_person['Rank_Name']; ?> <?php echo $row_rs_person['F_Name']; ?> <?php echo $row_rs_person['L_Name']; ?></span><br>
<br>
<table width="90%" border="3" align="center" cellpadding="1" cellspacing="2" bordercolor="#91B3C1">
<tr>
<td bgcolor="#CFDEE5"><div align="center">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25" colspan="3" class="style23"><div align="center" class="style26"><a href="personfamily_detail.php?FamilyPerson_ID=<?php echo $_GET['FamilyPerson_ID']; ?>"><?php echo $row_rs_personfamily['Rank_Name']; ?> <?php echo $row_rs_personfamily['F_Name']; ?> <?php echo $row_rs_personfamily['L_Name']; ?></a></div></td>
</tr>
<tr>
<td height="25" colspan="3" class="style23"><div align="center">เพศ <span class="style27"><?php echo $row_rs_personfamily['Sex_Name']; ?></span> วัน เดือน ปี เกิด <span class="style27">
<?php
$date = $row_rs_personfamily['Birthdate'];
echo datethai ($date);
?>
</span> อายุ <span class="style27"><?php echo $row_rs_personfamily['age']; ?></span> ปี</div></td>
</tr>
<tr>
<td height="25" colspan="3" class="style23"><div align="center">สถานภาพสมรส <span class="style27"><?php echo $row_rs_personfamily['Married_Name']; ?></span> สิทธิการรักษา <span class="style27"><?php echo $row_rs_personfamily['Code_Name']; ?></span> E-Mail <a href="mailto:<?php echo $row_rs_personfamily['email']; ?>" class="style27"><?php echo $row_rs_personfamily['email']; ?></a></div></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td bgcolor="#CFDEE5"><br>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#91B3C1">
<tr class="style23">
<td width="15%" height="30" bgcolor="#FFFFFF"><div align="center"><a href="illness_family.php?FamilyPerson_ID=<?php echo $row_rs_personfamily['FamilyPerson_ID']; ?>">ประวัติการเจ็บป่วย</a></div></td>
<td width="15%" height="30" bgcolor="#CFDEE5"><div align="center"><a href="health_history_family.php?FamilyPerson_ID=<?php echo $row_rs_personfamily['FamilyPerson_ID']; ?>">ข้อมูลสุขภาพ</a></div></td>
<td width="15%" height="30" bgcolor="#CFDEE5"><div align="center"><a href="lab_family.php?FamilyPerson_ID=<?php echo $row_rs_personfamily['FamilyPerson_ID']; ?>">LAB</a></div></td>
<td width="15%" height="30" bgcolor="#CFDEE5"><div align="center"><a href="risk_family.php?FamilyPerson_ID=<?php echo $row_rs_personfamily['FamilyPerson_ID']; ?>">ปัจจัยเสี่ยง</a></div></td>
<?php if ($row_rs_personfamily['Sex_ID'] == 2 && $row_rs_personfamily['Status_person_ID'] == 2) { ?>
<td width="15%" height="30" bgcolor="#CFDEE5"><div align="center"><a href="labour_family.php?FamilyPerson_ID=<?php echo $row_rs_personfamily['FamilyPerson_ID']; ?>">ประวัติการคลอด</a></div></td>
<?php } ?>
<?php if ($row_rs_personfamily['age'] <= 12) { ?>
<td width="15%" height="30" bgcolor="#CFDEE5"><div align="center"><a href="vaccine_family.php?FamilyPerson_ID=<?php echo $row_rs_personfamily['FamilyPerson_ID']; ?>">ประวัติการฉีดวัคซีน</a></div></td>
<?php } ?>
</tr>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#91B3C1">
<tr>
<td width="540%" height="25" colspan="6" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="95%">
<div class="KT_tng" id="listillness1">
<h1> แสดงประวัติการเจ็บป่วย
<?php
$nav_listillness1->Prepare();
require("includes/nav/NAV_Text_Statistics.inc.php");
?>
</h1>
<div class="KT_tnglist">
<form action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" method="post" id="form1">
<div class="KT_options"> <a href="<?php echo $nav_listillness1->getShowAllLink(); ?>"></a>
</div>
<table cellpadding="2" cellspacing="0" class="KT_tngtable">
<thead>
<tr class="KT_row_order">
<th> <input type="checkbox" name="KT_selAll" id="KT_selAll"/> </th>
<th id="Ill_Name" class="KT_sorter KT_col_Ill_Name <?php echo $tso_listillness1->getSortIcon('illness.Ill_Name'); ?>"> <a href="<?php echo $tso_listillness1->getSortLink('illness.Ill_Name'); ?>">ชื่อโรค</a> </th>
<th id="Hos_ID" class="KT_sorter KT_col_Hos_ID <?php echo $tso_listillness1->getSortIcon('hospital.Hos_name'); ?>"> <a href="<?php echo $tso_listillness1->getSortLink('hospital.Hos_name'); ?>">โรงพยาบาลที่รักษา</a> </th>
<th id="date_illness" class="KT_sorter KT_col_date_illness <?php echo $tso_listillness1->getSortIcon('illness.date_illness'); ?>"> <a href="<?php echo $tso_listillness1->getSortLink('illness.date_illness'); ?>">วันที่รับการรักษา</a> </th>
<th> </th>
</tr>
</thead>
<tbody>
<?php if ($totalRows_rsillness1 == 0) { // Show if recordset empty ?>
<tr>
<td colspan="5"><?php echo NXT_getResource("The table is empty or the filter you've selected is too restrictive."); ?></td>
</tr>
<?php } // Show if recordset empty ?>
<?php if ($totalRows_rsillness1 > 0) { // Show if recordset not empty ?>
<?php do { ?>
<tr class="<?php echo @$cnt1++%2==0 ? "" : "KT_even"; ?>">
<td><input type="checkbox" name="kt_pk_illness" class="id_checkbox" value="<?php echo $row_rsillness1['Ill_ID']; ?>" />
<input type="hidden" name="Ill_ID" class="id_field" value="<?php echo $row_rsillness1['Ill_ID']; ?>" /> </td>
<td><div class="KT_col_Ill_Name"><?php echo KT_FormatForList($row_rsillness1['Ill_Name'], 20); ?></div></td>
<td><div class="KT_col_Hos_ID"><?php echo KT_FormatForList($row_rsillness1['Hos_ID'], 40); ?> : <?php echo $row_rsillness1['category']; ?></div></td>
<td><div class="KT_col_date_illness">
<div align="center">
<?php
$date = $row_rsillness1['date_illness'];
echo datethai ($date);
?>
</div>
</div></td>
<td><a class="KT_edit_link" href="illness_family.php?FamilyPerson_ID=<?php echo $_GET['FamilyPerson_ID']; ?>"><?php echo NXT_getResource("edit_one"); ?></a> <a class="KT_delete_link" href="#delete"><?php echo NXT_getResource("delete_one"); ?></a> </td>
</tr>
<?php } while ($row_rsillness1 = mysql_fetch_assoc($rsillness1)); ?>
<?php } // Show if recordset not empty ?>
</tbody>
</table>
<div class="KT_bottomnav">
<div>
<?php
$nav_listillness1->Prepare();
require("includes/nav/NAV_Text_Navigation.inc.php");
?>
</div>
</div>
<div class="KT_bottombuttons">
<div class="KT_operations"> <a class="KT_edit_op_link" href="#" onClick="nxt_list_edit_link_form(this); return false;"><?php echo NXT_getResource("edit_all"); ?></a> <a class="KT_delete_op_link" href="#" onClick="nxt_list_delete_link_form(this); return false;"><?php echo NXT_getResource("delete_all"); ?></a> </div>
<span> </span>
<select name="no_new" id="no_new">
<option value="1">1</option>
</select>
<a class="KT_additem_op_link" href="illness_family.php?FamilyPerson_ID=<?php echo $_GET['FamilyPerson_ID']; ?>" onClick="return nxt_list_additem(this)"><?php echo NXT_getResource("add new"); ?></a> </div>
</form>
</div>
<br class="clearfixplain" />
</div> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="25" colspan="6" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="5"> </td>
<td width="95%">
<?php
echo $tNGs->getErrorMsg();
?>
<div class="KT_tng">
<h1>
<?php
// Show IF Conditional region2
if (@$_GET['Ill_ID'] == "") {
?>
<?php echo NXT_getResource("Insert_FH"); ?>
<?php
// else Conditional region2
} else { ?>
<?php echo NXT_getResource("Update_FH"); ?>
<?php }
// endif Conditional region2
?>
ประวัติการเจ็บป่วย </h1>
<div class="KT_tngform">
<form method="post" id="form2" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>">
<?php $cnt2 = 0; ?>
<?php do { ?>
<?php $cnt2++; ?>
<?php
// Show IF Conditional region2
if (@$totalRows_rsillness > 1) {
?>
<h2><?php echo NXT_getResource("Record_FH"); ?> <?php echo $cnt2; ?></h2>
<?php }
// endif Conditional region2
?>
<table cellpadding="2" cellspacing="0" class="KT_tngtable">
<tr>
<td class="KT_th"><label for="Ill_Name_<?php echo $cnt2; ?>">ชื่อโรค</label></td>
<td><input type="text" name="Ill_Name_<?php echo $cnt2; ?>" id="Ill_Name_<?php echo $cnt2; ?>" value="<?php echo KT_escapeAttribute($row_rsillness['Ill_Name']); ?>" size="32" maxlength="255" />
<?php echo $tNGs->displayFieldHint("Ill_Name");?> <?php echo $tNGs->displayFieldError("illness", "Ill_Name", $cnt2); ?> </td>
</tr>
<tr>
<td class="KT_th"><label for="Hos_ID_<?php echo $cnt2; ?>">โรงพยาบาลที่รักษา</label></td>
<td><select name="Hos_ID_<?php echo $cnt2; ?>" id="Hos_ID_<?php echo $cnt2; ?>">
<option value=""><?php echo NXT_getResource("Select one..."); ?>โรงพยาบาล</option>
<?php
do {
?>
<option value="<?php echo $row_Recordset2['Hos_ID']?>"<?php if (!(strcmp($row_Recordset2['Hos_ID'], $row_rsillness['Hos_ID']))) {echo "SELECTED";} ?>><?php echo $row_Recordset2['Hos_name']?> : <?php echo $row_Recordset2['type']; ?></option>
<?php
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
$rows = mysql_num_rows($Recordset2);
if($rows > 0) {
mysql_data_seek($Recordset2, 0);
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
}
?>
</select>
<?php echo $tNGs->displayFieldError("illness", "Hos_ID", $cnt2); ?> </td>
</tr>
<tr>
<td class="KT_th"><label for="date_illness_<?php echo $cnt2; ?>">วันที่รับการรักษา</label></td>
<td><input name="date_illness_<?php echo $cnt2; ?>" id="date_illness_<?php echo $cnt2; ?>" value="<?php echo KT_formatDate($row_rsillness['date_illness']); ?>" size="10" maxlength="22" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:mondayfirst="false" wdg:singleclick="true" wdg:restricttomask="no" />
<?php echo $tNGs->displayFieldHint("date_illness");?> <?php echo $tNGs->displayFieldError("illness", "date_illness", $cnt2); ?> </td>
</tr>
</table>
<input type="hidden" name="kt_pk_illness_<?php echo $cnt2; ?>" class="id_field" value="<?php echo KT_escapeAttribute($row_rsillness['kt_pk_illness']); ?>" />
<input type="hidden" name="Person2_ID_<?php echo $cnt2; ?>" id="Person2_ID_<?php echo $cnt2; ?>" value="<?php echo $_GET['FamilyPerson_ID']; ?>" />
<?php } while ($row_rsillness = mysql_fetch_assoc($rsillness)); ?>
<div class="KT_bottombuttons">
<div>
<?php
// Show IF Conditional region2
if (@$_GET['Ill_ID'] == "") {
?>
<input type="submit" name="KT_Insert1" id="KT_Insert1" value="<?php echo NXT_getResource("Insert_FB"); ?>" />
<?php
// else Conditional region2
} else { ?>
<input type="submit" name="KT_Update1" value="<?php echo NXT_getResource("Update_FB"); ?>" />
<input type="submit" name="KT_Delete1" value="<?php echo NXT_getResource("Delete_FB"); ?>" onClick="return confirm('<?php echo NXT_getResource("Are you sure?"); ?>');" />
<?php }
// endif Conditional region2
?>
<input type="button" name="KT_Cancel1" value="<?php echo NXT_getResource("Cancel_FB"); ?>" onClick="return UNI_navigateCancel(event, 'includes/nxt/back.php')" />
</div>
</div>
</form>
</div>
<br class="clearfixplain" />
</div>
<br> </td>
</tr>
</table></td>
</tr>
</table>
<br></td>
</tr>
</table>
<br></td>
</tr>
</table>
</td></tr></table>
</TD></TR><TR><TD VALIGN="BOTTOM">
<img src="picts/stretchbar.jpg" width="100%" height="28"><br>
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%" background="picts/bottom-shade.gif"><tr><td width="10">
<IMG SRC="picts/spacer.gif" height="35" width="10" border="0"><br>
</td><td ALIGN="left" VALIGN="middle">
<script language="JavaScript" type="text/javascript" src="copyright.js"></script>
</td><td ALIGN="right" VALIGN="middle">
<script language="JavaScript" type="text/javascript" src="copyright-allwebco.js"></script>
</TD><td width="10">
<IMG SRC="picts/spacer.gif" height="10" width="10" border="0"><br>
</td></tr></table>
</td></tr></table>
</BODY>
</HTML>
<?php
mysql_free_result($Recordset2);
mysql_free_result($rs_personfamily);
mysql_free_result($rs_person);
mysql_free_result($rsillness1);
?>
Date :
2010-08-30 15:54:43
By :
sppkmoo
ทรมานสายตามาก
ตกลงมันฟ้องว่า error บรรทัดไหน ตรงไหน บอกกันด้วยครับ
Date :
2010-08-30 18:19:21
By :
PlaKriM
ขอโทษ อย่างสูงค่ะ แบบว่า มี error แบบนี้ค่ะ
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Date :
2010-08-30 20:18:04
By :
sppkmoo
Load balance : Server 04