Location: PHPKode > scripts > EncapsGallery > encapsgallery/admin/html/base_items.html
<script language="JavaScript" type="text/javascript">
var visible_ = 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){
    		if(title_ == "visible_")
	      		document.form1.elements[i].checked = visible_;   
    		if(title_ == "delete_")
	      		document.form1.elements[i].checked = delete_;   
    	
	}
  }
  	if(title_ == "visible_")
  		visible_ = !visible_; 
	if(title_ == "delete_")  	
	  delete_ = !delete_; 
}
</script>
<div align="center"><?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>
	<th>Visible<br><a href="javascript:;" onclick="CheckAllINBOX('visible_');" 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="base_item.php?action=show_custom&amp;id=<?php echo $item["id"]?>"><?php echo $item["id"]?></a></td>
<td >Title:<br>
<INPUT type="text" name="title_<?php echo $item["id"]?>" value="<?php echo ($item["title"])?>" size="27"><br>
Date:<br>
<INPUT type="text" name="updated_at_<?php echo $item["id"]?>" value="<?php echo ($item["updated_at"])?>" size="27"><br>
</td>
<td>
<textarea rows="5" name="comment_<?php echo $item["id"]?>"><?php echo (stripslashes($item["comment"]))?></textarea>
</td>
<td>
<SELECT name="rank_<?php echo $item["id"]?>" >
<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>

<td style="text-align:center; background-color:#CCFFCC "><input type="checkbox" name="visible_<?php echo $item["id"]?>" <?php if($item["is_visible"]=="on")echo "checked";?>></td>
<td style="text-align:center; background-color:#FFCCCC "><input type="checkbox" name="delete_<?php echo $item["id"]?>" >
<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="base_items_update_bunch">
<INPUT type="hidden" name="page" value="<?php echo $html["pagination"]["page"]?>">
</form>
<div align="center"><?php include(dirname(__FILE__).'/pagination.html');?></center>
<hr>
<div align="center">
<form enctype="multipart/form-data" action="" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="8000000">

<table class="block">
<tr><th colspan="2">Add new:</th></tr>

<tr >
	<td >Title:</td>
	<td><INPUT name="title" type="text" style="width: 100%;"></td>
</tr>

<tr >
	<td>Comment:</td>
	<td><textarea name="comment" cols="50" rows="5"></textarea></td>
</tr>

<tr >
	<td>Description:</td>
	<td><textarea name="description" cols="50" rows="10"></textarea></td>
</tr>

<tr >
<td>Rank:</td>
<td>
<SELECT name="rank">
<?php  for($i=1;$i<$html["count_total"]+2;$i++){ ?>
<option value="<?php echo $i?>" <?php  if($i > $count)echo "selected"?> ><?php echo $i?></OPTION>
<?php  } ?>
</SELECT>
</td>
</tr>

<tr >
<td>Visible:</td>
<td><INPUT type="checkbox" name="is_visible" checked></td>
</tr>

<tr><th colspan="2"><INPUT type="submit" value="Submit"></th></tr>

</TABLE>
<INPUT type="hidden" name="action" value="base_items_update">
</form>
</div>
Return current item: EncapsGallery