<?php
$record = $_GET["record"];
setcookie("record1",$record,time()+1209600);
?>

<img src="../images/it%20graphics/1banner.jpg" width="622" height="199" border="0" usemap="#Map"> 
<map name="Map">
  <area shape="rect" coords="478,145,540,197" href="search.php">
  <area shape="rect" coords="543,151,611,195" href="DataAccess.php">
  <area shape="rect" coords="163,3,248,15" href="DataAccess.php">
  <area shape="rect" coords="280,146,362,194" href="actmgt.php">
  <area shape="rect" coords="188,146,276,196" href="ocm-first.htm">
  <area shape="rect" coords="127,147,182,197" href="DataAccessSearch.php">
  <area shape="rect" coords="75,147,121,196" href="helpDeskAccessAllCalls.php">
  <area shape="rect" coords="2,146,74,198" href="reportproblem.htm">
</map>
</head> 
<?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>Helpdesk call log details.</TITLE> 
 //   </HEAD> 
//    <BODY BGCOLOR=\"#CCCCCC\">"; 
//	} 

//function HTML_Foot() 
	//{ 
  //  echo "</body></html>"; 
//	} 
	
//print "Support Call ID: <b>$record</b><P>\n\n";

//setcookie("record1",$record,time()+1209600);




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

    // send a simple odbc query . returns an odbc cursor 

	$dataVar = $_GET["record"];
	//setcookie("record1",$dataVar,time()+1209600);
	
 	$cur= odbc_exec( $cnx, "SELECT ID,FirstName, LastName,PCatagory,describe,Resolution,staff,mainDate FROM data WHERE ID =$dataVar" );  

   if (!$cur) { 
      Error_handler( "Error in odbc_exec( no cursor returned ) " , $cnx ); 
    } 


    $nbrow=0;   //Local variable to count number of rows 
   
    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 "FirstName" 
		$PCatagory= odbc_result( $cur, 4 ); // get the field "FirstName" 
		$describe= odbc_result( $cur, 5 ); // get the field "FirstName" 
		$Resolution= odbc_result( $cur, 6 ); // get the field "FirstName" 
		$staff= odbc_result( $cur, 7 ); // get the field "FirstName" 
		$mainDate= odbc_result( $cur, 8 ); // get the field "FirstName" 
		$nbrow++; 
		//print "$FirstName  $LastName's Help Desk Record";
		//print "<br> The reported problem is catagorized as: $PCatagory </br> <br> Desribed by the user as <br> $describe </br>";
	//	print "<br> The Current resolution to this help desk call is: <br> $Resolution </br>";
		
		//test table
		    echo "<table border=1>";
			$record = $_GET["record"];
			echo "<tr><td>Time & Date: $mainDate</td><td>Support Call ID:$record</td>";
 			echo "<tr>";
			echo "<td>Problem submitted by: $FirstName $LastName</td><td>I.T. Staff Assigned to:  $staff </td>";
			echo "<tr>";
			echo    "<tr><td colspan=2>The reported problem is catagorized as: $PCatagory</td></tr>";
			echo "<tr><td>Described by the user as:  $describe </td>";
			echo "<tr><td>The Current resolution to this help desk call is: <br> $Resolution </br></td></table>"; 
		//test table
	   //fetch computer name
	    $cur= odbc_exec( $cnx, "select FirstName,CompName from inventory WHERE FirstName ='$FirstName' AND LastName ='$LastName'" ); 
    	
		if (!$cur) 
			{ 
        	Error_handler( "Error in odbc_exec( no cursor returned ) " , $cnx ); 
			}

		while( odbc_fetch_row( $cur ) ) 
			{ 
        	$nbrow++; 
        	$fName= odbc_result( $cur, 1 ); // get the field "Index" 
        	$CompName= odbc_result( $cur, 2 ); // get the field "FirstName" 
			echo "<table border=1>";
			echo "<tr><td>Computer name is: $CompName</td></br></table>";
			}//end fetch
}
    // close the connection. important if persistent connection are "On" 	
	
    odbc_close( $cnx); 
  	//echo "<input type=hidden name=ID value=$IdentTag>";


  
}

//HTML_Head(); 
Output_Entries(); 
//HTML_Foot(); 

?>
<br>
<form name="form1" method="post" action="helpDeskupdate.php">
  <table width="94%" border="0" cellpadding="0" cellspacing="1" bordercolor="#CCCCCC">
    <tr> 
      <td colspan="3"> <hr> </td>
    </tr>
    <tr> 
      <td width="31%">Call Status: Check to close call 
        <select name="Closed" size="1" id="Closed">
          <option value="Open" selected>Open</option>
          <option value="Closed">Closed</option>
        </select>
      </td>
      <td width="50%">Please enter the I.T. staff member assigned to this problem.</td>
      <td width="19%">&nbsp;</td>
    </tr>
    <tr> 
      <td>Help Desk Call Priority 
        <select name="priority" size="1" id="select4">
          <option value="High">High</option>
          <option value="Medium">Medium</option>
          <option value="Low" selected>Low</option>
        </select> </td>
      <td><select name="itstaff" size="1" id="select5">
          <option value="Anyone">Anyone</option>
          <option value="Tech1">Tech 1</option>
          <option value="Tech2">Tech 2</option>
          <option value="Tech3">Tech3</option>
          <option value="Tech4">Tech4</option>
          <option value="Tech5">Tech5</option>
          <option value="Tech6">Tech6</option>
          <option value="Tech7">Tech7</option>
          <option value="Tech8">Tech8</option>
          <option value="Tech9">Tech9</option>
          <option value="Tech10">Tech10</option>
          <option value="NetAdmin">NetAdmin</option>
          <option value="System Manger">System Manager</option>
          <option value="CIO">CIO</option>
        </select> <br> </td>
      <td rowspan="2">&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="2">Delete this Record? If so enter Help Desk Call ID here: 
        <input name="idDelete" type="text" id="idDelete"></td>
    </tr>
    <tr> 
      <td colspan="3"><p><br>
          Please describe the actions that have been taken to resolve the problem: 
        </p>
        <p> 
          <textarea name="Resolution" cols="70" rows="7" id="textarea"></textarea>
        </p>
        <p> 
          <input type="hidden" name="ID" value="<?php $dataVar = $_GET["record"];?>">
          <input type="submit" name="Submit" value="Submit">
        </p></td>
    </tr>
  </table>
  <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>
  <p align="center"><font size="5" face="Arial, Helvetica, sans-serif"></font></p>
  <p><br>
  </p>
  </form>

<p><a href="DataAccess.php">Back to the Main Page</a> </p>
