Location: PHPKode > projects > Helpdesk Over Web > how/calls/newcall.php
<?php
// Allows Creation of New Call.

// Include Configuration File
require_once('../includes/config.inc');

// Connect to Database
require_once ('../includes/mysql_connect.php');

// Set Page Title and Include HTML Header
$page_title = 'Helpdesk Over Web - Log New Call';
include_once('../includes/header.html');

// Work out date and time.
$datetoday = date("Y-m-d");
$timenow = date("H:i:s");
$engineer = ($_SESSION['LoggedInUser']);

// Retrieve default value of call severity pick list.
$query = "SELECT defaultcallseverity FROM sysconfig";
	$result = mysql_query($query)
	   or die("Invalid query: " . mysql_error());
	list($defaultcallseverity) = mysql_fetch_row($result);
	
echo "<H1>Log New Call</H1>";
echo "<FORM METHOD='POST' ACTION='newcall-process.php'>";
echo "<P><B>Date:</B> &nbsp;&nbsp;<input type='text' name='date' maxlength='10' size='10' value=$datetoday></P>";
echo "<P><B>Time:</B> &nbsp;&nbsp;<input type='text' name='time' maxlength='10' size='10'value=$timenow></P>";
echo "<P><B>User ID:</B> &nbsp;&nbsp;<select name='user'>";
	$sql = "SELECT * FROM users ORDER BY UserID;";
	$userlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	while($i = mysql_fetch_row($userlist)) 
		{ 
		echo "<OPTION VALUE='$i[0]'>$i[0], $i[1] $i[2] ($i[3])</OPTION>";
		}
echo "</SELECT>";

echo "<P><B>Asset:</B> &nbsp;&nbsp;<select name='asset'>";
	$sql = "SELECT * FROM assets;";
	$assetlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	while($i = mysql_fetch_row($assetlist)) 
		{ 
		echo "<OPTION VALUE='$i[0]'>$i[0] - $i[1] - $i[2] $i[3]</OPTION>";
		}
echo "</SELECT>";
echo "<P><B>Severity:</B> &nbsp;&nbsp;<select name='severity'>";
	$sql = "SELECT * FROM sevcategories ORDER BY SeverityText;";
	$sevlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	while($i = mysql_fetch_row($sevlist)) 
		{ 
		if($i[1] == $defaultcallseverity)
			echo "<OPTION SELECTED>$i[1]";
		else
			echo "<OPTION >$i[1]</OPTION>";
		}
echo "</SELECT>";
echo "<P><B>Category:</B> &nbsp;&nbsp;<select name='category'>";
	$sql = "SELECT * FROM kbcategories;";
	$catlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	while($i = mysql_fetch_row($catlist)) 
		{ 
		echo "<OPTION>$i[1]</OPTION>";
		}
echo "</SELECT>";
echo "<P><B>Fault:</B> &nbsp;&nbsp;<BR><textarea name='fault' cols='60' rows='5'></textarea></P>";
echo "<P><B>Work Log:</B> &nbsp;&nbsp;<BR><textarea name='worklog' cols='60' rows='5'></textarea></P>";
echo "<P><B>Call Status:</B> &nbsp;&nbsp;<select name='callstatus'>";
	$sql = "SELECT * FROM statcategories ORDER BY StatusText;";
	$statlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	while($i = mysql_fetch_row($statlist)) 
		{ 
		echo "<OPTION>$i[1]</OPTION>";
		}
echo "</SELECT>";
echo "<P><B>Engineer:</B></TD><TD> &nbsp;&nbsp;<select name='engineer'>";
	$sql = "SELECT * FROM systemusers WHERE Role LIKE 'Engineer%' OR Role LIKE 'Helpdesk Manager%' ORDER BY HOWLogin;";
	$engrlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	while($i = mysql_fetch_row($engrlist)) 
		{ 
		if($i[0] == $engineer)
			echo "<OPTION SELECTED VALUE='$i[0]'>$i[0]</OPTION>";
		else
			echo "<OPTION VALUE='$i[0]'>$i[0]</OPTION>";
		}
echo "</SELECT></TD></TR>";
echo "<input type='submit' value='Submit'>";
echo ("<H5>[ <A HREF='calladmin.php'>Call Log Administration</A> ]</H5>");
echo ("<H5>[ <A HREF='../index.php'>Main System Menu</A> ]</H5>");
// Include HTML footer.
include_once('../includes/footer.html');
?>
Return current item: Helpdesk Over Web