Viewing file: InsertPlanTeach.php (4.97 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php session_start(); if (session_is_registered("valid_user")) { $Username = $valid_user; include("../include/FunctionDB.php"); include("../include/Function.php"); ConnectDB(); $Flag = true; $Person_code = htmlspecialchars(trim($_POST[Person_code])); $Teacher_code = htmlspecialchars(trim($_POST[Teacher_code])); $HN_code = htmlspecialchars(trim($_POST[HN_code])); $Tooth_code = htmlspecialchars(trim($_POST[Tooth_code])); $Code = htmlspecialchars(trim($_POST[Code])); $No_code = htmlspecialchars(trim($_POST[No_code])); $Teach_code = htmlspecialchars(trim($_POST[Teach_code])); $Code = htmlspecialchars(trim($_POST[Code])); $Time_in = htmlspecialchars(trim($_POST[Time_in ])); $Time_out = htmlspecialchars(trim($_POST[Time_out])); $Date = $_POST[mYear1]."-".$_POST[mMonth1]."-".$_POST[mDate1]; $Religion = htmlspecialchars(trim($_POST[Religion])); $Discrition = htmlspecialchars(trim($_POST[Discrition]));
////////////// นำค่า id มาเพิ่มให้กับค่ารหัสสมาชิกครั้งละ1 //////// //$sql3 = "Select * From account order by Teach_id desc "; //$result3 = mysql_query($sql3) or die("Error $result3".mysql_error()); //$rss = mysql_fetch_row($result3); //$account = $rss [0] +1 ; // นำค่า id มาเพิ่มให้กับค่ารหัสสมาชิกครั้งละ1 //if($account>=100) { //$No_in = "0$account" ; //} //else { //if($account>=10) { //$No_in = "000$account" ; //} //else { //$No_in = "0000$account" ; //} //} //$No_code = "$HN_no$No_in" ; // รหัสสมาชิกเช่น ip0001 /////////////////// Check เลขที่ใบเสร็จ /////////// //if ($No_code =="") //{ //$msg .="<li>กรุณาระบุ เลขที่ใบเสร็จด้วยค่ะ"; //$button ="<input type=\"button\" value=\"กลับไปแก้ไข\" onclick=\"history.back();\" style=\"font-weight:bold;color:#FFF;background-color:#036;border-style:outset;border-color:#69F;font-family:Tohoma;\">"; //$Flag = false; //} ////////////// Check เลขที่ใบเสร็จ ///////////////////////////////////// //echo "$No_code <br>"; //$sql4 = "Select * From account Where No_code='$No_code'"; //$result4 = mysql_query($sql4) or die("Error $result4".mysql_error()); //$sum = mysql_num_rows($result4); //if ($sum>0) //{ //$msg .="<li>รหัส $No_code ซ้ำ"; //$button ="<input type=\"button\" value=\"Back to Edit\" onclick=\"history.back();\" style=\"font-weight:bold;color:#FFF;background-color:#036;border-style:outset;border-color:#69F;font-family:Tohoma;\">"; //$Flag = false; //} //////////////////////// check จำนวน ///////////////// //if ($Mount=="") //{ //$msg .="<li>กรุณาระบุ จำนวน"; //$button ="<input type=\"button\" value=\"กลับไปแก้ไข\" onclick=\"history.back();\" style=\"font-weight:bold;color:#FFF;background-color:#036;border-style:outset;border-color:#69F;font-family:Tohoma;\">"; //$Flag = false; //} ///////////////////// check name //if ($Price =="") //{ //$msg .="<li>กรุณาระบุ ราคา"; //$button ="<input type=\"button\" value=\"กลับไปแก้ไข\" onclick=\"history.back();\" style=\"font-weight:bold;color:#FFF;background-color:#036;border-style:outset;border-color:#69F;font-family:Tohoma;\">"; //$Flag = false; //} ///////////////////////// Check Status to Insert Data ///////////////////////////// if( $Flag) { $Path = "../images"; if ( isset($Img1) ) if (copy($Img1,"$Path/$Img1_name")) { unlink ($Img1); $Img1 = "$Path/$Img1_name"; } else echo"Can't Copy"; InsertPlanTeach($Person_code,$Teacher_code,$No_code,$HN_code,$Code,$Tooth_code,$Teach_code,$Time_in,$Img1,$Time_out,$Date,$Religion,$Discrition,$Flag); $msg.="<li>ระบบจัดเก็บข้อมูลเรียบร้อยแล้ว"; echo"<meta http-equiv=\"refresh\" content=\"2;URL=TeachPlanList.php?Person_code=$Person_code\">\n"; } CloseDB(); ?> <html> <head> <title>Inserting Treattment</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <link href="../css/style1.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#FFFFFF"> <form> <br> <table width="68%" border="0" cellspacing="0"cellpadding="2"align="center"> <tr> <td><div align="center"><span><b><font color="#000000" size="3" face="Tahoma">::ฟอร์มการเพิ่มข้อมูล::</font></b></span></div></td> </tr> <tr> <td> <table width="74%" border="0" cellspacing="1"cellpadding="2"align="center"bordercolor="#0B62D9" class="table"> <tr> <td bgcolor="#CCCCFF"> <div align="center"><b><font color="#003366" size="3" face="Tahoma">ระบบแจ้งการทำงาน</font></b></div></td> </tr> <tr> <td bgcolor="#000000"> <table width="90%" border="0" cellspacing="0"cellpadding="2"align="center"> <tr> <td><font color="#FFFFFF" size="3" face="Tahoma"><strong><span><?php echo $msg;?></span></strong></font></td> </tr> </table></td> </tr> <tr> <td bgcolor="#CCCCFF"> <div align="center"><b><font color="#CCFF00"><?php echo $button;?></font></b></div></td> </tr> </table> </td> </tr> </table> <br> <br> </form> </body> </html> <?php } else { echo"<meta http-equiv=\"refresh\" content=\"3;URL=../../login.php\">\n"; echo"Please Login "; } ?>
|