Location: PHPKode > projects > VampMan: V:tR Character Manager > vampman-1.0.2/phpnuke/modules/charactersheet/form.php
<?php
if (!eregi("modules.php", $PHP_SELF)){
  die (_accessdirectly);
}
if(!isset($equipment))
	$equipment = _equipment_text;
if(!isset($owned))
	$owned = _owned_text;

if(!isset($description))
	$description = _description_text;

if(!isset($details))
	$details = _details_text;

if(!isset($background))
	$background = _background_text;

if(!isset($experience))
	$experience = _experience_text;


$strings = array_merge($pre['string'],$during['string'],$post['string']);
$digits = array_merge($pre['digits'],$during['digits'],$post['digits']);

include("modules/$module_name/includes/checkvars.php");



echo"<div align=center>
<b>"._safarinotice."</b><br><br>
<form action=\"modules.php?name=$module_name\" method=\"post\">
<center><table width=\"600\" border=\"0\">
<td>"._charname.":</td>
<td> <input type=\"text\" name=\"charname\" value=\"$charname\" size=\"20\"></td>
<td>"._virtue.":</td>
<td ALIGN=right> ".make_selectbox_enum("virtue",$virtue)."</td>
<tr>
<td>"._embraced.":</td>
<td> <input type=\"text\" name=\"embraced\" value=\"$embraced\" size=\"20\"></td>
<td>"._vice.":</td>
<td align=right> ".make_selectbox_enum("vice",$vice)."</td>
<tr>
<td>"._concept.":</td>
<td> <input type=\"text\" name=\"concept\" value=\"$concept\" size=\"20\"></td>
<td>"._clan.":</td>
<td align=right>".make_selectbox_enum("clan",$clan)."</td></tr>
<tr>
<td>"._age.":</td>
<td> <input type=\"text\" name=\"age\" value=\"$age\" size=\"20\"></td>
<td>"._gender.":</td>
<td align=right>".make_selectbox_enum("gender",$gender)."</td></tr>
<tr>
<td>"._bloodline.":</td>
<td> <input type=\"text\" name=\"bloodline\" value=\"$bloodline\" size=\"20\"></td>
<td>"._covenant."</td>
<td align=right>".make_selectbox_enum("covenant",$covenant)."</td></tr>


</table>
</div>"
;


/*Stats. Modify as needed*/



echo"<div align=center><table width=\"600\"  border=\"0\">"
  . " <tr>"
  . "   <td width=\"25%\" valign=\"bottom\"><table width=\"100%\"  border=\"0\" cellspacing=\"7\">"
  . "     <tr>"
  . "       <th>"._power."</th>"
  . "     </tr>"
  . "     <tr>"
  . "       <th>"._finesse."</th>"
  . "     </tr>"
  . "     <tr>"
  . "       <th>"._resistance."</th>"
  . "     </tr>"
  . "   </table></td>";

foreach ($stats as $headerkey => $column) {
	echo   "   <td width=\"25%\"><table width=\"100%\"  border=\"1\">"
	. "    <tr><th>$headerkey</th></tr>";

	foreach($column as $rowkey => $row )
	{
		echo   "     <tr>"
		. "       <td><table width=\"100%\"  border=\"0\">"
		. "         <tr>"
		. "           <td>$row</td>"
		. "           <td align=right>".make_selectbox_num($rowkey,${$rowkey},1,5)."</td>"
		. "         </tr>"
		. "       </table></td>"
		. "     </tr>";
	}

	echo "   </table></td>";


}




echo   " </tr>"
  . "</table>"
 ."";

/*End Stats*/


/*Skills*/




echo"<table width=\"600\" border=\"0\">"
  . " <tr>";

foreach($skills as $headerkey => $column)
{
  echo "   <td width=\"33%\"><table width=\"100%\" border=\"1\">"
  . "     <tr>"
  . "       <th>$headerkey</th>"
  . "     </tr>";


foreach($column as $rowkey => $row )
	{
  echo "     <tr>"
  . "       <td><table width=\"100%\" >"
  . "         <tr>"
  . "           <td>$row</td>"
  . "           <td align=\"right\">".make_selectbox_num($rowkey,${$rowkey},0,5)."</td>"
  . "         </tr>"
  . "       </table></td>"
  . "     </tr>";
}


  echo "   </table></td>";
}



  echo " </tr>"
  . "</table>"
 ."</div>";

/*End Skills*/




echo "
<div align=center valign=top><table width=\"600\">
<tr>";

$numextras = 0;

foreach($extra as $key => $values)
{
	echo "<td valign=top width=33%>
<table width=100% valign=top border=\"1\">
<tr><th>$key</th></tr>

";

$numextras++;

$objectnum = ${$values['name']."num"};

if($objectnum == "")
 $objectnum = 0;



for($m = 0; $m < $objectnum; $m++) {
$objectname = $values['name'].$m;

$objectlist[$m][$values['name']] = ${$objectname};
if($values['hasdots'])
{
	$objectdotname = $values['name'].'dots'.$m;
	$objectlist[$m]['dots'] = ${$objectdotname};
}

if($values['hasvalue'])
{
	$objectvaluename = $values['name'].'value'.$m;
	$objectlist[$m]['value'] = ${$objectvaluename};
}
}

for($m = 0; $m < $objectnum; $m++){
	$objectrmname = $values['name'].'rm'.$m;
	if(${$objectrmname} == _remove){
		unset($objectlist[$m]);
		$temp = array_values($objectlist);
		$objectlist = array_values($temp);
	$objectnum--;
	break;
	}

}

if($submit == _add." ".ucfirst(constant("_".$values['name']))) {
	if(${'new'.$values['name']} != ""){
	$objectlist[$objectnum][$values['name']] = ${'new'.$values['name']};
	if($values['hasdots'])
		$objectlist[$objectnum]['dots'] = ${'new'.$values['name'].'dots'};
	if($values['hasvalue'])
		$objectlist[$objectnum]['value'] = ${'new'.$values['name'].'value'};
	$objectnum++;
	}
}



for($m = 0; $m < $objectnum; $m++) {
echo "<tr><td><table width=100%><tr><td> ".get_value($objectlist[$m][$values['name']],$values['name'],$values['name']."table")." "
.$objectlist[$m]['dots'];
if($objectlist[$m]['value'] != "")
	echo " (".$objectlist[$m]['value'].")";
echo"<input type=\"hidden\" name=\"".$values['name']."$m\" value=\"".$objectlist[$m][$values['name']]."\">";
if($values['hasdots'])
	echo" <input type=\"hidden\" name=\"".$values['name']."dots$m\" value=\"".$objectlist[$m]['dots']."\">";
if($values['hasvalue'])
echo" <input type=\"hidden\" name=\"".$values['name']."value"."$m\" value=\"".$objectlist[$m]['value']."\"></td>";

echo" <td align=right> <input type=\"submit\" name=\"".$values['name']."rm$m\" value=\""._remove."\"></td>"
."</tr></table></td></tr>";
}
echo "
<tr><td>".make_selectbox_table($values['name'],"new".$values['name'],$values['name']."table")."</td></tr>";
if($values['hasvalue'])
	echo"<tr><td align=center><input type=\"textarea\" name=\"new".$values['name']."value\" size=\"25\"></td></tr>";
echo"<tr><td><input type=\"hidden\" name=\"".$values['name']."num\" value=\"$objectnum\">";
echo "<table width=100%><tr>";
if($values['hasdots'])
	echo "<td align=left>".make_selectbox_num("new".$values['name']."dots","",1,10)."</td>";
echo "<td align=right><input type=\"submit\" name=\"submit\" value=\""._add." ".ucfirst(constant("_".$values['name']))."\"></td></tr></table>

</td></tr>
</table>

</td>";

unset ($objectlist);
unset ($objectnum);
if($numextras %3 == 0)
	echo "</tr><tr>";
 }


echo "</tr></table></center>";


echo"
<div align=left><br><br>
<b>"._equipment.":</b><br>
<textarea cols=\"100\" rows=\"8\" name=\"equipment\">$equipment</textarea>
<br><br>
<b>"._owned.":</b><br>
<textarea cols=\"100\" rows=\"8\" name=\"owned\">$owned</textarea><br><br>
<b>"._description.":</b><br>
<textarea cols=\"100\" rows=\"8\" name=\"description\">$description</textarea><br><br>
<b>"._details.":</b><br>
<textarea cols=\"100\" rows=\"8\" name=\"details\">$details</textarea><br><br>
<b>"._background.":</b><br>
<textarea cols=\"100\" rows=\"15\" name=\"background\">$background</textarea><br><br>
<b>"._experience.":</b><br>
<textarea cols=\"100\" rows=\"15\" name=\"experience\">$experience</textarea><br><br>
";

echo "
<p><input type=\"submit\" name=\"submit\" value=\""._preview."\"></form></div></p>
</div>
<br>
";

?>
Return current item: VampMan: V:tR Character Manager