<?php 
//Created by Chad Edwards
//01-29-03
//Requires M.S. Access 2000 with DNS configured to helpdesk pass=''
//Revision 1
//Juim Help Desk
$sysDate= date("h:i  M d Y", mktime());
function HTML_Head() 
		{ 
    echo " 
    <HTML><HEAD> 
    <TITLE>Processing Form</TITLE> 
    </HEAD> 
    <BODY BGCOLOR=\"#FFFFFF\">"; 
		}
		


function HTML_Foot() 
	{ 
    echo "</body></html>"; 
	} 
	
function Output_Entries() 
	{ 
    /* 
        Make the connection to the excessbase. The syntax is 
        odbc_connect( 'SYSTEM_DSN' , 'USER', 'PASSWORD' ); 
        $cnx will hold the 
        pconnect is used to establish a persistent excessbase 
        connection to the excessbase 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,partNum,serial,location,description,Date from excess" );   
	 	
   if (!$cur) 
   { 
      Error_handler( "Error in odbc_exec( no cursor returned ) " , $cnx ); 
    } 
  
    $nbrow=0;   //Local variable to count number of rows 
   
    echo "<table border=1><tr><th>ID</th><th>Excess Procedure Requested by</th><th>DOJ Part Number</th>". 
        "<th>Serial Number</th><th>Date</th><th>location</th><th>Description</th></tr>\n"; 
		
    while( odbc_fetch_row( $cur ))
		{
        $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" 
        $PartNum= odbc_result( $cur, 4 ); // get the field "PCatagory" 
		$serial= odbc_result( $cur, 5 ); // get the field "describe" 
		$location= odbc_result( $cur, 6 ); // get the field "date" 
		$description= odbc_result( $cur, 7 ); // get the field "date" 
		$Date= odbc_result( $cur, 8 ); // get the field "date" 
		$nbrow++; 
 		echo "<tr><td>$ID</a>\n</td><td>$FirstName</td><td>$PartNum</td>". 
         "<td>$serial</td><td>$Date</td><td>$location</td><td>$description</td></tr>\n"; 
		 }  
		    odbc_close( $cnx); 
	}

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

    // close the connection. important if persistent connection are "On" 

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





HTML_Head(); 
Output_Entries(); 
HTML_Foot(); 
print "<br>";

?> 
<div align="center">
  <p>&nbsp;</p>
  <p><strong>O.C.M. Excess I.T. Equipment Report</strong></p>
  <p>&nbsp;</p>
  <p><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>
  <p align="center"><font size="5" face="Arial, Helvetica, sans-serif"></font></p>
</div>
