KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/abtechsci/mmc15/ezupload/cp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/abtechsci/mmc15/ezupload/cp/ff.php
<?php
require("header.php");

$seq=$_POST["seq"];
$name=$_POST["name"];
$desc=$_POST["desc"];
$type=$_POST["type"];
$req=$_POST["req"];
$value=$_POST["value"];
$dvalue=$_POST["dvalue"];
$min=$_POST["min"];
$max=$_POST["max"];

$fid=$_POST["fid"];
//if ($fid==""){ $fid=$_GET["fid"]; }

//$v=$_GET["v"]; 

$submit=$_POST["submit"];
$btn_add_new = $_POST['btn_add_new'];

//echo $fid . "----------->" . $seq .  "----------->" . $name .  "----------->" . $desc  .  "----------->" . $type .  "----------->" . $req .  "----------->" . $value .  "----------->" . $dvalue  .  "----------->" . $min  .  "----------->" . $max ;


if(isset($btn_add_new )) //if add new fields is clicked
{
	$seq="";
	$name="";
	$desc="";
	//$type=""; //type if preserved
	$req="";
	$value="";
	$dvalue="";
	$min="";
	$max=""; 	
}

if($submit != "" )
{

	$fields=new fields();

	if($submit=="Remove Field")
	{				
		if(count($fid)>0)
		{
			for($a=0 ;$a< count($fid) ;$a++  )
			{
				$fields->delete( $fid[$a] );
			}
				$seq="";
				$name="";
				$desc="";
				$type="";
				$req="";
				$value="";
				$dvalue="";
				$min="";
				$max=""; 
		}
		
	}
	else
	{
		if($name=="" )
		{
			print("<font color=red ><b>Cannot save. all fields are required </b></font>");
			$error="Cannot save. all fields are required";
		}
		else
		{	$fid=$_POST["efid"];			
			if($fid == "" )
			{
				$fields->insert( $fid, $seq, $name, $desc, $type, $req, $value, $dvalue, $min, $max );
			}
			else
			{					
				$fields->update( $fid, $seq, $name, $desc, $type, $req, $value, $dvalue, $min, $max );
				$fid="";	
			}

			$seq="";
			$name="";
			$desc="";
			$type="";
			$req="";
			$value="";
			$dvalue="";
			$min="";
			$max=""; 			
		}
	}	
		
	
	
}
else
{
	$fid=$_GET["fid"];
	if($fid != "")
	{
		$fields=new fields();
		$temp=$fields->get($fid);

		$fid=$temp[0]->fid;
		$seq=$temp[0]->seq;
		$name=$temp[0]->name;
		$desc=$temp[0]->fdesc;
		$type=$temp[0]->type;
		$req=$temp[0]->req;
		$value=$temp[0]->value;
		$dvalue=$temp[0]->dvalue;
		$min=$temp[0]->min;
		$max=$temp[0]->max;
	}
}


?>
<HTML><HEAD><TITLE>Control Panel</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">

<LINK href="f_files/global.css" type=text/css rel=stylesheet>
<!--For help tooltips-->
<SCRIPT language="JavaScript1.2" src="f_files/help_tips/main.js" type="text/javascript"></SCRIPT>
<script language="javascript" type="text/javascript" src="js/main.js"></script>
</HEAD>
<BODY <?php if($error !=""){ echo "onLoad=\"alert('$error')\"" ; }  ?> >
<!--For help tooltips-->
<DIV id="TipLayer" style="visibility:hidden;position:absolute;z-index:1000;top:-100;"></DIV>
<SCRIPT language="JavaScript1.2" src="f_files/help_tips/style.js" type="text/javascript"></SCRIPT>  
	
<table width="100" align="center" cellpadding="0" cellspacing="0" class="main_table" id="table1">
  <tr>
	<td>
