I think Google should be like a Swiss Army knife: clean, simple, the tool you want to take everywhere. — Marissa Mayer

Pages: 1 [2] 3

Author Topic: hi sir,  (Read 350 times)

silverkortex1985

  • Regular
  • **
  • Offline Offline
  • Posts: 74
    • View Profile
Re: hi sir,
« Reply #15 on: November 10, 2009, 03:11:32 PM »
finaly thank you.
Logged

Jayhson

  • Global Moderator
  • Internet Junkie
  • *****
  • Offline Offline
  • Posts: 1169
    • View Profile
    • WWW
Re: hi sir,
« Reply #16 on: November 10, 2009, 03:22:27 PM »
ala kasi atang value ung adjust.... post it here kung pano mo sya na solve para maka tulong sa iba naman
Logged
PHP Developer

silverkortex1985

  • Regular
  • **
  • Offline Offline
  • Posts: 74
    • View Profile
Re: hi sir,
« Reply #17 on: November 10, 2009, 03:26:56 PM »
sir hindi pa na sosolve. nasabe ko lang finally kasi nag reply na kayo :)

I am still finding some other way.

i hope someone can help me.
Logged

Jayhson

  • Global Moderator
  • Internet Junkie
  • *****
  • Offline Offline
  • Posts: 1169
    • View Profile
    • WWW
Re: hi sir,
« Reply #18 on: November 10, 2009, 03:37:27 PM »
kala ko kasi ok na post mo code mo dito yung may adjust date
Logged
PHP Developer

silverkortex1985

  • Regular
  • **
  • Offline Offline
  • Posts: 74
    • View Profile
Re: hi sir,
« Reply #19 on: November 10, 2009, 03:55:07 PM »
ok na working na sir.

