Location: PHPKode > projects > SimpleHRM > simplehrm-1.0-beta1/simplehrm-1.0-beta1/templates/default/setting/listing.tpl.html
<script type="text/javascript" src="##JS_PATH##libsext/js/reorder.js"></script>
<script type="text/javascript" src="##JS_PATH##libsext/js/table_dnd.js"></script>
<link rel="stylesheet" type="text/css" href="##LBL_SITE_URL##templates/css_theme/setting.css"/>
{if $sm.res}
<div class="cont">
    <div class="cont_bg_top"></div>
    <div class="cont_bg_mdl">
        <div class="cont_hdr1 fltlft">
            <div class="cont_hdr_lft fltlft"></div>
            <div class="cont_hdr_mdl1 fltlft">
                <div class="fltlft">
                   Configuration settings 
                </div>
                <div class="fltrht mrgtp-5">
                    <input id="collapse" type="button" value="Expand All"/>
                    <!--<input  type="button" onclick="addNew('##LBL_SITE_URL##index.php/page-setting-choice-add-ce-0');" value="Add new" >-->
                    <span id="chk_unchk"><input  type="button" onclick="checkAll(1);" value="Check All" ></span>
                    <input  type="button" onclick="deleteKey('##LBL_SITE_URL##index.php/page-setting-choice-delete_config-ce-0','');" value="Delete" />
                </div>
                <div class="clear"></div>
            </div>    	        
            <div class="cont_hdr_rht fltlft"></div>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
        <div class="cont_txt">
            <div class="txtbg_top fltlft"></div>
            <div class="txtbg_mdl fltlft">


<div>
{section name=setting loop=$sm.res}
{assign var=x value=$sm.res[setting]}
    {if $sm.res[setting.index_prev].name != $x.name}
            <div class="div_head">
            	<div class="fl">
                	<b class="sign" style="font-size:16px; margin-left:5px">+</b>
                </div>
                
                <div class="fl">
                	<b>&nbsp;&nbsp;&nbsp;{$x.name}</b>
                </div>
                <div class="fr"><a href="javascript:void(0);" onclick="addNew('##LBL_SITE_URL##index.php/page-setting-choice-add-id_config-{$x.id_config}-ce-0');" class="rht_btn">Add new</a></div>
             </div>
            <div class="content table_margin" style="display:none; overflow:hidden">
{literal}
    <script type="text/javascript">
    $(document).ready(function(){
        var curl='##LBL_SITE_URL##index.php/setting/reorder?tab=';
        {/literal}
        new callreorder("tab{$x.name}","dragHandle",curl,"showDragHandle","class1");
        {literal}
    });
    </script>
{/literal}
<div class="fr" style="margin-top:10px;margin-right:5px">
    
    &emsp;&emsp;
</div>
            <form action="javascript:void(0);" id="setting_{$x.name}" name="setting_{$x.name}" method="post" onsubmit="updateConfig('##LBL_SITE_URL##index.php/page-setting-choice-update_config','{$x.name}')">
            <input type="hidden" name="sectype" value="{$x.name}" />
            <table align="center" id="tab{$x.name}" class="tbl_lstin" width="102%">
        {/if}
        <tr class="nodrag" id="{$x.id_config}">
<td class="dragHandle" style="width:10px" title="Drag"></td>
<td><input type="checkbox" value="{$x.id_config}" class="chkbox" id="id_chk{$x.id_config}" /></td>
            <td class="ttop" style="width:20%; text-align:right" align="right">{$x.ckey}</td>
            <td class="ttop" width="60%">
                <div class="fltlft">
                    {assign var=f_key value=","|explode:$x.f_key}
                    {assign var=f_value value=","|explode:$x.f_value}
                    {assign var=name_field value=$x.name|cat:'['|cat:$x.id_config|cat:']'}
                    {if $x.f_type=='radio'}
                        <span>{html_radios name=$name_field values=$f_key output=$f_value selected=$x.value}</span>
                    {elseif $x.f_type=='checkbox'}
                        {assign var=x_value value=","|explode:$x.value}
                        <span>{html_checkboxes name=$name_field values=$f_key output=$f_value}</span>
                    {elseif $x.f_type=='dropdown'}							
                        <select name="{$name_field}">
                            {html_options values=$f_key output=$f_value selected=$x.value}
                        </select>
                    {else}
                        <input type="text" name="{$name_field}" value="{$x.value}"/>
                    {/if}
                </div>
                {if $x.comment}
                <div class="fltlft" style="padding:3px">
                    <a href="javascript:void(0);" class="comment" onmouseover="return overlib('{$x.comment|escape}',CAPTION, 'Comment', CLOSECLICK,CSSCLASS,FGCLASS,'fgClass',BGCLASS,'bgClass',CLOSEFONTCLASS,'capfontClass','CAPTIONFONTCLASS','fontclass',FOLLOWMOUSE);" onmouseout="return nd();" style="text-decoration:none"><img src="##LBL_SITE_URL##templates/css_theme/img/help_sign.gif" alt="help"/></a>
                </div>
                {/if}
              
                {if $sm.res[setting.index_next].name != $x.name}
                    </td>
                    <td width="20%" valign="bottom"><input class="login_btn fltrht" type="submit" value="Update" name="submit"/></td>
                    </tr>
                    </table>
                    
                    </form>
                    </div>
    {else}   
    </td>
    </tr>
    {/if}
{/section}
</div>
{else}
	<center><b>No records found</b></center>
{/if}





            </div>
            <div class="txtbg_btm fltlft"></div>
            <div class="clrbth"></div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="cont_bg_btm"></div>
