<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="../css/main.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--

function mOvr(src, clrOver){ 
	if (!src.contains(event.fromElement)){ 
		src.style.cursor = 'hand'; 
		src.bgColor = clrOver; 
	} 
} 
function mOut(src, clrIn){ 
	if (!src.contains(event.toElement)){ 
		src.style.cursor = 'default'; 
		src.bgColor = clrIn; 
	} 
} 
function mClk(src, clrOver, clrIn){ 
	if((event.srcElement.tagName=='TD') && (src.children.tags('A')[0]))
		src.children.tags('A')[0].click();
}
//-->
</script>
							<?
    $key=$_GET['key'];
    $user=$_GET['user'];							
    $num=$_GET['num'];							
							?>

</head>
<body bgcolor="#F4F4F4" leftmargin="1" topmargin="1" marginwidth="1" marginheight="1">
<table width="100%" height="100%" cellpadding="0" cellspacing="1">
  <tr>
    <td align="center" valign="middle"><table width="696" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
        <tr> 
          <td height="19" bgcolor="#FFFFFF"><table width="100%" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="3" align="center" bgcolor="#33CC33"></td>
              </tr>
              <tr> 
                <td height="17" align="center" bgcolor="#339966"><strong><font color="#FFFFFF">Edit 
                  Job </font></strong></td>
              </tr>
              <tr> 
                <td height="17" align="center" bgcolor="#33CC66"><table width="100%" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td width="1%">&nbsp;</td>
                      <td width="10%" ><table cellpadding="0" cellspacing="1" bgcolor="#89B700">
                          <tr> 
                            <td align="center" bgcolor="#CCFF33" onMouseOver="mOvr(this, '#88EA35')"  onMouseOut="mOut(this, '#CCFF33')"  ><strong><a href="../manager.php?<? echo "num=$num&key=$key&user=$user"  ?>">&nbsp;Manager&nbsp;</a></strong></td>
                          </tr>
                        </table></td>
                      <td width="79%">&nbsp;</td>
                      <td width="10%"><table cellpadding="0" cellspacing="1" bgcolor="#89B700">
                          <tr> 
                            <td align="center" bgcolor="#CCFF33" onMouseOver="mOvr(this, '#88EA35')"  onMouseOut="mOut(this, '#CCFF33')"  ><strong><a href="../logout.php?<? echo "id=$split[1]"; ?>">&nbsp;Logout&nbsp;</a></strong></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
              <tr> 
                <td valign="top" bgcolor="#33CC66"> <table width="100%" height="100%" cellpadding="0" cellspacing="1">
                    <tr> 
                      <td height="38" valign="top" bgcolor="#F7FAED"><table width="100%" cellspacing="5" cellpadding="0">
                          <tr> 
                            <td> 
							
							<form action="ac_edit.php?<? echo "key=$key&user=$user"  ?>" method="post" enctype="multipart/form-data" name="form1">
                                <table width="100%" cellpadding="3" cellspacing="2" bgcolor="#FFFFFF">
                                  <tr valign="top"> 
                                    <td width="20%" align="right"><strong>Job 
                                      No.</strong></td>
                                    <?
	if(file_exists("new.txt")) 
	  {
	        $dat01 = file("new.txt");
       		    $split = explode("|X|",$dat01[$num]);
				$imgn="data/imagefiles/$split[3]";
				$No = sprintf("%04d",$split[0]);
      }
	  
	  	  
	// อ่านข้อมูลจากไฟล์ คำถามขึ้นมาแสดง
	if(file_exists("./data/$split[0].txt")) {
		$FILE=file("./data/$split[0].txt");
		for ($i=0;$i<count($FILE);$i++){
			$FData="$FData$FILE[$i]";
		}
	}

?>
                                    <td width="80%"><?php echo $No ?>&nbsp; <input name="num" type="hidden" id="num" value="<? echo $No ?>"></td>
                                  </tr>
                                  <tr valign="top"> 
                                    <td width="18%" align="right"><font size="1" face="MS Sans Serif, AngsanaUPC, CordiaUPC">Position</font></td>
                                    <td> <input name="title" type="text" id="title3" value="<?php echo "$split[1]" ?>" size="55"></td>
                                  </tr>
                                  <tr valign="top"> 
                                    <td align="right">Amount</td>
                                    <td> <input name="ndate" type="text" id="title" value="<?php  echo "$split[4]"  ?>" size="55"></td>
                                  </tr>
                                  <tr valign="top"> 
                                    <td align="right">Job Type</td>
                                    <td><input name="jobtype" type="text" id="data2" value="<?php  echo "$split[6]"  ?>" size="50"></td>
                                  </tr>
                                  <tr valign="top"> 
                                    <td align="right"><font size="1" face="MS Sans Serif, AngsanaUPC, CordiaUPC">Qualifications</font></td>
                                    <td> 
                                      <?php   $FData= str_replace("<br>","",$FData);	?>
                                      <textarea name="detail" cols="55" rows="5" id="detail"><?php echo "$FData" ?></textarea> 
                                    </td>
                                  </tr>
                                  <?
                           if($split[3]!="0")
						   {
                                 echo "   <tr valign=top> ";
                                 echo "    <td height=24 align=right><strong>รูปภาพ</strong></td>";
                                 echo "     <td><img src=$imgn><br> ";
                                 echo "      <input name=\"selpic\" type=\"checkbox\" id=\"selpic\" value=1>ไม่เอาภาพ </td></tr>";
                            } 
?>
                                  <tr> 
                                    <td align=right><b><font size=1 face="MS Sans Serif, AngsanaUPC, CordiaUPC"> 
                                      <?
                                             if($split[3]!="0") echo "เปลี่ยนไฟล์ภาพ"; else   echo "ไฟล์ภาพ"; 
								  ?>
                                      </font></b></td>
                                    <td> <input type="file" name="Upload_Img"   size=24> 
                                      <font color=#FF0033> (ไม่เกิน 50 Kb)</font> 
                                    </td>
                                  </tr>
                                  <tr> 
                                    <td align=right><font size="1" face="MS Sans Serif, AngsanaUPC, CordiaUPC">Place 
                                      of work</font></td>
                                    <td><input name="place" type="text" id="jobtype" value="<?php  echo "$split[7]"  ?>" size="50"></td>
                                  </tr>
                                  <tr valign="top"> 
                                    <td align="right">Job Description</td>
                                    <td><input name="data" type="text" id="data" value="<?php echo "$split[5]" ?>" size="50"></td>
                                  </tr>
                                  <tr> 
                                    <td align=right>Expected Salary</td>
                                    <td><input name="salary" type="text" id="jobtype" value="<?php  echo "$split[8]"  ?>" size="50"></td>
                                  </tr>
                                  <tr valign="top"> 
                                    <td align="right">&nbsp;</td>
                                    <td><input type="submit" name="Submit" value="Edit"> 
                                      <input type="reset" name="Submit3" value="Reset"> 
                                      <input type="button" name="Submit2" value="Cancel" onClick="window.history.back()" ></td>
                                  </tr>
                                </table>
                              </form></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
      </table></td>

  </tr>
</table>
