Ejemplo n.º 1
0
/**
 * Returns new refresh-free form for user ocupancy
 * 
 * @return string
 */
function web_ExpressAddressOccupancyForm()
{
    $allcities = zb_AddressGetCityAllData();
    $citybox = __('City') . '<select id="citybox" name="citybox" onchange="var valuec = document.getElementById(\'citybox\').value;  goajax(\'?module=expresscard&ajaxstreet=\'+valuec,\'dstreetbox\');">';
    $citybox .= '<option value="99999">-</option> <!-- really ugly hack -->';
    if (!empty($allcities)) {
        foreach ($allcities as $ic => $each) {
            $citybox .= '<option value="' . $each['id'] . '">' . $each['cityname'] . '</option>';
        }
    }
    $citybox .= '</select>';
    $citybox .= '<span id="dstreetbox"></span> <span id="dbuildbox"></span> <span id="daptbox"></span>';
    return $citybox;
}
Ejemplo n.º 2
0
/**
 * Returns available cities lister with some controls
 * 
 * @return string
 */
function web_CityLister()
{
    $allcity = zb_AddressGetCityAllData();
    $cells = wf_TableCell(__('ID'));
    $cells .= wf_TableCell(__('City name'));
    $cells .= wf_TableCell(__('City alias'));
    $cells .= wf_TableCell(__('Actions'));
    $rows = wf_TableRow($cells, 'row1');
    if (!empty($allcity)) {
        foreach ($allcity as $io => $eachcity) {
            $cells = wf_TableCell($eachcity['id']);
            $cells .= wf_TableCell($eachcity['cityname']);
            $cells .= wf_TableCell($eachcity['cityalias']);
            $acts = wf_JSAlert('?module=city&action=delete&cityid=' . $eachcity['id'], web_delete_icon(), 'Removing this may lead to irreparable results') . ' ';
            $acts .= wf_JSAlert('?module=city&action=edit&cityid=' . $eachcity['id'], web_edit_icon(), 'Are you serious') . ' ';
            $acts .= wf_Link('?module=streets', web_street_icon(), false, '');
            $cells .= wf_TableCell($acts);
            $rows .= wf_TableRow($cells, 'row3');
        }
    }
    $result = wf_TableBody($rows, '100%', 0, 'sortable');
    return $result;
}
Ejemplo n.º 3
0
 /**
  * Returns check box cities selecor
  * 
  * @return string
  */
 public function CityChecker($admin)
 {
     $tmpCity = zb_AddressGetCityAllData();
     $checker = '';
     $i = 0;
     if (!empty($tmpCity)) {
         if (file_exists(self::PERMISSION_PATH . $admin)) {
             $data = file_get_contents(self::PERMISSION_PATH . $admin);
             if (!empty($data)) {
                 $eachId = explode(",", $data);
                 foreach ($tmpCity as $io => $each) {
                     $checked = false;
                     foreach ($eachId as $id) {
                         if ($each['id'] == $id) {
                             $checked = true;
                         }
                     }
                     $checker .= $this->CheckInput("city[{$i}]", $each['cityname'], $each['id'], true, $checked);
                     $i++;
                 }
             }
         } else {
             foreach ($tmpCity as $io => $each) {
                 $checker .= $this->CheckInput("city[{$i}]", $each['cityname'], $each['id'], true, false);
                 $i++;
             }
         }
         $checker .= wf_delimiter(0);
         $checker .= wf_Submit(__('Send'));
     }
     $form = wf_Form('', 'POST', $checker);
     return $form;
 }