Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 17-05-2007, 03:09 PM
New kid on the block
 
Join Date: May 2007
Location: perak
Posts: 4
Rep Power: 0
nemia84 is on a distinguished road
how to retrieve data then computed them?

sy ade problem macamana nak letak function nak ambil date yg dah simpan dlm database,then nak compute date tu(subtract),function kat bawah ni boleh kira bil hari,tp sy nak letak lagi satu function supaya pengiraan hari boleh tolak dengan date yang dah simpan dlm database...

harap sesape boleh bantu...plz..sy newbie





<?

if ($submit == 'Compute') {
if ($compute == 'add') {
$day = $day + $days;
}
$echo = date($output, mktime (0,0,0,$month,$day,$year)); //This is the computed date
}

echo "
<form method=post>
<table border=0 cellspacing=1 cellpadding=2 bgcolor=blue width=300>
<tr>
<td bgcolor=blue><font color=white face=arial><B>Kira Hari Lulus Piagam";
if (!empty($echo)) {echo " - Tamat Piagam: $echo";} echo "</B></font></td>
</tr>
<tr>
<td bgcolor=white>
<table border=0 cellpadding=3 cellspacing=0>
<tr>
<td aligin=left><font color=blue face=arial>Pilih Tarikh Mula: </font></td><td aligin=left><select name=month>";

getoption(1, 31, date("d"));
echo "</select><select name=year>";
getoption(1, 12, date("m"));
echo "</select><select name=day>";
getoption(1970, 2020, date("Y"));
echo "</select></td>
</tr>
<tr>
<td aligin=left><font color=blue face=arial>Tempoh Piagam: </font><td aligin=left>
<input type=text name=days size=8 maxlength=8><font color=blue face=arial> hari</font></td>
</tr>
<tr>
<td aligin=left><font color=blue face=arial>Format Tarikh: </font></td><td aligin=left><select name=output><option value=\"d-m-Y\">hari-bulan-tahun<option value=\"l, d M Y\">hari, hari bulan tahun</select></td>
</tr>

<tr>
<td aligin=left colspan=2><input type=submit name=submit value=Compute></td>
</tr>
</table>


</td></tr></table></form>";





function getoption($start, $end, $if) {
for ($i=$start;$i<=$end;$i++) {
echo "<option value=$i"; if ($i == $if) { echo " selected";} echo ">$i";
}
}

?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
what different between bandwidth and data transfer? dongdong Paid Hosting Discussion Forum 10 30-03-2006 06:08 PM
sorting data gundam_seat Website Programming 2 06-08-2005 10:16 AM
Multiple data koisempoi Website Programming 5 06-12-2004 10:51 AM
display data,camne??? adib Website Programming 14 21-08-2004 10:27 AM
insert multiple data vash Website Programming 4 28-04-2004 02:48 PM


All times are GMT +8. The time now is 08:20 AM. 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.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61