Artha

Aplikasi Penentuan Tanggal Selesai Pekerjaan (versi php)

Posted on: April 13, 2011

versi PHP


<?php 
$now = getdate();
$tgl_format = $now['mday'].'-'.$now['mon'].'-'.$now['year'];
?>

<form name="frmmain" method="post">
Waktu Pengerjaan proyek (hari) : <input type="text" name="txtWaktu" value="">
<br>
Tanggal Awal Mulai Proyek : <input type="text" name="txtTgl" value="<?php echo $tgl_format?>">
<input type="submit" name="btnSubmit" value = "Tampilkan Waktu Penyelesaian">
</form>


<?php 
if ($_POST['txtWaktu'] != "" && $_POST['txtTgl'] != "" )
{
	$waktu = $_POST['txtWaktu'];
	$tgl = $_POST ['txtTgl'];
	$es = 1;
	$hasil = 0;
	$endindex = $waktu * 3;
	//$now = getdate();
	//$tgl_format = $now['mday'].'-'.$now['mon'].'-'.$now['year'];
	$now2 = date($tgl);
		for ($i=0;$i<$endindex;$i++)
		{
		$date1 = strtotime($now2);
		$result = date('j-n-Y', strtotime('+'.$i.' days', $date1));
		$arrdate = explode("-", $result);
		$hari[0] = date(D, mktime(0,0,0,$arrdate[1],$arrdate[0],$arrdate[2]));
		$hari[1] = date("D, j F Y", mktime(0,0,0,$arrdate[1],$arrdate[0],$arrdate[2]));
			if ($hari[0] != 'Sat' && $hari[0] != 'Sun')
				{
				 if ($es == $waktu)
					{
					echo "Tanggal Selesai Proyek adalah"."&nbsp;&nbsp;&nbsp;<strong>".$hari[1]."</strong>";
					break;
					}
				$es++;
				}
		}

}
else
	{
	echo "<strong>"."jumlah hari/tanggal mulai proyek belum dimasukkan  belum dimasukkan"."</strong>";
	}

?>

untuk melihat hasil dari kode diatas klik disini

1 Response to "Aplikasi Penentuan Tanggal Selesai Pekerjaan (versi php)"

[…] Artha Since 1986 Belajar tidak mengenal waktu , tempat dan usia HomeAbout RSS ← Cek Ke-EXIST-an Index array Yang Ditukar Aplikasi Penentuan Tanggal Selesai Pekerjaan (versi php) → […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: