Location: PHPKode > projects > Work project > workproject/activity.php
<?
include ("include_config.inc");
include ("include_profile_name.inc");
include ("include_project_name.inc");
include ("include_log_file.inc");
include ("include_delete_task.inc");
include ("include_delete_project.inc");
include ("include_delete_profile.inc");
include ("include_update_user.inc"); 
include ("include_delete_user.inc");
include ("include_list_user.inc");
include ("include_state_name.inc");
include ("include_user_name.inc");
include ("include_workload_project.inc");
include ("include_dates_project.inc");
include ("include_display_comment.inc");
include ("include_activity.inc");
include ("include_button.inc");

if ( isset( $HTTP_COOKIE_VARS[$g_string_cookie] ) ) {
	$g_string_cookie_val         = $HTTP_COOKIE_VARS[$g_string_cookie];
	write_log_user ($filename_log, "Cookie created 1.1: ".$g_string_cookie." -- ".$g_string_cookie_val);
}
if ( isset( $HTTP_COOKIE_VARS[$g_project_cookie] ) ) {
	$g_project_cookie_val        = $HTTP_COOKIE_VARS[$g_project_cookie];
	write_log_user ($filename_log, "Cookie created 2.1: ".$g_project_cookie." -- ".$g_project_cookie_val);
}

/* check the login for user */
login_cookie_check();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Your tasks - Activity of a user between 2 dates</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<?  include ("include_css.inc"); ?>
<script src="main.js" type="text/javascript"></script>
<script src="tasks.js" type="text/javascript"></script>
<script src="nav.js" type="text/javascript"></script>

</head>
<BODY onload="init()">

<?
include ("include_main.inc");
?>

<?php
write_log_user ($filename_log, "Beginning of activity of the connected user between 2 dates.");

/* database connection */
$link= mysql_connect($g_hostname, $g_db_username, $g_db_password) or die("could not connect");
$result = mysql_select_db($g_database_name);

/* read of the user connected */
$connected_user = user_connected();
$profile_connected_user = user_profile($connected_user);
$name_connected_user = user_name($connected_user,$g_database_name);
$name_profile_connected_user = profile_name($profile_connected_user);
display_connected_user($name_connected_user,$name_profile_connected_user);

if ($select_user == "") {
	$select_user = $connected_user;
	$name_user = $name_connected_user;
} else {
	$name_user = user_name ($select_user,$g_database_name);
}

if( $task_day != "" or $task_day2 != "") {

	write_log_user ($filename_log, "Display activity for the user: ".$select_user );

	$date_start = $task_year."-".$task_month."-".$task_day;
	write_log_user ($filename_log, "Date start activity : ". $task_month." - ".$task_day." - ".$task_year." / ".$date_start);
	if ($date_start == "--") $date_start='NULL';	

	$date_end = $task_year2."-".$task_month2."-".$task_day2;
	write_log_user ($filename_log, "Date end activity : ". $task_month2." - ".$task_day2." - ".$task_year2." / ".$date_end);
	if($date_end == "--") $date_end='NULL';	
	
	$data = display_activity ($select_user,$name_user,$date_start, $date_end);
	if ($detail == "") $detail="task";
	$image = display_activity_image ($select_user,$name_user,$date_start, $date_end,$detail);
	
	display_data($data);

} else {
	if ( $detail != ""){
		$is_comment= "Dates are mandatory.";
		display_comment($is_comment);
	}
}

?>

<form name="edit" method="post" >

<table class="around" border=1 align="center" cellspacing="2" cellpadding="4"> 
<tr><td class="title" colspan='6'>Activity of the user: <? echo $name_user; ?></td></tr>
<tr><td class="input">Start date</td><td>
<select name="task_day">
	<option value="" selected></option>
	<option value="01">1</option>
	<option value="02">2</option>
	<option value="03">3</option>
	<option value="04">4</option>
	<option value="05">5</option>
	<option value="06">6</option>
	<option value="07">7</option>
	<option value="08">8</option>
	<option value="09">9</option>
	<option value="10">10</option>
	<option value="11">11</option>
	<option value="12">12</option>
	<option value="13">13</option>
	<option value="14">14</option>
	<option value="15">15</option>
	<option value="16">16</option>
	<option value="17">17</option>
	<option value="18">18</option>
	<option value="19">19</option>
	<option value="20">20</option>
	<option value="21">21</option>
	<option value="22">22</option>
	<option value="23">23</option>
	<option value="24">24</option>
	<option value="25">25</option>
	<option value="26">26</option>
	<option value="27">27</option>
	<option value="28">28</option>
	<option value="29">29</option>
	<option value="30">30</option>
	<option value="31">31</option>
