Location: PHPKode > scripts > EncapsGallery > encapsgallery/admin/html/catalog_items.html
<div align="center">
<form name="form_category" action="">
<?php 
function category_parse_($_categories,$_nbsp="&nbsp;&nbsp;&nbsp;")
{
	$postget = $_POST?$_POST:$_GET;
	foreach($_categories as $_category)
	{
		?><option value="<?php echo $_category['id']?>" <?php echo ($_category['id']==@$postget['categ_id'])?"selected":"";?> ><?php echo $_nbsp.$_category['title']." (".$_category['total'].")"?></option>
		<?php if(count($_category['childs']))
					category_parse_($_category['childs'],$_nbsp.$_nbsp);
		}		
}
?>
Category:
<select name="categ_id" onchange="form_category.submit()">
<option value="0">/</option>
<?php category_parse_($html['categs'])?>
</select>
</form>

<script language="JavaScript" type="text/javascript">
var _is_enabled = true;
var _delete = true;
function CheckAllINBOX(title_) {
  for (var i = 0; i < document.form1.elements.length; i++) {
    if(document.form1.elements[i].type == 'checkbox' 
	&& document.form1.elements[i].name.indexOf(title_)>0
	){
//	alert(title_);
    		if(title_ == "_is_enabled")
	      		document.form1.elements[i].checked = _is_enabled;   
    		if(title_ == "_delete")
	      		document.form1.elements[i].checked = _delete;   
    	
	}
  }
  	if(title_ == "_is_enabled")
  		_is_enabled = !_is_enabled; 
	if(title_ == "_delete")  	
	  _delete = !_delete; 
}
</script>
<?php include(dirname(__FILE__).'/pagination.html');?></center>
<form enctype="multipart/form-data" action="" method="post" name="form1">
<table class="block" align="center" >
<tr>
	<th>Id</th>
	<th>Title</th>
	<th>Comment</th>
	<th>Rank</th>
	<?php if($config["shopcart_is_enabled"]==1){ ?>
	<th>Price</th>
	<?php } ?>
	<th>Visible<br><a href="javascript:;" onclick="CheckAllINBOX('_is_enabled');" style="background-color:#CCFFCC;font-weight: bold; color:#009900">on/off</a></th>
	<th>Delete<br><a href="javascript:;" onclick="CheckAllINBOX('_delete');" style="background-color:#FFCCCC;font-weight: bold; color:#FF0000">on/off</a></th>
</tr>
<?php 
$count = sizeof($html["items"]);
$current = 0;
foreach($html["items"] as $item){ ?> 
<tr align="center" >

<td style="text-align:center"><a href="catalog_item.php?id=<?php echo $item["id"]?>"><img src="../rwx/<?php echo $item["file_thumb"]?>"><br>[Edit]</a></td>

<td >Title:<br>
<INPUT type="text" name="id<?php echo $item["id"]?>_title" value="<?php echo ($item["title"])?>" size="27">
<br>Category:<br>
<select name="id<?php echo $item['id']?>_categ_id" >
<option value="0">/</option>
<?php category_parse_($html['categs'],"" ,$item['categ_id'])?>
</select>
</td>

<td>
<textarea rows="5" name="id<?php echo $item["id"]?>_comment"><?php echo (stripslashes($item["comment"]))?></textarea>
</td>

<td>
<SELECT name="id<?php echo $item["id"]?>_rank" >
<option>&nbsp;</option>
<?php  for($i=1;$i<$html["count_total"]+1;$i++){?>
<option value="<?php echo $i?>" <?php if($i==$item["rank"])echo "selected"?>><?php echo $i?></OPTION>
<?php }?>
</SELECT>
</td>

<?php if($config["shopcart_is_enabled"]==1){ ?>
<td ><INPUT type="text" name="id<?php echo $item["id"]?>_price" value="<?php echo sprintf("%.2f",$item["price"])?>" size="4"></td>
<?php } ?>

<td style="text-align:center; background-color:#CCFFCC "><input type="checkbox" name="id<?php echo $item["id"]?>_is_enabled" <?php if($item["is_enabled"]=="1")echo "checked";?>></td>
<td style="text-align:center; background-color:#FFCCCC "><input type="checkbox" name="id<?php echo $item["id"]?>_delete" >
<input type="hidden" name="id<?php echo $item["id"]?>" value="<?php echo $item["id"]?>">
</td>
<?php }?>
</tr>

<tr><th colspan="8" ><?php if($count>0){?><INPUT type="submit" value="Submit changes"><?php }?></th></tr>
</TABLE>
<INPUT type="hidden" name="action" value="catalog_items_update_bunch_submit">
<INPUT type="hidden" name="page" value="<?php echo $html["pagination"]["page"]?>">
<INPUT type="hidden" name="categ_id" value="<?php echo (int)@$postget["categ_id"]?>">
</form>
<?php include(dirname(__FILE__).'/pagination.html');?>
<hr>
<a href="catalog_item.php?categ_id=<?php echo (int)@$postget["categ_id"]?>">[Add new]</a>

</div>
Return current item: EncapsGallery