function catv_ReportDebtorsStreet() { if (wf_CheckPost(array('streetbox'))) { catv_ReportDebtorsStreetPrintable($_POST['streetbox']); } else { $inputs = zb_AjaxLoader(); $inputs .= catv_StreetSelector('current_debtorsstreet'); $inputs .= wf_tag('span', false, '', 'id="dbuildbox"'); $inputs .= wf_tag('span', true); $inputs .= wf_tag('span', false, '', 'id="datpbox"'); $inputs .= wf_tag('span', true); $form = wf_Form("", "POST", $inputs, 'glamour'); show_window(__('Current debtors for delivery by streets'), $form); } }
/** * Shows user register form of express card * * * @return string */ function web_ExpressCardRegForm() { $altconf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini"); $allcontracts = zb_UserGetAllContracts(); //contract proposal $top_offset = 100000; //contract generation mode default if ($altconf['CONTRACT_GENERATION_DEFAULT']) { for ($i = 1; $i < $top_offset; $i++) { if (!isset($allcontracts[$i])) { $contract = $i; break; } } } else { //alternate generation method $max_contract = max(array_keys($allcontracts)); $contract = $max_contract + 1; } $mac = '14:' . '88' . ':' . rand(10, 99) . ':' . rand(10, 99) . ':' . rand(10, 99) . ':' . rand(10, 99); $phone = ''; $mobile = ''; $email = ''; $notes = ''; $stgdata = ''; $currenttariff = ''; $birthdate = ''; $passportnum = ''; $passportdate = ''; $passportwho = ''; $pcity = ''; $pstreet = ''; $pbuild = ''; $papt = ''; $inputs = zb_AjaxLoader() . wf_delimiter(); $inputs .= __('Contract'); $inputs .= wf_TextInput('newcontract', '', $contract, false, '10'); $inputs .= __('Contract date'); $inputs .= wf_DatePickerPreset('newcontractdate', @$allcontractdates[$contract]); $inputs .= wf_delimiter(); $inputs .= __('Surname'); $inputs .= wf_TextInput('newsurname', '', '', false, '20'); $inputs .= __('Name'); $inputs .= wf_TextInput('newname', '', '', false, '20'); $inputs .= __('Patronymic'); $inputs .= wf_TextInput('newpatronymic', '', '', false, '20'); $inputs .= __('Birth date'); $inputs .= wf_DatePickerPreset('newbirthdate', $birthdate); $inputs .= wf_delimiter(); $inputs .= __('Passport number'); $inputs .= wf_TextInput('newpassportnum', '', $passportnum, false, '30'); $inputs .= __('Date of issue'); $inputs .= wf_DatePickerPreset('newpassportdate', $passportdate); $inputs .= __('Issuing authority'); $inputs .= wf_TextInput('newpassportwho', '', $passportwho, false, '40'); $inputs .= wf_delimiter(); $inputs .= __('Phone'); $inputs .= wf_TextInput('newphone', '', $phone, false, '20'); $inputs .= __('Mobile'); $inputs .= wf_TextInput('newmobile', '', $mobile, false, '20'); $inputs .= __('email'); $inputs .= wf_TextInput('newemail', '', $email, false, '20'); $inputs .= wf_delimiter(); $inputs .= wf_tag('fieldset'); //address data form $inputs .= __('Address of service') . ' '; //new address creation form $inputs .= web_ExpressAddressOccupancyForm(); $inputs .= wf_delimiter(); //additional address fields $inputs .= __('Registration address') . ' '; $inputs .= zb_JSHider(); $inputs .= web_PaddressUnhideBox(); $inputs .= web_HidingDiv('paddress'); $inputs .= __('City'); $inputs .= wf_TextInput('newpcity', '', $pcity, false, '20'); $inputs .= __('Street'); $inputs .= wf_TextInput('newpstreet', '', $pstreet, false, '20'); $inputs .= __('Build'); $inputs .= wf_TextInput('newpbuild', '', $pbuild, false, '5'); $inputs .= __('Apartment'); $inputs .= wf_TextInput('newpapt', '', $papt, false, '5'); $inputs .= wf_tag('div', true); $inputs .= wf_tag('fieldset', true); $inputs .= wf_delimiter(); $inputs .= __('Tariff'); $inputs .= web_ExpressTariffSelector('newtariff', $currenttariff); $inputs .= __('Service'); $inputs .= web_ExpressServiceSelectorReg(); $inputs .= __('IP'); $inputs .= wf_tag('span', false, '', 'id="dipbox"'); $allservices = multinet_get_services(); if (!empty($allservices)) { $firstService = $allservices[0]; $firstNet = $firstService['netid']; @($ip_proposal = multinet_get_next_freeip('nethosts', 'ip', $firstNet)); if (empty($ip_proposal)) { show_window('', wf_modalOpened(__('Error'), __('No free IP available in selected pool'), '400', '250')); } } else { $ip_proposal = __('Error'); } $inputs .= wf_TextInput('editip', '', $ip_proposal, false, '20'); $inputs .= wf_tag('span', true); //dummy login proposal $login = zb_RegLoginProposal('', '', '', '', $ip_proposal); $inputs .= __('MAC'); $inputs .= wf_TextInput('newmac', '', $mac, false, '20'); $inputs .= __('Login'); $inputs .= wf_TextInput('newlogin', '', $login, false, '20'); $inputs .= wf_delimiter(); $inputs .= __('Notes'); $inputs .= wf_TextInput('newnotes', '', $notes, false, '120'); $inputs .= wf_HiddenInput('expresscardreg', 'true'); $inputs .= wf_delimiter(); $inputs .= wf_Submit('Let register that user'); $expresscardform = wf_Form("", "POST", $inputs, 'expresscard'); show_window(__('Express card user register'), $expresscardform); }
/** * Collects billing stats * * @param bool $quiet */ function zb_BillingStats($quiet = false) { $ubstatsurl = 'http://stats.ubilling.net.ua/'; $statsflag = 'exports/NOTRACK'; //detect host id $hostid_q = "SELECT * from `ubstats` WHERE `key`='ubid'"; $hostid = simple_query($hostid_q); if (empty($hostid)) { //register new ubilling $randomid = 'UB' . md5(curdatetime() . zb_rand_string(8)); $newhostid_q = "INSERT INTO `ubstats` (`id` ,`key` ,`value`) VALUES (NULL , 'ubid', '" . $randomid . "');"; nr_query($newhostid_q); $thisubid = $randomid; } else { $thisubid = $hostid['value']; } //detect stats collection feature $thiscollect = file_exists($statsflag) ? 0 : 1; //disabling collect subroutine if (isset($_POST['editcollect'])) { if (!isset($_POST['collectflag'])) { file_put_contents($statsflag, 'Im greedy bastard'); } else { if (file_exists($statsflag)) { unlink($statsflag); } } rcms_redirect("?module=report_sysload"); } //detect total user count $usercount_q = "SELECT COUNT(`login`) from `users`"; $usercount = simple_query($usercount_q); $usercount = $usercount['COUNT(`login`)']; //detect tariffs count $tariffcount_q = "SELECT COUNT(`name`) from `tariffs`"; $tariffcount = simple_query($tariffcount_q); $tariffcount = $tariffcount['COUNT(`name`)']; //detect nas count $nascount_q = "SELECT COUNT(`id`) from `nas`"; $nascount = simple_query($nascount_q); $nascount = $nascount['COUNT(`id`)']; //detect payments count $paycount_q = "SELECT COUNT(`id`) from `payments`"; $paycount = simple_query($paycount_q); $paycount = $paycount['COUNT(`id`)']; $paycount = $paycount / 100; $paycount = round($paycount); //detect ubilling actions count $eventcount_q = "SELECT COUNT(`id`) from `weblogs`"; $eventcount = simple_query($eventcount_q); $eventcount = $eventcount['COUNT(`id`)']; $eventcount = $eventcount / 100; $eventcount = round($eventcount); //detect ubilling version $releaseinfo = file_get_contents("RELEASE"); $ubversion = explode(' ', $releaseinfo); $ubversion = vf($ubversion[0], 3); $releasebox = wf_tag('span', false, '', 'id="lastrelease"'); $releasebox .= wf_tag('span', true) . wf_tag('br'); $updatechecker = wf_AjaxLink('?module=report_sysload&checkupdates=true', $releaseinfo . ' (' . __('Check updates') . '?)', 'lastrelease', false, ''); $ubstatsinputs = zb_AjaxLoader(); $ubstatsinputs .= wf_tag('b') . __('Serial key') . ': ' . wf_tag('b', true) . $thisubid . wf_tag('br'); $ubstatsinputs .= wf_tag('b') . __('Use this to request technical support') . ': ' . wf_tag('b', true) . wf_tag('font', false, '', 'color="#076800"') . substr($thisubid, -4) . wf_tag('font', true) . wf_tag('br'); $ubstatsinputs .= wf_tag('b') . __('Ubilling version') . ': ' . wf_tag('b', true) . $updatechecker . wf_tag('br'); $ubstatsinputs .= $releasebox; $ubstatsinputs .= wf_HiddenInput('editcollect', 'true'); $ubstatsinputs .= wf_CheckInput('collectflag', 'I want to help make Ubilling better', false, $thiscollect); $ubstatsinputs .= ' ' . wf_Submit('Save'); $ubstatsform = wf_Form("", 'POST', $ubstatsinputs, 'glamour'); $ubstatsform .= wf_CleanDiv(); $statsurl = $ubstatsurl . '?u=' . $thisubid . 'x' . $usercount . 'x' . $tariffcount . 'x' . $nascount . 'x' . $paycount . 'x' . $eventcount . 'x' . $ubversion; $tracking_code = wf_tag('div', false, '', 'style="display:none;"') . wf_tag('iframe', false, '', 'src="' . $statsurl . '" width="1" height="1" frameborder="0"') . wf_tag('iframe', true) . wf_tag('div', true); if ($quiet == false) { show_window(__('Billing info'), $ubstatsform); } if ($thiscollect) { show_window('', $tracking_code); } }