Advertisement
tissana

addexten

Jan 12th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.26 KB | None | 0 0
  1. <?php
  2. session_start();
  3. ?>
  4. <!DOCTYPE HTML>
  5. <html>
  6. <head>
  7. <meta charset="utf-8">
  8. <title>เพิ่มรายการรายจ่าย (ใบส่งของ)</title>
  9. <!--[if lt IE 9]>
  10. <link rel="stylesheet" href="../styles/ie.css" type="text/css">
  11. <script src="../scripts/ie/html5shiv.min.js"></script>
  12. <![endif]-->
  13.  
  14. <link href="css/style.css" rel="stylesheet" type="text/css" />
  15.  
  16. <!---- Start Autocomplete ---->
  17. <!--<link rel="stylesheet" type="text/css" href="autocomplete/jquery.autocomplete.css" />-->
  18. <!--<script type="text/javascript" src="autocomplete/jquery.js"></script>
  19. <script type="text/javascript" src="autocomplete/jquery.autocomplete.js"></script>-->
  20. <!---- End Autocomplete ---->
  21.  
  22.  
  23. <script src="ajaxfile/ajax_framework.js"> </script>
  24.  
  25. <!-- start datetime picker---->
  26. <link rel="stylesheet" href="jquerydate/jquery-ui.css" />
  27. <script type="text/javascript" src="jquerydate/jquery-1.11.0.min.js"></script>
  28.  
  29. <script src="jquerydate/jquery-ui.js"></script>
  30.  
  31.  
  32. <script>
  33. $(function() {
  34. $( "#receiptdate" ).datepicker({
  35. changeMonth: true,
  36. changeYear: true
  37. });
  38. $( "#duedate" ).datepicker({
  39. changeMonth: true,
  40. changeYear: true
  41. });
  42. });
  43. </script>
  44. <!---End datetime picker--->
  45.  
  46.  
  47. <script type="text/javascript">
  48.  
  49. function slectdocno(data){
  50.  
  51. var errormsg="";
  52.  
  53. if (document.form1.quoteno.value==""){
  54. errormsg = "กรุณาป้อนหมายเลขอ้างอิงรายจ่ายที่ต้องการค้นหา ด้วยครับ";
  55. document.form1.quoteno.focus();
  56. }
  57. //document.form1.expendateto.style.borderColor="";
  58.  
  59. if (errormsg!=""){
  60. alert(errormsg);
  61. }else{
  62. //mail(to,subject,message,headers,parameters)
  63. document.form1.submit();
  64. }
  65.  
  66. }// end function slectdocno()
  67.  
  68.  
  69. $(function(){
  70. $("select.project").change(function(){
  71. //alert ("projectchange");
  72. var datalist2 = $.ajax({ // รับค่าจาก ajax เก็บไว้ที่ตัวแปร datalist2
  73.  
  74. url: "mainjob.php", // ไฟล์สำหรับการกำหนดเงื่อนไข
  75. data:"project_id="+$(this).val(), // ส่งตัวแปร GET ชื่อ project ให้มีค่าเท่ากับ ค่าของ project
  76. async: false
  77. }).responseText;
  78.  
  79. //this code ok
  80. $(this).next().html(datalist2);
  81. });
  82. });
  83.  
  84. /*******************///
  85. function check(data){
  86. if (data != "0"){
  87. document.form2.companydelivery.style.borderColor="";
  88. }
  89. }
  90.  
  91. function checkvalue(){
  92. var errormsg="";
  93.  
  94. if (document.form2.txtquant1.value==""){
  95. errormsg = "กรุณาระบุจำนวนสินค้า ด้วยครับ";
  96. document.form2.txtquant1.focus();
  97. }
  98.  
  99.  
  100. if (errormsg!=""){
  101. alert(errormsg);
  102. }else{
  103. //mail(to,subject,message,headers,parameters)
  104. document.form2.submit();
  105. }
  106. }
  107.  
  108. function isNumberKey(evt){
  109. var charCode = (evt.which) ? evt.which : event.keyCode
  110. if (charCode > 31 && (charCode < 48 || charCode > 57))
  111. return false;
  112. return true;
  113. }
  114. </script>
  115.  
  116. </head>
  117.  
  118.  
  119. <body>
  120. <?php
  121. //include "header.php";
  122. //f['cat[]'][i].value
  123.  
  124. //include "checksession.php"; // สำหรับเช็คว่า ท่านที่เข้ามานี้ ได้ login หรือยัง
  125. // หาก login มาแล้ว function "chksession.php" จะคืนค่า true ให้แก่ตัวแปรก $sess_status
  126. $sess_status = $_SESSION["sess_status"];
  127. $sess_username = $_SESSION["sess_username"];
  128. $sess_password = $_SESSION["sess_password"];
  129.  
  130. /*$sess_userid = $_SESSION["sess_userid"];
  131. echo "sess_userid is $sess_userid <br />";
  132. echo "sess_status is $sess_status <br />";
  133. echo "sess_username is $sess_username <br />";
  134. echo "sess_password is $sess_password <br />";*/
  135. //include "chksession.php"; // สำหรับเช็คว่า ท่านที่เข้ามานี้ ได้ login หรือยัง
  136. if ($sess_status == "true"){
  137. //include "selectmenu.php";
  138. include("header.php");
  139. include "ConnectionDb.php";
  140.  
  141.  
  142. if($_REQUEST['do']=='add'){
  143. // echo "Success You Click add button <br />";
  144. include("save_insertexpenditure.php");
  145.  
  146. } // end if ($_REQUEST['do']=='add')
  147.  
  148. ?>
  149. <form action="addexpenditure.php?do=select" method="post" enctype="multipart/form-data" name="form1" id="form1">
  150. <fieldset>
  151. <legend class="">1. ป้อนหมายเลขอ้างอิงรายจ่าย ที่ต้องการเพิ่มรายการ: </legend>
  152. <table width="800" border="0" align="center">
  153. <tr>
  154. <td width="421" align="right">ป้อนหมายเลขอ้างอิงรายจ่าย ที่ต้องการเพิ่มรายการ</td>
  155. <td width="369"><?php
  156. /*echo "<select name='quoteno' size='1' id='docno' onchange='slectdocno(this.value);'>";
  157. echo"<option value='0'>เลือกเลขที่อ้างอิงรายจ่าย ที่ต้องการแก้ไข</option>";
  158.  
  159. $sql_expen = "SELECT * FROM tb_delivery ORDER BY deli_quote";
  160. $result_expen = mysql_query($sql_expen);
  161.  
  162. while ($row_expen = mysql_fetch_array($result_expen)) {
  163. echo "<option value='$row_expen[deli_quote]'";
  164.  
  165. echo">เลขที่อ้างอิง PV$row_expen[deli_quote]</option>";
  166. }
  167. echo "</select>";*/
  168.  
  169. echo "&nbsp;PV<input name='quoteno' id='quoteno' type='text' size='6' maxlength='6' />&nbsp;<input type='button' name='Submit' id='btonok' value='ค้นหา' onclick = 'slectdocno()'>";
  170. ?>
  171. </td>
  172. </tr>
  173. <tr>
  174. <td>&nbsp;</td>
  175. <td height="50">&nbsp;</td>
  176. </tr>
  177. </table>
  178. </fieldset>
  179. </form>
  180.  
  181. <?
  182.  
  183. if($_REQUEST['do']=='select'){
  184.  
  185. $quote_no = $_POST['quoteno'];
  186.  
  187. $sql_select = "SELECT * FROM tb_delivery WHERE deli_quote = '$quote_no' ";
  188. $resultselect=mysql_query($sql_select);
  189. if (mysql_num_rows($resultselect) == 0) {
  190. echo "<div class='boxmsg02'>";
  191. echo "<div class='txt02'>ไม่พบ หมายเลขอ้างอิงรายจ่าย \"PV$quote_no\" ที่ท่านป้อน กรุณาลองใหม่</div>";
  192. echo "</div>";
  193. exit();
  194. } //end if($resultdata)
  195.  
  196. $result_rows = mysql_fetch_row($resultselect);
  197.  
  198.  
  199.  
  200. $year_receipt = substr($result_rows[4],0,4);
  201. $month_receipt = substr($result_rows[4],5,2);
  202. $day_receipt = substr($result_rows[4],8,2);
  203. $Date_receipt = $day_receipt.'-'.$month_receipt.'-'.$year_receipt;
  204. //echo "Date_receipt is $Date_receipt <br />";
  205.  
  206. $year_paydate = substr($result_rows[5],0,4);
  207. $month_paydate = substr($result_rows[5],5,2);
  208. $day_paydate = substr($result_rows[5],8,2);
  209. $txtpaydate = $day_paydate.'-'.$month_paydate.'-'.$year_paydate;
  210.  
  211. $txtprice = number_format($result_rows[9],2);
  212.  
  213. /// find company delivery name and details
  214. $sql_companydeli = "SELECT * FROM tb_companydelivery WHERE delivery_id = '$result_rows[3]' ";
  215. $resultcompanydeli=mysql_query($sql_companydeli);
  216. $result_rowscompany = mysql_fetch_row($resultcompanydeli);
  217.  
  218. ?>
  219.  
  220. <form action="addexpenditure.php?do=add" method="post" enctype="multipart/form-data" name="form2" id="form2">
  221.  
  222. <!--<form action="receiptvou.php?do=add" method="post" enctype="multipart/form-data" name="form1" id="form1">-->
  223. <fieldset>
  224. <legend class="">1. เพิ่มข้อมูลรายการ(รายจ่าย):</legend>
  225. <table width="1600" border="1" align="center" class="admin tbExp">
  226. <tr>
  227. <td colspan="10" align="center"><strong>เพิ่ม รายการรายจ่าย</strong></td>
  228. </tr>
  229. <tr>
  230. <td width="264" align="right">&nbsp;</td>
  231. <td colspan="2" align="center">&nbsp;</td>
  232. <td width="54" align="center">&nbsp;</td>
  233. <td width="53" align="center">&nbsp;</td>
  234. <td colspan="3" align="center">&nbsp;</td>
  235. <td align="center">&nbsp;</td>
  236. <td align="center">&nbsp;</td>
  237. </tr>
  238. <tr>
  239. <td align="right">เลขที่อ้างอิง
  240. <input name="txtquote" type="text" disabled id="txtquote" value="<?php echo "PV$result_rows[1]"; ?>" size="20" maxlength="200" /> &nbsp;</td>
  241. <td colspan="2" align="right">วันที่รับรายการ</td>
  242. <td colspan="7" align="left">&nbsp;<input name='receiptdate' type='text' disabled id ='receiptdate' value='<?php echo "$Date_receipt";?>' size='10' > <img src='jquerydatetime/calendar/calendar.gif' /> </td>
  243. <?php
  244. echo "<input name='txtdeli_docid' type='hidden' value='$result_rows[0]'>";
  245. echo "<input name='txtdeli_quote' type='hidden' value='$result_rows[1]'>";
  246. //echo "docid is $result_rows[0] <br />";
  247. //echo "quoteid is $result_rows[1] <br />";
  248.  
  249. ?>
  250.  
  251. </tr>
  252. <tr>
  253. <td align="right">เลขที่เอกสาร
  254. <input name="txtdocumentno" type="text" disabled id="txtdocumentno" value="<?php echo "$result_rows[2]"; ?>" size="20" maxlength="200" /></td>
  255. <td colspan="2" align="right">วันครบกำหนดชำระ</td>
  256. <td colspan="7" align="left">&nbsp;<input name='duedate' type='text' disabled id ='duedate' value='<?php echo "$txtpaydate";?>' size='10' >
  257. <img src='jquerydatetime/calendar/calendar.gif' /></td>
  258. </tr>
  259. <tr>
  260. <td align="right">ชื่อบริษัทที่มาส่ง
  261. <?php
  262. echo "<select name='companydelivery' disabled size='1' id='' onchange='check(this.value);'>";
  263. echo"<option value='0'>เลือกบริษัทที่มาส่งของ</option>";
  264.  
  265. $sql_rest = "SELECT * FROM tb_companydelivery ORDER BY delivery_id";
  266. $result_rest = mysql_query($sql_rest);
  267.  
  268. while ($row_rest = mysql_fetch_array($result_rest)) {
  269. if ($row_rest[delivery_id]==$result_rows[3]){
  270. echo "<option value='$row_rest[delivery_id]' selected";
  271. echo ">$row_rest[delivery_name]</option>";
  272. }else{
  273. echo "<option value='$row_rest[delivery_id]'";
  274. echo ">$row_rest[delivery_name]</option>";
  275. } // end if
  276. }// end while
  277. echo "</select>";
  278. ?> &nbsp; </td>
  279.  
  280. <td colspan="2" align="right">เงื่อนไขการชำระ</td>
  281. <td colspan="7" align="left">&nbsp;<input name="txtcondition" type="text" disabled id="" value="<?php echo "$result_rows[7]"; ?>" size="20" maxlength="100" /></td>
  282. </tr>
  283. <tr>
  284. <td align="right">จำนวนเงิน
  285. <input name="txttotalprice" type="text" disabled id="txttotalprice" value="<?php echo "$txtprice"; ?>" size="20" maxlength="200" /> &nbsp;</td>
  286. <td colspan="2" align="right">หมายเหตุ</td>
  287. <td colspan="7" align="left">&nbsp;<textarea name="txtremark" cols="20" rows="3" disabled id=""><?php echo "$result_rows[8]"; ?></textarea>
  288. <!--<select name="selpaystatus" id="" onchange='check(this.value);'>
  289. <option value="0">เลือกสถานะการชำระเงิน</option>
  290. <?php
  291. /*if ($result_rows[8] == '1'){
  292. echo "<option value='1' selected>ชำระเงินแล้ว</option>";
  293. echo "<option value='2'>ยังไม่ชำระเงิน</option>";
  294. }else if ($result_rows[8] == '2'){
  295. echo "<option value='1'>ชำระเงินแล้ว</option>";
  296. echo "<option value='2' selected>ยังไม่ชำระเงิน</option>";
  297. }*/
  298. ?>
  299. </select>--> </td>
  300. </tr>
  301. <tr>
  302. <td align="right">ผู้รับรายการ
  303. <input name="txtreceiptby" type="text" disabled id="txtreceiptby" value="<?php echo "$result_rows[6]"; ?>" size="20" maxlength="100" /></td>
  304. <td colspan="2" align="left">&nbsp;</td>
  305. <td align="right">&nbsp;</td>
  306. <td align="right">&nbsp;</td>
  307. <td colspan="3" align="right">&nbsp;</td>
  308. <td width='199'>&nbsp;</td>
  309. <td width='198'>&nbsp;</td>
  310.  
  311.  
  312. </tr>
  313. <!--<tr>
  314. <td align="right">นามผู้ซื้อ</td>
  315. <td colspan="6"><input name="txtreceiptfrom" type="text" id="txtreceiptfrom" size="50" maxlength="200" /> <span class="txtredcolor">*</span></td>
  316. </tr>
  317. <tr>
  318. <td align="right">เพื่อรับชำระ</td>
  319. <td colspan="3"><input name="txtreceiptfor" type="text" id="txtreceiptfor" size="50" maxlength="200" /></td>
  320. </tr>-->
  321. <tr>
  322. <td colspan="10">&nbsp;</td>
  323. </tr>
  324.  
  325.  
  326. <tr>
  327. <td colspan="2" align="center">รหัสสินค้า::รายการ</td>
  328. <td width="383" align="center">รายการ</td>
  329. <td align="center">จำนวน</td>
  330. <td align="center">หน่วย</td>
  331. <td width="70" align="center">ค่าของ<br>
  332. หน่วยละ</td>
  333. <td width="63" align="center">ค่าแรง<br>
  334. หน่วยละ</td>
  335. <td width="128" align="center">รวมเป็นเงิน</td>
  336. <td > โปรเจค/งานหลัก</td>
  337. <td align="center" >วันที่ลงหน้างาน<br>
  338. (วันที่/เดือน/ปีพ.ศ.)<br>
  339. ตย. 25032558</td>
  340. </tr>
  341. <?php
  342. ///
  343. $sql_delidetail = "SELECT * FROM tb_deliverydetails WHERE deli_quote = '$result_rows[1]' ORDER BY deli_deno ";
  344. $resultdelidetail=mysql_query($sql_delidetail);
  345.  
  346. $grand_total = 0;
  347. $no=0;
  348. while ($rows_array = mysql_fetch_array($resultdelidetail))
  349. {
  350. $sum_total = 0;
  351. //$grand_total += $rows_array[deli_detotal];
  352. //echo "<input name='txtdeli_deno[]' type='hidden' value='$rows_array[deli_deno]'>";
  353. /*
  354. joe joe
  355. */
  356. // find project from tb_project
  357. if ($rows_array[deli_deproject] != "0"){
  358. $sql_project = "SELECT * FROM tb_project WHERE pro_no = '$rows_array[deli_deproject]' ";
  359. $result_project=mysql_query($sql_project);
  360. $result_rowsproject = mysql_fetch_row($result_project);
  361. $projectname = $result_rowsproject[1];
  362. }else {
  363. $projectname = "ยังไม่ได้ระบุไซต์งาน";
  364. }
  365.  
  366. // find Realmainjob from tb_realmainjob
  367. if ($rows_array[deli_demainjob] != "0"){
  368. $sql_realmain = "SELECT * FROM tb_realmainjob WHERE realmain_no = '$rows_array[deli_demainjob]' ";
  369. $result_realmanin=mysql_query($sql_realmain);
  370. $result_rowsrealmain = mysql_fetch_row($result_realmanin);
  371. $realmainname = $result_rowsrealmain[1];
  372. }else {
  373. $realmainname = "ยังไม่ได้ระบุงานหลัก";
  374. }
  375.  
  376. $price = number_format($rows_array[deli_detotal],2);
  377. $no += 1;
  378.  
  379. ?>
  380. <tr>
  381. <td colspan="2" align="center">
  382. <?php
  383.  
  384. $sql_rest = "SELECT * FROM tb_subjobcode WHERE scode_id = '$rows_array[deli_decode]' ORDER BY scode_id";
  385. $result_rest = mysql_query($sql_rest);
  386. $row_rest = mysql_fetch_array($result_rest) ;
  387. //$good_price = number_format($row_rest[scode_goods],2);
  388. //$good_wage = number_format($row_rest[scode_wage],2);
  389.  
  390. $quantity=$rows_array[deli_dequan];
  391. $deli_goodsprice = $rows_array[deli_goodsprice];
  392. $deli_wageprice = $rows_array[deli_wageprice];
  393. $sum_total = ($quantity*$deli_goodsprice) + ($quantity*$deli_wageprice);
  394. $grand_total += $sum_total;
  395. $sum_total = number_format($sum_total,2);
  396.  
  397. $year_site = substr($rows_array[deli_date],0,4);
  398. if($year_site != "0000"){
  399. $month_site = substr($rows_array[deli_date],5,2);
  400. $day_site = substr($rows_array[deli_date],8,2);
  401. $year_site = $year_site + 543;
  402. $datesite = $day_site.'-'.$month_site.'-'.$year_site;
  403. }else{
  404. $datesite = "00".'-'."00".'-'."0000";
  405. }
  406.  
  407. ?>
  408. <input name="txtscodeid" disabled id="txtscodeid" type="text" size="5" maxlength="5" value="<?php echo "$row_rest[scode_id]" ?>" />
  409. </td>
  410. <td><input name="txtscodedetails" disabled id="txtscodedetails" type="text" size="50" maxlength="100" value="<?php echo "$row_rest[scode_details]" ?>" /></td>
  411. <td align="center"><input name="txtquant[]" disabled id="" type="text" size="5" maxlength="100" class="input_right" value="<?php echo "$rows_array[deli_dequan]" ?>" /></td>
  412. <td align="center"><input name="txtunit[]" disabled id="" type="text" size="3" class="input_right" maxlength="100" value="<?php echo "$rows_array[deli_unit]" ?>" /></td>
  413. <td align="center"><input name="txtgoods_price[]" disabled id="" type="text" size="7" class="input_right" maxlength="100" value="<?php echo "$deli_goodsprice" ?>" /></td>
  414. <td align="center"><input name="txtgoods_wage[]" disabled id="" type="text" size="7" class="input_right" maxlength="100" value="<?php echo "$deli_wageprice" ?>" /></td>
  415. <td align="center"><input name="txtsumtotal" disabled id="" type="text" size="10" class="input_rightbold" maxlength="100" value="<?php echo "$sum_total" ?>" /></td>
  416.  
  417. <td style="width:70px;">
  418. <select name="project[]" disabled class="project" >
  419. <option value="0" >-- เลือกโปรเจค --</option>
  420. <?php
  421. //include "ConnectionDb.php";
  422. $sql_select = "SELECT * FROM tb_project WHERE pro_status = '' ORDER BY pro_no ";
  423. $dbs=mysql_query($sql_select);/**/
  424.  
  425. while($db = mysql_fetch_row($dbs)) {
  426. if($db[0] == $rows_array[deli_deproject]){
  427. $joe = $rows_array[deli_deproject];
  428. //echo "<input name='txtdeli_deproject[]' type='hidden' value='$rows_array[deli_deproject]'>";
  429. echo "<option value=$db[0] selected>$db[1]</option>";
  430.  
  431. }else{
  432. echo "<option value=$db[0]>$db[1]</option>";
  433. }//end if
  434.  
  435.  
  436. }// end while
  437. ?>
  438. </select>
  439. &nbsp;&nbsp;
  440.  
  441. <select name="mainjob[]" disabled class="mainjob">
  442. <option value="0">-- เลือกงานหลัก --</option>
  443. <?php
  444. //include "ConnectionDb.php";
  445. $sql_realmain = "SELECT * FROM tb_realmainjob WHERE pro_no = $rows_array[deli_deproject] ORDER BY realmain_no ";
  446. $query_realmain=mysql_query($sql_realmain);/**/
  447.  
  448. while($row_realmain = mysql_fetch_row($query_realmain)) {
  449. if($row_realmain[0] == $rows_array[deli_demainjob]){
  450. //echo "<input name='txtdeli_demainjob[]' type='hidden' value='$rows_array[deli_demainjob]'>";
  451. echo "<option value=$row_realmain[0] selected>$row_realmain[1]</option>";
  452. }else{
  453. echo "<option value=$row_realmain[0]>$row_realmain[1]</option>";
  454. }//end if
  455.  
  456.  
  457.  
  458. }// end while
  459. ?>
  460. </select> </td>
  461. <td align="center" style="width:70px;"><input name="txtdate" disabled id="" type="text" size="7" maxlength="100" value="<?php echo "$datesite" ?>" /></td>
  462. </tr>
  463. <?php
  464. } // end while
  465. //$grand_total = number_format($grand_total,2);
  466. ?>
  467. <?php
  468. for($i=0;$i<10;$i++){
  469. $id = $i+1;
  470. echo "<tr>";
  471.  
  472. echo "<td td colspan='2'>
  473. <select name='subjobcode[]' size='1' id='subjobcode$id' onchange='check(this.value);'>
  474. <option value='0'>เลือกรายการสินค้า</option>";
  475.  
  476. $sql_rest = 'SELECT * FROM tb_subjobcode ORDER BY scode_id';
  477. $result_rest = mysql_query($sql_rest);
  478.  
  479. while ($row_rest = mysql_fetch_array($result_rest)) {
  480. //$good_price = number_format($row_rest[scode_goods],2);
  481. //$good_wage = number_format($row_rest[scode_wage],2);
  482. echo "<option value='$row_rest[scode_id]'>$row_rest[scode_id]:$row_rest[scode_details]</option>";
  483. }
  484. echo "</select>
  485. <br />
  486. <label class='txt01'>ใส่รหัสสินค้าใหม่:</label> <input name='txtcode[]' type='text' id='txtcode$id' size='40' maxlength='100' style='width:80px;' onselectstart='return false' onpaste='return false;' oncopy='return false' oncut='return false' ondrag='return false' ondrop='return false' autocomplete=off onKeyUp=\"check_id(form1.txtcode$id.value,'check_codeid')\" /></td>";
  487. echo "<td><input name='txtdetails[]' type='text' id='txtdetails1' size='60' maxlength='200' style='width:400px;' /></td>";
  488. echo "<td style='width:50px;' align='center'><input name='txtquant[]' type='text' id='txtquant$id' size='30' maxlength='100' style='width:50px;' /></td>";
  489.  
  490. echo "<td style='width:50px;' align='center'><input name='txtunit[]' type='text' id='txtunit1' size='30' maxlength='100' style='width:50px;' /></td>";
  491.  
  492. echo "<td align='center'><input name='txtgoods_price[]' type='text' id='txtgoods_price1' size='30' maxlength='100' style='width:70px;' /></td>";
  493. echo "<td align='center'><span style='width:250px;'>
  494. <input name='txtgoods_wage[]' type='text' id='txtgoods_wage1' size='30' maxlength='100' style='width:70px;' />
  495. </span></td>";
  496.  
  497. echo "<td align='center'>
  498. <input name='txtgrandtotal' type='text' id='txtgrandtotal' size='10' maxlength='100' />
  499. </td>";
  500.  
  501. echo "<td style='width:200px;' id='mySelect'>
  502. <select name='project[]' class='project' >
  503. <option value='0' >-- เลือกโปรเจค --</option>";
  504.  
  505. $sql_select = "SELECT * FROM tb_project WHERE pro_status = '' AND pro_office != '2' ORDER BY pro_no";
  506. $dbs=mysql_query($sql_select);
  507.  
  508. while($db = mysql_fetch_row($dbs)) {
  509. echo "<option value=$db[0]>$db[1]</option>";
  510. }
  511.  
  512. echo "</select>";
  513. echo "&nbsp;&nbsp;";
  514.  
  515. echo "<select name='mainjob[]' class='mainjob'>
  516. <option value='0'>-- เลือกงานหลัก --</option>
  517. </select>
  518. </td>";
  519. ?>
  520. <td align="center">
  521. <input name='site_date[]' type='text' id='site_date' size='10' maxlength='8' placeholder="ววดดปปปป" onkeypress="return isNumberKey(event)" />
  522. </td>
  523. <?php
  524. echo "</tr>";
  525. }/**/ //end for
  526. ?>
  527. <tr>
  528. <td colspan="2">&nbsp;</td>
  529. <td style="width:50px;">&nbsp;</td>
  530. <td>&nbsp;</td>
  531. <td style="width:50px;">&nbsp;</td>
  532. <td style="width:50px;">&nbsp;</td>
  533. <td style="width:50px;">&nbsp;</td>
  534. <td style="width:70px;">&nbsp;</td>
  535. <td style="width:200px;">&nbsp;</td>
  536. <td style="width:200px;">&nbsp;</td>
  537. </tr>
  538. <!--<tr>
  539. <td colspan="4"><div align="center"><input type="button" name="Submit" id="btonok" value="เพิ่มรายการรายรับ" onclick = "checkvalue()">
  540. <input type="reset" name="btcancel" id="btcancel" value="ยกเลิก"></div></td>
  541. </tr>-->
  542. </table>
  543. <div align="center">
  544. <input type="button" name="Submit" id="btonok" value="เพิ่มรายการรายจ่าย" onclick = "checkvalue()">
  545.  
  546. <input type="reset" name="btcancel" id="btcancel" value="ยกเลิก"></div>
  547.  
  548.  
  549. </fieldset>
  550.  
  551. </form>
  552. <p>&nbsp;</p>
  553. <p>&nbsp;</p>
  554. <p>&nbsp;</p>
  555. <?php
  556.  
  557. } // end if ($_REQUEST['do']=='select')
  558.  
  559. }else{ // else if ($sess_status == "true")
  560. echo "กรุุณา log in เข้าระบบก่อน <br />";
  561. echo "<meta http-equiv='refresh' content='4;url=index.php'>" ;
  562. //exit();
  563. }
  564. ?>
  565.  
  566. <!-- end class="center_member_form" -->
  567. <div class="clear"></div>
  568. <?php //include "footer.php"; ?>
  569.  
  570. <!-- end class="center_content" -->
  571. </body>
  572. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement