本文整理汇总了PHP中zb_StorageSet函数的典型用法代码示例。如果您正苦于以下问题:PHP zb_StorageSet函数的具体用法?PHP zb_StorageSet怎么用?PHP zb_StorageSet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zb_StorageSet函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: zb_AskoziaGetConf
function zb_AskoziaGetConf()
{
$result = array();
$emptyArray = array();
//getting url
$url = zb_StorageGet('ASKOZIAPBX_URL');
if (empty($url)) {
$url = 'http://sip.isp/';
zb_StorageSet('ASKOZIAPBX_URL', $url);
}
//getting login
$login = zb_StorageGet('ASKOZIAPBX_LOGIN');
if (empty($login)) {
$login = 'admin';
zb_StorageSet('ASKOZIAPBX_LOGIN', $login);
}
//getting password
$password = zb_StorageGet('ASKOZIAPBX_PASSWORD');
if (empty($password)) {
$password = 'askozia';
zb_StorageSet('ASKOZIAPBX_PASSWORD', $password);
}
//getting caching time
$cache = zb_StorageGet('ASKOZIAPBX_CACHETIME');
if (empty($cache)) {
$cache = '1';
zb_StorageSet('ASKOZIAPBX_CACHETIME', $cache);
}
$result['url'] = $url;
$result['login'] = $login;
$result['password'] = $password;
$result['cachetime'] = $cache;
return $result;
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:34,代码来源:index.php
示例2: zb_PhpConsoleCreateTemplate
function zb_PhpConsoleCreateTemplate($name, $body)
{
$key = 'PHPCONSOLETEMPLATE:' . zb_rand_string(16);
$newtemplatedata = array();
$newtemplatedata['name'] = $name;
$newtemplatedata['body'] = $body;
$value = serialize($newtemplatedata);
zb_StorageSet($key, $value);
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:9,代码来源:index.php
示例3: zb_PaySysPercentDelete
function zb_PaySysPercentDelete($mark)
{
$mark = mysql_real_escape_string($mark);
$olddata = zb_PaySysPercentGetAll();
$newdata = $olddata;
if (isset($newdata[$mark])) {
unset($newdata[$mark]);
$newdata = serialize($newdata);
$newdata = base64_encode($newdata);
zb_StorageSet('PAYSYSPC', $newdata);
log_register("PAYSYSPC DELETE `" . $mark . "`");
}
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:13,代码来源:index.php
示例4: zb_SetHelpdeskUnDenied
function zb_SetHelpdeskUnDenied($login)
{
$access = zb_GetHelpdeskDeniedAll();
if (!empty($login)) {
if (isset($access[$login])) {
unset($access[$login]);
$newarray = serialize($access);
$newarray = base64_encode($newarray);
zb_StorageSet('ZBS_HELP_DENIED', $newarray);
log_register("ZBSMAN SET ALLOWED (" . $login . ")");
}
}
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:13,代码来源:index.php
示例5: zb_AsteriskGetConf
function zb_AsteriskGetConf()
{
$result = array();
$emptyArray = array();
//getting url
$host = zb_StorageGet('ASTERISK_HOST');
if (empty($host)) {
$host = 'localhost';
zb_StorageSet('ASTERISK_HOST', $host);
}
//getting login
$login = zb_StorageGet('ASTERISK_LOGIN');
if (empty($login)) {
$login = 'asterisk';
zb_StorageSet('ASTERISK_LOGIN', $login);
}
//getting DB name
$db = zb_StorageGet('ASTERISK_DB');
if (empty($db)) {
$db = 'asteriskdb';
zb_StorageSet('ASTERISK_DB', $db);
}
//getting CDR table name
$table = zb_StorageGet('ASTERISK_TABLE');
if (empty($table)) {
$table = 'cdr';
zb_StorageSet('ASTERISK_TABLE', $table);
}
//getting password
$password = zb_StorageGet('ASTERISK_PASSWORD');
if (empty($password)) {
$password = 'password';
zb_StorageSet('ASTERISK_PASSWORD', $password);
}
//getting caching time
$cache = zb_StorageGet('ASTERISK_CACHETIME');
if (empty($cache)) {
$cache = '1';
zb_StorageSet('ASTERISK_CACHETIME', $cache);
}
$result['host'] = $host;
$result['db'] = $db;
$result['table'] = $table;
$result['login'] = $login;
$result['password'] = $password;
$result['cachetime'] = $cache;
return $result;
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:48,代码来源:index.php
示例6: tsms_SetTz
function tsms_SetTz($tz)
{
zb_StorageSet('TSMS_TZ', $tz);
log_register("TSMS TIMEZONE CHANGE");
}
开发者ID:syscenter,项目名称:ubilling-sms,代码行数:5,代码来源:index.php
示例7: saveConfig
/**
* saves tariff lines config to database
*
* @param string $newlines new lines, comma separated
*
* @return void
*/
public function saveConfig($newlines)
{
zb_StorageSet('ARPU_LINES', $newlines);
log_register('ARPUREPORT CHANGE CONFIG');
}
开发者ID:carriercomm,项目名称:Ubilling,代码行数:12,代码来源:index.php
示例8: docsis_ModemSnmpWalkSet
function docsis_ModemSnmpWalkSet($path)
{
zb_StorageSet('DOCSIS_SNMPWALK_PATH', $path);
log_register("DOCSIS SNMPWALK SET `" . $path . "`");
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:5,代码来源:index.php
示例9: wf_Link
$editform .= wf_Link('?module=cashtypes', 'Back', true, 'ubButton');
show_window(__('Edit') . ' ' . __('Cash type'), $editform);
}
}
//creating new cash type
if (isset($_POST['newcashtype'])) {
$newcashtype = mysql_real_escape_string($_POST['newcashtype']);
if (!empty($newcashtype)) {
zb_CashCreateCashType($newcashtype);
rcms_redirect("?module=cashtypes");
} else {
show_error(__('No all of required fields is filled'));
}
}
//setting default cashtype
if (wf_CheckPost(array('setdefaultcashtype'))) {
zb_StorageSet('DEF_CT', $_POST['setdefaultcashtype']);
log_register("CASHTYPE SET DEFAULT [" . $_POST['setdefaultcashtype'] . "]");
rcms_redirect("?module=cashtypes");
}
// Edit form construct
$fieldname = __('Cash type');
$fieldkey = 'cashtype';
$formurl = '?module=cashtypes';
$olddata = zb_CashGetAlltypes();
$form = web_EditorTableDataFormOneField($fieldname, $fieldkey, $formurl, $olddata);
show_window(__('Edit payment types'), $form);
show_window(__('Default cash type'), web_CashCashtypeDefaultForm());
} else {
show_error(__('You cant control this module'));
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:31,代码来源:index.php
示例10: ts_TaskProblemsEditForm
/**
* Returns task typical problems editing form
*
* @return string
*/
function ts_TaskProblemsEditForm()
{
$rawNotes = zb_StorageGet('PROBLEMS');
//extract old or create new typical problems array
if (!empty($rawNotes)) {
$rawNotes = base64_decode($rawNotes);
$rawNotes = unserialize($rawNotes);
} else {
$emptyArray = array();
$newNotes = serialize($emptyArray);
$newNotes = base64_encode($newNotes);
zb_StorageSet('PROBLEMS', $newNotes);
$rawNotes = $emptyArray;
}
//adding and deletion subroutines
if (wf_CheckPost(array('createtypicalnote'))) {
$toPush = strip_tags($_POST['createtypicalnote']);
array_push($rawNotes, $toPush);
$newNotes = serialize($rawNotes);
$newNotes = base64_encode($newNotes);
zb_StorageSet('PROBLEMS', $newNotes);
log_register('TASKMAN ADD TYPICALPROBLEM');
rcms_redirect("?module=taskman&probsettings=true");
}
if (wf_CheckPost(array('deletetypicalnote', 'typicalnote'))) {
$toUnset = $_POST['typicalnote'];
if (($delkey = array_search($toUnset, $rawNotes)) !== false) {
unset($rawNotes[$delkey]);
}
$newNotes = serialize($rawNotes);
$newNotes = base64_encode($newNotes);
zb_StorageSet('PROBLEMS', $newNotes);
log_register('TASKMAN DELETE TYPICALPROBLEM');
rcms_redirect("?module=taskman&probsettings=true");
}
$rows = '';
$result = wf_Link("?module=taskman", __('Back'), true, 'ubButton');
if (!empty($rawNotes)) {
foreach ($rawNotes as $eachNote) {
$cells = wf_TableCell($eachNote);
$rows .= wf_TableRow($cells, 'row3');
}
}
$result .= wf_TableBody($rows, '100%', '0', '');
$result .= wf_delimiter();
$addinputs = wf_TextInput('createtypicalnote', __('Create'), '', true, '20');
$addinputs .= wf_Submit(__('Save'));
$addform = wf_Form("", "POST", $addinputs, 'glamour');
$result .= $addform;
$delinputs = ts_TaskTypicalNotesSelector(false);
$delinputs .= wf_HiddenInput('deletetypicalnote', 'true');
$delinputs .= wf_Submit(__('Delete'));
$delform = wf_Form("", "POST", $delinputs, 'glamour');
$result .= $delform;
return $result;
}
开发者ID:carriercomm,项目名称:Ubilling,代码行数:61,代码来源:api.teskman.php
示例11: saveConfig
/**
* Saves config in database
*
* @return void
*/
public function saveConfig()
{
//TurboSMS configuration
if ($_POST['edittsmsgateway'] != $this->settings['TSMS_GATEWAY']) {
zb_StorageSet('SENDDOG_TSMS_GATEWAY', $_POST['edittsmsgateway']);
log_register('SENDDOG CONFIG SET TSMSGATEWAY `' . $_POST['edittsmsgateway'] . '`');
}
if ($_POST['edittsmslogin'] != $this->settings['TSMS_LOGIN']) {
zb_StorageSet('SENDDOG_TSMS_LOGIN', $_POST['edittsmslogin']);
log_register('SENDDOG CONFIG SET TSMSLOGIN `' . $_POST['edittsmslogin'] . '`');
}
if ($_POST['edittsmspassword'] != $this->settings['TSMS_PASSWORD']) {
zb_StorageSet('SENDDOG_TSMS_PASSWORD', $_POST['edittsmspassword']);
log_register('SENDDOG CONFIG SET TSMSPASSWORD `' . $_POST['edittsmspassword'] . '`');
}
if ($_POST['edittsmssign'] != $this->settings['TSMS_SIGN']) {
zb_StorageSet('SENDDOG_TSMS_SIGN', $_POST['edittsmssign']);
log_register('SENDDOG CONFIG SET TSMSSIGN `' . $_POST['edittsmssign'] . '`');
}
//SMS-Fly configuration
if ($_POST['editsmsflygateway'] != $this->settings['SMSFLY_GATEWAY']) {
zb_StorageSet('SENDDOG_SMSFLY_GATEWAY', $_POST['editsmsflygateway']);
log_register('SENDDOG CONFIG SET SMSFLYGATEWAY `' . $_POST['editsmsflygateway'] . '`');
}
if ($_POST['editsmsflylogin'] != $this->settings['SMSFLY_LOGIN']) {
zb_StorageSet('SENDDOG_SMSFLY_LOGIN', $_POST['editsmsflylogin']);
log_register('SENDDOG CONFIG SET SMSFLYLOGIN `' . $_POST['editsmsflylogin'] . '`');
}
if ($_POST['editsmsflypassword'] != $this->settings['SMSFLY_PASSWORD']) {
zb_StorageSet('SENDDOG_SMSFLY_PASSWORD', $_POST['editsmsflypassword']);
log_register('SENDDOG CONFIG SET SMSFLYPASSWORD `' . $_POST['editsmsflypassword'] . '`');
}
if ($_POST['editsmsflysign'] != $this->settings['SMSFLY_SIGN']) {
zb_StorageSet('SENDDOG_SMSFLY_SIGN', $_POST['editsmsflysign']);
log_register('SENDDOG CONFIG SET SMSFLYSIGN `' . $_POST['editsmsflysign'] . '`');
}
//telegram bot token configuration
if ($_POST['edittelegrambottoken'] != $this->settings['TELEGRAM_BOTTOKEN']) {
zb_StorageSet('SENDDOG_TELEGRAM_BOTTOKEN', $_POST['edittelegrambottoken']);
log_register('SENDDOG CONFIG SET TELEGRAMBOTTOKEN');
}
//default sms service
if ($_POST['defaultsmsservice'] != $this->settings['SMS_SERVICE']) {
zb_StorageSet('SENDDOG_SMS_SERVICE', $_POST['defaultsmsservice']);
log_register('SENDDOG CONFIG SET SMSSERVICE `' . $_POST['defaultsmsservice'] . '`');
}
}
开发者ID:nightflyza,项目名称:Ubilling,代码行数:52,代码来源:api.senddog.php
示例12: saveSettings
/**
* save the current settings of watchdog as it posted in settingsForm
*
* @return void
*/
public function saveSettings()
{
if (wf_CheckPost(array('changealert'))) {
zb_StorageSet('WATCHDOG_ALERT', $_POST['changealert']);
zb_StorageSet('WATCHDOG_PHONES', $_POST['changephones']);
zb_StorageSet('WATCHDOG_EMAILS', $_POST['changeemails']);
zb_StorageSet('WATCHDOG_TELEGRAM', $_POST['changetelegram']);
log_register("WATCHDOG SETTINGS CHANGED");
}
}
开发者ID:nightflyza,项目名称:Ubilling,代码行数:15,代码来源:api.watchdog.php
示例13: web_PaymentsShowGraph
/**
* Shows payments year graph with caching
*
* @param int $year
*/
function web_PaymentsShowGraph($year)
{
$months = months_array();
$year_summ = zb_PaymentsGetYearSumm($year);
$curtime = time();
$yearPayData = array();
$yearStats = array();
$cacheTime = 3600;
//sec intervall to cache
$cells = wf_TableCell('');
$cells .= wf_TableCell(__('Month'));
$cells .= wf_TableCell(__('Payments count'));
$cells .= wf_TableCell(__('ARPU'));
$cells .= wf_TableCell(__('Cash'));
$cells .= wf_TableCell(__('Visual'), '50%');
$rows = wf_TableRow($cells, 'row1');
//caching subroutine
$renewTime = zb_StorageGet('YPD_LAST');
if (empty($renewTime)) {
//first usage
$renewTime = $curtime;
zb_StorageSet('YPD_LAST', $renewTime);
$updateCache = true;
} else {
//cache time already set
$timeShift = $curtime - $renewTime;
if ($timeShift > $cacheTime) {
//cache update needed
$updateCache = true;
} else {
//load data from cache or init new cache
$yearPayData_raw = zb_StorageGet('YPD_CACHE');
if (empty($yearPayData_raw)) {
//first usage
$emptyCache = array();
$emptyCache = serialize($emptyCache);
$emptyCache = base64_encode($emptyCache);
zb_StorageSet('YPD_CACHE', $emptyCache);
$updateCache = true;
} else {
// data loaded from cache
$yearPayData = base64_decode($yearPayData_raw);
$yearPayData = unserialize($yearPayData);
$updateCache = false;
//check is current year already cached?
if (!isset($yearPayData[$year]['graphs'])) {
$updateCache = true;
}
//check is manual cache refresh is needed?
if (wf_CheckGet(array('forcecache'))) {
$updateCache = true;
rcms_redirect("?module=report_finance");
}
}
}
}
if ($updateCache) {
//extracting all of needed payments in one query
$allYearPayments_q = "SELECT * from `payments` WHERE `date` LIKE '" . $year . "-%' AND `summ`>'0';";
$allYearPayments = simple_queryall($allYearPayments_q);
if (!empty($allYearPayments)) {
foreach ($allYearPayments as $idx => $eachYearPayment) {
//Here we can get up to 50% of CPU time on month extraction, but this hacks is to ugly :(
//Benchmark results: http://pastebin.com/i7kadpN7
$statsMonth = date("m", strtotime($eachYearPayment['date']));
if (isset($yearStats[$statsMonth])) {
$yearStats[$statsMonth]['count']++;
$yearStats[$statsMonth]['summ'] = $yearStats[$statsMonth]['summ'] + $eachYearPayment['summ'];
} else {
$yearStats[$statsMonth]['count'] = 1;
$yearStats[$statsMonth]['summ'] = $eachYearPayment['summ'];
}
}
}
foreach ($months as $eachmonth => $monthname) {
$month_summ = isset($yearStats[$eachmonth]) ? $yearStats[$eachmonth]['summ'] : 0;
$paycount = isset($yearStats[$eachmonth]) ? $yearStats[$eachmonth]['count'] : 0;
$cells = wf_TableCell($eachmonth);
$cells .= wf_TableCell(wf_Link('?module=report_finance&month=' . $year . '-' . $eachmonth, rcms_date_localise($monthname)));
$cells .= wf_TableCell($paycount);
$cells .= wf_TableCell(@round($month_summ / $paycount, 2));
$cells .= wf_TableCell(web_roundValue($month_summ, 2));
$cells .= wf_TableCell(web_bar($month_summ, $year_summ));
$rows .= wf_TableRow($cells, 'row3');
}
$result = wf_TableBody($rows, '100%', '0', 'sortable');
$yearPayData[$year]['graphs'] = $result;
//write to cache
zb_StorageSet('YPD_LAST', $curtime);
$newCache = serialize($yearPayData);
$newCache = base64_encode($newCache);
zb_StorageSet('YPD_CACHE', $newCache);
} else {
//take data from cache
if (isset($yearPayData[$year]['graphs'])) {
//.........这里部分代码省略.........
开发者ID:nightflyza,项目名称:Ubilling,代码行数:101,代码来源:api.workaround.php
示例14: show_error
show_error(__('No') . ' ' . __('SNMP template'));
}
}
}
}
}
} else {
//display all of available fdb tables
$fdbData_raw = rcms_scandir('./exports/', '*_fdb');
if (!empty($fdbData_raw)) {
//// mac filters setup
if (wf_CheckPost(array('setmacfilters'))) {
//setting new MAC filters
if (!empty($_POST['newmacfilters'])) {
$newFilters = base64_encode($_POST['newmacfilters']);
zb_StorageSet('FDBCACHEMACFILTERS', $newFilters);
}
//deleting old filters
if (isset($_POST['deletemacfilters'])) {
zb_StorageDelete('FDBCACHEMACFILTERS');
}
}
//log download
if (wf_CheckGet(array('dlswpolllog'))) {
zb_FDBTableLogDownload();
}
//push ajax data
if (wf_CheckGet(array('ajax'))) {
if (wf_CheckGet(array('swfilter'))) {
$fdbData_raw = array($_GET['swfilter'] . '_fdb');
}
开发者ID:nightflyza,项目名称:Ubilling,代码行数:31,代码来源:index.php
示例15: saveSettings
public function saveSettings()
{
if (wf_CheckPost(array('changealert'))) {
zb_StorageSet('WATCHDOG_ALERT', $_POST['changealert']);
zb_StorageSet('WATCHDOG_PHONES', $_POST['changephones']);
zb_StorageSet('WATCHDOG_EMAILS', $_POST['changeemails']);
zb_StorageSet('WATCHDOG_TSMS_GATEWAY', $_POST['changetsmsgateway']);
zb_StorageSet('WATCHDOG_TSMS_LOGIN', $_POST['changetsmslogin']);
zb_StorageSet('WATCHDOG_TSMS_PASSWORD', $_POST['changetsmspassword']);
zb_StorageSet('WATCHDOG_TSMS_SIGN', $_POST['changetsmssign']);
log_register("WATCHDOG SETTINGS CHANGED");
}
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:13,代码来源:api.watchdog.php
示例16: web_SwitchesShow
/**
* Returns list of all available switches devices with its controls. Also catches ajaxping and forcereping events.
*
* @return string
*/
function web_SwitchesShow()
{
global $ubillingConfig;
$alterconf = $ubillingConfig->getAlter();
$allswitches = zb_SwitchesGetAll();
$modelnames = zb_SwitchModelsGetAllTag();
$currenttime = time();
$reping_timeout = $alterconf['SW_PINGTIMEOUT'];
$deathTime = zb_SwitchesGetAllDeathTime();
//counters
$countTotal = 0;
$countAlive = 0;
$countDead = 0;
$countNp = 0;
$countOnMap = 0;
$countSwpoll = 0;
$countMtsigmon = 0;
$countOlt = 0;
$countLinked = 0;
//non realtime switches pinging
$last_pingtime = zb_StorageGet('SWPINGTIME');
if (!$last_pingtime) {
zb_SwitchesRepingAll();
zb_StorageSet('SWPINGTIME', $currenttime);
$last_pingtime = $currenttime;
} else {
if ($currenttime > $last_pingtime + $reping_timeout * 60) {
// normal timeout reping sub here
zb_SwitchesRepingAll();
zb_StorageSet('SWPINGTIME', $currenttime);
}
}
//force total reping and update cache
if (wf_CheckGet(array('forcereping'))) {
zb_SwitchesRepingAll();
zb_StorageSet('SWPINGTIME', $currenttime);
if (wf_CheckGet(array('ajaxping'))) {
$dead_raw = zb_StorageGet('SWDEAD');
$deathTime = zb_SwitchesGetAllDeathTime();
$deadarr = array();
$ajaxResult = '';
if ($dead_raw) {
$deadarr = unserialize($dead_raw);
if (!empty($deadarr)) {
//there is some dead switches
$deadcount = sizeof($deadarr);
if ($alterconf['SWYMAP_ENABLED']) {
//getting geodata
$switchesGeo = zb_SwitchesGetAllGeo();
}
//ajax container
$ajaxResult .= wf_tag('div', false, '', 'id="switchping"');
foreach ($deadarr as $ip => $switch) {
if ($alterconf['SWYMAP_ENABLED']) {
if (isset($switchesGeo[$ip])) {
if (!empty($switchesGeo[$ip])) {
$devicefind = wf_Link('?module=switchmap&finddevice=' . $switchesGeo[$ip], wf_img('skins/icon_search_small.gif', __('Find on map'))) . ' ';
} else {
$devicefind = '';
}
} else {
$devicefind = '';
}
} else {
$devicefind = '';
}
//check morgue records for death time
if (isset($deathTime[$ip])) {
$deathClock = wf_img('skins/clock.png', __('Switch dead since') . ' ' . $deathTime[$ip]) . ' ';
} else {
$deathClock = '';
}
//switch location link
$switchLocator = wf_Link('?module=switches&gotoswitchbyip=' . $ip, web_edit_icon(__('Go to switch')));
//add switch as dead
$ajaxResult .= $devicefind . ' ' . $switchLocator . ' ' . $deathClock . $ip . ' - ' . $switch . '<br>';
}
} else {
$ajaxResult = __('Switches are okay, everything is fine - I guarantee');
}
}
$ajaxResult .= wf_delimiter() . __('Cache state at time') . ': ' . date("H:i:s");
print $ajaxResult;
//darkvoid update
$notifyArea = new DarkVoid();
$notifyArea->flushCache();
die;
}
}
//load dead switches cache
$dead_switches_raw = zb_StorageGet('SWDEAD');
if (!$dead_switches_raw) {
$dead_switches = array();
} else {
$dead_switches = unserialize($dead_switches_raw);
//.........这里部分代码省略.........
开发者ID:carriercomm,项目名称:Ubilling,代码行数:101,代码来源:api.switches.php
示例17: web_MigrationPrepare
//.........这里部分代码省略.........
$cells .= wf_TableCell($mac);
$tariff = $eachrow[$import_opts['tariff_col']];
$cells .= wf_TableCell($tariff);
$cash = $eachrow[$import_opts['cash_col']];
$cells .= wf_TableCell($cash);
if ($import_opts['phone_col'] != 'NONE') {
$phone = $eachrow[$import_opts['phone_col']];
} else {
$phone = '';
}
$cells .= wf_TableCell($phone);
if ($import_opts['mobile_col'] != 'NONE') {
$mobile = $eachrow[$import_opts['mobile_col']];
} else {
$mobile = '';
}
$cells .= wf_TableCell($mobile);
if ($import_opts['email_col'] != 'NONE') {
$email = $eachrow[$import_opts['email_col']];
} else {
$email = '';
}
$cells .= wf_TableCell($email);
if ($import_opts['credit_col'] != 'ZERO') {
$credit = $eachrow[$import_opts['credit_col']];
} else {
$credit = 0;
}
$cells .= wf_TableCell($credit);
if ($import_opts['creditex_col'] != 'NONE') {
$creditex = $eachrow[$import_opts['creditex_col']];
} else {
$creditex = '0';
}
$cells .= wf_TableCell($creditex);
if ($import_opts['address_col'] != 'NONE') {
$address = $eachrow[$import_opts['address_col']];
} else {
$address = '';
}
$cells .= wf_TableCell($address);
if ($import_opts['realname_col'] != 'NONE') {
$realname = $eachrow[$import_opts['realname_col']];
} else {
$realname = '';
}
$cells .= wf_TableCell($realname);
if ($import_opts['contract_col'] != 'NONE') {
$contract = $eachrow[$import_opts['contract_col']];
} else {
$contract = '';
}
$cells .= wf_TableCell($contract);
if ($import_opts['ao_col'] != 'AO_1') {
$ao = $eachrow[$import_opts['ao_col']];
} else {
$ao = 1;
}
$cells .= wf_TableCell($ao);
if ($import_opts['down_col'] != 'DOWN_0') {
$down = $eachrow[$import_opts['down_col']];
} else {
$down = 0;
}
$cells .= wf_TableCell($down);
if ($import_opts['passive_col'] != 'PASSIVE_0') {
$passive = $eachrow[$import_opts['passive_col']];
} else {
$passive = 0;
}
$cells .= wf_TableCell($passive);
$rows .= wf_TableRow($cells, 'row3');
// filling userreg array
$regdata[$login]['login'] = $login;
$regdata[$login]['password'] = $password;
$regdata[$login]['ip'] = $ip;
$regdata[$login]['mac'] = $mac;
$regdata[$login]['tariff'] = $tariff;
$regdata[$login]['cash'] = $cash;
$regdata[$login]['phone'] = $phone;
$regdata[$login]['mobile'] = $mobile;
$regdata[$login]['email'] = $email;
$regdata[$login]['credit'] = $credit;
$regdata[$login]['creditex'] = $creditex;
$regdata[$login]['address'] = $address;
$regdata[$login]['realname'] = $realname;
$regdata[$login]['contract'] = $contract;
$regdata[$login]['ao'] = $ao;
$regdata[$login]['down'] = $down;
$regdata[$login]['passive'] = $passive;
}
$regdata_save = serialize($regdata);
$regdata_save = base64_encode($regdata_save);
zb_StorageSet('IMPORT_REGDATA', $regdata_save);
$preparse = wf_TableBody($rows, '100%', '0', '');
show_window(__('All correct') . '?', $preparse);
$inputs = wf_Link('?module=migration', 'No I want to try another import settings', false, 'ubButton');
$inputs .= wf_Link('?module=migration&setpointers=true&goregister=ok', 'Yes proceed registeration of this users', false, 'ubButton');
show_window('', $inputs);
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:101,代码来源:index.php
示例18: simple_query
<?php
//frontend for cron task
if (isset($_GET['cronping'])) {
$hostid_q = "SELECT * from `ubstats` WHERE `key`='ubid'";
$hostid = simple_query($hostid_q);
if (!empty($hostid)) {
$ubserial = $hostid['value'];
//check for ubserial validity
if ($_GET['cronping'] == $ubserial) {
$currenttime = time();
$deadSwitches = zb_SwitchesRepingAll();
zb_StorageSet('SWPINGTIME', $currenttime);
//store dead switches log data
if (!empty($deadSwitches)) {
zb_SwitchesDeadLog($currenttime, $deadSwitches);
}
die('SWITCH REPING DONE ' . date("Y-m-d H:i:s"));
} else {
die('WRONG SERIAL');
}
}
}
if (cfr('SWITCHES')) {
$altCfg = $ubillingConfig->getAlter();
//icmp ping handling
if (wf_CheckGet(array('backgroundicmpping'))) {
$billingConf = $ubillingConfig->getBilling();
$command = $billingConf['SUDO'] . ' ' . $billingConf['PING'] . ' -i 0.01 -c 10 ' . $_GET['backgroundicmpping'];
$icmpPingResult = shell_exec($command);
die(wf_tag('pre') . $icmpPingResult . wf_tag('pre', true));
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:31,代码来源:index.php
示例19: zb_TicketsTAPEdit
/**
* Changes existing typical answer preset data in database
*
* @param string $key
* @param string $text
*
* @return void
*/
function zb_TicketsTAPEdit($key, $text)
{
$storeData = base64_encode($text);
zb_StorageSet($key, $storeData);
log_register('TICKET TAP CHANGE `' . $key . '`');
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:14,代码来源:api.ticketing.php
示例20: paymentsShowGraph
/**
* shows payments graph for some year
*
* @param string $year year to show
*
* @return void
*/
protected function paymentsShowGraph($year)
{
$months = months_array();
$year_summ = $this->paymentsGetYearSumm($year);
$curtime = time();
$yearPayData = array();
$cells = wf_TableCell('');
$cells .= wf_TableCell(__('Month'));
$cells .= wf_TableCell(__('Payments count'));
$cells .= wf_TableCell(__('ARPU'));
$cells .= wf_TableCell(__('Cash'));
$cells .= wf_TableCell(__('Visual'), '50%');
$rows = wf_TableRow($cells, 'row1');
//caching subroutine
$renewTime = zb_StorageGet('UKVYPD_LAST');
if (empty($renewTime)) {
//first usage
$renewTime = $curtime;
zb_StorageSet('UKVYPD_LAST', $renewTime);
$updateCache = true;
} else {
//cache time already set
$timeShift = $curtime - $renewTime;
if ($timeShift > 3600) {
//cache update needed
$updateCache = true;
} else {
//load data from cache or init new cache
$yearPayData_raw = zb_StorageGet('UKVYPD_CACHE');
if (empty($yearPayData_raw)) {
//first usage
$emptyCache = array();
$emptyCache = serialize($emptyCache);
$emptyCache = base64_encode($emptyCache);
zb_StorageSet('UKVYPD_CACHE', $emptyCache);
$updateCache = true;
} else {
// data loaded from cache
$yearPayData = base64_decode($yearPayData_raw);
$yearPayData = unserialize($yearPayData);
$updateCache = false;
//check is current year already cached?
if (!isset($yearPayData[$year]['graphs'])) {
$updateCache = true;
}
//check is manual cache refresh is needed?
if (wf_CheckGet(array('forcecache'))) {
$updateCache = true;
rcms_redirect(self::URL_REPORTS_MGMT . 'reportFinance');
}
}
}
}
if ($updateCache) {
foreach ($months as $eachmonth => $monthname) {
$month_summ = $this->paymentsGetMonthSumm($year, $eachmonth);
$paycount = $this->paymentsGetMonthCount($year, $eachmonth);
$cells = wf_TableCell($eachmonth);
$cells .= wf_TableCell(wf_Link(self::URL_REPORTS_MGMT . 'reportFinance&month=' . $year . '-' . $eachmonth, rcms_date_localise($monthname)));
$cells .= wf_TableCell($paycount);
$cells .= wf_TableCell(@round($month_summ / $paycount, 2));
$cells .= wf_TableCell(web_roundValue($month_summ, 2));
$cells .= wf_TableCell(web_bar($month_summ, $year_summ));
$rows .= wf_TableRow($cells, 'row3');
}
$result = wf_TableBody($rows, '100%', '0', 'sortable');
$yearPayData[$year]['graphs'] = $result;
//write to cache
zb_StorageSet('UKVYPD_LAST', $curtime);
$newCache = serialize($yearPayData);
$newCache = base64_encode($newCache);
zb_StorageSet('UKVYPD_CACHE', $newCache);
} else {
//take data from cache
if (isset($yearPayData[$year]['graphs'])) {
$result = $yearPayData[$year]['graphs'];
$result .= __('Cache state at time') . ': ' . date("Y-m-d H:i:s", $renewTime) . ' ';
$result .= wf_Link(self::URL_REPORTS_MGMT . 'reportFinance&forcecache=true', wf_img('skins/icon_cleanup.png', __('Renew')), false, '');
} else {
$result = __('Strange exeption');
}
}
show_window(__('Payments by') . ' ' . $year, $result);
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:91,代码来源:api.ukv.php
注:本文中的zb_StorageSet函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论