im trying to add an existaing calander onto a profile page by using Code: <?php include "diary/cal_show.php";?>
which looks like this...
But when i hit either arrows to move on the month using this script - Code: <tr bgcolor="#<? echo $bg_top; ?>"><th width="20" style="<?php echo $hcell; ?>"><a href="<?php echo $puser; ?>?m=<?php =(($m-1)<1) ? 12 : $m-1 ?>&y=<?php =(($m-1)<1) ? $y-1 : $y ?>"><img src='http://www.runningprofiles.com/calendar/images/prev.gif' height='18' width='18' alt='' border='0' /></a></th> It stays on the current month and i cant understand why..
here is the calander script
Code: <script src="http://www.runningprofiles.com/jquery.js" type="text/javascript"></script>
<link href="http://www.runningprofiles.com/members/diary/facebox/facebox.css" media="screen" rel="stylesheet" type="text/css"/>
<script src="http://www.runningprofiles.com/members/diary/facebox/facebox.js" type="text/javascript"></script>
<script>
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
}) </script>
<?php
// there is NO NEED to edit ANY of this code
$ev_dat = array();
for ($i=0;$i<32;$i++) {
$ev_dat[$i]=0;
}
$now = date("Y-m-d", time());
list($ty, $tm, $td) = explode('-',$now); // ty=thisyear, etc. used for highlighting 'today'
include("cal_parms.php"); // assorted configuration variables
include($dat_names); // retrieved from cal_parms.php as a 'language' file
if (!isset($_GET['m'])) {
$m = date("m",mktime());
} else {
$m = $_GET['m'];
}
if (!isset($_GET['y'])) {
$y = date("Y",mktime());
} else {
$y = $_GET['y'];
}
/*== get what weekday the first is on ==*/
$tmpd = getdate(mktime(0,0,0,$m,1,$y));
$month = $tmpd["month"];
$firstwday= $tmpd["wday"];
if ($firstDayIsMonday == 1) {
if ($firstwday == 0) {
$firstwday = 6;
} else {
$firstwday--;
}
}
$lastday = mk_getLastDayofMonth($m,$y);
/*== get the last day of the month ==*/
function mk_getLastDayofMonth($mon,$year)
{
for ($tday=28; $tday <= 31; $tday++)
{
$tdate = getdate(mktime(0,0,0,$mon,$tday,$year));
if ($tdate["mon"] != $mon)
{
break;
}
}
$tday--;
return $tday;
}
// compute range of dates for this month to match dates in database in the format yyyy-mm-dd
if (strlen($m)<2) {
$q="0";
$q.=$m;
}
else {
$q = $m;
}
$dats_beg = $y. "-". $q. "-01";
$dats_en = $y. "-". $q. "-". $lastday;
// open db conn and select all records where date is between $dats_beg and $dats_en
include("cal_db_conn.php");
mysql_connect($db_host, $db_login, $db_pass) or die ("Can't connect!");
mysql_select_db($db_name) or die ("Can't open database!");
$query = "SELECT * FROM $db_table WHERE (ev_dat>='$dats_beg') AND (ev_dat<='$dats_en') ";
$result = mysql_db_query($db_name, $query);
// any matches?
if ($result)
{
// handle the matches and pass relevant info to arrays
while ($myrow = mysql_fetch_array($result))
{
$found = $myrow['ev_dat'];
$pieces = explode("-", $found);
$dd = intval($pieces[2]);
$ev_dat[$dd] = $myrow['id'];
}
}
?>
<table cellpadding="1" cellspacing="1" border="0" bgcolor="#<? echo $bg_edge; ?>">
<tr><td colspan="7" bgcolor="#<? echo $bg_top; ?>">
<table cellpadding="1" cellspacing="1" border="0" width="100%">
<tr bgcolor="#<? echo $bg_top; ?>"><th width="20" style="<?php echo $hcell; ?>"><a href="<? echo $puser; ?>?m=<?=(($m-1)<1) ? 12 : $m-1 ?>&y=<?=(($m-1)<1) ? $y-1 : $y ?>"><img src='http://www.runningprofiles.com/calendar/images/prev.gif' height='18' width='18' alt='' border='0' /></a></th>
<th style="<?php echo $hcell; ?>">
<?php
echo "<a href='../diary/show-month.php?mon=". $m. "&yr=". $y. "'rel="facebox">";
echo "<span style='text-decoration:none'>". $mo[intval($m)]. " ". $y. "</span></a>";
?>
</th>
<th width="20" style="<? echo $hcell; ?>"><a href="<? echo $_SERVER['PHP_SELF']; ?>?m=<?=(($m+1)>12) ? 1 : $m+1 ?>&y=<?=(($m+1)>12) ? $y+1 : $y ?>"><img src='http://www.runningprofiles.com/calendar/images/next.gif' height='18' width='18' border='0' alt='' /></a></th>
</tr>
</table>
</td></tr>
<tr bgcolor="#<? echo $bg_top; ?>">
<th width="20" style="<?php echo $hcell; ?>"><? echo $da[1]; ?></th>
<th width="20" style="<?php echo $hcell; ?>"><? echo $da[2]; ?></th>
<th width="20" style="<?php echo $hcell; ?>"><? echo $da[3]; ?></th>
<th width="20" style="<?php echo $hcell; ?>"><? echo $da[4]; ?></th>
<th width="20" style="<?php echo $hcell; ?>"><? echo $da[5]; ?></th>
<th width="20" style="<?php echo $hcell; ?>"><? echo $da[6]; ?></th>
<th width="20" style="<?php echo $hcell; ?>"><? echo $da[7]; ?></th>
</tr>
<?
$d = 1;
$wday = $firstwday;
$firstweek = true;
/*== loop through all the days of the month ==*/
while ( $d <= $lastday)
{
/*== set up blank days for first week ==*/
if ($firstweek)
{
if ($wday!=0) {
echo "<tr bgcolor='#". $bg_tabl. "'>n";
for ($i=1; $i<=$firstwday; $i++) {
echo "<td style='". $tcell. "' bgcolor='#". $bg_fill. "'> </td>n";
}
}
/*== Sunday start week with <tr> ==*/
else {
echo "<tr bgcolor='#". $bg_tabl. "'>n";
}
$firstweek = false;
}
/*== check for event ==*/
echo "<td style='". $tcell. "' ";
// is this day 'today' AND there's no event today
if (($ty==$y) && ($tm==$m) && ($td == $d) && (!$ev_dat[$d])) {
echo "bgcolor='#". $bg_now. "'>". $d;
}
elseif ($ev_dat[$d]) {
// get what's happening that day and use as 'mouseOver' for the link
$query = "SELECT * FROM $db_table WHERE id=$ev_dat[$d] ";
$result = mysql_query($query);
$ev = mysql_fetch_array($result);
$titl = $ev['ev_title'];
echo "bgcolor='#". $bg_act. "'>";
$url = "../diary/show.php?event=". $ev_dat[$d]. "&sho=". $win_sho;
echo "<a href=' $url' rel="facebox" title="". $titl. "">". $d. "</a>";
}
else {
echo "bgcolor='#". $bg_days. "'>". $d;
}
echo "</td>n";
/*== Saturday end week with </tr> ==*/
if ($wday==6) {
echo "</tr>n";
}
$wday++;
$wday = $wday % 7;
if (($wday==0) AND ($d!=$lastday)){ echo "<tr bgcolor='#". $bg_tabl. "'>n"; }
$d++;
}
// and close off the table
if (($wday!=7) AND ($wday!=0)) {
for ($i=$wday; $i<=6; $i++) {
echo "<td style='". $tcell. "' bgcolor='#". $bg_fill. "'> </td>n";
}
echo "</tr>";
}
echo "n</table>";
include("win_open.php");
?>
Hopefully someone can make sence on why its not working... i dont want to put it in an iframe as i would like to have popout windows used to show what event are happening on them dates.
Tracking Unique Clicks
Hi guys and gals,Basically I have a database which tracks clicks on my outbound links, I do this by linking to a page like so.../redirect.php?id=1The page then reads the id and increments the click
Problem with HTML form
Hello,I made a HTML form with some fields and check box.Everything works fine except when i receive the email, only fields appear in the email not the content of the check box.I have attached the
PHP FTP Can't upload Big FIles
Anyone had any success using FTP to upload a file say 90m?im using ftp_put and it returns false. BUT the file DOES upload just fine. I even downloaded and tested it, its the full file. But ftp_put
passing data from one page to another
hey guysi have the follwoing code to get information from one page and place on another:(1st page) page to get info from:Code: <?php session_start();$_SESSION['data'] = "blah blah
check if value exists
I have googled this for a while and I am getting lots of different results. Is there a standard method used for checking to see if a value exists in a database before inserting a value? I have a form,
Character Set Setup
Whats the best character set to use if you want every character to work, and also how do you make your files, mysql stuff, and all that set for the best character type..... got a check list i can
Not sure why this script is not working?
Hi I am new to php programing and I was trying to make up a simple script like a captcha but I cannot get the validation part of it working. I think it should work but it is not. Anyone know what is
Help with syntax
Hi all!The $bridge variable is not getting passed while it is contained in the line below:Maybe I don't have the right brackets around it? I want the result to say Bridge1I think it's because its a
HeaderSelectedCssClass not working
I have an accordian where I have a drop down list in the first pane and a grid in the second pane. When the ddl selection is changed, I programatically change the selected index of the accordian to
need help about
i store the value of my select statement result to an array and stored it to a variable named $fname the i used it as the value of:<input type='text' name='fname' value=<?php echo $fname