<form method="POST" action="ff.php" name="frm" >
<TABLE height="496" cellSpacing=0 cellPadding=0 width="770" id="table2" bgcolor="#FFFFFF">
  <?php require("cp_header.php")?>
	<tr>
    <TD height=320 bgcolor="#FFFFFF" valign="top">
				<table border="0" cellpadding="0" cellspacing="0" width="748" id="table3" height="362">
					
					<tr>
						<td height="7" width="748"></td>
					</tr>
					<tr>
						<td align="center" class="normal_td">
					 <a href="" onMouseOver="stm(ff[0],Style);" onClick="return false;" onMouseOut="htm()"><img src="f_files/help_icon_small.jpg" alt="" width="40" height="40" border="0"></a><br>						</td>
				  </tr>
					<tr>
						<td height="2" width="748"></td>
					</tr>
					<tr>
						<td height="187" valign="top">
							<table width="583" height="280" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#8FABFF" class="main_table" id="table4">
								<tr>
								  <td height="20" bgcolor="#C1D1FF" width="579" colspan="2" valign="middle" class="t_header">
									<div class="div_1">Manage Form Fields <a href="upload_form.php"></a></div>								  </td>
								</tr>
								<tr>
								  <td colspan="2" align="center" valign="middle" class="td_1"><a href="upload_form.php">Click Here To View Uploading Form</a></td>
							  </tr>
								<tr>
								  <td width="579" height="26" colspan="2" align="center" valign="middle" class="td_1">
										
									  <select size="1" name="type">
										<option <?php if ($type =="text" ) { echo "SELECTED" ;  } ?> value=text>Text Box</option>
										<option <?php if ($type =="dropbox" ) { echo "SELECTED" ;  } ?> value=dropbox>Dropdown Menu</option>
										<option <?php if ($type =="checkbox" ) { echo "SELECTED" ;  } ?> value=checkbox>Check Box</option>
										<option <?php if ($type =="file" ) { echo "SELECTED" ;  } ?> value=file>File</option>
										<option <?php if ($type =="state" ) { echo "SELECTED" ;  } ?> value=state>US States</option>
										<option <?php if ($type =="country" ) { echo "SELECTED" ;  } ?> value=country>World Countries</option>
										<option <?php if ($type =="textarea" ) { echo "SELECTED" ;  } ?> value=textarea>Text Area</option>
										<option <?php if ($type =="radio" ) { echo "SELECTED" ;  } ?> value=radio>Radio Button</option>
									  </select> 
									  <input name="btn_add_new" type="submit" class="button" value="Add new field"   >								  </td>
								</tr>
											
								
								<?php

					$type_lookup = array(
					"file" => "File Field", 
					"text" => "Simple Text", 
					"password" => "Password", 
					"textarea" => "Text Area", 
					"dropbox" => "Drop Box", 
					"checkbox" => "Check Box", 
					"radio" => "Radio Buttons"					
					);
							
					$req_lookup = array(
					"0" => "No", 
					"1" => "Yes" 
					);	

					$fields=new fields();
					$temp=$fields->get("");					
					?>
					
					<tr>
						<td width="134" valign="top" bgcolor="#ECF1FF" class="td_1" >
						<table>
							<tr><td align="center" bgcolor="#FFFFFF" class="t_header">Fields</td>
							</tr>
						<!-- Fields names -->
						<?php
						for( $a=0; $a < count($temp) ; $a++ )
							{
							$f_name=$temp[$a]->name;
							$f_type=$type_lookup[$temp[$a]->type];
							$f_req=$req_lookup[$temp[$a]->req];
							$f_seq=$temp[$a]->seq;
							$f_lfid=$temp[$a]->fid;
						?>
						<tr>
							<td valign="middle" align="left" width="134">
							<input name="fid[]" type="checkbox" value="<?php echo $f_lfid ; ?>"> 								
							<a href="ff.php?fid=<?php echo $f_lfid ; ?>"><?php echo $f_name ; ?></a>						</tr>					
						<?php 
							}
						?>	
						<!-- End Fields names-->													
						</table>					    </td>
						<td width="441" align="right" valign="top" bgcolor="#ECF1FF" class="td_2"><br>
						  <table>
					 <tr onMouseOver="tplTrOver(this)" onMouseOut="tplTrOut(this)">
						<td width="145" height="21" align="right" valign="middle" class="td_1">Field Name</TD>
						<td width="282" height="21" align="left" valign="middle" class="td_2"><INPUT name=name value="<?php echo $name ; ?>" size=20 maxlength="50" ></TD>
					</tr>
                    
					<tr onMouseOver="tplTrOver(this)" onMouseOut="tplTrOut(this)">
                      <td width="145" height="21" align="right" valign="middle" class="td_1">Field Description</TD>
                      <td width="282" height="21" valign="middle" class="td_2"> <INPUT name=desc value="<?php echo $desc ; ?>" size=20 maxlength="50"  ></td>
					</tr>							
					
					<?php 
					if ( $type == "checkbox" || $type == "radio" || $type == "dropbox")
					{  						
					?>
                    <tr onMouseOver="tplTrOver(this)" onMouseOut="tplTrOut(this)">
                      <td width="145" height="21" align="right" valign="middle" class="td_1">Options(seperated by commas)</TD>
                      <td width="282" height="21" valign="middle" class="td_2"><INPUT name="value" value="<?php echo $value ; ?>" size=20 maxlength="300" ></td>
					</tr>
					<?php 
					}
					if ( $type != "file" &&  $type != "country" && $type != "state" )
					{ 					
					?>
                    <tr onMouseOver="tplTrOver(this)" onMouseOut="tplTrOut(this)">
                      <td width="145" height="21" align="right" valign="middle" class="td_1">Default Value</TD>
                      <td width="282" height="21" valign="middle" class="td_2"><INPUT name=dvalue value="<?php echo $dvalue ; ?>" size=20 maxlength="50" ></td>
					</tr>
					<?php 
					}
					if ( $type == "text" || $type == "password" || $type == "textarea" )
					{ 					
					?>
					<tr onMouseOver="tplTrOver(this)" onMouseOut="tplTrOut(this)">
                      <td width="145" height="21" align="right" valign="middle" class="td_1">Max Char</TD>
                      <td width="282" height="21" valign="middle" class="td_2"> <INPUT name=max  value="<?php echo $max ; ?>" size=20 maxlength="50" ></td>
					</tr>
					<?php 
					}					
					?> 



					 <tr onMouseOver="tplTrOver(this)" onMouseOut="tplTrOut(this)">
						<td width="145" height="21" align="right" valign="middle" class="td_1">Required 
                        Field?</TD>
						<td width="282" height="21" align="left" valign="middle" class="td_2">
							<INPUT type=radio <?php  if ( $req == "1" ){ echo "CHECKED" ; }  ?> value=1 name=req > Yes 
							<INPUT type=radio <?php  if ( $req == "0" ){ echo "CHECKED" ; } else if ( empty( $req)){ echo "CHECKED" ; }  ?> value=0 name=req > No						</TD>
					</tr>

					 

					<INPUT type=hidden size=50 name=efid value="<?php echo $fid ; ?>" >
					<INPUT type=hidden size=50 name=seq value="<?php echo $seq ; ?>" >
					<!-- INPUT type=hidden size=50 name="type" value="<?php echo $type ; ?>" -->
			</table>						
			<!--  ------------------------------------------------------------------------------------------         -->						</td>
					</tr>					
					<tr>
									<td width="134" align="center" bgcolor="#FFFFFF" class="td_1">
					    <br>
					    <input name="submit" type="submit" class="button" value="Remove Field">
					    <br>
					    <br></td>
									<td width="443" height="35" align="center" bgcolor="#FFFFFF" class="td_2">
					    <input name="submit" type="submit" class="button" value="   Save   "></td>
							  </tr>
					  </table>						</td>
					</tr>
					<tr>
						<td height="30"><p align="center"><a href="formgenerator.php">Back </a><br>
&nbsp;</td>
					</tr>
			  </table>	</TD>
    </tr>
		</TABLE>
			</form> 			</td>
		</tr>
	<?php include("footer.php"); ?>		
</table>
</BODY></HTML>

Anon7 - 2021