<?php
if (isset($tpl['status']))
{
	$status = __('status', true);
	switch ($tpl['status'])
	{
		case 2:
			pjUtil::printNotice(NULL, $status[2]);
			break;
	}
} else {
	pjUtil::printNotice(__('infoUpdateCategoryTitle', true), __('infoUpdateCategoryDesc', true));
	?>
	
	<form action="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminCategories&amp;action=pjActionUpdate" method="post" id="frmUpdateCategory" class="form pj-form">
		<input type="hidden" name="category_update" value="1" />
		<input type="hidden" name="id" value="<?php echo $tpl['arr']['id']; ?>" />
		
		<div class="clear_both">
			<p>
				<label class="title"><?php __('lblCategory'); ?></label>
				<span class="inline_block">
					<input type="text" name="name" value="<?php echo pjSanitize::html($tpl['arr']['name']);?>" class="pj-form-field w300 required" data-msg-required="<?php __('lblFieldRequired');?>"/>
				</span>
			</p>
			<p>
				<label class="title"><?php __('lblDescription'); ?></label>
				<span class="inline_block">
					<textarea name="description" class="pj-form-field w500 h150" data-msg-required="<?php __('lblFieldRequired');?>"><?php echo stripslashes($tpl['arr']['description']);?></textarea>
				</span>
			</p>
			<p>
				<label class="title"><?php __('lblFontColor', false, true); ?></label>
				<span class="pj-form-field-custom pj-form-field-custom-after">
					<input type="text" id="font_color" name="font_color" class="pj-form-field field-color w60" value="<?php echo pjSanitize::html($tpl['arr']['font_color']);?>"  />
					<span class="pj-form-field-after"></span>
				</span>
			</p>
			<p>
				<label class="title"><?php __('lblBackgroundColor', false, true); ?></label>
				<span class="pj-form-field-custom pj-form-field-custom-after">
					<input type="text" id="background_color" name="background_color" class="pj-form-field field-color w60" value="<?php echo pjSanitize::html($tpl['arr']['background_color']);?>"  />
					<span class="pj-form-field-after"></span>
				</span>
			</p>
			<p>
				<label class="title"><?php __('lblStatus'); ?></label>
				<span class="inline_block">
					<select name="status" id="status" class="pj-form-field required" data-msg-required="<?php __('lblFieldRequired');?>">
						<option value="">-- <?php __('lblChoose'); ?>--</option>
						<?php
						foreach (__('u_statarr', true) as $k => $v)
						{
							?><option value="<?php echo $k; ?>"<?php echo $k == $tpl['arr']['status'] ? ' selected="selected"' : NULL;?>><?php echo $v; ?></option><?php
						}
						?>
					</select>
				</span>
			</p>
			<p>
				<label class="title">&nbsp;</label>
				<input type="submit" value="<?php __('btnSave'); ?>" class="pj-button" />
				<input type="button" value="<?php __('btnCancel'); ?>" class="pj-button" onclick="window.location.href='<?php echo PJ_INSTALL_URL; ?>index.php?controller=pjAdminCategories&action=pjActionIndex';" />
			</p>
		</div>
	</form>
	<script type="text/javascript">
	var myLabel = myLabel || {};
	</script>
	<?php
}
?>