Location: PHPKode > projects > SimpleHRM > simplehrm-1.0-beta1/simplehrm-1.0-beta1/templates/default/admin/company/divisionlisting.tpl.html
{assign var=m value=$sm.next_prev->module}
<div id="division_list">
			<div class="box box-75 altbox">
				<div class="boxin">
					<div class="header">
						<h3>
						Division Listing
						</h3>
					</div>
{if $sm.list || $sm.hlink}
					<div class="content">
						<table cellspacing="0">
						<thead>
							<tr>
								{if $sm.special}
									<td class="tb">{$sm.special.prompt}</td>
								{/if}
								{foreach from=$sm.field item=item key=key}
									{if $key == $smarty.session.$m.sort_by}
										{if $smarty.session.$m.sort_order=="ASC"}
											{assign var=cls value="asc"}
										{else}
											{assign var=cls value="desc"}
										{/if}
									{else}
										{assign var=cls value=""}
									{/if}

									<td class="tc {$cls}">
										{if $item.1!=0}
											{if $sm.ajax}
												<a href="javascript:get_next_page('##APP_ROOT_URL##{$sm.uri}-sort_by-{$key}',0,0)">{if $item!=""}{$item.0}{else}{$key}{/if}</a>
											{else}
												<a href="##APP_ROOT_URL##{$sm.uri}-sort_by-{$key}">{if $item!=""}{$item.0}{else}{$key}{/if}</a>
											{/if}
										{else}
											{if $item!=""}{$item.0}{else}{$key}{/if}
										{/if}
									</td>
								{/foreach}
								{foreach from=$sm.links item=item key=key}
									<td class="tc">
										{$item.0}
									</td>
								{/foreach}
                                
							<td>Edit</td>
							<td>Remove</td>
							</tr>
						</thead>
						<tbody>
						{section name=cur loop=$sm.list}
						{assign var=x value=$sm.list[cur]}
							<tr {if $smarty.section.cur.iteration==1}class="first"{/if}>
							{if $sm.special}
								<td class="tb">
									{assign var=id value=$sm.special.id}
									<input type="checkbox" class="chkbox" value="{$x.$id}"/>
								</td>
							{/if}
							{foreach from=$sm.field item=item key=key}
								<td class="tb">
									{if $item.anchor}
										{if $item.condition}
											{assign var=cond value=$x.$key}
											<a href="{$item.anchor}{$x.id_user}">{$item.condition.$cond}</a>
										{else}
											<a href="{$item.anchor}{$x.$key}">{$x.$key}</a>
										{/if}
										<!--<a href="{$item.anchor}{$x.$key}">{$x.$key}</a>-->
									{elseif $item.condition}
										{assign var=cond value=$x.$key}
										{$item.condition.$cond}
									{else}
										{if $item.format!=""}
											{capture name=k}
												{ldelim}"{$x.$key}"|{$item.format}{rdelim}
											{/capture}
											{eval var=$smarty.capture.k}
										{elseif $item.image!=""}
											<img src="{$item.image}{$x.$key}" />
										{else}
											{$x.$key}
										{/if}
									{/if}
								</td>
							
							{/foreach}
				
                <td>
                <a href="javascript:void(0);" onclick="edit_department({$x.id_department},'{$x.dept_name}')"><img src="##LBL_SITE_URL##templates/css_theme/img/led-ico/pencil.png" alt="" title="Delete"/></a>			
                </td>
				<td>
                <a href="javascript:void(0);" onclick="remove_department({$x.id_department})"><img src="##LBL_SITE_URL##templates/css_theme/img/led-ico/delete.png" alt="" title="Delete"/></a>			
                </td>
				<td>
							{foreach from=$sm.links item=item key=key}
								<td class="tc">
									<a {if $item.function}onclick='{$item.function}("{$item.1}{$x[$item.2]}");'{else}href="{$item.1}{$x[$item.2]}"{/if}>{if $item.3}<img src="{$item.3}" title="{$item.0}"/>{else}{$item.0}{/if}</a>
								</td>
							{/foreach}
							</tr>
						{/section}
						</tbody>
						</table>
					</div>
				</div>
				{if $sm.type=='advance'}
					<div class="pagination_adv">
						{$sm.next_prev->generateadv()}
					</div>
				{elseif $sm.type=='box'}
					<div class="pagination_box">
						<div align="center">{$sm.next_prev->generate()}</div>
					</div>
				{elseif $sm.type=='normal'}
					<div class="pagination">
						<div align="center">{$sm.next_prev->generate()}</div>
					</div>
				{elseif $sm.type=='nextprev'}
					<div class="pagination">
						<div align="center">{$sm.next_prev->onlynextprev()}</div>
					</div>
				{elseif $sm.type=='extra'}
					<div class="pagination_box">
						<div align="center">{$sm.next_prev->generateextra()}</div>
					</div>
				{else}
					{if $sm.type!='no'}
						<div>
							<div align="center">{$sm.next_prev->generate()}</div>
						</div>
					{/if}
				{/if}
			</div>
{else}
	<center><b>No records found</b></center>
{/if}
</div>
<input type="hidden" id="rec" value='{$sm.rec}'>
<input type="hidden" id="qstart" value='{$sm.qstart}'>
<input type="hidden" id="mod" value='{$sm.mod}'>
{literal}
	<script type="text/javascript">
		
	function remove_department(id){
	 var url="##LBL_ADMIN_SITE_URL##company/remove_division/ce-0-?";
	 var conf=confirm('Do you really want to delete this record?');
	 if(conf){
		 $.post(url,{id_division:id},function(res){
		 $('#division_list').html(res);
		 });
	 }else
	 	return false;
	}
	function edit_department(id,divisionname)
	{
	//alert(id+" "+deptname);
	$('#dept_name').val(divisionname);
	$('#id_department').val(id);
	$('#dept_name').focus();
	$('#dept_name').select();
	$('#add').val("Update");
	}
	</script>
{/literal}
Return current item: SimpleHRM