Location: PHPKode > projects > Work project > workproject/view_prospect_data.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_help.inc");
include ("include_state_prospect.inc");
include ("include_delete_prospect.inc");
include ("include_prospect_name.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>Prospect data of the selected user</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

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

</head>
<body>

<?
/* 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);

write_log_user ($filename_log, "Beginning of Display prospect data. ----------------------");
?>
<table>
<tr>
<td>

<li>Related prospects to : <? echo user_name($select_user,$g_database_name); ?>
<ul> 
<?

if ( $select_user != ""){
	$result_keys = mysql_query("SELECT * FROM PROSPECT_USER WHERE USERID=$select_user");
	$total_rows_keys = mysql_numrows($result_keys);
	if ( $total_rows_keys != 0 ) {
		$counter =0;
		while($counter < $total_rows_keys) {
			$prospect_code = mysql_result($result_keys,$counter,PROSPECT_CODE);
			$query_select = "SELECT PROSPECT_NAME,STATE from PROSPECT where PROSPECT_CODE=$prospect_code";
			$result_name = mysql_query($query_select);
			$prospect_name = mysql_result($result_name,0,PROSPECT_NAME);
			$state = mysql_result($result_name,0,STATE);
			if ( $state == 1) {
				#win
				echo "<li class='win'>".$prospect_name." ";
			} elseif ( $state == 2 ) {
				#lost
				echo "<li class='lost'>".$prospect_name." ";
			} elseif ( $state == 3){
				#wait
				echo "<li class='wait'>".$prospect_name." ";
			} else {
				echo "<li>".$prospect_name." ";
			}
			$counter = $counter + 1;
		}
		echo "<p><br> Where: <br>";
		echo "<li class='win'> WIN";
		echo "<li class='lost'> LOST";
		echo "<li class='wait'> WAIT";				
		echo "<br>";
	} else {
		?> <br> No related prospect for the selected user. <br> <?
	}

} else {
?>
	<br> No user selected for displaying skill data. <br>
<? } ?>
</ul>
</td>
</tr>
</table>

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