Esempio n. 1
0
/**
 * Returns user full address search form
 * 
 * @return string
 */
function web_UserSearchAddressForm()
{
    $form = wf_tag('form', false, '', 'action="" method="POST"');
    $form .= wf_tag('table', false, '', 'width="100%" border="0"');
    if (!isset($_POST['citysel'])) {
        $cells = wf_TableCell(__('City'), '40%');
        $cells .= wf_TableCell(web_CitySelectorAc());
        $form .= wf_TableRow($cells, 'row3');
    } else {
        // if city selected
        $cityname = zb_AddressGetCityData($_POST['citysel']);
        $cityname = $cityname['cityname'];
        $cells = wf_TableCell(__('City'), '40%');
        $cells .= wf_TableCell(web_ok_icon() . ' ' . $cityname . wf_HiddenInput('citysel', $_POST['citysel']));
        $form .= wf_TableRow($cells, 'row3');
        if (!isset($_POST['streetsel'])) {
            $cells = wf_TableCell(__('Street'), '40%');
            $cells .= wf_TableCell(web_StreetSelectorAc($_POST['citysel']));
            $form .= wf_TableRow($cells, 'row3');
        } else {
            // if street selected
            $streetname = zb_AddressGetStreetData($_POST['streetsel']);
            $streetname = $streetname['streetname'];
            $cells = wf_TableCell(__('Street'), '40%');
            $cells .= wf_TableCell(web_ok_icon() . ' ' . $streetname . wf_HiddenInput('streetsel', $_POST['streetsel']));
            $form .= wf_TableRow($cells, 'row3');
            if (!isset($_POST['buildsel'])) {
                $cells = wf_TableCell(__('Build'), '40%');
                $cells .= wf_TableCell(web_BuildSelectorAc($_POST['streetsel']));
                $form .= wf_TableRow($cells, 'row3');
            } else {
                //if build selected
                $buildnum = zb_AddressGetBuildData($_POST['buildsel']);
                $buildnum = $buildnum['buildnum'];
                $cells = wf_TableCell(__('Build'), '40%');
                $cells .= wf_TableCell(web_ok_icon() . ' ' . $buildnum . wf_HiddenInput('buildsel', $_POST['buildsel']));
                $form .= wf_TableRow($cells, 'row3');
                if (!isset($_POST['aptsel'])) {
                    $cells = wf_TableCell(__('Apartment'), '40%');
                    $cells .= wf_TableCell(web_AptSelectorAc($_POST['buildsel']));
                    $form .= wf_TableRow($cells, 'row3');
                } else {
                    //if apt selected
                    $aptnum = zb_AddressGetAptDataById($_POST['aptsel']);
                    $aptnum = $aptnum['apt'];
                    $cells = wf_TableCell(__('Apartment'), '40%');
                    $cells .= wf_TableCell(web_ok_icon() . ' ' . $aptnum . wf_HiddenInput('aptsel', $_POST['aptsel']));
                    $form .= wf_TableRow($cells, 'row3');
                    $cells = wf_TableCell(wf_HiddenInput('aptsearch', $_POST['aptsel']));
                    $cells .= wf_TableCell(wf_Submit(__('Find')));
                    $form .= wf_TableRow($cells, 'row3');
                }
            }
        }
    }
    $form .= wf_tag('table', true);
    $form .= wf_tag('form', true);
    return $form;
}
Esempio n. 2
0
/**
 * Returns existing city editing form
 * 
 * @param int $cityid
 * @return string
 */
function web_CityEditForm($cityid)
{
    $citydata = zb_AddressGetCityData($cityid);
    $cityname = $citydata['cityname'];
    $cityalias = $citydata['cityalias'];
    $sup = wf_tag('sup') . '*' . wf_tag('sup', true);
    $inputs = wf_TextInput('editcityname', __('City name') . $sup, $cityname, true);
    $inputs .= wf_TextInput('editcityalias', __('City alias'), $cityalias, true);
    $inputs .= wf_Submit(__('Save'));
    $form = wf_Form('', 'POST', $inputs, 'glamour');
    $form .= wf_Link('?module=city', 'Back', true, 'ubButton');
    return $form;
}
Esempio n. 3
0
/**
 * Returns expresscard address modify form
 * 
 * @param $login - user login for modifying apt
 * 
 * @return string
 */