</div>	
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
{literal}
<script type="text/javascript">
	//$("#target").html('{/literal}{$smarty.session.raise_message.global}{literal}');
 function updateConfig(url,id){
	cShowActivity('1');
 	var fval=$("#setting_"+id).serialize();
	url+="-ce-0?"+fval;
 	$.post(url,function(response){
		cHideActivity();
		callmsg("Successfully Updated");//showmsg('divid','error message');
		//window.location.href=response;
		$("#container").html(response);
	});
 }
 function addNew(url){
	cShowActivity('');
	$.post(url,function(response){
		//$.fancybox(response,{centerOnScroll:true,hideOnOverlayClick:false});
		show_fancybox(response);
	});
 }
 $('#collapse').click(function(){
	var txt=$('#collapse').attr('value');
	if(txt=='Collapse All'){
		$('.table_margin').slideUp(1000);
		$('#collapse').attr('value','Expand All');
		$('.sign').html('+');

	 }
	else if(txt=='Expand All'){
		$('.table_margin').slideDown(1000);
		$('#collapse').attr('value','Collapse All');
		$('.sign').html('-');	
	 }
 });
 $(document).ready(function(){
 	$('table#tab').css({background:'none'});
 });
 $('.div_head').click(function(){
	var txt=$('.sign',this).html();
	if(txt=='-'){
		$(this).next('.table_margin').slideUp('slow');
		$('.sign',this).html('+');
		$('#collapse').attr('value','Expand All');
	}else if(txt=='+'){
		$(this).next('.table_margin').slideDown('slow');
		$('.sign',this).html('-');
		$('#collapse').attr('value','Collapse All');
	}
 });
 function checkAll(c){
	$('.chkbox').each(function(){
		if(c){
			$(this).attr('checked','checked');
			$("#chk_unchk").html('<input  type="button" onclick="checkAll(0);" value="Uncheck All" >');
		}else{
			$(this).removeAttr('checked');
			$("#chk_unchk").html('<input  type="button" onclick="checkAll(1);" value="Check All" >');
		}
	});
	var txt=$('#collapse').attr('value');
	if(txt=='Expand All'){
		$('.table_margin').slideDown(1000);
		$('#collapse').attr('value','Collapse All');
		$('.sign').html('-');	
	}else if(txt=='Collapse All' && !c){
		$('.table_margin').slideUp(1000);
		$('#collapse').attr('value','Expand All');
		$('.sign').html('+');		
	}
 }
 function deleteKey(url,chc){
	var keys='';
	$('.chkbox').each(function(){
		if($(this).is(':checked'))
			keys +=$(this).val()+",";
	});
	if(!keys){
		jqueryAlert("Please choose records to delete.");
		return false;
	}else{
		if(chc==''){
			chc=jqueryConfirm("Do you really want to delete selected records?","deleteKey",url);
		}
		if(!chc)
			return false;
	}
	cShowActivity('1');
	$.post(url,{'keys':keys}, function(res){
		window.location.href=res;
	});
 }
</script> 
{/literal}
{literal}
<style type="text/css">
.class1{
	background:#3366FF;
}
.showDragHandle{	
	background:#FF0000;
	cursor:move;
}
.altbox .content table tr.even td {background: #fff;}
</style>
{/literal}
Return current item: SimpleHRM