<body link="#0000FF" vlink="#0000FF">
<p><img src="../images/it%20graphics/3banner.jpg" width="612" height="199" border="0" usemap="#Map"> 
  <map name="Map">
    <area shape="rect" coords="543,151,611,195" href="DataAccess.php">
    <area shape="rect" coords="480,145,542,197" href="search.php">
    <area shape="rect" coords="280,146,362,194" href="actmgt.php">
    <area shape="rect" coords="189,146,277,196" href="ocm-first.htm">
    <area shape="rect" coords="127,148,182,198" href="DataAccessSearch.php">
    <area shape="rect" coords="76,147,122,196" href="helpDeskAccessAllCalls.php">
    <area shape="rect" coords="2,147,74,199" href="reportproblem.htm">
    <area shape="rect" coords="163,2,248,14" href="DataAccess.php">
  </map>
  <br>
  <?php 
//Created by Chad Edwards
//01-29-03
//Requires M.S. Access 2000 with DNS configured to helpdesk pass=''
//Revision 1
//Juim Help Desk



function HTML_Head() { 
    echo " 
    <HTML><HEAD> 
    <TITLE>Processing Form</TITLE> 
    </HEAD> 
    <BODY BGCOLOR=\"#FFFFFF\">"; 
	

} 

function HTML_Foot() { 
    echo "</body></html>"; 
} 

function Database_Entries($msg) { 
    echo $msg; 
} 

function Output_Entries() { 
    /* 
        Make the connection to the database. The syntax is 
        odbc_connect( 'SYSTEM_DSN' , 'USER', 'PASSWORD' ); 
        $cnx will hold the 
        pconnect is used to establish a persistent database 
        connection to the Database until the procedure is completed. 
    */ 

    $cnx = odbc_connect( 'HelpDesk' , '', '' ); 
    if (!$cnx) { 
        Error_handler( "Error in odbc_connect" , $cnx ); 
    } 

    // send a simple odbc query . returns an odbc cursor 
    $cur= odbc_exec( $cnx, "select ID,FirstName,LastName,PCatagory,describe, Status,mainDate from Data" ); 
    if (!$cur) { 
        Error_handler( "Error in odbc_exec( no cursor returned ) " , $cnx ); 
    } 
    	echo "<table border=1><tr><th>ID</th><th>Time & Date</th><th>First Name</th>". 
        "<th>Last Name</th><th>Help Request Status</th><th>Type of Problem</th></tr>\n"; 

    $nbrow=0;   //Local variable to count number of rows 

    // fetch the succesive result rows 
    while( odbc_fetch_row( $cur ) ) { 
        $nbrow++; 
        $ID= odbc_result( $cur, 1 ); // get the field "Index" 
        $FirstName= odbc_result( $cur, 2 ); // get the field "FirstName" 
        $LastName= odbc_result( $cur, 3 ); // get the field "LastName" 
        $PCatagory= odbc_result( $cur, 4 ); // get the field "PCatagory" 
		$value= odbc_result( $cur, 5 ); // get the field "describe" <br><br>
		$Status= odbc_result( $cur, 6 ); // get the field "Status" 
		$sysDate= odbc_result( $cur, 7 ); // get the field "Status" 
		$url = 'viewDetails.php?record=';
		$url2 = "$ID";
		$url3 = "$url$url2"; 
		


 		echo "<tr><td><a href=\"$url3\">$ID</a>\n</td><td>$sysDate</td><td>$FirstName</td>". 
        "<td>$LastName</td><td>$Status</td><td>$PCatagory</td></tr>\n"; 
    	} 

    echo "<tr><td colspan=2>$nbrow entries </td></tr></table>"; 

    // close the connection. important if persistent connection are "On" 
    odbc_close( $cnx); 
} 

function Error_Handler( $msg, $cnx ) { 
    echo "$msg \n"; 
    odbc_close( $cnx); 
    exit(); 
} 

$strOldEntries = "Previous Entries in database"; 
$strNewEntries = "Updated version of databse (after entries)"; 



HTML_Head(); 
Database_Entries($strOldEntries); 
Output_Entries(); 
HTML_Foot(); 

?>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p align="center"><a href="http://www.quickintranet.com"><img src="http://www.quickintranet.com/infosec/quickintranet-com.jpg" border="0"></a><br>
  CopyRight 2004<br>
  QuickIntranet.com<br>
  <a href="http://www.quickintranet.com">http://www.QuickIntranet.com </a> </p>
