<?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,Name1,Name2,Description from Security" );   
	 	
   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>User Security Changes were made on</th><th>User that Requested Changes</th>". 
        "<th>Description of change</th></tr>\n"; 
		
    while( odbc_fetch_row( $cur ))
		{
        $ID= odbc_result( $cur, 1 ); // get the field "Index" 
        $Name1= odbc_result( $cur, 2 ); // get the field "FirstName" 
        $Name2= odbc_result( $cur, 3 ); // get the field "LastName" 
        $Description = odbc_result( $cur, 4 ); // get the field "PCatagory" 
		$nbrow++; 
 		echo "<tr><td>$ID</a>\n</td><td>$Name1</td><td>$Name2</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>Security Report</strong></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>
  </div>
