📄 managestates.tpl
字号:
{strip}
<script type="text/javascript">
/* <![CDATA[ */
function checkMe(form)
{ldelim}
if (form.code.value == '' || form.name.value == ''){ldelim}
alert("{lang mkey='errormsgs' skey=20}");
return false;
{rdelim}
return true;
{rdelim}
function confirmDelete(id)
{ldelim}
var conmsg = "{lang mkey='admin_js__delete_error_msgs' skey=13}";
if (confirm(conmsg)){ldelim}
document.location='managestates.php?countrycode={$countrycode}&action=delete&id='+id;
{rdelim}
{rdelim}
function confirmDeleteSel(frm)
{ldelim}
var conmsg = "{lang mkey='admin_js__delete_error_msgs' skey=15}";
if (confirm(conmsg)){ldelim}
document.frmStates.groupaction.value = "{lang mkey='delete_selected'}";
document.frmStates.submit();
{rdelim}
{rdelim}
/* ]]> */
</script>
{assign var="page_hdr01_text" value='<a href="managecountries.php" class="subhead">'|cat:"{lang mkey='manage_countries'}"|cat:'</a> > '}
{if $todo != ''}
{assign var="page_hdr01_text" value=$page_hdr01_text|cat:'<a href="managestates.php?countrycode='|cat:$countrycode|cat:'" class="subhead">'|cat:"{lang mkey='manage_states'}"|cat:'</a> > '}
{if $todo == 'add'}
{assign var="page_hdr01_text" value=$page_hdr01_text|cat:"{lang mkey='insert_state'}"|cat:'</a>'}
{else}
{assign var="page_hdr01_text" value=$page_hdr01_text|cat:"{lang mkey='modify_state'}"|cat:'</a>'}
{/if}
{else}
{assign var="page_hdr01_text" value=$page_hdr01_text|cat:"{lang mkey='manage_states'}"}
{/if}
{include file="admin/admin_page_hdr01.tpl"}
<br />
<center>
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td class="module_detail_inside" width="100%">
{assign var="page_hdr02_text" value=$countryname|cat:' >> '}
{if $todo == 'add'}
{assign var="page_hdr02_text" value=$page_hdr02_text|cat:"{lang mkey='insert_state'}"}
{elseif $todo == 'edit'}
{assign var="page_hdr02_text" value=$page_hdr02_text|cat:"
{lang mkey='modify_state'}"}
{else}
{assign var="page_hdr02_text" value=$page_hdr02_text|cat:"{lang mkey='states_count'}: "|cat:$total_recs}
{/if}
{include file="admin/admin_page_hdr02.tpl"}
{ if $errmsg != ''}
<table>
<tr>
<td width="6"> </td>
<td colspan="2" style="padding-top: 5px; padding-bottom: 5px;"><span class="errors">{mylang mkey='errormsgs' skey=$errmsg}</span></td>
</tr>
</table>
{ /if }
{if $todo != ''}
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="left">
<form name="states" method="post" action="managestates.php" onsubmit="javascript: return checkMe(this);">
<table width="100%" cellspacing="{$config.cellspacing}" cellpadding="{$config.cellpadding}" border="0">
<tr>
<td width="6"> </td>
<td align="left" width="150">
{lang mkey='state_code'}:<font color="{lang mkey='required_info_indicator_color'}">{lang mkey='required_info_indicator'}</font>
</td>
<td >
<input type="text" name="code" value="{$data.code|stripslashes}" />
</td>
</tr>
<tr>
<td width="6"> </td>
<td width="150">
{lang mkey='state_name'}:<font color="{lang mkey='required_info_indicator_color'}">{lang mkey='required_info_indicator'}</font>
</td>
<td >
<input type="text" name="name" value="{$data.name|stripslashes}" />
</td>
</tr>
<tr>
<td width="6"> </td>
<td align="center">
<input name="id" type="hidden" value="{$data.id}" />
<input name="countrycode" type="hidden" value="{$countrycode}" />
<input type="hidden" name="action" {if $todo == 'edit'}value='edited'{else}value='added' {/if} />
<input type="submit" class="formbutton" name="submit" {if $todo == 'edit'}value="{lang mkey='modify_state'}"{else}value="{lang mkey='insert_state'}" {/if} />
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
{ else }
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table width="100%" cellspacing="{$config.cellspacing}" cellpadding="{$config.cellpadding}" border="0">
<tr><td colspan="3"><a href="managestates.php?countrycode={$countrycode}&action=add">{lang mkey='insert_state'}</a>
<td colspan="3" align="right">
<form action="" method="get" name="frmPageList">
{lang mkey='results_per_page'}
<select name="results_per_page" id="results_per_page">
{html_options options=$lang.search_results_per_page selected=$page_size}
</select>
<input type="hidden" name="countrycode" value="{$countrycode}" />
<input type="submit" class="formbutton" value="{lang mkey='show'}" />
</form>
</td>
</tr>
</table>
<form action="managestates.php" method='post' name="frmStates">
<input type="hidden" name="countrycode" value="{$countrycode}" />
<table width="100%" cellspacing="{$config.cellspacing}" cellpadding="{$config.cellpadding}" border="0">
<tr class="table_head">
<th><input type="checkbox" name="chkall" value="" onclick="checkAll(this.form,'txtcheck[]',this.checked)" /></th>
<th nowrap>{lang mkey='col_head_srno'}</th>
<th nowrap><a href="?sort={lang mkey='state_code' escape='url'}&type={$sort_type}&countrycode={$countrycode}">{lang mkey='state_code'}</a></th>
<th nowrap><a href="?sort={lang mkey='state_name' escape='url'}&type={$sort_type}&countrycode={$countrycode}">{lang mkey='state_name'}</a></th>
<th colspan="2" >{lang mkey='action'}</th>
</tr>
{assign var="n" value="$upr"}
{foreach item=item key=key from=$stateslist}
{math equation="$n+1" assign="n" }
<tr class="{cycle values="oddrow,evenrow"}">
<td ><input type="checkbox" name="txtcheck[]" value="{$item.id}" /></td>
<td nowrap>{$n}</td>
<td nowrap>{$item.code|stripslashes}</td>
<td nowrap><a href="managecounties.php?countrycode={$countrycode}&statecode={$item.code}">{$item.name|stripslashes}</a></td>
<td nowrap colspan="2" ><a href="managestates.php?countrycode={$countrycode}&action=edit&id={$item.id}"><img src="images/button_edit.png" alt='Edit' border="0" /></a>
<a href="#" onclick="confirmDelete({$item.id});"><img src="images/button_drop.png" alt="Delete" border="0" /></a></td>
</tr>
{/foreach}
<tr>
<td colspan="5">
<img src="images/arrow_ltr.png" alt="" />{lang mkey='with_selected'}
<input type="button" class="formbutton" value="{lang mkey='delete_selected'}" name="checkDel" onclick="javascript: confirmDeleteSel();" />
<input name="groupaction" type="hidden" value="" />
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td colspan="5" align="center">
{assign var="pageno" value=$smarty.get.offset}
{if $pageno == ""}{assign var="pageno" value=1}{/if}
{if $pageno != "1"}
<a href="managestates.php?countrycode={$countrycode}&offset={$pageno-1}">{lang mkey='previous'}</a>
{else}
{lang mkey='previous'}
{/if}
{if $total_recs > $page_size}
<a href="managestates.php?countrycode={$countrycode}&offset={$pageno+1}">{lang mkey='next'}</a>
{else}
{lang mkey='next'}
{/if}
</td>
</tr>
</table>
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="module_detail_inside">
{assign var="page_hdr02_text" value="{lang mkey='filter_records'}"}
{include file="admin/admin_page_hdr02.tpl"}
<table width="100%" border="0" cellspacing="2" cellpadding="1" align="center">
<tr>
<td>
<form name="srchMe" method="post" action="">
<input type="hidden" name="countrycode" value="{$countrycode}" />
{lang mkey='state_code'}:
<input name="statecode" value="{$statecode}" type="text" size="4" maxlength="4" />
{lang mkey='or'}
{lang mkey='state_name'}:
<input type="text" name="statename" value="{$statename}" size="30" maxlength="100" />
<input type="submit" class="formbutton" name="searchme" value="{lang mkey='show'}" />
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
{/if}
</td>
</tr>
</table>
</center>
{/strip}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -