/** * logs succeful self credit fact into database * * @param string $login existing users login * * @return void */ function zbs_CreditLogPush($login) { $login = mysql_real_escape_string($login); $date = curdatetime(); $query = "INSERT INTO `zbssclog` (`id` , `date` , `login` ) VALUES ( NULL , '" . $date . "', '" . $login . "');"; nr_query($query); }
/** * Creates card in database with some serial and price * * @param int $serial * @param float $cash * * @return void */ function zb_CardCreate($serial, $cash) { $admin = whoami(); $date = curdatetime(); $query = "INSERT INTO `cardbank` (`id` ,`serial` , `cash` , `admin` , `date` , `active` , `used` , `usedate` , `usedlogin` , `usedip`) " . "VALUES (NULL , '" . $serial . "', '" . $cash . "', '" . $admin . "', '" . $date . "', '1', '0', NULL , '', NULL);"; nr_query($query); }
/** * Sets default options * * @return void */ protected function setOptions() { $this->curdate = curdatetime(); $this->dayLimit = vf($this->altCfg['CAP_DAYLIMIT'], 3); $this->penalty = vf($this->altCfg['CAP_PENALTY'], 3); $this->payId = vf($this->altCfg['CAP_PAYID'], 3); $this->ignoreFrozen = $this->altCfg['CAP_IGNOREFROZEN'] ? true : false; $this->logPath = DATA_PATH . 'documents/crimeandpunishment.log'; }
/** * Registers new non processed transaction * * @param string $hash * @param float $summ * @param int $customerid * @param string $paysys * @param string $note * * @return void */ function op_TransactionAdd($hash, $summ, $customerid, $paysys, $note) { $date = curdatetime(); $summ = vf($summ); $customerid = mysql_real_escape_string($customerid); $paysys = mysql_real_escape_string($paysys); $note = mysql_real_escape_string($note); $hash = mysql_real_escape_string($hash); $query = "INSERT INTO `op_transactions` (`id`,`hash`, `date` , `summ` , `customerid` ,`paysys` , `processed` ,`note`)\n VALUES (NULL ,'" . $hash . "' , '" . $date . "', '" . $summ . "', '" . $customerid . "', '" . $paysys . "', '0', '" . $note . "');"; nr_query($query); }
function ms_TicketCreate($from, $to, $text, $replyto = 'NULL', $admin = '') { $from = mysql_real_escape_string($from); $to = mysql_real_escape_string($to); $admin = mysql_real_escape_string($admin); $text = mysql_real_escape_string(strip_tags($text)); $date = curdatetime(); $replyto = vf($replyto); $query = "\n INSERT INTO `ticketing` (\n `id` ,\n `date` ,\n `replyid` ,\n `status` ,\n `from` ,\n `to` ,\n `text`,\n `admin`\n )\n VALUES (\n NULL ,\n '" . $date . "',\n " . $replyto . ",\n '0',\n '" . $from . "',\n '" . $to . "',\n '" . $text . "',\n '" . $admin . "'\n );\n "; nr_query($query); }
/** * Sets default options * * @return void */ protected function setOptions() { $this->curdate = curdatetime(); $this->discountPullDays = vf($this->altCfg['CUD_PULLDAYS'], 3); $this->fillPercent = vf($this->altCfg['CUD_PERCENT'], 3); $this->discountPayId = vf($this->altCfg['CUD_PAYID'], 3); $this->discountLimit = vf($this->altCfg['CUD_PERCENTLIMIT'], 3); $this->customDiscountCfId = vf($this->altCfg['CUD_CFID'], 3); $this->logPath = DATA_PATH . 'documents/cudiscounts.log'; $this->setDebug($this->altCfg['CUD_ENABLED']); $this->customDiscountCfId = vf($this->altCfg['CUD_CFID'], 3); }
/** * Creates message for some admin user * * @param string $to admin login * @param string $text message text * * @return void */ function im_CreateMessage($to, $text) { $to = mysql_real_escape_string($to); $text = mysql_real_escape_string($text); $text = strip_tags($text); $from = whoami(); $date = curdatetime(); $read = 0; $query = "INSERT INTO `ub_im` (\n `id` ,\n `date` ,\n `from` ,\n `to` ,\n `text` ,\n `read`\n )\n VALUES (\n NULL , '" . $date . "', '" . $from . "', '" . $to . "', '" . $text . "', '" . $read . "'\n );\n "; nr_query($query); log_register("UBIM SEND FROM {" . $from . "} TO {" . $to . "}"); }
/** * Add some cash to user login in stargazer, and creates payment record in registry * * @global object $billing Pre-initialized low-level stargazer handlers * @param string $login Existing users login * @param float $cash Amount of money to put/set on user login * @param string $operation Operation type: add, correct,set,mock * @param int $cashtype Existing cashtype ID for payment registry * @param string $note Payment notes * * @return void */ function zb_CashAdd($login, $cash, $operation, $cashtype, $note) { global $billing; $login = mysql_real_escape_string($login); $cash = mysql_real_escape_string($cash); $cash = preg_replace("#[^0-9\\-\\.]#Uis", '', $cash); $cash = trim($cash); $cashtype = vf($cashtype); $note = mysql_real_escape_string($note); $date = curdatetime(); $balance = zb_CashGetUserBalance($login); $admin = whoami(); $noteprefix = ''; /** * They wanna f**k you for free and explode ya * I gonna waiting no time let me show ya * You gonna be kidding Couse nothing is happening * You wanna be happy So follow me */ switch ($operation) { case 'add': $targettable = 'payments'; $billing->addcash($login, $cash); log_register('BALANCEADD (' . $login . ') ON ' . $cash); break; case 'correct': $targettable = 'paymentscorr'; $billing->addcash($login, $cash); log_register('BALANCECORRECT (' . $login . ') ON ' . $cash); break; case 'set': $targettable = 'payments'; $billing->setcash($login, $cash); log_register("BALANCESET (" . $login . ') ON ' . $cash); $noteprefix = 'BALANCESET:'; break; case 'mock': $targettable = 'payments'; log_register("BALANCEMOCK (" . $login . ') ON ' . $cash); $noteprefix = 'MOCK:'; break; } //push dat payment to payments registry $query = "INSERT INTO `" . $targettable . "` (\n `id` ,\n `login` ,\n `date` ,\n `admin` ,\n `balance` ,\n `summ` ,\n `cashtypeid` ,\n `note`\n )\n VALUES (\n NULL , '" . $login . "', '" . $date . "', '" . $admin . "', '" . $balance . "', '" . $cash . "', '" . $cashtype . "', '" . ($noteprefix . $note) . "'\n );"; nr_query($query); }
/** * Creates new personal note in database * * @return void */ public function addMyNote() { if (wf_CheckPost(array('newtext'))) { $owner = $this->myLogin; $createDate = curdatetime(); $remindDate = !empty($_POST['newreminddate']) ? $_POST['newreminddate'] : ''; $activity = isset($_POST['newactive']) ? 1 : 0; $text = $_POST['newtext']; $this->createNote($owner, $createDate, $remindDate, $activity, $text); $newId = simple_get_lastid('stickynotes'); log_register("STICKY CREATE [" . $newId . "]"); } }
if (isset($_POST['changetask'])) { if (wf_CheckPost(array('editenddate', 'editemployeedone'))) { if (zb_checkDate($_POST['editenddate'])) { //editing task sub $editid = vf($_POST['changetask']); simple_update_field('taskman', 'enddate', $_POST['editenddate'], "WHERE `id`='" . $editid . "'"); simple_update_field('taskman', 'employeedone', $_POST['editemployeedone'], "WHERE `id`='" . $editid . "'"); simple_update_field('taskman', 'donenote', $_POST['editdonenote'], "WHERE `id`='" . $editid . "'"); simple_update_field('taskman', 'status', '1', "WHERE `id`='" . $editid . "'"); //flushing darkvoid after changing task $darkVoid = new DarkVoid(); $darkVoid->flushCache(); log_register('TASKMAN DONE [' . $editid . ']'); //generate job for some user if (wf_CheckPost(array('generatejob', 'generatelogin', 'generatejobid'))) { stg_add_new_job($_POST['generatelogin'], curdatetime(), $_POST['editemployeedone'], $_POST['generatejobid'], 'TASKID:[' . $_POST['changetask'] . ']'); log_register("TASKMAN GENJOB (" . $_POST['generatelogin'] . ') VIA [' . $_POST['changetask'] . ']'); } } else { show_error(__('Wrong date format')); } } else { show_error(__('All fields marked with an asterisk are mandatory')); } } //setting task undone if (isset($_GET['setundone'])) { $undid = vf($_GET['setundone'], 3); simple_update_field('taskman', 'status', '0', "WHERE `id`='" . $undid . "'"); simple_update_field('taskman', 'enddate', 'NULL', "WHERE `id`='" . $undid . "'"); log_register("TASKMAN UNDONE [" . $undid . ']');
/** * Creates new ticket into database * * @param string $from * @param string $to * @param string $text * @param int $replyto * @param string $admin * * @return void */ function zb_TicketCreate($from, $to, $text, $replyto = 'NULL', $admin = '') { $from = mysql_real_escape_string($from); $to = mysql_real_escape_string($to); $admin = mysql_real_escape_string($admin); $text = mysql_real_escape_string(strip_tags($text)); $date = curdatetime(); $replyto = vf($replyto); $query = "INSERT INTO `ticketing` (`id` , `date` , `replyid` , `status` ,`from` , `to` , `text`, `admin`) " . "VALUES (NULL , '" . $date . "', " . $replyto . ", '0', '" . $from . "', '" . $to . "', '" . $text . "', '" . $admin . "');"; nr_query($query); log_register("TICKET CREATE (" . $to . ")"); }
/** * register uploaded template into database * * @param $path string path to template file * @param $displayname string template display name * @param $public int is template accesible from userstats * * @return void */ protected function registerTemplateDB($path, $displayname, $public) { $path = mysql_real_escape_string($path); $displayname = mysql_real_escape_string($displayname); $public = vf($public, 3); $admin = whoami(); $date = curdatetime(); $query = "INSERT INTO `docxtemplates` (`id`, `date`, `admin`, `public`, `name`, `path`) \n VALUES (NULL, '" . $date . "', '" . $admin . "', '" . $public . "', '" . $displayname . "', '" . $path . "');"; nr_query($query); log_register("PLDOCS ADD TEMPLATE `" . $displayname . "`"); }
/** * 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); } }
/** * Creates new task in database * * @param string $startdate * @param string $starttime * @param string $address * @param string $login * @param string $phone * @param int $jobtypeid * @param int $employeeid * @param string $jobnote * * @return void */ function ts_CreateTask($startdate, $starttime, $address, $login, $phone, $jobtypeid, $employeeid, $jobnote) { $altercfg = rcms_parse_ini_file(CONFIG_PATH . "alter.ini"); $curdate = curdatetime(); $admin = whoami(); $address = str_replace('\'', '`', $address); $address = mysql_real_escape_string($address); $login = mysql_real_escape_string($login); $phone = mysql_real_escape_string($phone); $startdate = mysql_real_escape_string($startdate); $jobSendTime = !empty($starttime) ? ' ' . date("H:i", strtotime($starttime)) : ''; if (!empty($starttime)) { $starttime = "'" . mysql_real_escape_string($starttime) . "'"; } else { $starttime = 'NULL'; } $jobtypeid = vf($jobtypeid, 3); $employeeid = vf($employeeid, 3); $jobnote = mysql_real_escape_string($jobnote); $smsData = 'NULL'; //store sms for backround processing via watchdog if ($altercfg['WATCHDOG_ENABLED']) { if (isset($_POST['newtasksendsms'])) { $newSmsText = $address . ' ' . $phone . ' ' . $jobnote . $jobSendTime; $smsDataRaw = ts_SendSMS($employeeid, $newSmsText); if (!empty($smsDataRaw)) { $smsData = serialize($smsDataRaw); $smsData = "'" . base64_encode($smsData) . "'"; } } } $query = "INSERT INTO `taskman` (`id` , `date` , `address` , `login` , `jobtype` , `jobnote` , `phone` , `employee` , `employeedone` ,`donenote` , `startdate` ,`starttime`, `enddate` , `admin` , `status`,`smsdata`)\n VALUES (NULL , '" . $curdate . "', '" . $address . "', '" . $login . "', '" . $jobtypeid . "', '" . $jobnote . "', '" . $phone . "', '" . $employeeid . "',NULL, NULL , '" . $startdate . "'," . $starttime . ",NULL , '" . $admin . "', '0'," . $smsData . ");"; nr_query($query); //flushing darkvoid $darkVoid = new DarkVoid(); $darkVoid->flushCache(); log_register("TASKMAN CREATE `" . $address . "`"); }
/** * Adds some money to user account * * @param string $login * @param float $cash * @param string $note * * @return void */ function zbs_CashAdd($login, $cash, $note) { $login = vf($login); $cash = mysql_real_escape_string($cash); $cashtype = 0; $note = mysql_real_escape_string($note); $date = curdatetime(); $balance = zb_CashGetUserBalance($login); billing_addcash($login, $cash); $query = "INSERT INTO `payments` ( `id` , `login` , `date` , `balance` , `summ` , `cashtypeid` , `note` )\n VALUES (NULL , '" . $login . "', '" . $date . "', '" . $balance . "', '" . $cash . "', '" . $cashtype . "', '" . $note . ");"; nr_query($query); log_register("BALANCECHANGE (" . $login . ') ON ' . $cash); }
/** * Creates scheduler task in database * * @param string $login * @param string $action * @param int $tariffid * * @return void */ protected function createQueue($login, $action, $tariffid) { $loginF = mysql_real_escape_string($login); $actionF = mysql_real_escape_string($action); $tariffid = vf($tariffid, 3); $curdate = curdatetime(); $query = "INSERT INTO `mg_queue` (`id`,`login`,`date`,`action`,`tariffid`) VALUES"; $query .= "(NULL,'" . $loginF . "','" . $curdate . "','" . $actionF . "','" . $tariffid . "')"; nr_query($query); log_register('MEGOGO QUEUE CREATE (' . $login . ') TARIFF [' . $tariffid . '] ACTION `' . $action . '`'); }
/** * Performs signal preprocessing for sig/sn index arrays and stores it into cache for ZTE OLT * * @param int $oltid * @param array $sigIndex * @param array $macIndex * @param array $snmpTemplate * * @return void */ protected function signalParseZteGpon($oltid, $sigIndex, $snIndex, $snmpTemplate) { $oltid = vf($oltid, 3); $sigTmp = array(); $macTmp = array(); $result = array(); $curDate = curdatetime(); //signal index preprocessing if (!empty($sigIndex) and !empty($snIndex)) { foreach ($sigIndex as $devIndex => $eachsig) { $signalRaw = $eachsig; // signal level if ($signalRaw == $snmpTemplate['DOWNVALUE']) { $signalRaw = 'Offline'; } else { if ($snmpTemplate['OFFSETMODE'] == 'div') { if ($snmpTemplate['OFFSET']) { $signalRaw = $signalRaw / $snmpTemplate['OFFSET']; } } } $signalRaw = str_replace('"', '', $signalRaw); $sigTmp[$devIndex] = $signalRaw; } //mac index preprocessing foreach ($snIndex as $devIndex => $eachSn) { $snRaw = $eachSn; //serial $snRaw = str_replace(' ', ':', $snRaw); $snRaw = strtoupper($snRaw); $snTmp[$devIndex] = $snRaw; } //storing results if (!empty($snTmp)) { foreach ($snTmp as $devId => $eachSn) { if (isset($sigTmp[$devId])) { $signal = $sigTmp[$devId]; $result[$eachSn] = $signal; //signal history filling $historyFile = self::ONUSIG_PATH . md5($eachSn); if ($signal == 'Offline') { $signal = -9000; //over 9000 offline signal level :P } file_put_contents($historyFile, $curDate . ',' . $signal . "\n", FILE_APPEND); } } $result = serialize($result); file_put_contents(self::SIGCACHE_PATH . $oltid . '_' . self::SIGCACHE_EXT, $result); } } }
/** * Creates new ticket in database * * @param string $from * @param string $to * @param string $text * @param string $replyto */ function zbs_TicketCreate($from, $to, $text, $replyto = 'NULL') { $from = mysql_real_escape_string($from); $to = mysql_real_escape_string($to); $text = mysql_real_escape_string(strip_tags($text)); $date = curdatetime(); $replyto = vf($replyto); $query = "INSERT INTO `ticketing` (`id` ,`date` ,`replyid` , `status` ,`from` ,`to` ,`text`)\n VALUES ( NULL ,'" . $date . "', " . $replyto . ", '0','" . $from . "', " . $to . ",'" . $text . "');"; nr_query($query); }
/** * Pushes payment action for some processed salary job * * @param int $jobid * * @return void */ protected function pushPaid($jobid) { $jobid = vf($jobid, 3); $date = curdatetime(); if (isset($this->allJobs[$jobid])) { $jobData = $this->allJobs[$jobid]; if ($jobData['state'] == 0) { $cash = $this->getJobPrice($jobid); $employeeid = $jobData['employeeid']; $query = "INSERT INTO `salary_paid` (`id`, `jobid`, `employeeid`, `paid`, `date`) VALUES (NULL, '" . $jobid . "', '" . $employeeid . "', '" . $cash . "', '" . $date . "');"; nr_query($query); } else { log_register('SALARY JOB PROCESSING FAIL [' . $jobid . '] DUPLICATE'); } } else { log_register('SALARY JOB PROCESSING FAIL [' . $jobid . '] NOT_EXIST'); } }
function bs_ParseRaw($rawid) { $alterconf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini"); $bs_options = $alterconf['BS_OPTIONS']; //delimiter,data,name,addr,summ $options = explode(',', $bs_options); //magic numbers, khe khe $data_offset = $options[1]; $realname_offset = $options[2]; $address_offset = $options[3]; $summ_offset = $options[4]; $delimiter = $options[0]; $date = curdatetime(); $rawdata_q = "SELECT `rawdata` from `bankstaraw` WHERE `id`='" . $rawid . "'"; $rawdata = simple_query($rawdata_q); $rawdata = $rawdata['rawdata']; $hash = md5($rawdata); $splitrows = explodeRows($rawdata); if (sizeof($splitrows) > $data_offset) { $i = 0; foreach ($splitrows as $eachrow) { if ($i >= $data_offset) { $rowsplit = explode($delimiter, $eachrow); //filter ending if (isset($rowsplit[$summ_offset])) { $realname = trim(strtolower_utf8($rowsplit[$realname_offset])); $address = trim(strtolower_utf8($rowsplit[$address_offset])); $realname = str_replace(' ', '', $realname); $address = str_replace(' ', '', $address); $summ = trim($rowsplit[$summ_offset]); $query = "INSERT INTO `bankstaparsed` (\n `id` ,\n `hash` ,\n `date` ,\n `row` ,\n `realname` ,\n `address` ,\n `summ` ,\n `state` ,\n `login`\n )\n VALUES (\n NULL ,\n '" . $hash . "',\n '" . $date . "',\n '" . $i . "',\n '" . $realname . "',\n '" . $address . "',\n '" . $summ . "',\n '0',\n ''\n ); \n "; nr_query($query); } } $i++; } } }
/** * Logs array of switches to deadlog (timemachine) * * @param int $currenttime current timestamp * @param array $deadSwitches dead switches array */ function zb_SwitchesDeadLog($currenttime, $deadSwitches) { $date = curdatetime(); $timestamp = $currenttime; $logData = serialize($deadSwitches); $query = "INSERT INTO `switchdeadlog` (`id` ,`date` ,`timestamp` ,`swdead`)\n VALUES (\n NULL , '" . $date . "', '" . $timestamp . "', '" . $logData . "');"; nr_query($query); }
/** * Saves current storeTmp into database * * @return void */ protected function saveHorseData() { $curTime = curdatetime(); $query = "INSERT INTO `exhorse` (`id`, `date`, `u_totalusers`, `u_activeusers`, `u_inactiveusers`, `u_frozenusers`, `u_complextotal`, `u_complexactive`, `u_complexinactive`, `u_signups`, `u_citysignups`, `f_totalmoney`, `f_paymentscount`, `f_cashmoney`, `f_cashcount`, `f_arpu`, `f_arpau`, `c_totalusers`, `c_activeusers`, `c_inactiveusers`, `c_illegal`, `c_complex`, `c_social`, `c_totalmoney`, `c_paymentscount`, `c_arpu`, `c_arpau`, `c_totaldebt`, `c_signups`, `a_totalcalls`, `a_totalanswered`, `a_totalcallsduration`, `a_averagecallduration`, `e_switches`, `e_pononu`, `e_docsis`) " . "VALUES (\n NULL,\n '" . $curTime . "',\n '" . $this->storeTmp['u_totalusers'] . "',\n '" . $this->storeTmp['u_activeusers'] . "',\n '" . $this->storeTmp['u_inactiveusers'] . "',\n '" . $this->storeTmp['u_frozenusers'] . "',\n '" . $this->storeTmp['u_complextotal'] . "',\n '" . $this->storeTmp['u_complexactive'] . "',\n '" . $this->storeTmp['u_complexinactive'] . "',\n '" . $this->storeTmp['u_signups'] . "',\n '" . $this->storeTmp['u_citysignups'] . "',\n '" . $this->storeTmp['f_totalmoney'] . "',\n '" . $this->storeTmp['f_paymentscount'] . "',\n '" . $this->storeTmp['f_cashmoney'] . "',\n '" . $this->storeTmp['f_cashcount'] . "',\n '" . $this->storeTmp['f_arpu'] . "',\n '" . $this->storeTmp['f_arpau'] . "',\n '" . $this->storeTmp['c_totalusers'] . "',\n '" . $this->storeTmp['c_activeusers'] . "',\n '" . $this->storeTmp['c_inactiveusers'] . "',\n '" . $this->storeTmp['c_illegal'] . "',\n '" . $this->storeTmp['c_complex'] . "',\n '" . $this->storeTmp['c_social'] . "',\n '" . $this->storeTmp['c_totalmoney'] . "',\n '" . $this->storeTmp['c_paymentscount'] . "',\n '" . $this->storeTmp['c_arpu'] . "',\n '" . $this->storeTmp['c_arpau'] . "',\n '" . $this->storeTmp['c_totaldebt'] . "',\n '" . $this->storeTmp['c_signups'] . "',\n '" . $this->storeTmp['a_totalcalls'] . "',\n '" . $this->storeTmp['a_totalanswered'] . "',\n '" . $this->storeTmp['a_totalcallsduration'] . "',\n '" . $this->storeTmp['a_averagecallduration'] . "',\n '" . $this->storeTmp['e_switches'] . "',\n '" . $this->storeTmp['e_pononu'] . "',\n '" . $this->storeTmp['e_docsis'] . "');"; nr_query($query); }
/** * Creates new comment in database * * @param string $text text for new comment * * @return void */ protected function createComment($text) { $curdate = curdatetime(); $text = strip_tags($text); $text = mysql_real_escape_string($text); $query = "INSERT INTO `adcomments` (`id`, `scope`, `item`, `date`, `admin`, `text`) " . "VALUES (NULL, '" . $this->scope . "', '" . $this->item . "', '" . $curdate . "', '" . $this->mylogin . "', '" . $text . "');"; nr_query($query); log_register("ADCOMM CREATE SCOPE `" . $this->scope . "` ITEM [" . $this->item . "]"); }
/** * Returns server system information * * @return array */ protected function getSystemInformation() { $result = array(); $curdate = curdatetime(); $operatingSystem = shell_exec('uname'); $billingVersion = file_get_contents('RELEASE'); $result['date'] = $curdate; $result['os'] = trim($operatingSystem); $result['billing']['name'] = 'Ubilling'; $result['billing']['version'] = trim($billingVersion); return $result; }
//не забываем что суммы в копейках $form .= '<input type="radio" name="amount" value="' . $eachprice . '" ' . $selected . '> ' . $eachprice / 100 . ' ' . $merchant_currency . '<br>'; $i++; } } else { $form .= '<input type="text" name="amount"> ' . $merchant_currency; } //передаем прочие нужные параметры $form .= '<input type="hidden" name="desc" value="' . $customer_id . '">'; $form .= '<input type="hidden" name="good" value="' . $good_url . '">'; $form .= '<input type="hidden" name="bad" value="' . $bad_url . '">'; $form .= '<input type="hidden" name="lang" value="' . $lang . '">'; $form .= '<input type="hidden" name="id" value="' . $merchant_id . '">'; $form .= '<br> <input type="submit">'; $form .= '</form> </p>'; return $form; } // строим форму выбора сумы платежа $payment_form = ipay_form($customer_id, $debug, $method, $ipay_sandbox, $ipay_link, $merchant_id, $avail_prices, $lang, $good_url, $bad_url, $merchant_currency); //если надо логаем формочку со всеми потрохами if ($log_forms) { $datetime = curdatetime(); $log_file = "config/forms.log"; $remote_ip = $_SERVER['REMOTE_ADDR']; $log_data = '=======================' . $datetime . "\n"; $log_data .= $payment_form; $log_data .= "\n" . '=======================' . "\n"; file_put_contents($log_file, $log_data, FILE_APPEND); } //показываем все что нужно в темплейт include $template_file;
/** * Deletes uploaded image from database * * @param int $imageid */ protected function unregisterImage($imageid) { if (!empty($this->scope) and !empty($this->itemId)) { $imageid = vf($imageid, 3); $date = curdatetime(); $query = "DELETE from `photostorage` WHERE `id`='" . $imageid . "';"; nr_query($query); log_register('PHOTOSTORAGE DELETE SCOPE `' . $this->scope . '` ITEM [' . $this->itemId . ']'); } }
/** * Just system logging subroutine * * @param string $event */ function log_register($event) { $admin_login = whoami(); @($ip = $_SERVER['REMOTE_ADDR']); if (!$ip) { $ip = '127.0.0.1'; } $current_time = curdatetime(); $event = mysql_real_escape_string($event); $query = "INSERT INTO `weblogs` (`id`,`date`,`admin`,`ip`,`event`) VALUES(NULL,'" . $current_time . "','" . $admin_login . "','" . $ip . "','" . $event . "')"; nr_query($query); }
/** * Puts userreg log entry into database * * @param string $login * * @return void */ function zb_UserRegisterLog($login) { $date = curdatetime(); $admin = whoami(); $login = vf($login); $address = zb_AddressGetFulladdresslist(); $address = $address[$login]; $address = mysql_real_escape_string($address); $query = "INSERT INTO `userreg` (`id` ,`date` ,`admin` ,`login` ,`address`) " . "VALUES (NULL , '" . $date . "', '" . $admin . "', '" . $login . "', '" . $address . "');"; nr_query($query); }
function catvbs_ProcessHash($hash) { global $billing; $alterconf = rcms_parse_ini_file(CONFIG_PATH . "catv.ini"); $query = "SELECT `id`,`summ`,`login`,`address` from `catv_bankstaparsed` WHERE `hash`='" . $hash . "' AND `state`='0' AND `login` !=''"; $allinprocessed = simple_queryall($query); if (!empty($allinprocessed)) { log_register("CATV_BANKSTA PROCESSING " . $hash . " START"); foreach ($allinprocessed as $io => $eachrow) { //setting payment variables $cash = $eachrow['summ']; $note = mysql_real_escape_string("CATV_BANKSTA:" . $eachrow['id']); $month_detect = catvbs_MonthDetect($eachrow['address']); if ($month_detect) { $target_month = $month_detect; } else { $target_month = date("m"); } $target_year = date("Y"); $curdate = curdatetime(); // standalone user cash push //zb_CashAdd($eachrow['login'], $cash, $operation, $cashtype, $note); //deb('DEBUG CATV adding cash'.$eachrow['login']); catv_CashAdd($eachrow['login'], $curdate, $cash, $target_month, $target_year, $target_month, $target_year, $note); simple_update_field('catv_bankstaparsed', 'state', '1', "WHERE `id`='" . $eachrow['id'] . "'"); // end of processing without linking } log_register("CATV_BANKSTA PROCESSING " . $hash . " END"); } else { log_register("CATV_BANKSTA PROCESSING " . $hash . " EMPTY"); } }
/** * Fills cemetary log with some data * * @param string $login * @param int $state * * @return void */ protected function logFuneral($login, $state) { $state = vf($state, 3); $date = curdatetime(); $loginF = mysql_real_escape_string($login); $query = "INSERT INTO `cemetery` (`id`,`login`,`state`,`date`) VALUES (NULL,'" . $loginF . "','" . $state . "','" . $date . "'); "; nr_query($query); log_register('CEMETERY (' . $login . ') SET `' . $state . '`'); }