Viewing file: addcollege.php (5.51 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once "template.php";
include_once "../class/clsTable.php";
include_once "../link/functionshow.php";
include_once "funct.php";
include_once "../link/keyThai.php";
include_once "../class/clsCollegeDetail.php";
include_once "../class/clsSysConfig.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
$oCd = new collegedetail($oC);
$oCd2 = new collegedetail($oC);
$oSys = new sysConfig($oCe);
$oSys->RSsysConfig();
$oSys->GetRecord();
?>
<?
if($method=="addcollege"){
$oCd2->SearchByKey($editID);
$oCd2->GetRecord();
//echo 'collegeName='.$collegeName[$oCd2->collegeID].'<br>';
//echo 'collegeAbbr='.$collegeAbbr[$oCd2->collegeID].'<br>';
//echo 'collegeHost='.$collegeHost[$oCd2->collegeID].'<br>';
$oCd2->Edit();
$oCd2->cID=$oCd2->cID;
$oCd2->collegeID=$oCd2->collegeID;
$oCd2->collegeName=$collegeName[$oCd2->collegeID];
$oCd2->collegeAbbr=$collegeAbbr[$oCd2->collegeID];
$oCd2->collegeHost=$collegeHost[$oCd2->collegeID];
if($collegeHost[$oCd2->collegeID]==''){
$oCd2->collegeType='N';
}else{
$oCd2->collegeType=$flag[$oCd2->collegeID];
}
$oCd2->Save();
?>
<script language="JavaScript">
parent.location.href ="addcollege.php";
</script>
<?
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<link href="../source/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<iframe id="configDept" name="configDept" src="" style="width:$0px;height:0px;border:0"></iframe>
<br>
<table width=703 align="center">
<tr><td height="150">
<fieldset>
<legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="?mm=1">ตั้งค่าการใช้งานระบบ</a>
<img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle">กำหนดข้อมูลวิทยาลัย</font></legend>
<form name="ff" action="addcollege.php" method="post"target="configDept" ><? //?>
<table width="100%" height="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse">
<tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_15"];?>">
<td align="center" width="5%"><strong>รหัสวิทยาลัย</strong></td>
<td align="center" width="35%"><strong>ชื่อวิทยาลัย</strong></td>
<td align="center" width="15%"><strong>ชื่อย่อวิทยาลัย</strong></td>
<td align="center" width="20%"><strong>ip ของวิทยาลัย</strong></td>
<td align="center" width="10%"><strong>สถานะ<br>การใช้งาน</strong></td>
<td align="center" width="5%"><strong>แก้ไข</strong></td>
</tr>
<?
$i=0;
$oCd->RScollegedetail();
while($oCd->GetRecord()){
if(($i%2) == 0)
echo "<tr>";
else
echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_16"]."\">";
?>
<td align="center"><? echo $oCd->collegeID; ?></td>
<td> <? if($edit==1 && $oCd->collegeID==$collegeID){ ?><input name="collegeName[<? echo $oCd->collegeID; ?>]" type="text" size="40" maxlength="255" value="<? echo $oCd->collegeName; ?>" onKeyPress="event.keyCode=CheckInputComma(event.keyCode); return event.keyCode;"><? }else{ echo $oCd->collegeName; } ?></td>
<td> <? if($edit==1 && $oCd->collegeID==$collegeID){ ?><input name="collegeAbbr[<? echo $oCd->collegeID; ?>]" type="text" size="20" value="<? echo $oCd->collegeAbbr; ?>" onKeyPress="event.keyCode=CheckInputComma(event.keyCode); return event.keyCode;"><? }else{ echo $oCd->collegeAbbr; } ?></td>
<td> <? if($edit==1 && $oCd->collegeID==$collegeID){ ?><input name="collegeHost[<? echo $oCd->collegeID; ?>]" type="text" size="20" value="<? echo $oCd->collegeHost; ?>" onKeyPress="event.keyCode=CheckInputComma(event.keyCode); return event.keyCode;"><? }else{ echo $oCd->collegeHost; } ?></td>
<td align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_4"];?>">
<input name="flag[<? echo $oCd->collegeID; ?>]" type="checkbox" value="Y" <? if($oCd->collegeType=="Y"){ echo "checked"; } ?> <? if($edit!=1 || ($edit==1 && $oCd->collegeID!=$collegeID)){ echo 'disabled'; }?>>
ใช้ </font></td>
<td align="center">
<? if($edit==1 && $oCd->collegeID==$collegeID){ ?>
<img src="../picture/save.gif" alt="บันทึกข้อมูล" border="0" style="cursor:pointer;" onClick="return checkFormat('<? echo $oCd->collegeID; ?>');">
<? }else{?>
<img src="../picture/edit1.gif" alt="แก้ไขข้อมูล" border="0" style="cursor:pointer;" onClick="location.href='addcollege.php?edit=1&collegeID=<? echo $oCd->collegeID?>';">
<? } ?>
</td></tr>
<? $i++;}?>
</table>
<table border="0" align="center" width="100%"><tr><td align="center">
<br>
<input type="hidden" name="method">
<input type="hidden" name="editID">
<input type="button" name="cancel" value="กลับสู่เมนูหลัก" onClick="location.href = '?mm=1'">
<input type="button" name="cancel" value="ยกเลิก" onClick="location.href = 'addcollege.php'">
</td>
</tr></table></form>
</fieldset>
<br>
</td>
</tr>
</table>
</body>
</html>
<script language="javascript">
function checkFormat(editID){
var agree=confirm("คุณต้องการแก้ไขข้อมูลวิทยาลัยแน่นอนใช่หรือไม่ ?");
if (agree){
document.ff.editID.value=editID;
document.ff.method.value="addcollege";
document.ff.submit();
return true;
}else{
return false ;
}
}
</script>
|