<p><a href="DataAccess.php">View Open Calls Only</a><br>
  <?php 




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

} 

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 from Data" ); 
    if (!$cur) { 
        Error_handler( "Error in odbc_exec( no cursor returned ) " , $cnx ); 
    } 

    $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" 
$url = 'viewDetails.php?record=';
$url2 = "$ID";
$url3 = "$url$url2"; 
//echo "<a href=\"$url\">Next</a>\n";

    echo "<table border=1><tr><th>ID</th><th>First Name</th>". 
        "<th>Last Name</th><th>Help Request Status</th><th>Type of Problem</th></tr>\n"; 

 echo "<tr><td><a href=\"$url3\">$ID</a>\n</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>
