本文整理汇总了PHP中zb_AddressGetFulladdresslist函数的典型用法代码示例。如果您正苦于以下问题:PHP zb_AddressGetFulladdresslist函数的具体用法?PHP zb_AddressGetFulladdresslist怎么用?PHP zb_AddressGetFulladdresslist使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zb_AddressGetFulladdresslist函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render()
{
$cells = wf_TableCell(__('Login'));
$cells .= wf_TableCell(__('Address'));
$cells .= wf_TableCell(__('Real Name'));
$cells .= wf_TableCell(__('IP'));
$cells .= wf_TableCell(__('Tariff'));
$cells .= wf_TableCell(__('Traffic'));
$cells .= wf_TableCell(__('Actions'));
$rows = wf_TableRow($cells, 'row1');
if (!empty($this->data)) {
$allrealnames = zb_UserGetAllRealnames();
$alladdress = zb_AddressGetFulladdresslist();
foreach ($this->data as $io => $each) {
$loginLink = wf_Link("?module=userprofile&username=" . $each['login'], web_profile_icon() . ' ' . $each['login'], false, '');
$cells = wf_TableCell($loginLink);
$cells .= wf_TableCell(@$alladdress[$each['login']]);
$cells .= wf_TableCell(@$allrealnames[$each['login']]);
$cells .= wf_TableCell($each['IP']);
$cells .= wf_TableCell($each['Tariff']);
$cells .= wf_TableCell(stg_convert_size($each['traffic']), '', '', 'sorttable_customkey="' . $each['traffic'] . '"');
$actionLinks = wf_Link('?module=pl_traffdetails&username=' . $each['login'], wf_img('skins/icon_stats.gif', __('Detailed stats')), false, '');
$actionLinks .= wf_link('?module=dstatedit&username=' . $each['login'], web_edit_icon(), false, '');
$cells .= wf_TableCell($actionLinks);
$rows .= wf_TableRow($cells, 'row3');
}
}
$result = wf_TableBody($rows, '100%', '0', 'sortable');
return $result;
}
示例2: loadAddress
/**
* Loads cached address data to private data property
*
* @return void
*/
protected function loadAddress()
{
if ($this->cachedAddress) {
$this->alladdress = zb_AddressGetFulladdresslistCached();
} else {
$this->alladdress = zb_AddressGetFulladdresslist();
}
}
示例3: web_CardShowUsageByMonth
/**
* Renders search results for used cards
*
* @param int $year
* @param string $month
*
* @return void
*/
function web_CardShowUsageByMonth($year, $month)
{
$month = mysql_real_escape_string($month);
$year = mysql_real_escape_string($year);
$query = "SELECT * from `cardbank` WHERE `usedate` LIKE '%" . $year . "-" . $month . "-%'";
$allusedcards = simple_queryall($query);
$allrealnames = zb_UserGetAllRealnames();
$alladdress = zb_AddressGetFulladdresslist();
$totalsumm = 0;
$totalcount = 0;
$csvdata = '';
$tablecells = wf_TableCell(__('ID'));
$tablecells .= wf_TableCell(__('Serial number'));
$tablecells .= wf_TableCell(__('Cash'));
$tablecells .= wf_TableCell(__('Usage date'));
$tablecells .= wf_TableCell(__('Used login'));
$tablecells .= wf_TableCell(__('Full address'));
$tablecells .= wf_TableCell(__('Real name'));
$tablerows = wf_TableRow($tablecells, 'row1');
if (!empty($allusedcards)) {
$csvdata = __('ID') . ';' . __('Serial number') . ';' . __('Cash') . ';' . __('Usage date') . ';' . __('Used login') . ';' . __('Full address') . ';' . __('Real name') . "\n";
foreach ($allusedcards as $io => $eachcard) {
$tablecells = wf_TableCell($eachcard['id']);
$tablecells .= wf_TableCell($eachcard['serial']);
$tablecells .= wf_TableCell($eachcard['cash']);
$tablecells .= wf_TableCell($eachcard['usedate']);
$profilelink = wf_Link("?module=userprofile&username=" . $eachcard['usedlogin'], web_profile_icon() . ' ' . $eachcard['usedlogin'], false);
$tablecells .= wf_TableCell($profilelink);
@($useraddress = $alladdress[$eachcard['usedlogin']]);
$tablecells .= wf_TableCell($useraddress);
@($userrealname = $allrealnames[$eachcard['usedlogin']]);
$tablecells .= wf_TableCell($userrealname);
$tablerows .= wf_TableRow($tablecells, 'row3');
$totalcount++;
$totalsumm = $totalsumm + $eachcard['cash'];
$csvdata .= $eachcard['id'] . ';' . $eachcard['serial'] . ';' . $eachcard['cash'] . ';' . $eachcard['usedate'] . ';' . $eachcard['usedlogin'] . ';' . $useraddress . ';' . $userrealname . "\n";
}
}
if (!empty($csvdata)) {
$exportFilename = 'exports/cardreport_' . $year . '-' . $month . '.csv';
$csvdata = iconv('utf-8', 'windows-1251', $csvdata);
file_put_contents($exportFilename, $csvdata);
$exportLink = wf_Link('?module=cardreport&dloadcsv=' . base64_encode($exportFilename), wf_img('skins/excel.gif', __('Export')), false, '');
} else {
$exportLink = '';
}
$result = wf_TableBody($tablerows, '100%', '0', 'sortable');
$result .= __('Total') . ': ' . $totalcount . ' ' . __('payments') . ', ' . __('with total amount') . ': ' . $totalsumm;
show_window(__('Payment cards usage report') . ' ' . $exportLink, $result);
}
示例4: web_AnnihilateFormShow
function web_AnnihilateFormShow($login)
{
$alladdress = zb_AddressGetFulladdresslist();
$inputs = __('Be careful, this module permanently deletes user and all data associated with it. Opportunities to raise from the dead no longer.');
$inputs .= wf_tag('br');
$inputs .= __('To ensure that we have seen the seriousness of your intentions to enter the word сonfirm the field below.');
$inputs .= wf_tag('br');
$inputs .= wf_tag('input', false, '', 'type="text" name="confirmation" autocomplete="off"');
$inputs .= wf_HiddenInput('anihilation', 'true');
$inputs .= wf_delimiter();
$inputs .= wf_Submit(__('I really want to stop suffering User'));
$form = wf_Form('', 'POST', $inputs, 'glamour');
show_window(__('Deleting user') . ' ' . @$alladdress[$login] . ' (' . $login . ')', $form);
}
示例5: web_VserviceCashForm
function web_VserviceCashForm($login)
{
$currentvcash = zb_VserviceCashGet($login);
$alladdr = zb_AddressGetFulladdresslist();
$allrealnames = zb_UserGetAllRealnames();
$form = '
<form action="" method="POST">
<table width="50%" border="0">
<tr>
<td class="row2">' . __('Login') . '</td>
<td class="row3">' . $login . '</td>
</tr>
<tr>
<td class="row2">' . __('Address') . '</td>
<td class="row3">' . @$alladdr[$login] . '</td>
</tr>
<tr>
<td class="row2">' . __('Real Name') . '</td>
<td class="row3">' . @$allrealnames[$login] . '</td>
</tr>
<tr>
<td class="row2">' . __('Current Cash state') . '</td>
<td class="row3">' . $currentvcash . '</td>
</tr>
<tr>
<td class="row2">' . __('New cash') . '</td>
<td class="row3"><input name="newcash" size="5" type="text"></td>
</tr>
<tr>
<td class="row2">' . __('Actions') . '</td>
<td class="row3">
<input name="operation" value="add" checked="checked" type="radio"> ' . __('Add cash') . '
<input name="operation" value="set" type="radio"> ' . __('Set cash') . '
</td>
</tr>
<tr>
<td class="row2">' . __('Payment type') . '</td>
<td class="row3">' . web_CashTypeSelector() . '</td>
</tr>
<tr>
<td class="row2">' . __('Virtual services') . '</td>
<td class="row3">' . web_VservicesSelector() . '</td>
</tr>
</table>
<input type="submit" value="' . __('Change') . '">
</form>';
return $form;
}
示例6: ajaxGetData
/**
* Returns JSON reply for jquery datatables with full list of available UHW usages
*
* @return string
*/
public function ajaxGetData()
{
$query = "SELECT * from `uhw_log` ORDER by `id` DESC;";
$alluhw = simple_queryall($query);
$alladdress = zb_AddressGetFulladdresslist();
$allrealnames = zb_UserGetAllRealnames();
$result = '{
"aaData": [ ';
if (!empty($alluhw)) {
foreach ($alluhw as $io => $each) {
$profileLink = wf_Link('?module=userprofile&username=' . $each['login'], web_profile_icon() . ' ' . $each['login'], false);
$profileLink = str_replace('"', '', $profileLink);
$profileLink = str_replace("'", '', $profileLink);
$profileLink = trim($profileLink);
$userAddress = @$alladdress[$each['login']];
$userAddress = str_replace("'", '`', $userAddress);
$userAddress = str_replace('"', '``', $userAddress);
$userAddress = trim($userAddress);
$userRealname = @$allrealnames[$each['login']];
$userRealname = str_replace("'", '`', $userRealname);
$userRealname = str_replace('"', '``', $userRealname);
$userRealname = trim($userRealname);
$result .= '
[
"' . $each['id'] . '",
"' . $each['date'] . '",
"' . $each['password'] . '",
"' . $profileLink . '",
"' . $userAddress . '",
"' . $userRealname . '",
"' . $each['ip'] . '",
"' . $each['nhid'] . '",
"' . $each['oldmac'] . '",
"' . $each['newmac'] . '"
],';
}
}
$result = substr($result, 0, -1);
$result .= ']
}';
return $result;
}
示例7: web_UsersLister
function web_UsersLister($users)
{
$tablecells = wf_TableCell(__('Login'));
$tablecells .= wf_TableCell(__('Real Name'));
$tablecells .= wf_TableCell(__('Full address'));
$tablecells .= wf_TableCell(__('Tariff'));
$tablecells .= wf_TableCell(__('Tariff speeds'));
$tablecells .= wf_TableCell(__('Speed override'));
$tablecells .= wf_TableCell(__('Actions'));
$tablerows = wf_TableRow($tablecells, 'row1');
if (!empty($users)) {
$udata = array();
$alluserdata = zb_UserGetAllStargazerData();
$alladdress = zb_AddressGetFulladdresslist();
$allrealnames = zb_UserGetAllRealnames();
$allspeeds = zb_TariffGetAllSpeeds();
if (!empty($alluserdata)) {
foreach ($alluserdata as $ia => $eachdata) {
$udata[$eachdata['login']]['Tariff'] = $eachdata['Tariff'];
@($udata[$eachdata['login']]['Address'] = $alladdress[$eachdata['login']]);
@($udata[$eachdata['login']]['RealName'] = $allrealnames[$eachdata['login']]);
@($udata[$eachdata['login']]['NormalSpeedDown'] = $allspeeds[$eachdata['Tariff']]['speeddown']);
@($udata[$eachdata['login']]['NormalSpeedUp'] = $allspeeds[$eachdata['Tariff']]['speedup']);
}
}
foreach ($users as $io => $eachuser) {
$tablecells = wf_TableCell(wf_Link('?module=userprofile&username=' . $eachuser['login'], web_profile_icon() . ' ' . $eachuser['login']));
$tablecells .= wf_TableCell($udata[$eachuser['login']]['RealName']);
$tablecells .= wf_TableCell($udata[$eachuser['login']]['Address']);
$tablecells .= wf_TableCell($udata[$eachuser['login']]['Tariff']);
$tablecells .= wf_TableCell($udata[$eachuser['login']]['NormalSpeedDown'] . '/' . $udata[$eachuser['login']]['NormalSpeedUp']);
$tablecells .= wf_TableCell(zb_UserGetSpeedOverride($eachuser['login']));
$fixlink = wf_JSAlert('?module=speedcontrol&fix=' . $eachuser['login'], '<img src="skins/icon_repair.gif" title=' . __('Fix') . '>', 'Are you serious');
$tablecells .= wf_TableCell($fixlink);
$tablerows .= wf_TableRow($tablecells, 'row3');
}
}
$result = wf_TableBody($tablerows, '100%', '0', 'sortable');
return $result;
}
示例8: docsis_AjaxModemDataSource
function docsis_AjaxModemDataSource()
{
$query = "SELECT * from `modems`";
$alladdress = zb_AddressGetFulladdresslist();
$alluserips = zb_UserGetAllIPs();
$alluserips = array_flip($alluserips);
$allmodems = simple_queryall($query);
$i = 1;
$totalcount = sizeof($allmodems);
$result = '{
"aaData": [';
if (!empty($allmodems)) {
foreach ($allmodems as $io => $each) {
$ending = $i != $totalcount ? ',' : '';
if (isset($alluserips[$each['userbind']])) {
@($useraddress = $alladdress[$alluserips[$each['userbind']]]);
} else {
$useraddress = '';
}
$actions = '<a href=?module=docsis&showmodem=' . $each['id'] . '><img src=skins/icon_edit.gif></a>';
$result .= '
[
"' . $each['id'] . '",
"' . $each['maclan'] . '",
"' . $each['date'] . '",
"' . $each['ip'] . '",
"' . $each['userbind'] . '",
"' . $useraddress . '",
"' . $actions . '"
]' . $ending . '
';
$i++;
}
}
$result .= ']
}';
die($result);
}
示例9: web_TsmsExcludeOpts
function web_TsmsExcludeOpts()
{
$excludedUsers = tsms_GetExcludeUsers();
$alladdress = zb_AddressGetFulladdresslist();
$allrealnames = zb_UserGetAllRealnames();
$allphones = tsms_GetAllMobileNumbers();
$cells = wf_TableCell(__('Login'));
$cells .= wf_TableCell(__('Full address'));
$cells .= wf_TableCell(__('Real Name'));
$cells .= wf_TableCell(__('Phone'));
$cells .= wf_TableCell(__('Actions'));
$rows = wf_TableRow($cells, 'row1');
if (!empty($excludedUsers)) {
foreach ($excludedUsers as $eachlogin => $io) {
$cells = wf_TableCell(wf_Link("?module=userprofile&username=" . $eachlogin, web_profile_icon() . ' ' . $eachlogin));
$cells .= wf_TableCell(@$alladdress[$eachlogin]);
$cells .= wf_TableCell(@$allrealnames[$eachlogin]);
$cells .= wf_TableCell(@$allphones[$eachlogin]);
$cells .= wf_TableCell(wf_JSAlert("?module=turbosms&excludedelete=" . $eachlogin, web_delete_icon(), __('Are you serious')));
$rows .= wf_TableRow($cells, 'row3');
}
}
//adding form
$inputs = wf_TextInput('newexcludelogin', __('User login to exclude from sending'), '', true, '15');
$inputs .= wf_Submit('Save');
$result = wf_TableBody($rows, '100%', '0', 'sortable');
$result .= wf_delimiter();
$result .= wf_Form("", 'POST', $inputs, 'glamour');
return $result;
}
示例10: bs_ShowHash
function bs_ShowHash($hash)
{
$hash = vf($hash);
$allrealnames = zb_UserGetAllRealnames();
$alladdress = zb_AddressGetFulladdresslist();
$checkarr = bs_SearchCheckArr($alladdress, $allrealnames);
$alter_conf = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
$query = "SELECT * from `bankstaparsed` WHERE `hash`='" . $hash . "' ORDER BY `id` DESC";
$alldata = simple_queryall($query);
// проверяем врублены ли корпоративные пользователи
if ($alter_conf['USER_LINKING_ENABLED']) {
$alllinkedusers = cu_GetAllLinkedUsers();
$allparentusers = cu_GetAllParentUsers();
}
if (!empty($alldata)) {
$tablecells = wf_TableCell(__('ID'));
$tablecells .= wf_TableCell(__('Real Name'));
$tablecells .= wf_TableCell(__('Address'));
$tablecells .= wf_TableCell(__('Cash'));
$tablecells .= wf_TableCell(__('Login poroposal'));
$tablecells .= wf_TableCell(__('Processed'));
$tablecells .= wf_TableCell(__('Actions'));
$tablerows = wf_TableRow($tablecells, 'row1');
foreach ($alldata as $io => $eachrow) {
$tablecells = wf_TableCell($eachrow['id']);
$tablecells .= wf_TableCell(bs_NameEditForm($eachrow['id'], $eachrow['realname']));
$tablecells .= wf_TableCell(bs_AddressEditForm($eachrow['id'], $eachrow['address']));
$tablecells .= wf_TableCell($eachrow['summ']);
//proposal subroutine
if (empty($eachrow['login'])) {
$proposed_login = bs_SearchLoginByAddresspart($eachrow['address'], $eachrow['realname'], $checkarr);
//if no one found
if (sizeof($proposed_login) == 0) {
$proposal_form = bs_LoginProposalForm($eachrow['id'], '');
}
//if only one user found
if (sizeof($proposed_login) == 1) {
$proposal_form = bs_LoginProposalForm($eachrow['id'], $proposed_login[0]);
//заполним со старта что-ли
simple_update_field('bankstaparsed', 'login', $proposed_login[0], "WHERE `id`='" . $eachrow['id'] . "'");
}
//if many users found
if (sizeof($proposed_login) > 1) {
//считаем что это корпоративный пользователь и достаем для него родительского
if ($alter_conf['USER_LINKING_ENABLED']) {
foreach ($proposed_login as $eachcorp) {
if (bs_cu_IsParent($eachcorp, $allparentusers)) {
$proposal_form = web_corporate_icon() . ' ' . $eachcorp;
//заполним родительского пользователя
simple_update_field('bankstaparsed', 'login', $eachcorp, "WHERE `id`='" . $eachrow['id'] . "'");
}
}
} else {
// если корпоративщина не включена - вываливаем екзепшн
$proposal_form = __('Multiple users found');
}
}
} else {
$proposal_form = bs_LoginProposalForm($eachrow['id'], $eachrow['login']);
}
$tablecells .= wf_TableCell($proposal_form);
$procflag = web_bool_led($eachrow['state']);
if (!$eachrow['state']) {
$actlink = wf_JSAlert("?module=bankstatements&lockrow=" . $eachrow['id'] . "&showhash=" . $eachrow['hash'], web_key_icon('Lock'), __('Are you serious'));
} else {
$actlink = '';
}
$tablecells .= wf_TableCell($procflag);
$tablecells .= wf_TableCell($actlink);
$tablerows .= wf_TableRow($tablecells, 'row3');
}
$result = wf_TableBody($tablerows, '100%', '0', 'sortable');
} else {
$result = __('Strange exeption catched');
}
show_window('', wf_Link("?module=bankstatements", 'Back', true, 'ubButton'));
show_window(__('Bank statement processing'), $result);
}
示例11: web_PaymentSearch
function web_PaymentSearch($markers)
{
if (wf_CheckPost(array('searchtable'))) {
if ($_POST['searchtable'] == 'payments') {
$table = 'payments';
}
if ($_POST['searchtable'] == 'corrections') {
$table = 'paymentscorr';
}
} else {
$table = 'payments';
}
$query = "SELECT * from `" . $table . "`";
$query .= $markers;
$altercfg = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
$csvdata = '';
$allpayments = simple_queryall($query);
if ($altercfg['FINREP_CONTRACT']) {
$allcontracts = zb_UserGetAllContracts();
$allcontracts = array_flip($allcontracts);
}
if ($altercfg['FINREP_TARIFF']) {
$alltariffs = zb_TariffsGetAllUsers();
}
$allrealnames = zb_UserGetAllRealnames();
$alladdress = zb_AddressGetFulladdresslist();
$alltypes = zb_CashGetAllCashTypes();
$allservicenames = zb_VservicesGetAllNamesLabeled();
$allpaysyspercents = zb_PaySysPercentGetAll();
$totalsumm = 0;
$paysyssumm = 0;
$profitsumm = 0;
$totalcount = 0;
$cells = wf_TableCell(__('ID'));
$cells .= wf_TableCell(__('Date'));
$cells .= wf_TableCell(__('Cash'));
$cells .= wf_TableCell(__('PS%'));
$cells .= wf_TableCell(__('Profit'));
$cells .= wf_TableCell(__('Login'));
if ($altercfg['FINREP_CONTRACT']) {
$cells .= wf_TableCell(__('Contract'));
}
$cells .= wf_TableCell(__('Full address'));
$cells .= wf_TableCell(__('Real Name'));
if ($altercfg['FINREP_TARIFF']) {
$cells .= wf_TableCell(__('Tariff'));
}
$cells .= wf_TableCell(__('Payment type'));
$cells .= wf_TableCell(__('Notes'));
$cells .= wf_TableCell(__('Admin'));
$rows = wf_TableRow($cells, 'row1');
if (!empty($allpayments)) {
if ($altercfg['FINREP_TARIFF']) {
$csvTariffColumn = ';' . __('Tariff');
} else {
$csvTariffColumn = '';
}
$csvdata .= __('ID') . ';' . __('Date') . ';' . __('Cash') . ';' . __('PS%') . ';' . __('Profit') . ';' . __('Login') . ';' . __('Full address') . ';' . __('Real Name') . $csvTariffColumn . ';' . __('Payment type') . ';' . __('Notes') . ';' . __('Admin') . "\n";
foreach ($allpayments as $io => $each) {
$cells = wf_TableCell($each['id']);
$cells .= wf_TableCell($each['date']);
$cells .= wf_TableCell($each['summ']);
//detecting paymentsystem and calc percent
if (isset($allpaysyspercents[$each['note']])) {
$currPc = $allpaysyspercents[$each['note']]['percent'];
$rawSumm = $each['summ'];
$paySysPc = $rawSumm / 100 * $currPc;
$ourProfit = $rawSumm - $paySysPc;
} else {
$paySysPc = 0;
$ourProfit = $each['summ'];
}
$cells .= wf_TableCell($paySysPc);
$cells .= wf_TableCell($ourProfit);
$cells .= wf_TableCell(wf_Link('?module=userprofile&username=' . $each['login'], web_profile_icon() . ' ' . $each['login'], false, ''));
if ($altercfg['FINREP_CONTRACT']) {
$cells .= wf_TableCell(@$allcontracts[$each['login']]);
}
@($paymentRealname = $allrealnames[$each['login']]);
@($paymentCashType = __($alltypes[$each['cashtypeid']]));
@($paymentAddress = $alladdress[$each['login']]);
$cells .= wf_TableCell($paymentAddress);
$cells .= wf_TableCell($paymentRealname);
if ($altercfg['FINREP_TARIFF']) {
@($userTariff = $alltariffs[$each['login']]);
$cells .= wf_TableCell($userTariff);
$csvTariff = ';' . $userTariff;
} else {
$csvTariff = '';
}
$cells .= wf_TableCell($paymentCashType);
//payment notes translation
if ($altercfg['TRANSLATE_PAYMENTS_NOTES']) {
$paynote = zb_TranslatePaymentNote($each['note'], $allservicenames);
} else {
$paynote = $each['note'];
}
$cells .= wf_TableCell($paynote);
$cells .= wf_TableCell($each['admin']);
$rows .= wf_TableRow($cells, 'row3');
//.........这里部分代码省略.........
示例12: zb_RMExportUserbaseCsv
/**
* Exports existing userbase as CSV format
*
* @return void
*/
function zb_RMExportUserbaseCsv()
{
$allusers = zb_UserGetAllStargazerData();
$allrealnames = zb_UserGetAllRealnames();
$alladdress = zb_AddressGetFulladdresslist();
$allcontracts = zb_UserGetAllContracts();
$allmac = array();
$mac_q = "SELECT * from `nethosts`";
$allnh = simple_queryall($mac_q);
if (!empty($allnh)) {
foreach ($allnh as $nh => $eachnh) {
$allmac[$eachnh['ip']] = $eachnh['mac'];
}
}
$result = '';
//options
$delimiter = ";";
$in_charset = 'utf-8';
$out_charset = 'windows-1251';
/////////////////////
if (!empty($allusers)) {
$result .= __('Login') . $delimiter . __('Password') . $delimiter . __('IP') . $delimiter . __('MAC') . $delimiter . __('Tariff') . $delimiter . __('Cash') . $delimiter . __('Credit') . $delimiter . __('Credit expire') . $delimiter . __('Address') . $delimiter . __('Real Name') . $delimiter . __('Contract') . $delimiter . __('AlwaysOnline') . $delimiter . __('Disabled') . $delimiter . __('User passive') . "\n";
foreach ($allusers as $io => $eachuser) {
//credit expirity
if ($eachuser['CreditExpire'] != 0) {
$creditexpire = date("Y-m-d", $eachuser['CreditExpire']);
} else {
$creditexpire = '';
}
//user mac
if (isset($allmac[$eachuser['IP']])) {
$usermac = $allmac[$eachuser['IP']];
} else {
$usermac = '';
}
$result .= $eachuser['login'] . $delimiter . $eachuser['Password'] . $delimiter . $eachuser['IP'] . $delimiter . $usermac . $delimiter . $eachuser['Tariff'] . $delimiter . $eachuser['Cash'] . $delimiter . $eachuser['Credit'] . $delimiter . $creditexpire . $delimiter . @$alladdress[$eachuser['login']] . $delimiter . @$allrealnames[$eachuser['login']] . $delimiter . @$allcontracts[$eachuser['login']] . $delimiter . $eachuser['AlwaysOnline'] . $delimiter . $eachuser['Down'] . $delimiter . $eachuser['Passive'] . "\n";
}
if ($in_charset != $out_charset) {
$result = iconv($in_charset, $out_charset, $result);
}
log_register('DOWNLOAD FILE `userbase.csv`');
// push data for csv handler
header('Content-type: application/ms-excel');
header('Content-Disposition: attachment; filename=userbase.csv');
echo $result;
die;
}
}
示例13: sn_SnmpParseFdbCacheJson
/**
* function that display JSON data for display FDB cache
*
* @param $fdbData_raw - array of existing cache _fdb files
*
* @return string
*/
function sn_SnmpParseFdbCacheJson($fdbData_raw)
{
$allusermacs = zb_UserGetAllMACs();
$allusermacs = array_flip($allusermacs);
$alladdress = zb_AddressGetFulladdresslist();
$allswitches = zb_SwitchesGetAll();
$rawFilters = zb_StorageGet('FDBCACHEMACFILTERS');
$filteredCounter = 0;
$switchdata = array();
$allfilters = array();
//switch data preprocessing
if (!empty($allswitches)) {
foreach ($allswitches as $io => $eachswitch) {
$switchdata[$eachswitch['ip']] = $eachswitch['location'];
}
}
//mac filters preprocessing
if (!empty($rawFilters)) {
$rawFilters = base64_decode($rawFilters);
$rawFilters = explodeRows($rawFilters);
if (!empty($rawFilters)) {
foreach ($rawFilters as $rawfindex => $rawfmac) {
$eachMacFilter = strtolower($rawfmac);
$allfilters[trim($eachMacFilter)] = $rawfindex;
}
}
}
$result = '{
"aaData": [';
foreach ($fdbData_raw as $each_raw) {
$nameExplode = explode('_', $each_raw);
if (sizeof($nameExplode) == 2) {
$switchIp = $nameExplode[0];
if (file_exists('exports/' . $each_raw)) {
$eachfdb_raw = file_get_contents('exports/' . $each_raw);
$eachfdb = unserialize($eachfdb_raw);
if (!empty($eachfdb_raw)) {
foreach ($eachfdb as $mac => $port) {
//detecting user login by his mac
if (isset($allusermacs[$mac])) {
$userlogin = $allusermacs[$mac];
} else {
$userlogin = false;
}
if ($userlogin) {
$userlink = '<a href=?module=userprofile&username=' . $userlogin . '><img src=skins/icon_user.gif> ' . @$alladdress[$userlogin] . '</a>';
} else {
$userlink = '';
}
if (sn_FDBFilterCheckMac($mac, $allfilters)) {
$result .= '
[
"' . $switchIp . '",
"' . $port . '",
"' . @$switchdata[$switchIp] . '",
"' . $mac . '",
"' . $userlink . '"
],';
$filteredCounter++;
}
}
}
}
}
}
//show some data if filters failed
if ($filteredCounter == 0) {
$result .= '
[
"",
"",
"",
"' . __('Nothing found') . '",
""
],';
}
$result = substr($result, 0, -1);
$result .= ']
}';
return $result;
}
示例14: renderAll
public function renderAll($cutdata = false)
{
$alladdress = zb_AddressGetFulladdresslist();
$allrealnames = zb_UserGetAllRealnames();
$userCounter = 0;
$cells = '';
if (!$cutdata) {
$cells .= wf_TableCell(__('Login'));
}
$cells .= wf_TableCell(__('Address'));
$cells .= wf_TableCell(__('Real Name'));
$cells .= wf_TableCell(__('IP'));
$cells .= wf_TableCell(__('Tariff'));
$cells .= wf_TableCell(__('Next month'));
$cells .= wf_TableCell(__('Cash'));
$cells .= wf_TableCell(__('Credit'));
$cells .= wf_TableCell(__('Contract'));
$cells .= wf_TableCell(__('Service active'));
$rows = wf_TableRow($cells, 'row1');
if (!empty($this->data)) {
foreach ($this->data as $io => $each) {
$cells = '';
if (!$cutdata) {
$profileLink = wf_Link('?module=userprofile&username=' . $each['login'], web_profile_icon() . ' ' . $each['login'], false, '');
$cells = wf_TableCell($profileLink);
}
$cells .= wf_TableCell(@$alladdress[$each['login']]);
$cells .= wf_TableCell(@$allrealnames[$each['login']]);
$cells .= wf_TableCell($each['IP']);
$cells .= wf_TableCell($each['Tariff']);
$cells .= wf_TableCell($each['TariffChange']);
$cells .= wf_TableCell($each['Cash']);
$cells .= wf_TableCell($each['Credit']);
$cells .= wf_TableCell(@$this->contracts[$each['login']]);
$actFlag = web_bool_led(@$this->actives[$each['login']], true);
if ($cutdata) {
$actFlag = strip_tags($actFlag);
}
$cells .= wf_TableCell($actFlag, '', '', 'sorttable_customkey="' . @$this->actives[$each['login']] . '"');
$rows .= wf_TableRow($cells, 'row3');
$userCounter++;
}
}
$result = wf_TableBody($rows, '100%', '0', 'sortable');
$result .= __('Total') . ': ' . $userCounter;
return $result;
}
示例15: ajaxGetData
/**
* Returns JSON reply for jquery datatables with full list of available connection details
*
* @return void
*/
public function ajaxGetData()
{
$query = "SELECT * from `condet`;";
$all = simple_queryall($query);
$alladdress = zb_AddressGetFulladdresslist();
$allrealnames = zb_UserGetAllRealnames();
$allStgData_raw = zb_UserGetAllStargazerData();
$userData = array();
if (!empty($allStgData_raw)) {
foreach ($allStgData_raw as $io => $each) {
$userData[$each['login']] = $each;
}
}
$result = '{
"aaData": [ ';
if (!empty($all)) {
foreach ($all as $io => $each) {
$profileLink = wf_Link('?module=userprofile&username=' . $each['login'], web_profile_icon() . ' ', false);
$profileLink = str_replace('"', '', $profileLink);
$profileLink = str_replace("'", '', $profileLink);
$profileLink = trim($profileLink);
$userAddress = @$alladdress[$each['login']];
$userAddress = str_replace("'", '`', $userAddress);
$userAddress = str_replace('"', '``', $userAddress);
$userAddress = trim($userAddress);
$userRealname = @$allrealnames[$each['login']];
$userRealname = str_replace("'", '`', $userRealname);
$userRealname = str_replace('"', '``', $userRealname);
$userRealname = trim($userRealname);
@($cash = $userData[$each['login']]['Cash']);
@($credit = $userData[$each['login']]['Credit']);
$act = wf_img('skins/icon_active.gif') . __('Yes');
//finance check
if ($cash < '-' . $credit) {
$act = wf_img('skins/icon_inactive.gif') . __('No');
}
$act = str_replace('"', '', $act);
$act = trim($act);
$result .= '
[
"' . $profileLink . $userAddress . '",
"' . $userRealname . '",
"' . @$userData[$each['login']]['IP'] . '",
"' . @$userData[$each['login']]['Tariff'] . '",
"' . $act . '",
"' . $cash . '",
"' . $credit . '",
"' . $each['seal'] . '",
"' . $each['price'] . '",
"' . $each['length'] . '",
"' . 'CREDIT' . '"
],';
}
}
$result = substr($result, 0, -1);
$result .= ']
}';
die($result);
}