• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP zb_rand_string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中zb_rand_string函数的典型用法代码示例。如果您正苦于以下问题:PHP zb_rand_string函数的具体用法?PHP zb_rand_string怎么用?PHP zb_rand_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了zb_rand_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: 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


示例2: sendEmail

 /**
  * Stores message in email sending queue. Use this method in your modules.
  * 
  * @param string $email
  * @param string $subj
  * @param string $message
  * @param string $module
  * 
  * @return bool
  */
 public function sendEmail($email, $subj, $message, $module = '')
 {
     $result = false;
     $email = trim($email);
     $subj = trim($subj);
     $module = !empty($module) ? ' MODULE ' . $module : '';
     if (!empty($email)) {
         $message = trim($message);
         $filename = self::QUEUE_PATH . 'eml_' . zb_rand_string(8);
         $storedata['email'] = $email;
         $storedata['subj'] = $subj;
         $storedata['message'] = $message;
         $storedata = json_encode($storedata);
         file_put_contents($filename, $storedata);
         log_register('UEML SEND EMAIL `' . $email . '`' . $module);
         $result = true;
     }
     return $result;
 }
开发者ID:nightflyza,项目名称:Ubilling,代码行数:29,代码来源:api.email.php


示例3: sendMessage

 /**
  * Stores message in telegram sending queue. Use this method in your modules.
  * 
  * @param int $chatid
  * @param string $message
  * @param bool $translit
  * @param string $module
  * 
  * @return bool
  */
 public function sendMessage($chatid, $message, $translit = false, $module = '')
 {
     $result = false;
     $chatid = trim($chatid);
     $module = !empty($module) ? ' MODULE ' . $module : '';
     if (!empty($chatid)) {
         $message = str_replace(array("\n\r", "\n", "\r"), ' ', $message);
         if ($translit) {
             $message = zb_TranslitString($message);
         }
         $message = trim($message);
         $filename = self::QUEUE_PATH . 'tlg_' . zb_rand_string(8);
         $storedata = 'CHATID="' . $chatid . '"' . "\n";
         $storedata .= 'MESSAGE="' . $message . '"' . "\n";
         file_put_contents($filename, $storedata);
         log_register('UTLG SEND MESSAGE `' . $chatid . '`' . $module);
         $result = true;
     }
     return $result;
 }
开发者ID:nightflyza,项目名称:Ubilling,代码行数:30,代码来源:api.telegram.php


示例4: sendSMS

 /**
  * Stores SMS in sending queue 
  * 
  * @param string $number Mobile number in international format. Eg: +380506666666
  * @param string $message Text message for sending
  * @param bool $translit force message transliteration
  * @param string $module module that inits SMS sending
  * 
  * @return bool
  */
 public function sendSMS($number, $message, $translit = true, $module = '')
 {
     $result = false;
     $number = trim($number);
     $module = !empty($module) ? ' MODULE ' . $module : '';
     if (!empty($number)) {
         if (ispos($number, '+')) {
             $message = str_replace(array("\n\r", "\n", "\r"), ' ', $message);
             if ($translit) {
                 $message = zb_TranslitString($message);
             }
             $message = trim($message);
             $filename = self::QUEUE_PATH . 'us_' . zb_rand_string(8);
             $storedata = 'NUMBER="' . $number . '"' . "\n";
             $storedata .= 'MESSAGE="' . $message . '"' . "\n";
             file_put_contents($filename, $storedata);
             log_register('USMS SEND SMS `' . $number . '`' . $module);
             $result = true;
         }
     }
     return $result;
 }
开发者ID:nightflyza,项目名称:Ubilling,代码行数:32,代码来源:api.usms.php


示例5: sendSMS

 /**
  * Stores SMS in sending queue 
  * 
  * @param string $number Mobile number in international format. Eg: +380506666666
  * @param string $message Text message for sending
  * @param bool $translit force message transliteration
  * @return bool
  */
 public function sendSMS($number, $message, $translit = true)
 {
     $result = false;
     $number = trim($number);
     if (!empty($number)) {
         if (ispos($number, '+')) {
             $message = str_replace('\\r\\n', ' ', $message);
             if ($translit) {
                 $message = zb_TranslitString($message);
             }
             $message = trim($message);
             $filename = self::QUEUE_PATH . 'us_' . zb_rand_string(8);
             $storedata = 'NUMBER="' . $number . '"' . "\n";
             $storedata .= 'MESSAGE="' . $message . '"' . "\n";
             $result['number'] = $number;
             $result['message'] = $message;
             file_put_contents($filename, $storedata);
             log_register("USMS SEND SMS `" . $number . "`");
             $result = true;
         }
     }
     return $result;
 }
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:31,代码来源:api.usms.php


