Location: PHPKode > projects > SimpleHRM > simplehrm-1.0-beta1/simplehrm-1.0-beta1/templates/default/report/leaveSummeryListing.tpl.html
{* notag *}
{if defined($smarty.const.LINK_SEPARATOR)}
	{assign var=sep value=$smarty.const.LINK_SEPARATOR}
{else}
	{assign var=sep value="-"}
{/if}
<div id="report_leaveSummery" align="center">
    <div class="smler_box">
        <div class="top"></div>
        <div class="mdl">
            <div class="cont_hdr1 fltlft">
                <div class="cont_hdr_lft fltlft"></div>
                <div class="cont_hdr_mdl1 fltlft" align="left">Leave summary ({$sm.next_prev->total})</div>
                <div class="cont_hdr_rht fltlft"></div>
            </div>
            <div class="clear"></div>	
            <div class="txtbg_top_smler"></div>
            <div class="txtbg_mdl_smler">
            {if $sm.list}
                <table class="tbl_listing">
                <thead>
                <tr>
                    {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}
                        <th>
                            {if $item.1!=0}
                            {if $sm.ajax}
                            <div style="width:1px; background:#fff; height:20px; float:left; margin-left:-4px"></div>
                                <a href="javascript:get_next_page('##APP_ROOT_URL##{$sm.uri}{$sep}sort_by{$sep}{$key}',0,0,'{$smarty.request.page}_{$smarty.request.choice}')">
                                    {if $item!=""}
                                        {if $smarty.request.group_by eq '2'}
                                            {if $item.0 eq 'Leave Type'}
                                            {else}
                                                {$item.0}
                                            {/if}
                                        {else}
                                            {$item.0}
                                        {/if}
                                    {else}
                                        {$key}
                                    {/if}
                                </a>
                            {else}
                            <div style="width:1px; background:#fff; height:20px; float:left; margin-left:-4px"></div>
                                <a href="##APP_ROOT_URL##{$sm.uri}sort_by{$sep}{$key}">{if $item!=""}{$item.0}{else}{$key}{/if}</a>
                            {/if}
                            {else}
                                {if $item!=""}{$item.0}{else}{$key}{/if}
                            {/if}
                        </th>
                        {/foreach}
                </tr>
                </tr>
                </thead>
                <tbody>
                {section name=cur loop=$sm.list}
                {assign var=x value=$sm.list[cur]}
                <tr class="{cycle values="even,odd"}">
                    <td><div align="left">{$x.name}</div></td>
                    <td>
                        {if $x.total neq 0}
                            <a onclick="leaveDetail('{$x.id_employee}','{$x.leave_type}');" style="cursor:pointer;" title="Click to see detail">{$x.total}</a>
                        {else}
                            {$x.total}
                        {/if}
                    </td>
                    {if $smarty.request.group_by neq '2'}
                    <td>{$x.ltype|capitalize:true}</td>
                    {/if}
                </tr>
                {/section}
                </tbody>
                </table>
                <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}
            <div>No records found.</div>
            {/if}
        	</div>
            <div class="txtbg_btm_smler"></div>
        </div>
        <div class="btm"></div>
    </div>
</div>
{literal}
<script type="text/javascript">
$("#indiv").autocomplete("##LBL_SITE_URL##index.php/adminstration/userAutoComplete/ce-0");
$("#indiv").result(function(event, data, formatted) {
	 if (data) {
		var empId = data[1].split("::");
		$('#indiv').val(empId[1]);
		$('#id_employee').val(empId[0]);
	 }
});
function editreminder(id,rem,rmnddate,recstatus){
	var dt=rmnddate.split(" ");
	$("#tempid").val(id);
	$("#reminder").val(rem);
	$("#reminder_date").val(dt[0]);
	var tim=dt[1].split(":");
	if(tim[0]>12){
		tim[2]='PM';	
	}else{
		tim[2]='AM';
	}
	if(tim[0]>12)
		tim[0]="0"+(tim[0]-12);
	$("#hr1").val(tim[0]);
	$("#minut").val(tim[1]);
	$("#merd").val(tim[2]);
	if(recstatus==1){
		$("#recurrence_status").val("Daily");
	}else if(recstatus==2){
		$("#recurrence_status").val("Weekly");
	}else{
		$("#recurrence_status").val("Monthly");
	}
	$("#sb").val('Update');
	$("#freminder").attr("action","##LBL_SITE_URL##adminstration/updateReminder/ce/0");
}
function delreminder(cur,id){
	 var qstart='{/literal}{$smarty.request.qstart|default:0}{literal}';
	 var url="##LBL_SITE_URL##index.php/adminstration/deleteReminder";
	 var conf=confirm('Do you really want to delete this record?');
	 if(conf){
		 $.post(url,{ce:0,id:id,cur:cur,qstart:qstart},function(res){
			$('#adminstration_reminders').html(res);
		 });
	 }else
	 	return false;
}
function leaveDetail(id,ltype){
	 cShowActivity('');
	 var group_by='';
	 if(document.getElementById("group_by_type").checked==true){
	 	group_by=1;
	 }else if(document.getElementById("group_by_emp").checked==true){
	 	group_by=2;
	 }
	 var url="##LBL_SITE_URL##index.php/report/leaveDetail";
	 $.post(url,{ce:0,id:id,ltype:ltype,group_by:group_by},function(res){
		show_fancybox(res);
	 });
}
</script>
{/literal}
Return current item: SimpleHRM