Selasa, 08 Oktober 2013

PHP Indonesia - Facebook: [ASK] para master PHP mohon bantuannya lagi nih, a...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
How to Get into Medical School

A tested blueprint to approach the daunting admissions process with both confidence and success! Enroll in this online course for just $29.
From our sponsors
[ASK] para master PHP mohon bantuannya lagi nih, a...
Oct 8th 2013, 09:28, by Agus Mardi Samekto

Agus Mardi Samekto 9:28am Oct 8
[ASK]
para master PHP mohon bantuannya lagi nih, ane dapet source code untuk buat kalendar php.
Kalendar sih udah bisa muncul, tapi ketika ane tambahin script untuk previous dan next tidak running. Berikut source codenya

<html>
<head>
<script>
function goLastMonth(month, year)
{
if(month == 1)
{
--year;
month = 12;
}
document.location.href="<?php $_SERVER['PHP_SELF'];?>?month="+month"&year="+year";
}

function goNextMonth(month, year)
{
if(month == 12)
{
++year;
month = 1;
}
document.location.href="<?php $_SERVER['PHP_SELF'];?>?month="+month"&year="+year";
}
</script>
</head>
<body>
<?php

if(isset($_GET['day']))
{
$day = $_GET['day'];
}
else
{
$day = date("j");
}

if(isset($_GET['month']))
{
$month = $_GET['month'];
}
else
{
$month = date("n");
}

if(isset($_GET['year']))
{

}
else
{
$year = date("Y");
}


//This code store day, month, and year variable in timeStamp
$currentTimeStamp = strtotime("$year-$month-$day");

//Get current month name
$monthName = date("F", $currentTimeStamp);

//Get how many days are there in current Month
$numDays = date("t", $currentTimeStamp);

//We need to set variable to count cell in the loop later
$counter = 0;

?>
<table border=1>
<tr>
<td><input style='width:50px;' type='button' value='<' name='previousbutton' onclick="goLastMonth(<?php echo $month.", ".$year?>)"></td>
<td colspan=5 align=center><?php echo $monthName.", ".$year; ?></td>
<td><input style='width:50px;' type='button' value='>' name='nextbutton' onclick="goNextMonth(<?php echo $month.", ".$year?>)"></td>
</tr>
</tr>
<td align=center width=200><b>Sun</b></td>
<td align=center width=200><b>Mon</b></td>
<td align=center width=200><b>Tue</b></td>
<td align=center width=200><b>Wed</b></td>
<td align=center width=200><b>Thu</b></td>
<td align=center width=200><b>Fri</b></td>
<td align=center width=200><b>Sat</b></td>
</tr>
<?php

echo"<tr>";
for($i = 1; $i < $numDays+1; $i++, $counter++)
{
$timeStamp = strtotime("$year-$month-$i");
if($i == 1)
{
$firstDay = date("w", $timeStamp);

for($j = 0; $j < $firstDay; $j++, $counter++)
{
//Blank Space
echo"<td></td>";
}
}

if($counter % 7 == 0)
{
echo"</tr><tr>";
}

echo"<td height=150 valign=top>".$i."</td>";

}
echo"</tr>";

?>
</table>
</body>
</html>

buttonya tidak bisa berfungsi untuk menampilkan previous dan next month.

mohon di bantunya para master

Cahya Dsn 9:46am Oct 8
ini maksudnya apa ya?

if(isset($_GET['year']))
{

}
else
{
$year = date("Y");
}

maklum ane nubi blm ngarti yg ginian..

trus kalo klik next/previous maka bulan nggak nambah/kurang ya?
semacam:

function goLastMonth(month, year)
{
if(month == 1)
{
--year;
month = 12;
}
document.location.href="<?php $_SERVER['PHP_SELF'];?>?month="+month"&year="+year";
}

//.. kalo monthnya tidak sama dengan 1 .. maka gak akan berubah..gitu ya?

Cahya Dsn 10:07am Oct 8
http://paste.laravel.com/XhD mungkin bisa ^_^V

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar