<?php
/*===================================================+
|| # HoloCMS - Website and Content Management System
|+===================================================+
|| # Copyright © 2008 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|+===================================================+
|| # HoloCMS is provided "as is" and comes without
|| # warrenty of any kind. HoloCMS is free software!
|+===================================================+
|| # Parts written by IzTheWiz of RaGEZONE forums
|| # Parts written by HandyAndy160 of RaGEZONE forums
|| # Sisija is NOT a fag
|+===================================================*/

require_once('../core.php');
if($hkzone !== true){ header("Location: index.php?throwBack=true"); exit; }
if(!session_is_registered(acp)){ header("Location: index.php?p=login"); exit; }

$pagename = "Add new rare to guide";

if($do == "save"){

	$id = $key;

	$name = addslashes($_POST['name']);
	$img = addslashes($_POST['img']);
	$value = addslashes($_POST['value']);
	$category = addslashes($_POST['category']);

	if($category != 1 && $category != 2 && $category != 3 && $category != 4) { $category = 1; }
	if(!is_numeric($value)) { $value = 1; }

	mysql_query("INSERT INTO rarevalue (name,img,value,valuestate,releasestate,category,last_update) VALUES ('".$name."','".$img."','".$value."','0','0','".$category."','".$date."?".$time."')") or die(mysql_error());

	header("Location: index.php?p=rare_manage&do=bounce");

}

@include('subheader.php');
@include('header.php');
?>
<table cellpadding='0' cellspacing='8' width='100%' id='tablewrap'>
<tr> <td width='22%' valign='top' id='leftblock'>
 <div>
 <!-- LEFT CONTEXT SENSITIVE MENU -->
<?php @include('sitemenu.php'); ?>
 <!-- / LEFT CONTEXT SENSITIVE MENU -->
 </div>
 </td>
 <td width='78%' valign='top' id='rightblock'>
 <div><!-- RIGHT CONTENT BLOCK -->

<form action='index.php?p=rare_add&do=save' method='post' name='theAdminForm' id='theAdminForm'>
<div class='tableborder'>
<div class='tableheaderalt'>Add new rare to guide</div>

<table width='100%' cellspacing='0' cellpadding='5' align='center' border='0'>
<tr>
<td class='tablerow1'  width='40%'  valign='middle'><b>Rare Name</b><div class='graytext'>The correct name of the rare.</div></td>
<td class='tablerow2'  width='60%'  valign='middle'><input type='text' name='name' value="<?php echo $rare['name']; ?>" size='30' class='textinput'></td>
</tr>

<tr>
<td class='tablerow1'  width='40%'  valign='middle'><b>Image Filename</b><div class='graytext'>The filename of the thumbnail image (in rareimg folder).</div></td>
<td class='tablerow2'  width='60%'  valign='middle'><input type='text' name='img' value="<?php echo $rare['img']; ?>" size='30' class='textinput'>.gif</td>
</tr>

<tr>
<td class='tablerow1'  width='40%'  valign='middle'><b>Value</b><div class='graytext'>The starting value of this rare in HCs.<br>Eg. 2 or 2.5</div></td>
<td class='tablerow2'  width='60%'  valign='middle'><input type='text' name='value' value="<?php echo $rare['value']; ?>" size='5' class='textinput'></td>
</tr>

<tr>
<td class='tablerow1'  width='40%'  valign='middle'><b>Category</b><div class='graytext'>What type of rare this is.<br>1 = normal rare, 2 = xmas, 3 = h'ween, 4 = HC</div></td>
<td class='tablerow2'  width='60%'  valign='middle'><input type='text' name='category' value="<?php echo $rare['category']; ?>" size='1' maxlength='1'class='textinput'></td>
</tr>

<tr>
<tr><td align='center' class='tablesubheader' colspan='2' ><input type='submit' value='Add rare' class='realbutton' accesskey='s'></td></tr>
</form></table></div><br />
	 </div><!-- / RIGHT CONTENT BLOCK -->
	 </td></tr>
</table>
</div><!-- / OUTERDIV -->
<div align='center'><br />
<?php
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
printf('Time: %.3f', $totaltime);
?>
</div>