function web_ExpressAddressAptForm($login)
{
    $login = vf($login);
    $aptdata = zb_AddressGetAptData($login);
    $useraddress = zb_AddressGetFulladdresslist();
    @($useraddress = $useraddress[$login]);
    $buildid = $aptdata['buildid'];
    $builddata = zb_AddressGetBuildData($buildid);
    $buildnum = $builddata['buildnum'];
    $streetid = $builddata['streetid'];
    $streetdata = zb_AddressGetStreetData($streetid);
    $streetname = $streetdata['streetname'];
    $cityid = $streetdata['cityid'];
    $citydata = zb_AddressGetCityData($cityid);
    $cityname = $citydata['cityname'];
    $inputs = __('Full address') . ': ';
    $inputs .= wf_tag('b') . $useraddress . ' ' . wf_tag('b', true);
    $inputs .= __('Entrance');
    $inputs .= wf_TextInput('editentrance', '', @$aptdata['entrance'], false, '5');
    $inputs .= __('Floor');
    $inputs .= wf_TextInput('editfloor', '', @$aptdata['floor'], false, '5');
    $inputs .= __('Apartment');
    $inputs .= wf_TextInput('editapt', '', @$aptdata['apt'], false, '5');
    $inputs .= wf_JSAlert('?module=expresscard&username='******'&orphan=true', web_delete_icon(), __('Are you sure you want to make the homeless this user') . "?");
    //same data for passport apartment
    $inputs .= wf_HiddenInput('samepapt', $aptdata['apt']);
    $inputs .= wf_HiddenInput('samepbuild', $buildnum);
    $inputs .= wf_HiddenInput('samepstreet', $streetname);
    $inputs .= wf_HiddenInput('samepcity', $cityname);
    return $inputs;
}
Esempio n. 4
0
/**
 * Returns register last step form
 * 
 * @param array $newuser_data
 * @return string
 */
