예제 #1
0
if (!empty($params['country'])) {
    if (!empty($sqlsearch)) {
        $sqlsearch .= " AND ";
    }
    $sqlsearch .= "country like :country ";
    $searchparams['country'] = '%' . $params['country'] . '%';
}
$companyrecords = $DB->get_fieldset_select('company', 'id', $sqlsearch, $searchparams);
$companylist = "";
if (!empty($companyrecords)) {
    $companylist = "id in (" . implode(',', array_values($companyrecords)) . ")";
} else {
    $companylist = "1=2";
}
if (!empty($companylist)) {
    $companies = iomad::get_companies_listing($sort, $dir, $page * $perpage, $perpage, '', '', '', $companylist);
} else {
    $companies = array();
}
$companycount = count($companyrecords);
echo $OUTPUT->heading("{$companycount} " . get_string('companies', 'block_iomad_company_admin'));
$alphabet = explode(',', get_string('alphabet', 'block_iomad_company_admin'));
$strall = get_string('all');
$baseurl = new moodle_url('editcompanies.php', $params);
echo $OUTPUT->paging_bar($companycount, $page, $perpage, $baseurl);
flush();
if (!$companies) {
    $match = array();
    echo $OUTPUT->heading(get_string('nocompanies', 'block_iomad_company_admin'));
    $table = null;
} else {