Login   Register  
PHP Classes
elePHPant
Icontem

File: tmpl/admin.view.list-bar.tpl

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of invitro  >  Navelo CMS  >  tmpl/admin.view.list-bar.tpl  >  Download  
File: tmpl/admin.view.list-bar.tpl
Role: Auxiliary data
Content type: text/plain
Description: Admin list bar
Class: Navelo CMS
A complete Content Management System
Author: By
Last change:
Date: 2004-08-04 07:23
Size: 5,142 bytes
 

Contents

Class file image Download
<script language="JavaScript">

function CheckAll(ch)
{ldelim}
	var v = ch.checked;
	var f = ch.form;
	
	for( var i=0; i < f.elements.length; i++ )
	{ldelim}
    	if( f.elements[i].type == "checkbox" )
		{ldelim}
    	   f.elements[i].checked = v; 
	    {rdelim}
	{rdelim}
{rdelim}

</script>

<table width="100%">
	<tr>
		<td>
		<input type="checkbox" value="Check All 2" onClick="CheckAll(this)" />
		Check All&nbsp;<em><small>and</small></em>&nbsp;
		<select name="do">
			<option value="">[ Select Action ]</option>
			<option value="Delete">Delete</option>
			<option value="Status1">Change Status (Show)</option>
			<option value="Status2">Change Status (Hidden)</option>
		</select>
		&nbsp;
		<input type="Submit" value="Submit" onclick="if(confirm('Are you sure want to perform this action to all selected item?')) return true; else return false;" />
		</td>
		
		<td align="right">
		{* Initial Value *}
		{assign var="num" value=$record.num}
		{assign var="off" value=$record.off}

		{**************************************************************************************************}

		{* Formula *}

		{* Total Paging *}
		{math equation="ceil(total / num)" total=$record.total num=$num format="%.0f" assign="total_paging"}

		{* Substract Offset *}
		{math equation="off - num" off=$off num=$num assign="offset_minus"}

		{* Adding Offset *}
		{math equation="off + num" off=$off num=$num assign="offset_plus"}

		{* Last Page Offset *}
		{math equation="( total - 1 ) * num" total=$total_paging num=$num assign="last_page_offset"}

		{* At the Last Page *}
		{math equation="off + num" off=$off num=$num assign="at_last_page"}

		{**************************************************************************************************}

		{* First Offset *}
		{if $record.total lt $num || $off lt "-1" || $off eq "-1"}
			{assign var="calculate_offset1" value="-1"}
			{assign var="status_offset1" value="hide"}
		{else}
			{assign var="calculate_offset1" value="-1"}
			{assign var="status_offset1" value="show"}
		{/if}

		{* Prev Offset *}
		{if $offset_minus lt "-1" || $offset_minus gt $record.total}
			{assign var="calculate_offset2" value="-1"}
			{assign var="status_offset2" value="hide"}
		{elseif $offset_minus eq "-1"}
			{assign var="calculate_offset2" value=$offset_minus}
			{assign var="status_offset2" value="show"}
		{elseif $offset_minus eq "0"}
			{assign var="calculate_offset2" value="-1"}
			{assign var="status_offset2" value="show"}
		{else}
			{assign var="calculate_offset2" value=$offset_minus}
			{assign var="status_offset2" value="show"}
		{/if}

		{* Next Offset *}
		{if $offset_plus lt "-1" || $offset_plus eq "-1" || $offset_plus gt $record.total || $record.total lte $num || $at_last_page gte $record.total}
			{assign var="calculate_offset3" value="-1"}
			{assign var="status_offset3" value="hide"}
		{elseif $offset_plus eq "0"}
			{assign var="calculate_offset3" value="-1"}
			{assign var="status_offset3" value="show"}
		{elseif $offset_plus eq "1" && $record.total gt 2}
			{assign var="calculate_offset3" value="2"}
			{assign var="status_offset3" value="show"}
		{else}
			{assign var="calculate_offset3" value=$offset_plus}
			{assign var="status_offset3" value="show"}
		{/if}

		{* Last Offset *}
		{if $last_page_offset lt "0" || $last_page_offset eq "-1" || $last_page_offset gt $record.total || $at_last_page gte $record.total|| $record.total lte $num}
			{assign var="calculate_offset4" value="-1"}
			{assign var="status_offset4" value="hide"}
		{else}
			{assign var="calculate_offset4" value=$last_page_offset}
			{assign var="status_offset4" value="show"}
		{/if}

		{**************************************************************************************************}

		{if $status_offset1 eq "show" || $status_offset2 eq "show" || $status_offset3 eq "show" || $status_offset4 eq "show"}
		<table width="100%">
			<tr align="right">
				<td>
				{* First *}
				{if $status_offset1 eq "show"}
					<a href="?action={$smarty.get.action}&num={$num}&off={$calculate_offset1}" title="First Page"><strong>&laquo;&laquo;</strong></a>
				{else}
					<strong>&laquo;&laquo;</strong>
				{/if}
		
				&nbsp;|&nbsp;
		
				{* Prev *}
				{if $status_offset2 eq "show"}
					<a href="?action={$smarty.get.action}&num={$num}&off={$calculate_offset2}" title="Previous Page"><strong>&laquo;</strong></a>
				{else}
					<strong>&laquo;</strong>
				{/if}
		
				&nbsp;|&nbsp;
		
				{* Next *}
				{if $status_offset3 eq "show"}
					<a href="?action={$smarty.get.action}&num={$num}&off={$calculate_offset3}" title="Next Page"><strong>&raquo;</strong></a>
				{else}
					<strong>&raquo;</strong>
				{/if}
		
				&nbsp;|&nbsp;
		
				{* Last *}
				{if $status_offset4 eq "show"}
					<a href="?action={$smarty.get.action}&num={$num}&off={$calculate_offset4}" title="Last Page"><strong>&raquo;&raquo;</strong></a>
				{else}
					<strong>&raquo;&raquo;</strong>
				{/if}
				</td>
			</tr>
		</table>
		{/if}
		</td>
	</tr>
</table>