Location: PHPKode > projects > SimpleHRM > simplehrm-1.0-beta1/simplehrm-1.0-beta1/templates/default/admin/setting/msg_list.tpl.html
{assign var=lang_code value=$util->get_values_from_config_reverse('LANGUAGE')}
{assign var=qstart value=$sm.next_prev->start}
{assign var=m value=$sm.next_prev->module}
{assign var=total value=$sm.next_prev->total}
{if $sm.list}
<div>
	<div class="inner-container">
		<div class="box box-75 altbox">
			<div class="boxin">
			<div class="header">
				<h3>
					{if $sm.pg_header}
						{$sm.pg_header}&nbsp;({$sm.next_prev->total})
					{else}
						{$sm.next_prev->module|capitalize:true} Lists
					{/if}
				</h3>
				{if $smarty.session.id_developer}
					<a class="button" href="javascript:void(0);" onclick="add_msg();">Add New Message&nbsp;»</a>
					<span>&nbsp;&nbsp;<font color="#FFFFFF"><b>Please does not remove Message Key starting with SETTING_<b></font></span>
				{/if}					
			</div>
			<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,'{$smarty.request.page}_{$smarty.request.choice}')">{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}
						</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}
									<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}
										{if $key=='lang_code'}
											{assign var=language value=$lang_code[$x.lang_code]}
											{$language}
										{else}
											{$x.$key}
										{/if}
									{/if}
								{/if}
							</td>
						{/foreach}
						{foreach from=$sm.links item=item key=key}
							<td class="tc">
								<a {if $item.function}href="javascript:void(0);"onclick='{$item.function}("{$item.1}{$x[$item.2]}",{$qstart});'{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 $total > $sm.limit}
		{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}
		{/if}
</div>
{else}
	<div align="center"><div class="inner-container"><div class="box box-75 altbox"><b>No records found</b></div></div></div>
{/if}
{literal}
<script type="text/javascript">
	function add_msg() {
		var url = "##LBL_ADMIN_SITE_URL##index.php";
		$.fancybox.showActivity();
		$.post(url,{"page":"setting","choice":"add_msg",ce : 0},function(res){
			//$.fancybox(res);
			show_fancybox(res);
		});
	}
	
	function edit_msg(id_msg) {
		var url="##LBL_ADMIN_SITE_URL##index.php";
		$.fancybox.showActivity();
		$.post(url,{"page":"setting","choice":"edit_msg","id_msg":id_msg,ce:0},function(res) {
			//$.fancybox(res);
			show_fancybox(res);
		});
	}
	
	function delete_msg(key_name) {
		var ser_msg_name=$('#ser_msg_name').val()?$('#ser_msg_name').val():'';
		var msg = {/literal}"{$smarty.const.SETTING_CONFIRM_DEL_EN}"{literal};
		if(confirm(msg)) {
			var url="##LBL_ADMIN_SITE_URL##index.php";
			$.post(url,{"page":"setting","choice":"delete_msg","key_name":key_name,"ser_msg_name":ser_msg_name,ce:0},function(res) {
				var msg_del = {/literal}"{$smarty.const.SETTING_DELETE_SUC_EN}"{literal};
				alert(msg_del);
				$('#setting_msg_list').html(res);
			});
		}else {
			return false;
		}
	}
</script>
{/literal}
Return current item: SimpleHRM