ung server ko pala ang may problem.
so i change into xampp. :( and now its working properly...

<?php
   require_once('auth.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My Profile</title>
<link href="loginmodule.css" rel="stylesheet" type="text/css" />
<link href="include/home.css" rel="stylesheet" type="text/css" />
</head>
<body >
<table id="body" align="center">
<tr>
   <td>
<h1>My Profile </h1>
<a href="member-index.php">Home</a> | <a href="logout.php">Logout</a>
<p>This is another secure page. </p>

<table style="margin: auto">

<tr>

<?php
$madj=$_GET['madj'];
if(isset($prm) and $prm > 0){
$m=$prm+$chm;}else{
$m= date("m")+$madj;
}

$d= date("d");     // Finds today's date
$y= date("Y");     // Finds today's year

$no_of_days = date('t',mktime(0,0,0,$m,1,$y)); // This is to calculate number of days in a month

$mn=date('M',mktime(0,0,0,$m,1,$y)); // Month is calculated to display at the top of the calendar

$yn=date('Y',mktime(0,0,0,$m,1,$y)); // Year is calculated to display at the top of the calendar

$j= date('w',mktime(0,0,0,$m,1,$y)); // This will calculate the week day of the first day of the month

for($k=1; $k<=$j; $k++){ // Adjustment of date starting
$adj .="<td>&nbsp;</td>";
}

/// Starting of top line showing name of the days of the week

echo " <table border='1' bordercolor='#FFFF00' cellspacing='0' cellpadding='0' align=left>

<tr><td>";

echo "<table cellspacing='0' cellpadding='0' align=center width='350' height='300' border='0'><td align=center bgcolor='#ffff00'><font size='3' face='Tahoma'> <a href='".$_SERVER['PHP_SELF']."?madj=".($madj-1)."'><<</a> </td><td colspan=5 align=center bgcolor='#ffff00'><font size='5px' face='Tahoma'>$mn $yn </td><td align=center bgcolor='#ffff00'><font size='4' face='Tahoma'> <a href='".$_SERVER['PHP_SELF']."?madj=".($madj+1)."'>>></a> </td></tr><tr>";

echo "<td><font size='3' face='Tahoma'><b>Sun</b></font></td><td><font size='3' face='Tahoma'><b>Mon</b></font></td><td><font size='3' face='Tahoma'><b>Tue</b></font></td><td><font size='3' face='Tahoma'><b>Wed</b></font></td><td><font size='3' face='Tahoma'><b>Thu</b></font></td><td><font size='3' face='Tahoma'><b>Fri</b></font></td><td><font size='3' face='Tahoma'><b>Sat</b></font></td></tr><tr>";

////// End of the top line showing name of the days of the week//////////

//////// Starting of the days//////////
for($i=1;$i<=$no_of_days;$i++){
echo $adj ."<td valign=top><font size='3' face='Tahoma'><a href='".$_SERVER['PHP_SELF']."?$y-$m-$i'>$i</a><br>"; // This will display the date inside the calendar cell
echo " </font></td>";
$adj='';
$j ++;
if($j==7){echo "</tr><tr>";
$j=0;}

}
echo "<tr><td colspan=7 align=center></td></tr>";
echo "</tr></table></td></tr></table>";


?>
<div id="wrap">
6:00 to 6:30 <br />
6:30 to 7:00 <br />
7:00 to 7:30 <br />
7:30 to 8:00 <br />
8:00 to 8:30 <br />
8:30 to 9:00 <br />
9:00 to 9:30 <br />
9:30 to 10:00 <br />
10:00 to 10:30 <br />
10:30 to 11:00 <br />
11:00 to 11:30 <br />
11:30 to 12:00 <br />
12:00 to 12:30 <br />
12:30 to 13:00 <br />
13:00 to 13:30 <br />
13:30 to 14:00 <br />
14:00 to 14:30 <br />
14:30 to 15:00 <br />
15:00 to 15:30 <br />
15:30 to 16:30 <br />
16:30 to 17:00 <br />
17:00 to 17:30 <br />
17:30 to 18:00 <br />
18:00 to 18:30 <br />
18:00 to 19:00 <br />
19:00 to 19:30 <br />
19:30 to 20:00 <br />
20:00 to 20:30 <br />
20:30 to 21:00 <br />
</div>



</tr>
</table>
</td>
</td>
</table>
</body>
</html>


Logged

Jayhson

  • Global Moderator
  • Internet Junkie
  • *****
  • Offline Offline
  • Posts: 1169
    • View Profile
    • WWW
Re: hi sir,
« Reply #20 on: November 10, 2009, 04:11:50 PM »
ok na ba sya... pero pansin ko error pa din... kasi alang value yung $adj anu ba gusto mong gawin or mangyari sa page.. mo
Logged
PHP Developer

eeeh_aarrh

  • Regular
  • **
  • Offline Offline
  • Posts: 82
    • View Profile
Re: hi sir,
« Reply #21 on: November 10, 2009, 04:49:13 PM »
$adj = "";

for($k=1; $k<=$j; $k++){ // Adjustment of date starting
$adj .="<td>&nbsp;</td>";
}

I think this should solve the issue.

No 'thanks' for my code kanina? hmp. Magtampo ba? haha.
Logged
"...Remember being a youngster, mom or dad telling you "close the door"? Well the same applies to HTML ...."

eeeh_aarrh

  • Regular
  • **
  • Offline Offline
  • Posts: 82
    • View Profile
Re: hi sir,
« Reply #22 on: November 10, 2009, 05:11:22 PM »
Quote
$adj .="<td>&nbsp;</td>";
------>added a string to a variable that was not yet defined which caused the error

Solution: define the variable first before adding additional value to it.
Quote
$adj = "";

for($k=1; $k<=$j; $k++){ // Adjustment of date starting
$adj .="<td>&nbsp;</td>";
}


E.g.:
$val = "hello";
$val .= " world";
$val .= "!!!";
echo $val;

Output:
hello world!!!

 ;D
« Last Edit: November 10, 2009, 05:22:25 PM by eeeh_aarrh »
Logged
"...Remember being a youngster, mom or dad telling you "close the door"? Well the same applies to HTML ...."

silverkortex1985

  • Regular
  • **
  • Offline Offline
  • Posts: 74
    • View Profile
Re: hi sir,
« Reply #23 on: November 10, 2009, 05:21:23 PM »
sir jayhson ganito po iyon.

i want to create a calendar that can view the month of it. but parang meron syang pagination if i click next on the side of it. it goes to another month. I mean for example today is November then i click on the next month.

kahit simple script lang po for calendar. the whole day kasi ako ng search ala sila mabigay na simple script for that e.

and its so sad kasi need ko na sya huhuhu:
Logged

silverkortex1985

  • Regular
  • **
  • Offline Offline
  • Posts: 74
    • View Profile
Re: hi sir,
« Reply #24 on: November 10, 2009, 05:22:34 PM »
sir jayhson ganito po iyon.

i want to create a calendar that can view the month of it. but parang meron syang pagination if i click next on the side of it. it goes to another month. I mean for example today is November then i click on the next month.

kahit simple script lang po for calendar. the whole day kasi ako ng search ala sila mabigay na simple script for that e.

and its so sad kasi need ko na sya huhuhu:
Logged

silverkortex1985

  • Regular
  • **
  • Offline Offline
  • Posts: 74
    • View Profile
Re: hi sir,
« Reply #25 on: November 10, 2009, 05:22:44 PM »
sir jayhson ganito po iyon.

i want to create a calendar that can view the month of it. but parang meron syang pagination if i click next on the side of it. it goes to another month. I mean for example today is November then i click on the next month.

kahit simple script lang po for calendar. the whole day kasi ako ng search ala sila mabigay na simple script for that e.

and its so sad kasi need ko na sya huhuhu:
Logged

eeeh_aarrh

  • Regular
  • **
  • Offline Offline
  • Posts: 82
    • View Profile
Re: hi sir,
« Reply #26 on: November 10, 2009, 05:23:53 PM »
Quote
Insert Quote
sir jayhson ganito po iyon.

i want to create a calendar that can view the month of it. but parang meron syang pagination if i click next on the side of it. it goes to another month. I mean for example today is November then i click on the next month.

kahit simple script lang po for calendar. the whole day kasi ako ng search ala sila mabigay na simple script for that e.

and its so sad kasi need ko na sya huhuhu:

Ganun yung ginawa kong code di ba? Click mo yung > and < magbabago ng month.
Logged
"...Remember being a youngster, mom or dad telling you "close the door"? Well the same applies to HTML ...."

eeeh_aarrh

  • Regular
  • **
  • Offline Offline
  • Posts: 82
    • View Profile
Re: hi sir,
« Reply #27 on: November 10, 2009, 05:32:35 PM »
Hindi mo lang siguro napansin na clickable yung < and > sa top left and right side ng calendar. O heto na. nilagyan ko na ng previous at back links.

Code: [Select]
<?php
$madj
=$_GET['madj'];
if(isset(
$prm) and $prm 0){
$m=$prm+$chm;}else{
$mdate("m")+$madj;}

$ddate("d");     // Finds today's date
$ydate("Y");     // Finds today's year

$no_of_days date('t',mktime(0,0,0,$m,1,$y)); // This is to calculate number of days in a month

$mn=date('M',mktime(0,0,0,$m,1,$y)); // Month is calculated to display at the top of the calendar

$yn=date('Y',mktime(0,0,0,$m,1,$y)); // Year is calculated to display at the top of the calendar

$jdate('w',mktime(0,0,0,$m,1,$y)); // This will calculate the week day of the first day of the month

$adj "";

for(
$k=1$k<=$j$k++){ // Adjustment of date starting
$adj .="<td>&nbsp;</td>";
}

/// Starting of top line showing name of the days of the week

echo " <table border='1' bordercolor='#FFFF00' cellspacing='0' cellpadding='0' align=center>

<tr><td>"
;

echo 
"<table cellspacing='0' cellpadding='0' align=center width='100' border='1'><td align=center bgcolor='#ffff00'><font size='3' face='Tahoma'> <a href='".$_SERVER['PHP_SELF']."?madj=".($madj-1)."'><</a> </td><td colspan=5 align=center bgcolor='#ffff00'><font size='3' face='Tahoma'>$mn $yn </td><td align=center bgcolor='#ffff00'><font size='3' face='Tahoma'> <a href='".$_SERVER['PHP_SELF']."?madj=".($madj+1)."'>></a> </td></tr><tr>";

echo 
"<td><font size='3' face='Tahoma'><b>Sun</b></font></td><td><font size='3' face='Tahoma'><b>Mon</b></font></td><td><font size='3' face='Tahoma'><b>Tue</b></font></td><td><font size='3' face='Tahoma'><b>Wed</b></font></td><td><font size='3' face='Tahoma'><b>Thu</b></font></td><td><font size='3' face='Tahoma'><b>Fri</b></font></td><td><font size='3' face='Tahoma'><b>Sat</b></font></td></tr><tr>";

////// End of the top line showing name of the days of the week//////////

//////// Starting of the days//////////
for($i=1;$i<=$no_of_days;$i++){
echo 
$adj."<td valign=top><font size='2' face='Tahoma'>$i<br>"// This will display the date inside the calendar cell
echo " </font></td>";
$adj='';
$j ++;
if(
$j==7){echo "</tr><tr>";
$j=0;}

}
echo 
"<tr><td colspan=7 align=center></td></tr>";
echo 
"</tr></table></td></tr></table>";
echo 
"<center><font face='Verdana' size='2'><a href='".$_SERVER['PHP_SELF']."?madj=".($madj+1)."'>&#38;#171; previous</a> <a href='".$_SERVER['PHP_SELF']."?madj=".($madj+1)."'>next &#38;#187;</a></center></font>";




?>
Logged
"...Remember being a youngster, mom or dad telling you "close the door"? Well the same applies to HTML ...."

silverkortex1985

  • Regular
  • **
  • Offline Offline
  • Posts: 74
    • View Profile
Re: hi sir,
« Reply #28 on: November 10, 2009, 05:44:09 PM »
nope nagawa ko na sya.
but i am still looking for simple.
well kung ala na ok na ako d2...

thanks ulit.
Logged

Jayhson

  • Global Moderator
  • Internet Junkie
  • *****
  • Offline Offline
  • Posts: 1169
    • View Profile
    • WWW
Re: hi sir,
« Reply #29 on: November 10, 2009, 06:19:04 PM »
try this

Code: [Select]
<?php
$monthNames 
= Array("January""February""March""April""May""June""July""August""September""October""November""December");
?>

<?php
if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n");
if (!isset(
$_REQUEST["year"])) $_REQUEST["year"] = date("Y");
?>

<?php
$cMonth 
$_REQUEST["month"];
$cYear $_REQUEST["year"];

$prev_year $cYear;
$next_year $cYear;

$prev_month $cMonth-1;
$next_month $cMonth+1;

if (
$prev_month == ) {
$prev_month 12;
$prev_year $cYear 1;
}
if (
$next_month == 13 ) {
$next_month 1;
$next_year $cYear 1;
}
?>


<table width="200">
<tr align="center">
<td bgcolor="#999999" style="color:#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" align="left">&nbsp;&nbsp;<a href="<?php echo $_SERVER["PHP_SELF"] . "?month="$prev_month "&year=" $prev_year?>" style="color:#FFFFFF">Previous</a></td>
<td width="50%" align="right"><a href="<?php echo $_SERVER["PHP_SELF"] . "?month="$next_month "&year=" $next_year?>" style="color:#FFFFFF">Next</a>&nbsp;&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr align="center">
<td colspan="7" bgcolor="#999999" style="color:#FFFFFF"><strong><?php echo $monthNames[$cMonth-1].' '.$cYear?></strong></td>
</tr>
<tr>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>M</strong></td>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>T</strong></td>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>W</strong></td>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>T</strong></td>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>F</strong></td>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td>
</tr>
<?php 
$timestamp 
mktime(0,0,0,$cMonth,1,$cYear);
$maxday date("t",$timestamp);
$thismonth getdate ($timestamp);
$startday $thismonth['wday'];

for (
$i=0$i<($maxday+$startday); $i++) {
if((
$i 7) == ) echo "<tr>\n";
if(
$i $startday) echo "<td></td>\n";
else echo 
"<td align='center' valign='middle' height='20px'>". ($i $startday 1) . "</td>\n";
if((
$i 7) == ) echo "</tr>\n";

?>



</table>
</td>
</tr>
</table>
Logged
PHP Developer
Pages: 1 [2] 3
« previous next »
 


WebGeek Philippines © Copyright 2009 - Privacy Policy
The WebGeek Philippines is a Community for Filipino Web Users, Webmasters, Web Designers,
Web Developers, Bloggers, Graphic Artists, Internet Marketers, SEO & Web Enthusiasts.
Powered by SMF 2.0 RC1 | SMF © 2006–2009, Simple Machines LLC