Пример #1
0
/**
 * Returns auto-clicking city selector
 * 
 * @return string
 */
function web_CitySelectorAc()
{
    $allcity = array();
    $tmpCity = zb_AddressGetCityAllData();
    $allcity['-'] = '-';
    //placeholder
    if (!empty($tmpCity)) {
        foreach ($tmpCity as $io => $each) {
            $allcity[$each['id']] = $each['cityname'];
        }
    }
    $selector = wf_SelectorAC('citysel', $allcity, '', '', false);
    $selector .= wf_tag('a', false, '', 'href="?module=city" target="_BLANK"') . web_city_icon() . wf_tag('a', true);
    return $selector;
}
Пример #2
0
 /**
  * Returns auto-clicking city selector
  * 
  * @return string
  */
 protected function CitySelectorPermissioned($admin)
 {
     $allcity = array();
     $tmpCity = zb_AddressGetCityAllData();
     $allcity['-'] = '-';
     //placeholder
     if (!empty($tmpCity)) {
         if (file_exists(self::PERMISSION_PATH . $admin)) {
             $data = file_get_contents(self::PERMISSION_PATH . $admin);
             $eachId = explode(",", $data);
             foreach ($tmpCity as $io => $each) {
                 $check = false;
                 foreach ($eachId as $id) {
                     if ($each['id'] == $id) {
                         $check = true;
                     }
                 }
                 if ($check) {
                     $allcity[$each['id']] = $each['cityname'];
                 }
             }
         } else {
             foreach ($tmpCity as $io => $each) {
                 $allcity[$each['id']] = $each['cityname'];
             }
         }
     }
     $selector = wf_SelectorAC('citysel', $allcity, '', '', false);
     $selector .= wf_tag('a', false, '', 'href="?module=city" target="_BLANK"') . web_city_icon() . wf_tag('a', true);
     return $selector;
 }