function web_UserRegFormNetData($newuser_data)
{
    $alterconf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
    $safe_mode = $alterconf['SAFE_REGMODE'];
    $citydata = zb_AddressGetCityData($newuser_data['city']);
    $cityalias = zb_TranslitString($citydata['cityalias']);
    $streetdata = zb_AddressGetStreetData($newuser_data['street']);
    $streetalias = zb_TranslitString($streetdata['streetalias']);
    $buildata = zb_AddressGetBuildData($newuser_data['build']);
    $buildnum = zb_TranslitString($buildata['buildnum']);
    if (empty($newuser_data['apt'])) {
        $newuser_data['apt'] = 0;
    }
    $apt = zb_TranslitString($newuser_data['apt']);
    //assign some agent from previously selected form
    if (isset($alterconf['LOGIN_GENERATION'])) {
        if ($alterconf['LOGIN_GENERATION'] == 'DEREBAN') {
            $agentPrefixID = $newuser_data['contrahent'];
        } else {
            $agentPrefixID = '';
        }
    } else {
        $agentPrefixID = '';
    }
    $ip_proposal = multinet_get_next_freeip('nethosts', 'ip', multinet_get_service_networkid($newuser_data['service']));
    $login_proposal = zb_RegLoginProposal($cityalias, $streetalias, $buildnum, $apt, $ip_proposal, $agentPrefixID);
    $password_proposal = zb_RegPasswordProposal();
    if (empty($ip_proposal)) {
        $alert = wf_tag('script', false, '', 'type="text/javascript"');
        $alert .= 'alert("' . __('Error') . ': ' . __('No free IP available in selected pool') . '");';
        $alert .= wf_tag('script', true);
        print $alert;
        rcms_redirect("?module=multinet");
        die;
    }
    //protect important options
    if ($safe_mode) {
        $modifier = 'READONLY';
    } else {
        $modifier = '';
    }
    $form = wf_tag('table', false, 'glamour', 'width="100%" border="0"');
    $form .= wf_tag('form', false, '', ' action="" method="POST"');
    $form .= wf_tag('tr', false, 'row3');
    $form .= wf_tag('td', false, '', 'width="50%"');
    $form .= wf_tag('input', false, '', 'type="text" name="login" value="' . $login_proposal . '" ' . $modifier);
    $form .= wf_tag('td', true);
    $form .= wf_tag('td', false);
    $form .= __('Login') . ' ' . zb_CheckLoginRscriptdCompat($login_proposal);
    $form .= wf_tag('td', true);
    $form .= wf_tag('tr', true);
    $form .= wf_tag('tr', false, 'row3');
    $form .= wf_tag('td', false);
    $form .= wf_tag('input', false, '', 'type="text" name="password" value="' . $password_proposal . '" ' . $modifier);
    $form .= wf_tag('td', true);
    $form .= wf_tag('td', false);
    $form .= __('Password');
    $form .= wf_tag('td', true);
    $form .= wf_tag('tr', true);
    $form .= wf_tag('tr', false, 'row3');
    $form .= wf_tag('td', false);
    $form .= wf_tag('input', false, '', 'type="text" name="IP" value="' . $ip_proposal . '" ' . $modifier);
    $form .= wf_tag('td', true);
    $form .= wf_tag('td', false);
    $form .= __('IP');
    $form .= wf_tag('td', true);
    $form .= wf_tag('tr', true);
    $form .= wf_tag('table', true);
    $form .= wf_HiddenInput('repostdata', base64_encode(serialize($newuser_data)));
    $form .= wf_Submit(__('Let register that user'));
    $form .= wf_tag('form', true);
    $form .= wf_tag('div', false, '', 'style="clear:both;"') . wf_tag('div', true);
    return $form;
}
Esempio n. 5
0
 /**
  * City selector with check rights
  * 
  * @param string $admin
  * @param string $action
  * 
  * @return string
  */
 public function CitySelector($admin, $action)
 {
     $form = wf_tag('form', false, '', 'action="" method="GET"');
     $form .= wf_tag('table', false, '', 'width="100%" border="0"');
     if (!isset($_GET['citysel'])) {
         $cells = wf_TableCell(__('City'), '40%');
         $cells .= wf_HiddenInput("module", "per_city_action");
         $cells .= wf_HiddenInput("action", $action);
         if (isset($_GET['monthsel'])) {
             $cells .= wf_HiddenInput('monthsel', $_GET['monthsel']);
         }
         if (isset($_GET['from_date'])) {
             $cells .= wf_HiddenInput("from_date", $_GET['from_date']);
         }
         if (isset($_GET['to_date'])) {
             $cells .= wf_HiddenInput("to_date", $_GET['to_date']);
         }
         if (isset($_GET['by_day'])) {
             $cells .= wf_HiddenInput("by_day", $_GET['by_day']);
         }
         if (isset($_GET['year'])) {
             $cells .= wf_HiddenInput("year", $_GET['year']);
         }
         $cells .= wf_TableCell($this->CitySelectorPermissioned($admin));
         $form .= wf_TableRow($cells, 'row3');
     } else {
         $cityname = zb_AddressGetCityData($_GET['citysel']);
         $cityname = $cityname['cityname'];
         $cells = wf_TableCell(__('City'), '40%');
         $cells .= wf_HiddenInput("module", "per_city_action");
         $cells .= wf_HiddenInput("action", $action);
         if (isset($_GET['monthsel'])) {
             $cells .= wf_HiddenInput('monthsel', $_GET['monthsel']);
         }
         if (isset($_GET['from_date'])) {
             $cells .= wf_HiddenInput("from_date", $_GET['from_date']);
         }
         if (isset($_GET['to_date'])) {
             $cells .= wf_HiddenInput("to_date", $_GET['to_date']);
         }
         if (isset($_GET['by_day'])) {
             $cells .= wf_HiddenInput("by_day", $_GET['by_day']);
         }
         if (isset($_GET['year'])) {
             $cells .= wf_HiddenInput("year", $_GET['year']);
         }
         $cells .= wf_TableCell(web_ok_icon() . ' ' . $cityname . wf_HiddenInput('citysearch', $_GET['citysel']));
         $cells .= wf_TableCell(wf_Submit(__('Find')));
         $form .= wf_TableRow($cells, 'row3');
     }
     $form .= wf_tag('table', true);
     $form .= wf_tag('form', true);
     return $form;
 }
