ขอโค้ดการเตือนเวลากรอกข้อมูลไม่ครบหน่อยคับ ต้องเพิ่มอะไรตรงไหนphp
<?php require_once('../Connections/pgtong.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_Recordset1 = "-1";
if (isset($_GET['id_act'])) {
$colname_Recordset1 = $_GET['id_act'];
}
mysql_select_db($database_pgtong, $pgtong);
$query_Recordset1 = sprintf("SELECT * FROM pro63 WHERE id_act = %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $pgtong) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$colname_Recordset2 = "-1";
if (isset($_GET['pro63_id'])) {
$colname_Recordset2 = $_GET['pro63_id'];
}
mysql_select_db($database_pgtong, $pgtong);
$query_Recordset2 = sprintf("SELECT * FROM project63 WHERE pro63_id = %s", GetSQLValueString($colname_Recordset2, "int"));
$Recordset2 = mysql_query($query_Recordset2, $pgtong) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<th height="136" scope="col"><center><img src="img/3.png" width="93%" height="211"></th>
<br /><br />
<body>
<?php
//index.php
$connect = new PDO("mysql:host=localhost;charset=utf8;dbname=asu_system", "root", "12345678");
function fill_unit_select_box($connect)
{
$output = '';
$query = "SELECT * FROM faculty ORDER BY fac_id ASC";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach($result as $row)
{
$output .= '<option value="'.$row["fac_id"].'">'.$row["fac_name"].'</option>';
}
return $output;
}
function fill_unit_select_box1($connect)
{
$output2 = '';
$query = "SELECT * FROM tlo_type ORDER BY type_id ASC";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach($result as $row)
{
$output2 .= '<option value="'.$row["type_id"].'">'.$row["type_name"].'</option>';
}
return $output2;
}
function fill_unit_select_box2($connect)
{
$output3 = '';
$query = "SELECT * FROM tlo_status ORDER BY status_id ASC";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach($result as $row)
{
$output3 .= '<option value="'.$row["status_id"].'">'.$row["status_name"].'</option>';
}
return $output3;
}
?>
<table width="78%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<th scope="col"><form action="save-integ-study.php" method="post" enctype="multipart/form-data" name="frmAdd" id="frmAdd">
<table width="84%" height="394" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th height="54" colspan="2" scope="col">การบูรณาการต่อการเรียนการสอน</th>
</tr>
<tr>
<td align="right">โครงการย่อย :</td>
<td align="left"><?php
mysql_connect("localhost","root","12345678") or die(mysql_error());
mysql_select_db("asu_system") or die(mysql_error());
mysql_query("SET NAMES UTF8"); //Extension By DwThai.Com
$query = "SELECT * FROM `pro63` ORDER BY `id_act` ";
$result = mysql_query($query) or die(mysql_error()."[".$query."]");
$optSelected = $objResult['id_act']; #ค่าที่เราเก็บไว้ตอนเพิ่มข้อมูลเข้าไปในครั้งก่อน
?>
<label for="id_act"></label>
<?php echo $row_Recordset1['act_name']; ?>
<input name="id_act" type="hidden" id="id_act" value="<?php echo $row_Recordset1['id_act']; ?>" />
<label for="pro63_id"></label>
<input name="pro63_id" type="hidden" id="pro63_id" value="<?php echo $row_Recordset1['pro63_id']; ?>" />
<input name="integ_study" type="hidden" id="integ_study" value="<?php echo $row_Recordset2['integ_study']+1; ?>" /></td>
</tr>
<tr>
<td width="39%" align="right">บูรณาการรายวิชา :</td>
<td width="61%" align="left"><input type="text" name="instudy_name" id="instudy_name" /></td>
</tr>
<tr>
<td align="right">รหัสวิชา :</td>
<td align="left"><input type="text" name="instudy_pass" id="instudy_pass" /></td>
</tr>
<tr>
<td align="right">ชื่อผู้สอน :</td>
<td align="left"><input type="text" name="instudy_teach" id="instudy_teach" /></td>
</tr>
<tr>
<td align="right">นักศึกษาชั้นปี :</td>
<td align="left"><input type="text" name="instudy_year" id="instudy_year" /></td>
</tr>
<tr>
<td align="right">หัวข้อที่บูรณาการ :</td>
<td align="left"><input type="text" name="instudy_title" id="instudy_title" /></td>
</tr>
<tr>
<td align="right">หัวข้อเนื้อหา : </td>
<td align="left"><textarea name="content" id="content" cols="45" rows="5"></textarea></td>
</tr>
<tr>
<td align="right">สัปดาห์ที่มีการบูรณาการ :</td>
<td align="left"><input type="text" name="week" id="week" /></td>
</tr>
<tr>
<td align="right">อัพโหลด มคอ. :</td>
<td align="left"><input type="file" name="fileUpload[]" id="fileUpload[]" /></td>
</tr>
</table>
<br />
<center>
<p>
<input name="Submit" type="submit" value="บันทึก" />
<br />
<br />
</p>
</center>
</form></th>
</tr>
</table>
<p> </p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);
?>Tag : PHP
Date :
2019-12-11 14:14:23
By :
ljo
View :
538
Reply :
1
Load balance : Server 04