<?php require_once('../Connections/connect.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $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; } } mysql_select_db($database_connect, $connect); $query_Recordset1 = "SELECT * FROM employee"; $Recordset1 = mysql_query($query_Recordset1, $connect) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?><meta http-equiv="Content-Type" content="text/html; charset=utf8" /> <style type="text/css"> <!-- .style1 {font-size: 24px} .style2 {font-size: 18px} --> </style> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <?php ?> <p align="center" class="style1">เงินเดือนพนักงาน</p> <p align="center" class="style2">ประจำเดือน / ปี</p> <p align="center" class="style2"> <select name="select" id="select"> <option>มกราคม</option> <option>กุมพาพันธ์</option> <option>มีนาคม</option> <option>เมษายน</option> <option>พฤษภาคม</option> <option>มิถุนายน</option> <option>กรกฎาคม</option> <option>สิงหาคม</option> <option>กันยายน</option> <option>ตุลาคม</option> <option>พฤศจิกายน</option> <option>ธันวาคม</option> </select> <select name="select2" id="select2"> <option>2554</option> <option>2555</option> <option>2556</option> <option>2557</option> <option>2558</option> <option>2559</option> <option>2560</option> <option>2561</option> <option>2562</option> <option>2563</option> </select> </p> <table width="898" border="1" align="center"> <tr> <td width="52">ลำดับที่</td> <td width="159"><div align="center">ชื่อ </div></td> <td width="162"><div align="center">นามสกุล</div></td> <td width="150"><div align="center">แผนก</div></td> <td width="157"><div align="center">อัตราค่าจ้าง</div></td> <td width="81">วันมาทำงาน</td> <td width="91"><div align="center">รวมเงิน</div></td> </tr> <tr> <?php $sqltxt = "SELECT * FROM employee"; $db_query=mysql_db_query($db,$sql); $sub_total = $row_Recordset1['emp_price'] * $row_Recordset1['emp_other'] ; $empoth = $row_Recordset1['emp_other']; { echo " <td align=center></td> <td align=center>{$row_Recordset1['emp_name']}</td> <td align=center>{$row_Recordset1['emp_lname']}</td> <td align=center>{$row_Recordset1['emp_dep']}</td> <td align=center>{$row_Recordset1['emp_price']}</td> <td align=center> <input type=text size=10 name=$empoth value={$row_Recordset1['emp_other']} /> </td> <td>$sub_total</td> </tr>"; } ?> </tr> </table> <p align="center" class="style2"> <label> <input type="submit" name="button" id="button" value="บันทึก" /> </label> <label> <input type="submit" name="button2" id="button2" value="ลบข้อมูล" /> </label> </p> <label></label> <p> </p> <p> </p> <p align="left" class="style2"> </p> <p align="left"> </p> <p> </p> <p> </p> <p> </p> </form> <?php mysql_free_result($Recordset1); ?>
<?php $sqltxt = "SELECT * FROM employee"; $db_query=mysql_db_query($db,$sql); $sub_total = $row_Recordset1['emp_price'] * $row_Recordset1['emp_other'] ; $empoth = $row_Recordset1['emp_other']; { echo " <td align=center></td> <td align=center>{$row_Recordset1['emp_name']}</td> <td align=center>{$row_Recordset1['emp_lname']}</td> <td align=center>{$row_Recordset1['emp_dep']}</td> <td align=center>{$row_Recordset1['emp_price']}</td> <td align=center> <input type=text size=10 name=$empoth value={$row_Recordset1['emp_other']} /> </td> <td>$sub_total</td> </tr>"; $total = $total + $row_Recordset1['emp_price']; } ?>
<?php $sqltxt = "SELECT * FROM employee"; $db_query=mysql_db_query($db,$sql); $sub_total = $row_Recordset1['emp_price'] * $_POST['empoth'] ; $empoth = $row_Recordset1['emp_other']; { echo " <td align=center></td> <td align=center>{$row_Recordset1['emp_name']}</td> <td align=center>{$row_Recordset1['emp_lname']}</td> <td align=center>{$row_Recordset1['emp_dep']}</td> <td align=center>{$row_Recordset1['emp_price']}</td> <td align=center> <input type=text size=10 name='empoth' value={$row_Recordset1['emp_other']} /> </td> <td>$sub_total</td> </tr>"; } ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง