Location: PHPKode > projects > SnortSMS > snortsms/variables/dsp_AddEdit.php
<?
/***************************************************************************
 *   Copyright (C) 2005 by J Randolph Smith                                *
 *   hide@address.com                                                *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

$temp_vartype_ary = array(0 => "var", 1 => "portvar");

if($obj_FMK->currentAction() == "edit")
	{	
	$row = $rsVar->fetchRow(DB_FETCHMODE_ASSOC);
	$temp_id = $row['id'];
	$temp_varname = $row['varname'];	
	$temp_varvalue = $row['varvalue'];
	$temp_vartype = $row['vartype'];
	$temp_title = "Edit Variable";
	$temp_button = "Update";
	}
else
	{
	$temp_title = "New Variable";
	$temp_button = "Save";
	}



include_once("FMK_lib/func_DrawRepHeader.php");

DrawRepHeader("Variables");
?>




<FORM action="index.php?fmk=variables.save" method="POST">
<INPUT type="hidden" name="FRM_id" value="<?=$temp_id?>">





<div align="center">

<table border="0" class="bg1" cellspacing="1" cellpadding="0">
<tr class="heading2" align="center">
<td><?=$temp_title?></TD>
</TR>
<tr><td>




<table border="0" class="bg2">
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td class="label" align="right">Variable Type:</td>
<td>
<select name="FRM_vartype">
<?
foreach( $temp_vartype_ary as $value=>$name   )
	{
	$sel = ( $value == $temp_vartype ? "selected" : ""  );
	?>
	<option value="<?=$value?>" <?=$sel?>><?=$name?></option>
	<?
	}
?>
</select>
</td>
</tr>

<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td class="label" align="right">Variable Name:</td><td><INPUT type="text" name="FRM_varname" size="30" value="<?=$temp_varname?>"></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td class="label" align="right" valign="top">Value:</td><td>
<INPUT type="text" name="FRM_varvalue" size="40" value="<?=$temp_varvalue?>">
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2" align="center"><INPUT type="submit" name="BTN_submit" value="<?=$temp_button?>"></td>
</tr>
</table>




</td>
</tr>
</TABLE>


</div>



</FORM>


Return current item: SnortSMS