<?
	#---------------------------------------------------------------------#
	# This source code is (c)2000 White Pajamas, Inc                      #
	# see http://www.stonekeep.com/license.html for licensing information #
	#---------------------------------------------------------------------#

	#----------------------------------------------------------------------
	# $Id: modslip.php3,v 1.57 2000/12/29 05:46:42 shevett Exp $
	#----------------------------------------------------------------------

?>

<?
	#
	# pull out the data from the current slip.
	#
	
	$result = db_query("select * from slips where sid=$sid");
	$currow = db_fetch_array($result);
	
	
?>

<?
	include "./sliputils.php3"

?>

	<form method="post" action="nbrowse.php3">
	<input type=hidden name="f_process" value="postslip">
	<input type=hidden name="f_flag" value="mod">
	<input type=hidden name="sid" value="<? echo $sid ?>">
	<input type=hidden name="a_o_date" value="<? echo $currow[o_date] ?>">
	<input type=hidden name="a_c_date" value="<? echo $currow[c_date] ?>">
	<input type=hidden name="a_c_tech" value="<? echo $currow[c_tech] ?>">
	<input type=hidden name="a_o_tech" value="<? echo $currow[o_tech] ?>">
	<? if (!$sys_enableacl) { ?>
		<input name="a_spolicy" type="hidden" value=0>
	<? } ?>


	<tr bgcolor=#BBBBcB>
	<td width=100% bgcolor=#202020>
	<table width=100% bgcolor=#bbbbbb cellspacing=2 border=0>
	<tr>
		<td align=center colspan=2>
 			Modify Slip # <? echo $sid ?>
		</td>
	</tr>
	<tr bgcolor=#bbbbbb valign=top>
		<td bgcolor=#808080>
		<table width=100% border=0 cellspacing=0 cellpadding=0>
		<tr bgcolor=#bbbbbb valign=top>
			<td bgcolor=#808080 width=50%>
				<? ChooseParent("a_spid",$parent); ?>
			</td>
			<td bgcolor=#808080 width=50%>
				<? ChooseDependent(); ?>
			</td>
		</tr>
		</table>
		</td>
		<td bgcolor=#808080>
		<table width=100% border=0 cellspacing=0 cellpadding=0>
		<tr bgcolor=#bbbbbb valign=top>
			<td bgcolor=#808080 width=50%>
				<? TimeSpent(); ?>
			</td>
			<td bgcolor=#808080 width=50%>
				<? ChooseGroup(); ?><br>
			</td>
		</tr>
		</table>
		</td>
	</tr>


	
	<tr bgcolor=#bbbbbb valign=top>
		<td bgcolor=#808080>
			<table width=100% border=0 cellspacing=0 cellpadding=0>
			<tr bgcolor=#bbbbbb valign=top>
				<td bgcolor=#808080 width=33%>
					<? ChooseCurrtech(); ?>
				</td>
				<td bgcolor=#808080 width=33%>
					<? ChooseStatus(); ?>
				</td>
				<td bgcolor=#808080 width=33%>
					<? ChoosePriority("a_priority",$currow[priority]); ?>
				</td>
			</tr>
			</table>
		</td>
		<td bgcolor=#808080>
		<table width=100% border=0 cellspacing=0 cellpadding=0>
		<tr bgcolor=#bbbbbb valign=top>
			<td bgcolor=#808080 width=50%>
					<? ChooseResource(); ?>
			</td>
			<? if ($sys_enableacl) { ?>
			<td bgcolor=#808080 width=50%>
				<? ChoosePolicy() ?>
			</td>
			<? } ?>
		</tr>
		</table>
		</td>
	</tr>
		
		

	<tr bgcolor=#bbbbbb valign=top>
		<td bgcolor=#808080 valign=top>
		<table width=100% border=0 cellspacing=0 cellpadding=0>
		<tr bgcolor=#bbbbbb valign=top>
			<td bgcolor=#808080 width=34%>
				<? ChooseContact(); ?>
			</td>
			<td bgcolor=#808080 width=33%>
				<? ChooseCadd(); ?>
			</td>
			<td bgcolor=#808080 width=33%>
				<? ChooseCphone(); ?>
			</td>
		</tr>
		</table>
		</td>
		<td bgcolor=#808080>
	<? if ($sys_schedule) { ?>
		<table width=100% border=0 cellspacing=0 cellpadding=0>
		<tr bgcolor=#bbbbbb valign=top>
		<td bgcolor=#808080 width=50%>
			<i>Scheduled Open Date (MM/DD/YYYY)</i><br>
			<!-- FIXME: needs maxsize based on database query -->
			<input type="text" name="a_so_date" size=10 value="<? echo ($currow[so_date]) ? date("$sys_datefmt",$currow[so_date]) : "" ?>">
		</td>
		<td bgcolor=#808080 width=50%>
			<i>Scheduled Close Date (MM/DD/YYYY)</i><br>
			<!-- FIXME: needs maxsize based on database query -->
			<input type="text" name="a_sc_date" size=10 value="<? echo ($currow[sc_date]) ? date("$sys_datefmt",$currow[sc_date]) : "" ?>">
		</td>
		</tr>
		</table>
	<? } ?>
		</td>
	</tr>

	</tr>
	<tr bgcolor=#bbbbbb valign=top>
		<td bgcolor=#808080 colspan=2>
			<i>Problem</i><br>
			<font size=<?echo $sys_selfont?>><input name="a_problem" size=80 value="<? echo StripSlashes(htmlspecialchars($currow[problem])) ?>"></font>
		</td>
	</tr>
	<tr bgcolor=#bbbbbb valign=top>
		<td bgcolor=#808080>
			<i>Summary</i><br>
			<font size=<?echo $sys_selfont?>><textarea name="a_summary" rows=10 cols=60 wrap="soft"><? echo StripSlashes(htmlspecialchars($currow[summary]))?></textarea></font>
			<hr>
			<i>Change comment (this text will show in the followup recording the change)</i><br>
			<font size=<? echo $sys_selfont?>><input name="a_comment" size=75></font>
		</td>
		<td bgcolor=#808080 valign=top>
		<table width=100% border=0 cellspacing=0 cellpadding=0>
			<tr bgcolor=#bbbbbb valign=top>
		<? if ($sys_choosepublic || $sys_mailopts) { ?>
			<? 
			if ($sys_choosepublic) {
				ChoosePublic();
			}
			echo "<hr>";
			if ($sys_mailopts) { 
				MailOptions();
			}
		} ?>
		</tr>
		</table>
		</td>
	</tr>
	<tr bgcolor=#bbbbbb valign=top>
		<td bgcolor=#808080 colspan=2>
			<?
				# Load up an associative array of values from the bulk table.
				
				$dquery=db_query("select belement,bvalue from ebulk where btable='slips' and browref=$currow[sid]");
				while ($ddata=db_fetch_array($dquery)) {
					$edata[$ddata[belement]] = $ddata[bvalue] ;
				}
				
				# +-----------+-------------+------+-----+---------+----------------+
				# | _rowid    | int(10)     |      | PRI | 0       | auto_increment |
				# | etable    | varchar(15) |      | MUL |         |                |
				# | element   | varchar(15) | YES  |     |         |                |
				# | etype     | char(1)     | YES  |     |         |                |
				# | eflags    | varchar(80) | YES  |     |         |                |
				# | esequence | int(2)      | YES  |     |         |                |
				# | elength   | int(2)      | YES  |     |         |                |
			 	# | elabel    | varchar(20) | YES  |     |         |                |
				# +-----------+-------------+------+-----+---------+----------------+

				ShowExtras ("slips",$edata);
			?>
		</td>
	</tr>
	</table>
	</td>
		
	<tr bgcolor=#000000><td colspan=2>
	<?
		PostBar("Post Modifications");
	?>
	</td>
	</tr>
