Location: PHPKode > projects > Wombat Open Source > wombat/calendar/dailyindex.php
<?
include("../inc/local.inc.php");
include("../inc/wombat.inc.php");
include("../inc/header.inc.php");
include("../inc/msg.inc.php");
include("../inc/calendar.inc.php");


?>
<html>
<head>

<?
echo "</head><body>";
if(eregi("MSIE",$_SERVER['HTTP_USER_AGENT']))
{
	echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"genericie.css\" />"; 
	echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"style-ie.css\" />";
}
else 
{
	echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"generic.css\" /> <link rel=\"stylesheet\" type=\"text/css\" href=\"style0.css\" />";
}



if(!isset($HTTP_GET_VARS['day'])) $day = date('j');
else $day = $HTTP_GET_VARS['day'];

if(!isset($HTTP_GET_VARS['month'])) $month = date('m');
else $month = $HTTP_GET_VARS['month'];

if(!isset($HTTP_GET_VARS['year'])) $year = date('Y');
else $year = $HTTP_GET_VARS['year'];

$tablename = date('Fy', mktime(12, 0, 0, $month, 1, $year));
$monthname = month_name($month);

$lasttime = mktime(12, 0, 0, $month, $day - 1, $year);
$lastday = date('j', $lasttime);
$lastmonth = date('n', $lasttime);
$lastyear = date('Y', $lasttime);
$lastmonthname = month_name($lastmonth);

$nexttime = mktime(12, 0, 0, $month, $day + 1, $year);
$nextday = date('j', $nexttime);
$nextmonth = date('n', $nexttime);
$nextyear = date('Y', $nexttime);
$nextmonthname = month_name($nextmonth);
  
$daynum = date('w',mktime(12,0,0, $month, $day, $year));
if($daynum==0)
	$dayname = $words['wom_day_sun'];
 else {if($daynum==1) $dayname = $words['wom_day_mon'];
         else {if ($daynum==2) $dayname = $words['wom_day_tue'];
		 		else {if ($daynum==3) $dayname = $words['wom_day_wed'];
						else{ if ($daynum==4) $dayname = $words['wom_day_thu'];
								else {if ($daynum==5) $dayname = $words['wom_day_fri'];
									  else $dayname = $words['wom_day_sat'];
									  }
						}
				}
		 }
	}
 
  echo '<table id="display">  <caption>'."<h1><a href=\"dailyindex.php?month=$lastmonth&&day=$lastday&&year=$lastyear\"> « </a>" . "$dayname, $day $monthname $year" ."<a href=\"dailyindex.php?month=$nextmonth&&day=$nextday&&year=$nextyear\"> » </a></h1>". '</caption>  <colgroup></colgroup>';


  $result = eventsdate($day, $month, $year, $gs_tdrn_id);

  
  $i = 0;
 
  
while ($row = mysql_fetch_array($result))
{
    $i++;
    $start = $row['start'];
	$end = $row['end'];
	$starttime = date('g:i A', $start);
	$endtime = date('g:i A', $end);     
    $duration = $row['end'] - $row['start'];
    $minduration = ($duration/60) % 60; 
    $hourduration  = ($duration/3600) % 24; 
	
    $subject = stripslashes($row['subject']);
    $desc = nl2br(stripslashes($row['description']));
    $typeofevent = $row['eventtype'];
	$employee_name = $row['author'];

    if($row['eventtype']==2)
	  $typeofevent = "Appointment";
	if($row['eventtype']==3)
	  $typeofevent = "Meeting";
    if($row['eventtype']==4)
  	  $typeofevent = "Other Event";
	
    if ($row['public']==1)
	{
	 echo "<tr>   <td> $typeofevent<br>$starttime - $endtime</td>	<td><a href=\"cal_events_edit.php?event_id=$row[id]\">" . "<b>".$words['daily_sub']." : $subject</b><br>" . "</a> ".$words['daily_pub']."<br> ".$words['daily_by']." : $employee_name<br>".$words['daily_dur']." : $hourduration ".$words['daily_hour']." $minduration ".$words['daily_min']."<br>".$words['daily_desc']." : $desc<br><br></td></tr>";
	}
	else 
	{
	 echo "<tr>   <td> $typeofevent<br>$starttime - $endtime</td>	<td><a href=\"cal_events_edit.php?event_id=$row[id]\">" . "<b>".$words['daily_sub']." : $subject</b><br>" . "</a> ".$words['daily_priv']."<br> ".$words['daily_by']." : $employee_name<br>".$words['daily_dur']." : $hourduration ".$words['daily_hour']." $minduration ".$words['daily_min']."<br>".$words['daily_desc']." : $desc<br><br></td></tr>";
	}
	  
  }

  if(empty($i)) 
	{
		echo "<tr><td colspan=\"7\"><h1>" . $words['daily_no'] . "</h1></td> </tr>\n";
	}

   echo "<tr><td colspan=\"7\">" . "<br><a href =\"cal_events_edit.php?year=$year&&day=$day&&month=$month\">".$words['daily_add']."</a>" . "</td>
	</tr>\n";
  
  echo '<form action=gotodate.php method=post><tr>  <td colspan="7">' . "<br>". $words['daily_go']."<br>";
   echo "<select name = goto_day>";
   for($i=1;$i<32;$i++)
   {
		if($i==date("d",mktime()))
			echo "<option value=$i selected> $i </option>";
		else
			echo "<option value=$i> $i </option>";
	}  
	echo "</select>";
    echo "<select name = goto_month>";
   for($i=1;$i<13;$i++)
  	{
		if($i==date("m",mktime()))
	   		echo "<option value=$i selected>" . month_name($i). "</option>";
		else
			echo "<option value=$i>" . month_name($i). "</option>";
			
	}
	echo "</select>";
   echo "<select name = goto_year>";
   for($i=2000;$i<2007;$i++)
   {
   		if($i==date("Y",mktime()))
	    	echo "<option value=$i selected> $i </option>";
		else
			echo "<option value=$i> $i </option>";
	}
	echo "</select>";
	echo "<input type=hidden name=lf_day value=$day>";
	echo "<input type=hidden name=lf_month value=$month>";
	echo "<input type=hidden name=lf_year value=$year>";
	echo "<input type=submit class = button value=Go!>";
   echo "</td></tr></form>\n";

echo  '  </tbody>
</table>
';

include("../inc/footer.inc.php");

?>
</body>
</html>
Return current item: Wombat Open Source