Esempio n. 6
0
/**
 * Returns user occupancy form
 * 
 * @return string
 */
function web_AddressOccupancyForm()
{
    $inputs = '';
    if (!isset($_POST['citysel'])) {
        $inputs = __('City') . ' ' . web_CitySelectorAc();
    } else {
        $cityname = zb_AddressGetCityData($_POST['citysel']);
        $cityname = $cityname['cityname'];
        $inputs .= web_ok_icon() . ' ';
        $inputs .= wf_HiddenInput('citysel', $_POST['citysel']);
        $inputs .= $cityname . wf_tag('br');
        if (!isset($_POST['streetsel'])) {
            $inputs .= __('Street') . ' ' . web_StreetSelectorAc($_POST['citysel']);
        } else {
            $streetname = zb_AddressGetStreetData($_POST['streetsel']);
            $streetname = $streetname['streetname'];
            $inputs .= web_ok_icon() . ' ';
            $inputs .= wf_HiddenInput('streetsel', $_POST['streetsel']);
            $inputs .= $streetname . wf_tag('br');
            if (!isset($_POST['buildsel'])) {
                $inputs .= __('Build') . ' ' . web_BuildSelectorAc($_POST['streetsel']);
            } else {
                $buildnum = zb_AddressGetBuildData($_POST['buildsel']);
                $buildnum = $buildnum['buildnum'];
                $inputs .= web_ok_icon() . ' ';
                $inputs .= wf_HiddenInput('buildsel', $_POST['buildsel']);
                $inputs .= $buildnum . wf_tag('br');
                $inputs .= web_AddressBuildShowAptsCheck($_POST['buildsel']) . web_AptCreateForm();
                $inputs .= wf_Submit(__('Create'));
            }
        }
    }
    $form = wf_Form('', 'POST', $inputs, '');
    return $form;
}
Esempio n. 7
0
 //check apt data
 $newcityid = $_POST['citybox'];
 $newstreetid = $_POST['streetbox'];
 $newbuildid = $_POST['buildbox'];
 $newaptnum = $_POST['createapt'];
 $newentrance = $_POST['createentrance'];
 $newfloor = $_POST['createfloor'];
 //check passport data
 if (!@$_POST['custompaddress']) {
     $newpcity = $_POST['newpcity'];
     $newpstreet = $_POST['newpstreet'];
     $newpbuild = $_POST['newpbuild'];
     $newpapt = $_POST['newpapt'];
 } else {
     //use the same passport address
     $cityname = zb_AddressGetCityData($newcityid);
     $cityname = $cityname['cityname'];
     $streetname = zb_AddressGetStreetData($newstreetid);
     $streetname = $streetname['streetname'];
     $buildnum = zb_AddressGetBuildData($newbuildid);
     $buildnum = $buildnum['buildnum'];
     $newpcity = $cityname;
     $newpstreet = $streetname;
     $newpbuild = $buildnum;
     $newpapt = $newaptnum;
 }
 $newpassportdate = $_POST['newpassportdate'];
 $newpassportnum = $_POST['newpassportnum'];
 $newpassportwho = $_POST['newpassportwho'];
 //check is ip acceptable for this pool?
 @($checkfreeip = multinet_get_next_freeip('nethosts', 'ip', $newnetid));