<!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> <FORM METHOD="POST" ACTION="Member3.php"> <? ob_start(); include "connect.php"; echo $p_id=$_POST[p_id]; $ref_id_type_search=$_POST[ref_id_type_search]; $sql="select * from member where divisi_id='$ref_id_type_search'"; $result=mysql_db_query($dbname,$sql) or die(mysql_error()); $number=mysql_num_rows($result); $no=1; echo $_session['total']= $_POST['total']; $i=0; ?> <? if ($number<>0) { echo " <table border=1> <tr> <td align=center><b>ชื่อ - นามสกุล</b></td> <td align=center><b>เพศ</b></td> <td align=center><b>ฝ่าย</b></td> <td align=center><b>อัตราค่าจ้าง</b></td> <td colspan=15 align=center><strong>วันที่ทำงาน</strong></td> </tr> "; while($rs=mysql_fetch_array($result)) { echo $p_id=$rs[p_id]; $code_prd=sprintf("%05d",$p_id); $p_name=$rs[p_name]; $divisi_id=$rs[divisi_id]; $p_sex=$rs[p_sex]; $sara_amout=$rs[sara_amout]; if ($p_sex==1){ $p_sex1="ชาย"; } else { $p_sex1="หญิง"; } $sql2="select divisi_name from division where divisi_id='$divisi_id' "; //เรียกฝ่ายออกมา $result2=mysql_db_query($dbname,$sql2)or die(mysql_error()); $rs2=mysql_fetch_array($result2); $divisi_name=$rs2[divisi_name]; echo " <TR> <TD>$p_name</TD> <TD>$p_sex1</TD> <TD>$divisi_name</TD> <TD>$sara_amout</TD> <div align=center></div> <td width=56><div align=center>1</div></td> <td width=56><div align=center>2</div></td> <td width=56><div align=center>3</div></td> <td width=56><div align=center>4</div></td> <td width=56><div align=center>5</div></td> <td width=56><div align=center>6</div></td> <td width=56><div align=center>7</div></td> <td width=56><div align=center>8</div></td> <td width=56><div align=center>9</div></td> <td width=56><div align=center>10</div></td> <td width=56><div align=center>11</div></td> <td width=56><div align=center>12</div></td> <td width=56><div align=center>13</div></td> <td width=56><div align=center>14</div></td> <td width=56><div align=center>15</div></td> <td width=56><div align=center>จำนวนวัน</div></td> <td width=56><div align=center>รวม</div></td> </tr> <tr> <td> <td> <td> <td> <form name=calc> <td><div align=center> <select name=month1[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td></td></td></td></td> <td><div align=center> <select name=month2[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month3[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month4[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month5[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month6[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month7[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month8[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month9[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month10[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month11[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month12[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month13[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month14[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td><td><div align=center> <select name=month15[$i] onClick=calcfunc('{$i}')> <option value=0 selected=selected>-</option> <option value=1>1</option> <option value=0.5>0.5</option> </select> </div></td> <td><div align=center> <input type=text name=ret[$i]> </div></td></tr> </form> </TR>"; //$no++; $i++; } echo "</TABLE>"; mysql_close(); } echo "<script language=JavaScript> //ให้รับเฉพาะตัวเลข //function checknumber() { // Click=event.onClick // if (Click<48 || Click>57) event.returnValue = true; //} //คำนวณเมื่อ KeyUp function calcfunc(id) { var val1 = document.getElementsByName("month1[]"); var val2 = document.getElementsByName("month2[]"); var val3 = document.getElementsByName("month3[]"); var val4 = document.getElementsByName("month4[]"); var val5 = document.getElementsByName("month5[]"); var val6 = document.getElementsByName("month6[]"); var val7 = document.getElementsByName("month7[]"); var val8 = document.getElementsByName("month8[]"); var val9 = document.getElementsByName("month9[]"); var val10 = document.getElementsByName("month10[]"); var val11 = document.getElementsByName("month11[]"); var val12 = document.getElementsByName("month12[]"); var val13 = document.getElementsByName("month13[]"); var val14 = document.getElementsByName("month14[]"); var val15 = document.getElementsByName("month15[]"); var ret = document.getElementsByName("ret[]"); val1 = parseFloat(val1[id].value); val1 = parseFloat(val1[id].value); val2 = parseFloat(val2[id].value); val3 = parseFloat(val3[id].value); val4 = parseFloat(val4[id].value); val5 = parseFloat(val5[id].value); val6 = parseFloat(val6[id].value); val7 = parseFloat(val7[id].value); val8 = parseFloat(val8[id].value); val9 = parseFloat(val9[id].value); val10 = parseFloat(val10[id].value); val11 = parseFloat(val11[id].value); val12 = parseFloat(val12[id].value); val13 = parseFloat(val13[id].value); val14 = parseFloat(val14[id].value); val15 = parseFloat(val15[id].value); ret[id].value=val1+val2+val3+val4+val5+val6+val7+val8+val9+val10+val11+val12+val13+val14+val15; } </script>"; ?> <INPUT TYPE="submit" NAME="calculate" VALUE="คำนวณใหม่"> <INPUT TYPE="submit" NAME="complete" VALUE="สั่งซื้อสินค้า"> <INPUT TYPE="hidden" NAME="ref_id_type_search" VALUE="<?=$ref_id_type_search?>"> <INPUT TYPE="hidden" NAME="p_id" VALUE="<?=$p_id?>"> <INPUT TYPE="hidden" NAME="ref_id_type_search" VALUE="<?=$ref_id_type_search?>"> <input type="button" value="ย้อนกลับ" onClick="history.back();"> </FORM>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง