$root="/usr/home/deb3977n3/domains/morechemistry.com/public_html";
include("${root}/includes/layout_page.php");
layout_load();
#META INFORMATION
//$filetosave="";
$category="labview";
$title="LabVIEW - ChemE projects";
$keywords="labview, chemical engineering, projects";
$description="labview projects at the chemical engineering department";
menu_load($category);
# copyright 2000-2010, morechemistry.com, All Rights Reserved
$content=$menu;
include("${root}/labview/cheme/projects-menu.php");
function show_table_header($Header)
{
$tableheader=<< ${Header} |
|
client |
title |
planning |
status |
TABLE_HEADER;
return $tableheader;
}
function show_data_field($Cell)
{
if ($Cell=="") { $Cell=" "; }
$tablecell=<<${Cell}
TABLE_CELL;
return $tablecell;
}
function show_icon_cell()
{
$iconcell=<<
ICON_CELL;
return $iconcell;
}
function show_white_cell()
{
$whitecell=<<
WHITE_CELL;
return $whitecell;
}
function show_data_detail($Name,$Cell)
{
if ($Cell=="") { $Cell=" "; }
$detail=<<${Name} | | ${Cell} |
DETAIL;
return $detail;
}
function show_table_row($Data)
{
global $year;
// global $detailsid;
$li=$Data[link];
$thetable="";
if ($li<>'')
{
$linkstart="";
$linkend="";
}
else
{
$linkstart="";
$linkend="";
}
$dp=$Data[planning];
if ($Data[planning]=="20070000") { $dp="ready"; }
if ($Data[realstatus]=="-1") { $dp="possibly new project"; }
if ($_GET['detailsid']==$Data[id])
{
// show common line without link
$thetable .= "";
$thetable .= show_icon_cell();
$thetable .= show_data_field($Data[client]);
$thetable .= show_data_field("$Data[title]");
$thetable .= show_data_field(${dp});
$thetable .= show_data_field($Data[status]);
$thetable .= "
\n";
// show details
$thetable .= "";
$thetable .= show_white_cell();
$thetable .= "\n";
$thetable .= "\n";
$thetable .= show_data_detail("client",$Data[client]);
$thetable .= show_data_detail("title",$Data[title]);
$thetable .= show_data_detail("equipment",$Data[equipment]);
$thetable .= show_data_detail("autorisation",$Data[autorisation]);
$thetable .= show_data_detail("size","$Data[size] (1=small .. 5=large)");
$thetable .= show_data_detail("planning",${dp});
$thetable .= show_data_detail("status",$Data[status]);
$thetable .= show_data_detail("comments",$Data[comments]);
$thetable .= " \n";
$thetable .= "\n";
$thetable .= " |
\n";
}
else
{
$thetable .= "";
$thetable .= show_icon_cell();
$thetable .= show_data_field($Data[client]);
$thetable .= show_data_field("$Data[title]");
$thetable .= show_data_field(${dp});
$thetable .= show_data_field($Data[status]);
$thetable .= "
\n";
}
return $thetable;
}
//require_once("${DOCUMENT_ROOT}/labview/cheme/includes/config.php");
require_once("./includes/config.php");
$db=mysql_connect($dbhost, $dbuname, $dbpass) or die ("MySQL verbinding mislukt");
$dbid = "deb3977n3_trial";
mysql_select_db($dbid, $db) or die ("Database verbinding mislukt");
$content .= $projectmenu;
// start table
$content .= "\n";
$query="SELECT * FROM worklist WHERE realstatus=-1 ORDER BY planning DESC";
mysql_select_db($dbid, $db) or die ("Database verbinding mislukt");
$resultset = mysql_query($query);
$content .= show_table_header('== Possibly New Projects ==');
while($data=mysql_fetch_array($resultset)) { $content .= show_table_row($data); }
$query="SELECT * FROM worklist WHERE realstatus=0 ORDER BY planning";
mysql_select_db($dbid, $db) or die ("Database verbinding mislukt");
$resultset = mysql_query($query);
$content .= show_table_header('== Current Projects ==');
while($data=mysql_fetch_array($resultset)) { $content .= show_table_row($data); }
$period="";
if ($_GET['year']=="all") { $period="AND planning BETWEEN 20000000 AND 21000000"; }
if ($_GET['year']==2007) { $period="AND planning BETWEEN 20070000 AND 20080000"; }
if ($_GET['year']==2008) { $period="AND planning BETWEEN 20080000 AND 20090000"; }
if ($_GET['year']==2009) { $period="AND planning BETWEEN 20090000 AND 20100000"; }
if ($_GET['year']==2010) { $period="AND planning BETWEEN 20100000 AND 20110000"; }
if ($_GET['year']==2011) { $period="AND planning BETWEEN 20110000 AND 20120000"; }
if ($_GET['year']==2012) { $period="AND planning BETWEEN 20120000 AND 20130000"; }
$query="SELECT * FROM worklist WHERE realstatus=1 ${period} ORDER BY planning DESC";
//$query="SELECT * FROM worklist WHERE ${period} ORDER BY planning DESC";
mysql_select_db($dbid, $db) or die ("Database verbinding mislukt");
$resultset = mysql_query($query);
$linkall='[all]';
$link2007='[2007]';
$link2008='[2008]';
$link2009='[2009]';
$link2010='[2010]';
$link2011='[2011]';
$link2012='[2012]';
$content .= show_table_header("== Finished Projects ==
$linkall $link2007 $link2008 $link2009 $link2010 $link2011");
while($data=mysql_fetch_array($resultset)) { $content .= show_table_row($data); }
$query="SELECT * FROM worklist WHERE realstatus=-2 ORDER BY planning DESC";
mysql_select_db($dbid, $db) or die ("Database verbinding mislukt");
$resultset = mysql_query($query);
$content .= show_table_header('== Non Assigned Projects ==');
while($data=mysql_fetch_array($resultset)) { $content .= show_table_row($data); }
//end table
$content .= "
\n
\n";
$content .= "
\n";
$content .="\n";
layout_show($layoutpage,$content,$googlecode,$title,$keywords,$description);
?>