示例6: web_MigrationPrepare

 function web_MigrationPrepare($import_rawdata, $import_opts)
 {
     $import_rawdata = unserialize(base64_decode($import_rawdata));
     $import_opts = unserialize(base64_decode($import_opts));
     $cells = wf_TableCell('#');
     $cells .= wf_TableCell('[login]');
     $cells .= wf_TableCell('[password]');
     $cells .= wf_TableCell('[ip]');
     $cells .= wf_TableCell('[mac]');
     $cells .= wf_TableCell('[tariff]');
     $cells .= wf_TableCell('[cash]');
     $cells .= wf_TableCell('[phone]');
     $cells .= wf_TableCell('[mobile]');
     $cells .= wf_TableCell('[email]');
     $cells .= wf_TableCell('[credit]');
     $cells .= wf_TableCell('[creditex]');
     $cells .= wf_TableCell('[address]');
     $cells .= wf_TableCell('[realname]');
     $cells .= wf_TableCell('[contract]');
     $cells .= wf_TableCell('[ao]');
     $cells .= wf_TableCell('[down]');
     $cells .= wf_TableCell('[passive]');
     $rows = wf_TableRow($cells, 'row1');
     $regdata = array();
     $i = 0;
     foreach ($import_rawdata as $eachrow) {
         $i++;
         $cells = wf_TableCell($i);
         if ($import_opts['login_col'] != 'RANDOM') {
             $login = $eachrow[$import_opts['login_col']];
         } else {
             $login = 'mi_' . zb_rand_string(8);
         }
         $cells .= wf_TableCell($login);
         if ($import_opts['password_col'] != 'RANDOM') {
             $password = $eachrow[$import_opts['password_col']];
         } else {
             $password = zb_rand_string(10);
         }
         $cells .= wf_TableCell($password);
         $ip = $eachrow[$import_opts['ip_col']];
         $cells .= wf_TableCell($ip);
         if ($import_opts['mac_col'] != 'RANDOM') {
             $mac = $eachrow[$import_opts['mac_col']];
         } else {
             $mac = '14:' . '88' . ':' . rand(10, 99) . ':' . rand(10, 99) . ':' . rand(10, 99) . ':' . rand(10, 99);
         }
         $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);
//.........这里部分代码省略.........
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:101,代码来源:index.php


示例7: createKey

 /**
  * installs new license key
  * 
  * @param $key string valid license key
  * 
  * @return bool
  */
 public function createKey($key)
 {
     $key = mysql_real_escape_string($key);
     if ($this->checkLicenseValidity($key)) {
         $keyname = 'AVLICENSE_' . zb_rand_string('8');
         $query = "INSERT INTO `ubstorage` (`id`, `key`, `value`) VALUES (NULL, '" . $keyname . "', '" . $key . "');";
         nr_query($query);
         log_register("AVARICE INSTALL KEY `" . $keyname . '`');
         return true;
     } else {
         log_register("AVARICE TRY INSTALL WRONG KEY");
         return false;
     }
 }
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:21,代码来源:api.deploy.php


示例8: exportCSV

 /**
  * extracts data from agentPring cache for future export in CSV
  * 
  * @param int $agentid Existing agent ID in database
  * 
  * @return void
  */
 public function exportCSV($agentid)
 {
     $tmpArr = array();
     $result = '';
     if (!empty($this->altcfg)) {
         $altercfg = $this->altcfg;
     } else {
         global $ubillingConfig;
         $this->altcfg = $ubillingConfig->getAlter();
         $altercfg = $this->altcfg;
     }
     if (file_exists(self::EXPORT_PATH . 'report_agentfinance.prindataraw')) {
         $rawData = file_get_contents(self::EXPORT_PATH . 'report_agentfinance.prindataraw');
         $tmpArr = unserialize($rawData);
         $allservicenames = zb_VservicesGetAllNamesLabeled();
         $this->loadUserRealnames();
         $this->loadCashTypes();
         if (!empty($tmpArr)) {
             if (isset($tmpArr[$agentid])) {
                 if (!empty($tmpArr[$agentid])) {
                     //CSV header
                     $result .= __('ID') . ';' . __('Date') . ';' . __('Cash') . ';' . __('Login') . ';' . __('Full address') . ';' . __('Real Name') . ';' . __('Contrahent name') . ';' . __('Payment type') . ';' . __('Notes') . ';' . __('Admin') . "\n";
                     //CSV data
                     foreach ($tmpArr[$agentid] as $io => $each) {
                         $summ = str_replace('.', ',', $each['summ']);
                         //need for normal summ in excel
                         $result .= $each['id'] . ';' . $each['date'] . ';' . $summ . ';' . $each['login'] . ';' . @$this->alladdress[$each['login']] . ';' . @$this->userRealnames[$each['login']] . ';' . @$this->agentsNamed[$this->assigns[$each['login']]] . ';' . __(@$this->cashtypes[$each['cashtypeid']]) . ';' . zb_TranslatePaymentNote($each['note'], $allservicenames) . ';' . $each['admin'] . "\n";
                     }
                 }
             }
         }
     }
     $saveCsvName = self::EXPORT_PATH . 'report_agentfinance_' . $agentid . '_' . zb_rand_string(8) . '.csv';
     $result = iconv('utf-8', 'windows-1251', $result);
     file_put_contents($saveCsvName, $result);
     zb_DownloadFile($saveCsvName, 'csv');
     die;
 }
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:45,代码来源:api.assignreport.php


示例9: ts_SendSMS

/**
 * Stores SMS for some employee for further sending with watchdog run
 * 
 * @param int $employeeid
 * @param string $message
 * @return array
 * @throws Exception
 */
function ts_SendSMS($employeeid, $message)
{
    $query = "SELECT `mobile`,`name` from `employee` WHERE `id`='" . $employeeid . "'";
    $empData = simple_query($query);
    $mobile = $empData['mobile'];
    $employeeName = $empData['name'];
    $result = array();
    if (!empty($mobile)) {
        if (ispos($mobile, '+')) {
            $message = str_replace('\\r\\n', ' ', $message);
            $message = zb_TranslitString($message);
            $message = trim($message);
            $number = trim($mobile);
            $filename = 'content/tsms/ts_' . zb_rand_string(8);
            $storedata = 'NUMBER="' . $number . '"' . "\n";
            $storedata .= 'MESSAGE="' . $message . '"' . "\n";
            $result['number'] = $number;
            $result['message'] = $message;
            file_put_contents($filename, $storedata);
            log_register("TASKMAN SEND SMS `" . $number . "` FOR `" . $employeeName . "`");
        } else {
            throw new Exception('BAD_MOBILE_FORMAT');
        }
    }
    return $result;
}
开发者ID:carriercomm,项目名称:Ubilling,代码行数:34,代码来源:api.teskman.php


示例10: zb_NewMacShow

function zb_NewMacShow()
{
    global $ubillingConfig;
    $billing_config = $ubillingConfig->getBilling();
    $alter_config = $ubillingConfig->getAlter();
    $allarp = array();
    $sudo = $billing_config['SUDO'];
    $cat = $billing_config['CAT'];
    $grep = $billing_config['GREP'];
    $tail = $billing_config['TAIL'];
    $alter_conf = parse_ini_file(CONFIG_PATH . 'alter.ini');
    $leases = $alter_conf['NMLEASES'];
    $leasemark = $alter_conf['NMLEASEMARK'];
    $command = $sudo . ' ' . $cat . ' ' . $leases . ' | ' . $grep . ' "' . $leasemark . '" | ' . $tail . ' -n 200';
    $rawdata = shell_exec($command);
    $allusedMacs = zb_getAllUsedMac();
    $result = '';
    //fdb cache preprocessing
    $fdbData_raw = rcms_scandir('./exports/', '*_fdb');
    if (!empty($fdbData_raw)) {
        $fdbArr = sn_SnmpParseFdbCacheArray($fdbData_raw);
        $fdbColumn = true;
    } else {
        $fdbArr = array();
        $fdbColumn = false;
    }
    $cells = wf_TableCell(__('MAC'));
    if (!empty($fdbColumn)) {
        $cells .= wf_TableCell(__('Switch'));
    }
    if ($alter_config['MACVEN_ENABLED']) {
        $cells .= wf_TableCell(__('Manufacturer'));
    }
    $rows = wf_TableRow($cells, 'row1');
    if (!empty($rawdata)) {
        $cleardata = exploderows($rawdata);
        foreach ($cleardata as $eachline) {
            preg_match('/[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}/i', $eachline, $matches);
            if (!empty($matches)) {
                $allarp[] = $matches[0];
            }
        }
        $un_arr = array_unique($allarp);
        if (!empty($un_arr)) {
            if ($alter_config['MACVEN_ENABLED']) {
                //adding ajax loader
                $result .= wf_AjaxLoader();
            }
            foreach ($un_arr as $io => $eachmac) {
                if (zb_checkMacFree($eachmac, $allusedMacs)) {
                    $cells = wf_TableCell(@$eachmac);
                    if (!empty($fdbColumn)) {
                        $cells .= wf_TableCell(sn_SnmpParseFdbExtract(@$fdbArr[$eachmac]));
                    }
                    if ($alter_config['MACVEN_ENABLED']) {
                        $containerName = 'NMRSMCNT_' . zb_rand_string(8);
                        $lookupVendorLink = wf_AjaxLink('?module=macvendor&mac=' . @$eachmac . '&raw=true', wf_img('skins/macven.gif', __('Device vendor')), $containerName, false, '');
                        $lookupVendorLink .= wf_tag('span', false, '', 'id="' . $containerName . '"') . '' . wf_tag('span', true);
                        $cells .= wf_TableCell($lookupVendorLink, '350');
                    }
                    $rows .= wf_TableRow($cells, 'row3');
                }
            }
        }
    }
    $result .= wf_TableBody($rows, '100%', '0', 'sortable');
    return $result;
}
开发者ID:nightflyza,项目名称:Ubilling,代码行数:68,代码来源:api.networking.php


示例11: zb_RegPasswordProposal

/**
 * Returns new user password proposal
 * 
 * @return string
 */
function zb_RegPasswordProposal()
{
    $alterconf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
    if (isset($alterconf['PASSWORD_GENERATION_LENGHT']) and isset($alterconf['PASSWORD_TYPE'])) {
        if ($alterconf['PASSWORD_TYPE']) {
            $password = zb_rand_string($alterconf['PASSWORD_GENERATION_LENGHT']);
        } else {
            $password = zb_rand_digits($alterconf['PASSWORD_GENERATION_LENGHT']);
        }
    } else {
        die(strtoupper('you have missed a essential option. before update read release notes motherfucker!'));
    }
    return $password;
}
开发者ID:nightflyza,项目名称:Ubilling,代码行数:19,代码来源:api.userreg.php


示例12: zb_BillingStats

/**
 * 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);
    }
}
开发者ID:nightflyza,项目名称:Ubilling,代码行数:84,代码来源:api.workaround.php


示例13: catchFileUpload

 /**
  * Catches file upload in background
  * 
  * @return void
  */
 public function catchFileUpload()
 {
     if (wf_CheckGet(array('uploadfilephoto'))) {
         if (!empty($this->scope)) {
             $allowedExtensions = array("jpg", "gif", "png", "jpeg");
             $fileAccepted = true;
             foreach ($_FILES as $file) {
                 if ($file['tmp_name'] > '') {
                     if (!in_array(end(explode(".", strtolower($file['name']))), $allowedExtensions)) {
                         $fileAccepted = false;
                     }
                 }
             }
             if ($fileAccepted) {
                 $newFilename = zb_rand_string(16) . '_upload.jpg';
                 $newSavePath = self::STORAGE_PATH . $newFilename;
                 move_uploaded_file($_FILES['photostorageFileUpload']['tmp_name'], $newSavePath);
                 if (file_exists($newSavePath)) {
                     $uploadResult = wf_tag('span', false, 'alert_success') . __('Photo upload complete') . wf_tag('span', true);
                     $this->registerImage($newFilename);
                     rcms_redirect(self::MODULE_URL . '&scope=' . $this->scope . '&itemid=' . $this->itemId . '&mode=loader&preview=' . $newFilename);
                 } else {
                     $uploadResult = wf_tag('span', false, 'alert_error') . __('Photo upload failed') . wf_tag('span', true);
                 }
             } else {
                 $uploadResult = wf_tag('span', false, 'alert_error') . __('Photo upload failed') . ': ' . self::EX_WRONG_EXT . wf_tag('span', true);
             }
         } else {
             $uploadResult = wf_tag('span', false, 'alert_error') . __('Strange exeption') . ': ' . self::EX_NOSCOPE . wf_tag('span', true);
         }
         show_window('', $uploadResult);
         show_window('', wf_Link(self::MODULE_URL . '&scope=' . $this->scope . '&itemid=' . $this->itemId . '&mode=loader', __('Back'), false, 'ubButton'));
     }
 }
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:39,代码来源:api.photostorage.php


示例14: zb_TicketsTAPCreate

/**
 * Creates new typical answer preset in database
 * 
 * @param string $taptext
 * 
 * @return void
 */
function zb_TicketsTAPCreate($taptext)
{
    $keyName = 'HELPDESKTAP_' . zb_rand_string(8);
    $storeData = base64_encode($taptext);
    zb_StorageSet($keyName, $storeData);
    log_register('TICKET TAP CREATE `' . $keyName . '`');
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:14,代码来源:api.ticketing.php


示例15: smsflyPushMessages

 /**
  * Sends all sms storage via sms-fly.com service
  * 
  */
 protected function smsflyPushMessages()
 {
     $result = '';
     $apiUrl = $this->settings['SMSFLY_GATEWAY'];
     $source = $this->safeEscapeString($this->settings['SMSFLY_SIGN']);
     $description = "Ubilling_" . zb_rand_string(8);
     $start_time = 'AUTO';
     $end_time = 'AUTO';
     $rate = 1;
     $lifetime = 4;
     $user = $this->settings['SMSFLY_LOGIN'];
     $password = $this->settings['SMSFLY_PASSWORD'];
     $allSmsQueue = $this->smsQueue->getQueueData();
     if (!empty($allSmsQueue)) {
         foreach ($allSmsQueue as $io => $eachsms) {
             $number = str_replace('+', '', $eachsms['number']);
             //numbers in international format without +
             $myXML = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
             $myXML .= "<request>";
             $myXML .= "<operation>SENDSMS</operation>";
             $myXML .= '		<message start_time="' . $start_time . '" end_time="' . $end_time . '" lifetime="' . $lifetime . '" rate="' . $rate . '" desc="' . $description . '" source="' . $source . '">' . "\n";
             $myXML .= "\t\t<body>" . $eachsms['message'] . "</body>";
             $myXML .= "\t\t<recipient>" . $number . "</recipient>";
             $myXML .= "</message>";
             $myXML .= "</request>";
             $ch = curl_init();
             curl_setopt($ch, CURLOPT_USERPWD, $user . ':' . $password);
             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
             curl_setopt($ch, CURLOPT_POST, 1);
             curl_setopt($ch, CURLOPT_URL, $apiUrl);
             curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml", "Accept: text/xml"));
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
             curl_setopt($ch, CURLOPT_POSTFIELDS, $myXML);
             $result .= curl_exec($ch);
             curl_close($ch);
             //remove old sent message
             $this->smsQueue->deleteSms($eachsms['filename']);
         }
     }
 }
开发者ID:nightflyza,项目名称:Ubilling,代码行数:44,代码来源:api.senddog.php


示例16: catchFileUpload

 /**
  * Catches file upload
  * 
  * @return string
  */
 public function catchFileUpload()
 {
     $result = '';
     $allowedExtensions = array("kml", "txt");
     $fileAccepted = true;
     foreach ($_FILES as $file) {
         if ($file['tmp_name'] > '') {
             if (@(!in_array(end(explode(".", strtolower($file['name']))), $allowedExtensions))) {
                 $fileAccepted = false;
             }
         }
     }
     if ($fileAccepted) {
         $newFilename = zb_rand_string(10) . '_custmap.kml';
         $newSavePath = self::UPLOAD_PATH . $newFilename;
         move_uploaded_file($_FILES['itemsUploadFile']['tmp_name'], $newSavePath);
         if (file_exists($newSavePath)) {
             $uploadResult = wf_tag('span', false, 'alert_success') . __('Upload complete') . wf_tag('span', true);
             $result = $newFilename;
         } else {
             $uploadResult = wf_tag('span', false, 'alert_error') . __('Upload failed') . wf_tag('span', true);
         }
     } else {
         $uploadResult = wf_tag('span', false, 'alert_error') . __('Upload failed') . ': ' . self::EX_WRONG_EXT . wf_tag('span', true);
     }
     show_window('', $uploadResult);
     if ($result) {
         $this->itemsImportKml($newFilename, $_GET['showitems'], $_POST['itemsUploadTypes']);
     }
     return $result;
 }
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:36,代码来源:api.custmaps.php


示例17: zb_UserCreateContract

         zb_UserCreateContract($randomLogin, '');
         zb_UserCreateEmail($randomLogin, '');
         zb_UserCreateSpeedOverride($randomLogin, 0);
         multinet_change_mac($randomIp, $randomMac);
         multinet_rebuild_all_handlers();
         $billing->settariff($randomLogin, $tariff);
         $billing->setao($randomLogin, '1');
         $billing->setdstat($randomLogin, '1');
         zb_UserRegisterLog($randomLogin);
         log_register("SAMPLE GENERATION OF (" . $randomLogin . ") DONE");
     }
 } else {
     //fast SQL users generation directly in database
     for ($i = 1; $i <= $neednum; $i++) {
         $randomLogin = 'gen_' . zb_rand_string(10);
         $randomPassword = zb_rand_string(8);
         $randomName = $names[array_rand($names)] . ' ' . $surnames[array_rand($surnames)];
         $randomPhone = rand(111111, 999999);
         $randomMobile = '380' . rand(1111111, 9999999);
         $randomMac = '14:' . '88' . ':' . rand(10, 99) . ':' . rand(10, 99) . ':' . rand(10, 99) . ':' . rand(10, 99);
         $randomApt = $i;
         $randomCash = rand(0, 500);
         $randomIp = multinet_get_next_freeip('nethosts', 'ip', $netID);
         $randomFloor = rand(1, 9);
         $randomEntrance = rand(1, 4);
         //registering subroutine
         $querybuff = "\n            INSERT INTO `users` (\n            `login`,\n            `Password`,\n            `Passive`,\n            `Down`,\n            `DisabledDetailStat`,\n            `AlwaysOnline`,\n            `Tariff`,\n            `Address`,\n            `Phone`,\n            `Email`,\n            `Note`,\n            `RealName`,\n            `StgGroup`,\n            `Credit`,\n            `TariffChange`,\n            `Userdata0`,\n            `Userdata1`,\n            `Userdata2`,\n            `Userdata3`,\n            `Userdata4`,\n            `Userdata5`,\n            `Userdata6`,\n            `Userdata7`,\n            `Userdata8`,\n            `Userdata9`,\n            `CreditExpire`,\n            `IP`,\n            `D0`,\n            `U0`,\n            `D1`,\n            `U1`,\n            `D2`,\n            `U2`,\n            `D3`,\n            `U3`,\n            `D4`,\n            `U4`,\n            `D5`,\n            `U5`, \n            `D6`, \n            `U6`,\n            `D7`, \n            `U7`, \n            `D8`,\n            `U8`,\n            `D9`,\n            `U9`,\n            `Cash`,\n            `FreeMb`,\n            `LastCashAdd`,\n            `LastCashAddTime`,\n            `PassiveTime`,\n            `LastActivityTime`,\n            `NAS`)\n            VALUES (\n            '" . $randomLogin . "',\n            '" . $randomPassword . "',\n            '0',\n            '0',\n            '1',\n            '1',\n            '" . $tariff . "',\n            '',\n            '',\n            '',\n            '',\n            '',\n            '',\n            '0',\n            '', \n            '',\n            '',\n            '',\n            '', \n            '', \n            '', \n            '', \n            '',\n            '', \n            '', \n            '0',\n            '" . $randomIp . "',\n            '0',\n            '0',\n            '0',\n            '0',\n            '0', \n            '0',\n            '0',\n            '0', \n            '0',\n            '0',\n            '0',\n            '0',\n            '0', \n            '0',\n            '0',\n            '0', \n            '0', \n            '0', \n            '0', \n            '0', \n            '" . $randomCash . "',\n            '0',\n            '0', \n            '0',\n            '0', \n            '0',\n            '');\n            ";
         //push da query!
         nr_query($querybuff);
         zb_AddressCreateApartment($lastBuildId, $randomEntrance, $randomFloor, $randomApt);
         zb_AddressCreateAddress($randomLogin, zb_AddressGetLastid());
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:31,代码来源:index.php


示例18: web_PaymentSearch


//.........这里部分代码省略.........
     $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');
             //calculating totals
             if ($each['summ'] > 0) {
                 $totalsumm = $totalsumm + $each['summ'];
                 $totalcount++;
             }
             if ($paySysPc > 0) {
                 $paysyssumm = $paysyssumm + $paySysPc;
             }
             if ($ourProfit > 0) {
                 $profitsumm = $profitsumm + $ourProfit;
             }
             $csvSumm = str_replace('.', ',', $each['summ']);
             $csvdata .= $each['id'] . ';' . $each['date'] . ';' . $csvSumm . ';' . $paySysPc . ';' . $ourProfit . ';' . $each['login'] . ';' . $paymentAddress . ';' . $paymentRealname . $csvTariff . ';' . $paymentCashType . ';' . $paynote . ';' . $each['admin'] . "\n";
         }
     }
     //saving report for future download
     if (!empty($csvdata)) {
         $csvSaveName = 'exports/payfind_' . zb_rand_string(8) . '.csv';
         $csvSaveNameEnc = base64_encode($csvSaveName);
         $csvdata = iconv('utf-8', 'windows-1251', $csvdata);
         file_put_contents($csvSaveName, $csvdata);
         $csvDownloadLink = wf_Link('?module=payfind&downloadcsv=' . $csvSaveNameEnc, wf_img('skins/excel.gif', __('Export')), false);
     } else {
         $csvDownloadLink = '';
     }
     $result = wf_TableBody($rows, '100%', '0', 'sortable');
     //additional total counters
     $result .= wf_tag('div', false, 'glamour') . __('Count') . ': ' . $totalcount . wf_tag('div', true);
     $result .= wf_tag('div', false, 'glamour') . __('Total payments') . ': ' . $totalsumm . wf_tag('div', true);
     $result .= wf_tag('div', false, 'glamour') . __('Payment systems %') . ': ' . $paysyssumm . wf_tag('div', true);
     $result .= wf_tag('div', false, 'glamour') . __('Our final profit') . ': ' . $profitsumm . wf_tag('div', true);
     $result .= wf_CleanDiv();
     show_window(__('Payments found') . ' ' . $csvDownloadLink, $result);
 }
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:101,代码来源:index.php


示例19: sendSMS

 public function sendSMS($number, $message)
 {
     $number = trim($number);
     $filename = 'content/tsms/wd_' . zb_rand_string(8);
     $storedata = 'NUMBER="' . $this->safeEscapeString($number) . '"' . "\n";
     $storedata .= 'MESSAGE="' . $this->safeEscapeString($message) . '"' . "\n";
     file_put_contents($filename, $storedata);
     log_register("WATCHDOG SEND SMS `" . $number . "`");
 }
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:9,代码来源:api.watchdog.php


示例20: ub_SwitchesTimeMachineSearch

/**
 * Do the search in dead switches time machine
 * 
 * @param string $query
 * @return string
 */
function ub_SwitchesTimeMachineSearch($request)
{
    $request = strtolower_utf8($request);
    $result = '';
    $query = "SELECT * from `switchdeadlog` ORDER BY `id` DESC";
    $raw = simple_queryall($query);
    $deadcount = 0;
    $tmpArr = array();
    if (!empty($raw)) {
        foreach ($raw as $io => $each) {
            if (!empty($each)) {
                $switchData = unserialize($each[' 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP zbase函数代码示例发布时间:2022-05-23
下一篇:
PHP zb_UserGetAllRealnames函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap