HEX
Server: Apache/2
System: Linux host.ouroempresas.com.br 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User: silver (1010)
PHP: 8.2.28
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/silver/domains/jornaldecostarica.com.br/public_html/classificados/php/countries.php
<?php

$countries = array();
$count = 1;

$row = ORM::for_table($config['db']['pre'].'countries')
    ->where('active',1)
    ->order_by_asc('asciiname')
    ->find_many();
$total = count($row);
$divide = intval($total/4)+1;
$col = "";
foreach ($row as $info)
{
    $countrylang = getLangFromCountry($info['languages']);
    $countries[$count]['tpl'] = "";
    if($count == 1 or $count == $col){
        $countries[$count]['tpl'] .= '<ul class="flag-list col-xl-3">';
        $checkEnd = $count+$divide-1;
        $col = $count+$divide;
        //echo "Start : ".$divide."<br>";
    }
    $countries[$count]['tpl'] .= '<li><span class="flag flag-'.strtolower($info['code']).'"></span><a href="'.$config['site_url'].'home/'.$countrylang.'/'.$info['code'].'" data-id="'.$info['id'].'" data-name="'.$info['asciiname'].'">'.$info['asciiname'].'</a></li>';


    if($count == $checkEnd or $count == $total){
        $countries[$count]['tpl'] .= '</ul>';
        //echo "end : ".$checkEnd."<br>";
    }
    $count++;
}


$title = "Free Local Classified Ads in the World";
$page = new HtmlTemplate ('templates/' . $config['tpl_name'] . '/countries.tpl');
$page->SetParameter ('OVERALL_HEADER', create_header($title));
$page->SetLoop ('COUNTRYLIST',$countries);
$page->SetParameter ('OVERALL_FOOTER', create_footer());
$page->CreatePageEcho();
?>