|
|||
help me..data tak boleh display
hi sume..saya ada mslh mengenai data x boleh display kat interface sistem..tp dalam database data tersebut dah masuk..n then data tersebut hanya boleh display kat page lain bukan page yg spatutnye..query untuk page ni adalah gabungan 3 table..so,apa yg saya perlu buat atau ubah?
coding interface <? include("odbc.php"); include("banner.php"); include("homestaff.php"); ?> <html> <head> <script language="JavaScript" src="calendar.js"></script> <title>borrow file record</title> </head> <body> <br> <table width="100%" cellpadding="2" cellspacing="0" border="0" bordercolor="#000000" align="center"> <tr> <td align="right"> <a href="staff.php"><strong>Sign Up</strong></a> </td> </tr> <tr align="center"> <td height="400" valign="top"> <form method="POST" name="form" action="borrowprocess.php"> <br><table align="center" bgcolor="#FF9966"> <tr> <td width="104" height="36"><strong>Borrow Date :</strong></td> <td width="183"><input type="text" name="borrowdate"> <a href="javascript:show_calendar('form.borrowdate'); " onMouseOver="window.status='borrowdate';return true;" onMouseOut="window.status='';return true;"><img src="images/b_calendar.png" width=16 height=16 border=0 align="middle"></a></td> </tr> <tr> <td height="29"><strong>Staff No :</strong></td> <td><select name="staffno"> <option value="">Please Select Staff No</option> <? $sqlst = mysql_query("SELECT * FROM staff"); while($staf = mysql_fetch_array($sqlst)) { ?> <option value="<? echo $staf['staff_id'] ?>"<?php if($code['staff_id'] == $code1) echo ' selected="selected"'; ?>><? echo $staf['staffno'];?> </option> <? } ?> </select> <a href="staffrecord.php?staff_id=<? echo $result['staff_id'];?><? echo $result['staff_name'];?>');">[details] </a> </tr> <tr> <td><strong>File Name:</strong></td> <td><select name="file"> <option value="">Select File</option> <? $sqlst = mysql_query("SELECT * FROM item"); while($code = mysql_fetch_array($sqlst)) { ?> <option value="<? echo $code['item_id'] ?>"<?php if($code['item_id'] == $code1) echo ' selected="selected"'; ?>><? echo $code['item_name'];?> </option> <? } ?> </select></td> </tr> <tr> <td><strong>Return Date :</strong></td> <td><input type="text" name="returndate"> <a href="javascript:show_calendar('form.returndate'); " onMouseOver="window.status='returndate';return true;" onMouseOut="window.status='';return true;"><img src="images/b_calendar.png" width=16 height=16 border=0 align="middle"></a></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" name="hantar" value="ADD"> <input type="reset" name="padam" value="CANCEL"></td></tr> </table> </form> <table align="center" border="1" bordercolor="#000000" width="100%"> <tr bgcolor="#FF5C0F"> <td colspan="7" align="center"><strong>BORROW FILE RECORD</strong></td> </tr> <tr> <td width="7%" align="center"><strong>No</strong></td> <td width="13%" align="center"><strong>Borrow Date </strong></td> <td width="13%" align="center"><strong>Staff No</strong></td> <td width="18%" align="center"><strong>File Name </strong></td> <td width="12%" align="center"><strong>Return Date </strong></td> <td width="20%" align="center"><strong>Action</strong></td> </tr> <? $i=1; $sqlstmt =mysql_query("SELECT item.*, borrow.*, staff.* FROM staff RIGHT JOIN (item RIGHT JOIN borrow ON item.item_id=borrow.item_id) ON staff.staff_id=borrow.item_id"); while($result = mysql_fetch_array($sqlstmt)) ?> <tr> <td height="31"><? echo $i;?> </td> <td><? echo date('d-m-Y',strtotime($result['borrowdate']));?> </td> <td><? echo $result['staffno'];?> </td> <td><? echo $result['item_name'];?> </td> <td><? echo date('d-m-Y',strtotime($result['returndate']));?> </td> <td align="center"><p><a href="deleteborrow.php?borrow_id=<? echo $result['borrow_id'];?>" onClick="return confirm('Are You Sure To Delete? \n <? echo $result['staffno'];?>');"><img src="images/butdel.jpg" border="0"></a> <a href="editborrow.php?borrow_id=<? echo $result['borrow_id'];?>" onClick="return confirm('Are You Sure To Edit? \n <? echo $result['staffno'];?>');"><img src="images/butedit.jpg" border="0"></a> </p> </td> </tr> </table> </td> </tr> <tr> <td> </td> </tr> </table> </body> </html> process <?php include("odbc.php"); echo $borrow=$_POST['borrowdate']; echo $borrow = substr($borrow,6,4)."_".substr($borrow,3,2)."_".su bstr($borrow,0,2); echo $staff = $_POST['staffno']; echo $file= $_POST['file']; echo $return = $_POST['returndate']; echo $return = substr($return,6,4)."_".substr($return,3,2)."_".su bstr($return,0,2); $query_add_data = "INSERT INTO borrow(borrowdate,staff_id,item_id,returndate) VALUES ('$borrow','$staff','$file','$return')"; $result = mysql_query($query_add_data); echo "<META HTTP-EQUIV=Refresh CONTENT=\"3; URL=borrowrecord.php\">"; ?> |
|
|||
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Best Ads to Display? | azoundria | Revenue and Monetization | 7 | 11-06-2007 08:10 PM |
| display php code in wordpress | mdpai | Blogging Discussion | 3 | 22-02-2007 12:55 AM |
| display data,camne??? | adib | Website Programming | 14 | 21-08-2004 10:27 AM |
| display value listbox | nov8998 | Website Programming | 1 | 25-06-2004 02:21 PM |
| Display contents | mysticmind | Website Design | 3 | 04-05-2003 08:55 PM |
All times are GMT +8. The time now is 07:08 PM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.









Tip: It is a good practice to put comments for a certain block of coding statements/SQL queries. Coding documentation is very important. If not, future maintenance will be a very painful nightmare.


Linear Mode