</select>
<select name="task_month">
	<option value="" selected></option>
	<option value="01">1</option>
	<option value="02">2</option>
	<option value="03">3</option>
	<option value="04">4</option>
	<option value="05">5</option>
	<option value="06">6</option>
	<option value="07">7</option>
	<option value="08">8</option>
	<option value="09">9</option>
	<option value="10">10</option>
	<option value="11">11</option>
	<option value="12">12</option>
</select>
<select name="task_year">
	<option value="" selected></option>
	<option value="2003">2003</option>
	<option value="2004">2004</option>
	<option value="2005">2005</option>
	<option value="2006">2006</option>
	<option value="2007">2007</option>
	<option value="2008">2008</option>
	<option value="2009">2009</option>
	<option value="2010">2010</option>
	<option value="2011">2011</option>
	<option value="2012">2012</option>
	<option value="2013">2013</option>
</select>
<img src="<? echo $g_path;?>images/calendar.gif" ALT="Calendar" onClick="showPicker('date','edit','');">
</td>
<td class="input">End date</td><td>
<select name="task_day2">
	<option value="" selected></option>
	<option value="01">1</option>
	<option value="02">2</option>
	<option value="03">3</option>
	<option value="04">4</option>
	<option value="05">5</option>
	<option value="06">6</option>
	<option value="07">7</option>
	<option value="08">8</option>
	<option value="09">9</option>
	<option value="10">10</option>
	<option value="11">11</option>
	<option value="12">12</option>
	<option value="13">13</option>
	<option value="14">14</option>
	<option value="15">15</option>
	<option value="16">16</option>
	<option value="17">17</option>
	<option value="18">18</option>
	<option value="19">19</option>
	<option value="20">20</option>
	<option value="21">21</option>
	<option value="22">22</option>
	<option value="23">23</option>
	<option value="24">24</option>
	<option value="25">25</option>
	<option value="26">26</option>
	<option value="27">27</option>
	<option value="28">28</option>
	<option value="29">29</option>
	<option value="30">30</option>
	<option value="31">31</option>
</select>
<select name="task_month2">
	<option value="" selected></option>
	<option value="01">1</option>
	<option value="02">2</option>
	<option value="03">3</option>
	<option value="04">4</option>
	<option value="05">5</option>
	<option value="06">6</option>
	<option value="07">7</option>
	<option value="08">8</option>
	<option value="09">9</option>
	<option value="10">10</option>
	<option value="11">11</option>
	<option value="12">12</option>
</select>
<select name="task_year2">
	<option value="" selected></option>
	<option value="2003">2003</option>
	<option value="2004">2004</option>
	<option value="2005">2005</option>
	<option value="2006">2006</option>
	<option value="2007">2007</option>
	<option value="2008">2008</option>
	<option value="2009">2009</option>
	<option value="2010">2010</option>
	<option value="2011">2011</option>
	<option value="2012">2012</option>
	<option value="2013">2013</option>
</select>
<img src="<? echo $g_path;?>images/calendar.gif" ALT="Calendar" onClick="showPicker('date','edit2','');">
</td>
</tr>
<tr><td class="input">Level of Details: </td><td>
<select name="detail">
	<option value="task" selected>Task</option>
	<option value="project">Project</option>
</select>
</td>
</tr>
</table>
<br>
<table align="center" cellspacing="2" cellpadding="4">
<tr>
<? if ( right_user($connected_user,22) ){ ?>
<td>
<? button("Your activity","Display the activity of the current user between the selected dates","submit();"); ?>
</td>
<? } 
if ( right_user($connected_user,13) ){ ?>
<td>
<a href=<? echo $g_file_log_directory; ?>  title="Log data" > <img src="<? echo $g_icon_path;?>see.gif" border="0"> </a>
</td>
<? } ?>
<td>
<img src="<? echo $g_icon_path;?>question.gif" ALT="Help" onClick="show_comment_screen('Help','Display the activity',24,'');">
</td>
</tr>
</table>

</form>

<?
include ("include_bottom.inc");
?>

</BODY>
</HTML>
Return current item: Work project