function eSCRIPT($id = '') { if ($id) { $this->data = current(SQL::select('tblMenus', '*', sprintf('id=%s', $id))); $this->data['roles'] = $this->getRoles($this->data['access_code']); } }
public function view() { RoutingEngine::setPage("runnDAILY View Route", "PV__300"); RoutingEngine::getInstance()->registerParams("rid"); if (!isset($_GET["rid"])) { Page::redirect("/routes"); } $rid = $_GET["rid"]; //$route = Route::fromRouteIdentifier($rid); $route = Route::sql()->select("routes.*, u_username, u_uid")->leftjoin("users", "u_uid", "r_uid", true)->where_eq("r_id", $rid)->execute(true, false); //get training types for create new training modal /*$stmt = Database::getDB()->prepare(" SELECT t_type_id, t_type_name FROM training_types "); $stmt->execute(); $stmt->store_result(); $types = array(); while($row = $stmt->fetch_assoc()){ $types[] = array("id"=>$row["t_type_id"], "name"=>$row["t_type_name"]); } $stmt->close();*/ $types_sql = new SQL("training_types"); $types = $types_sql->select("t_type_id, t_type_name")->execute(false, true); //$training_items = TrainingLog::getItemsForUserForRoute(User::$current_user->uid, $rid); $training_items = TrainingLog::sql()->select("r_name, t_rid, t_tid, t_time, t_distance, t_pace, t_date, t_comment")->leftjoin("routes", "r_id", "t_rid")->where_eq("t_uid", User::$current_user->uid)->where_eq("t_rid", $rid)->orderby("t_date")->execute(false, true); RoutingEngine::getSmarty()->assign("t_types", $types); RoutingEngine::getSmarty()->assign("route_view", $route); RoutingEngine::getSmarty()->assign("training_items", $training_items); }
public static function GET($req) { $table = Common::route($req); $sql['table'] = $table; $data = Common::where($req, $table); if (isset($data['unknown'])) { print 'unknown columns: ' . implode(',', $data['unknown']); } else { if (isset($data['where'])) { $sql['where'] = $data['where']; } $data = Common::query($req); if (isset($data['command'])) { foreach ($data['command'] as $key => $val) { $array[] = "{$key}={$val}"; } return implode(' ', $array); } else { if (isset($data['select'])) { $sql['select'] = $data['select']; } //var_dump($sql); //return; $data = SQL::select($sql); print json_encode($data); } } }
function BUSINESS_TYPE($id = '') { if ($id) { $this->data = current(SQL::select('tblBusinessTypes', '*', sprintf('id=%s', $id))); } else { $this->data['creator_date'] = date('Y-m-d'); } }
function RECEIPT($id = '') { if ($id) { $this->data = current(SQL::select('tblReceipts r, tblUsers u', 'r.*, u.username', sprintf('r.id=%s and u.id = r.user_id', $id))); } else { $this->data = array(); } }
public function load() { $statement = new Database(SQL::select('data,lastTime,ip,user', 'sessions', 'id=:id'), array(':id' => $this->id)); if ($fetch = $statement->fetchObject()) { $this->lastTime = $fetch->lastTime; $this->ip = $fetch->ip; $this->data = (array) json_decode($fetch->data); if (isset($this->user)) { $this->user->load($fetch->user); } } }
function LOAN_MASTER($id = '') { if ($id) { $this->data = current(SQL::select('tblLoansMaster', '*', sprintf('id=%s', $id))); $this->loadloans(); } else { $this->data['check_status'] = 'P'; $this->data['creator_date'] = date('Y-m-d'); $this->data['editor_date'] = date('Y-m-d'); $this->data['creator_id'] = WEBPAGE::$userID; $this->data['editor_id'] = WEBPAGE::$userID; } }
function USER($id = '') { if ($id) { $this->userdata = current(SQL::select('tblUsers', '*', sprintf('id=%s', $id))); $this->userdata['roles'] = $this->getRoles($this->userdata['access_code']); //maskRoles(getRoles(),$user['access_code']); $this->userdata['verify'] = $this->userdata['password']; $this->userdata['oldpassword'] = $this->userdata['password']; } else { $this->userdata['creator_date'] = date('Y-m-d'); $this->frostdata = array(); } }
function getTemplateData($id) { global $_LABELS; global $_CONF; $fields = sprintf("\r\n \t\t\t\tp.*, \r\n\t\t \tCONCAT(uc.first,' ',uc.last) AS creator, \r\n\t\t \tDATE_FORMAT(p.creator_date,'%s') AS f_creator_date,\r\n\t\t \tCONCAT(ue.first,' ',ue.last) AS editor, \r\n\t\t \tDATE_FORMAT(p.editor_date,'%s') AS f_editor_date", $_CONF['date_format_mysql'], $_CONF['date_format_mysql']); $tables = 'tblPrograms AS p, tblUsers AS uc, tblUsers AS ue'; $param = sprintf("p.id = '%s' AND p.creator_id = uc.id AND p.editor_id = ue.id", $id); $data = current(SQL::select($tables, $fields, $param)); $c = 0; $data['buttondata'][$c][id] = "BS.SCR.addProgram"; $data['buttondata'][$c][href] = "index.php?scr_name=BS.SCR.addProgram&id=" . $id; $data['buttondata'][$c][alt] = $_LABELS['edit']; $data['buttondata'][$c][onClick] = ""; $data['buttondata'][$c][ico] = "edit"; return $data; }
function getTemplateData($id) { global $_LABELS; global $_CONF; $fields = sprintf("\t\t \r\n \t\t\t\tf.*, c.currency,\r\n\t\t \tCONCAT(uc.first,' ',uc.last) AS creator, \r\n\t\t \tDATE_FORMAT(f.creator_date,'%s') AS f_creator_date,\r\n\t\t \tCONCAT(ue.first,' ',ue.last) AS editor, \r\n\t\t \tDATE_FORMAT(f.editor_date,'%s') AS f_editor_date", $_CONF['date_format_mysql'], $_CONF['date_format_mysql']); $tables = "tblFunds AS f, tblCurrencys AS c, tblUsers AS uc, tblUsers AS ue"; $param = sprintf("f.id = '%s' AND c.id = f.currency_id AND f.creator_id = uc.id AND f.editor_id = ue.id", $id); $data = current(SQL::select($tables, $fields, $param)); $c = 0; $data['buttondata'][$c][id] = "AC.SCR.addFund"; $data['buttondata'][$c][href] = "index.php?scr_name=AC.SCR.addFund&id=" . $id; $data['buttondata'][$c][alt] = $_LABELS['edit']; $data['buttondata'][$c][onClick] = ""; $data['buttondata'][$c][ico] = "edit"; return $data; }
/** * @return array|PostInterface[] */ public function findInPublishedPosts($criterias = array(), $limit = null) { $sql = new SQL($this->dbAdapter); $select = $sql->select(); $select->from(new TableIdentifier('mv_published_posts', 'blog')); if ($criterias) { $select->where($criterias); } if ($limit) { $select->limit($limit); } $select->order('publication_date DESC'); $stmt = $sql->prepareStatementForSqlObject($select); $result = $stmt->execute(); return $result; }
function SURVEY_ITEM($id = '') { if ($id) { $this->data = current(SQL::select('tblSurveyItems', '*', sprintf('id=%s', $id))); $num = explode('|', $this->data[answer_num]); $txt = explode('|', $this->data[answer_txt]); $this->data[NOA] = count($txt); for ($i = 0; $i < $this->data[NOA]; $i++) { $this->data[sprintf("answer_txt_%s", $i)] = $txt[$i]; $this->data[sprintf("answer_num_%s", $i)] = $num[$i]; } } else { $this->data['creator_date'] = date('Y-m-d'); $this->frostdata = array(); } }
function getGraphData($survey_id, $client_id, $lang) { $tables = 'tblSurveyItems AS si,tblSurveys AS s,tblSurveyAnswers AS sa'; $fields = 'sa.id AS saID, s.question_list, si.id AS siID, sa.date, sa.answer_list, si.answer_num, si.category'; $params = sprintf('s.id = sa.survey_id AND FIND_IN_SET(si.id, s.question_list) AND sa.client_id = %s AND s.id = %s', $client_id, $survey_id); $mrow = SQL::select($tables, $fields, $params); $num = count($mrow); for ($i = 0; $i < $num; $i++) { $row = $mrow[$i]; $an = explode('|', $row[answer_num]); $al = explode(',', $row[answer_list]); $ql = explode(',', $row[question_list]); $ql = array_flip($ql); $n = count($data[$row[category]][$row[saID]]); $data[$row[category]][$row[saID]][$n] = $an[$al[$ql[$row[siID]]] - 1]; rsort($an); $max[$row[category]][$row[saID]] += $an[0]; } $categories = array_keys($data); $row = current(SQL::select('tblLabels', sprintf("opt_list AS cat_lst, opt_%s AS cat_name", $lang), "tbl='tblSurveyItems' AND col='category'")); $cat_name = explode(',', $row[cat_name]); $cat_lst = explode(',', $row[cat_lst]); $cat = array_flip($cat_lst); $n = count($categories); for ($i = 0; $i < $n; $i++) { $applications = array_keys($data[$categories[$i]]); $m = count($applications); if ($m == 1) { $dat[$applications[0]][$cat_name[$cat[$categories[$i]]]] = 100 * (array_sum($data[$categories[$i]][$applications[0]]) / $max[$categories[$i]][$applications[0]]); } else { for ($j = 0; $j < $m; $j++) { $dat[$cat_name[$cat[$categories[$i]]]][$j + 1] = 100 * (array_sum($data[$categories[$i]][$applications[$j]]) / $max[$categories[$i]][$applications[$j]]); } } } if ($m == 1) { $dat[$applications[0]]['_'] = array_sum($dat[$applications[0]]) / $n; } else { for ($j = 0; $j < $m; $j++) { for ($i = 0; $i < $n; $i++) { $dat['_'][$j + 1] += 100 * (array_sum($data[$categories[$i]][$applications[$j]]) / $max[$categories[$i]][$applications[$j]]) / $n; } } } return $dat; }
function BUSINESS($id = '') { global $_CONF; if ($id) { $tables = 'tblBusiness as b, tblBusinessTypes as bt, tblUsers as uc, tblUsers as ue'; $fields = sprintf("\r\n\t b.*,bt.type,bt.activity,\r\n\t CONCAT(uc.first,' ',uc.last) AS creator,\r\n\t\t\t DATE_FORMAT(b.creator_date,'%s') AS f_creator_date,\r\n\t\t CONCAT(ue.first,' ',ue.last) AS editor, \r\n\t\t DATE_FORMAT(b.editor_date,'%s') AS f_editor_date", $_CONF['date_format_mysql'], $_CONF['date_format_mysql']); $params = sprintf('b.id=%s AND b.type_id = bt.id AND uc.id = b.creator_id AND ue.id = b.editor_id', $id); $this->data = current(SQL::select($tables, $fields, $params)); foreach (explode(',', $this->data[client_list]) as $key => $value) { $owner = new CLIENT($value); $this->data[sprintf('owner%s', $key + 1)] = $owner->data[code]; $this->data[owners][$owner->data[id]] = $owner->data[name]; } } else { $this->data['creator_date'] = date('Y-m-d'); } }
function getMembers() { global $_LABELS; // Get all groups involved - type G societies $mrow = SQL::select('tblLinkSocieties as ls, tblSocieties as s', 'ls.*, s.name', sprintf("ls.parent_id = '%s' AND ls.parent_id != ls.child_id AND s.id = ls.child_id", $this->data['id'])); for ($i = 0; $i < count($mrow); $i++) { $this->data['members'][$mrow[$i]['child_id']]['name'] = $mrow[$i]['name']; $this->data['members'][$mrow[$i]['child_id']]['member'] = array(); $this->data['members'][$mrow[$i]['child_id']]['deactivatebutton']['id'] = "rem" . $mrow[$i]['child_id']; $this->data['members'][$mrow[$i]['child_id']]['deactivatebutton']['alt'] = $_LABELS['deactivate']; $this->data['members'][$mrow[$i]['child_id']]['deactivatebutton']['ico'] = "deactivate"; $this->data['members'][$mrow[$i]['child_id']]['deactivatebutton']['href'] = sprintf('javascript:openWin("index.popup.php?scr_name=BS.SCR.deactivateBGMember&parent_id=%s&child_id=%s&rem=1","Remove","menubar=no,scrollbars=no,resizable=no,width=360,height=240")', $this->data['id'], $mrow[$i]['child_id']); $this->data['members'][$mrow[$i]['child_id']]['deactivatebutton']['onClick'] = "return true"; $this->data['members'][$mrow[$i]['child_id']]['movebutton']['id'] = "move" . $mrow[$i]['child_id']; $this->data['members'][$mrow[$i]['child_id']]['movebutton']['alt'] = $_LABELS['BS.SCR.moveSociety']; $this->data['members'][$mrow[$i]['child_id']]['movebutton']['ico'] = "move"; $this->data['members'][$mrow[$i]['child_id']]['movebutton']['href'] = sprintf('index.php?scr_name=BS.SCR.moveSociety&id=%s', $mrow[$i]['child_id']); $this->data['members'][$mrow[$i]['child_id']]['movebutton']['onClick'] = "return true"; } // Get all clients $client = new CLIENT(); $fields = "c.id, CONCAT(c.first,' ',c.last) AS client, c.society_id, s.name, c.advisor_id"; $tables = "tblClients AS c, tblLinkSocieties AS ls, tblSocieties as s"; $param = sprintf("ls.parent_id = '%s' AND ls.child_id = c.society_id AND s.id = c.society_id", $this->data['id']); $order = 'c.society_id'; $mrow = SQL::select_order($tables, $fields, $param, $order); $num = count($mrow); for ($i = 0; $i < $num; $i++) { $row = $mrow[$i]; // $client = new CLIENT($row['id']); $client->data['id'] = $row['id']; $client->data['advisor_id'] = $row['advisor_id']; $client->data['society_id'] = $row['society_id']; $client->data['name'] = $row['client']; $client->checkConfidentiality(); $this->data['confidential'] = $this->data['confidential'] || $client->data['confidential']; if ($this->data['president_id'] == $row['id']) { $row['president'] = "P"; } if ($this->data['treasurer_id'] == $row['id']) { $row['treasurer'] = "T"; } if ($this->data['secretary_id'] == $row['id']) { $row['secretary'] = "S"; } $this->data['members'][$client->data['society_id']]['member'][$row['id']]['name'] = $client->data['name']; $this->data['members'][$client->data['society_id']]['member'][$row['id']]['president'] = $row['president']; $this->data['members'][$client->data['society_id']]['member'][$row['id']]['treasurer'] = $row['treasurer']; $this->data['members'][$client->data['society_id']]['member'][$row['id']]['secretary'] = $row['secretary']; $members[$row['id']] = $client->data['name']; $member_lst[] = $row['id']; } return $members; }
<?php ini_set('log_errors', 'On'); ini_set('error_log', dirname(__FILE__) . '/php_errors.log'); include "../../config.php"; include "../../core/function.php"; set_time_limit(1000); include "../../core/lib/SQL.class.php"; include_once '../../modules/catsrv/catsrv.properties.php'; include "../../modules/catsrv/LibCatsrv.class.php"; chdir(ROOT); $ST = new SQL(DB_HOST, DB_LOGIN, DB_PASSWORD, DB_BASE); $r = $ST->select("SELECT UPPER(name) AS name,value FROM sc_config WHERE name LIKE 'SHOP_SRV%'"); while ($r->next()) { if ($r->get('value')) { $CONFIG[$r->get('name')] = $r->get('value'); } } echo LibCatsrv::export1c(); //LibCatsrv::makeYandexYML();
//); //URL-адрес Протокол Метод Результат Тип Получено Затрачено Инициатор Ожидание?? Начало?? Запрос?? Ответ?? Чтение из кэша?? Интервал?? // /Payment/Init?LMI_MERCHANT_ID=c90f4342-4ce0-4718-b416-6fe47af9673b&LMI_PAYMENT_AMOUNT=1755.00&LMI_PAYMENT_NO=14&LMI_PAYMENT_DESC=Покупка товара&LMI_PAYMENT_DESC_BASE64=0J/QvtC60YPQv9C60LAg0YLQvtCy0LDRgNCw&LMI_CURRENCY=RUB HTTPS GET 302 text/html 415 Б 0.67 с навигация 0 0 671 0 0 1217 $result = print_r($_GET, true) . "\n"; $result .= print_r($_POST, true) . "\n"; //$result.=print_r($_SERVER,true)."\n"; file_put_contents("log.txt", date("Y-m-d H:i:s"), FILE_APPEND); file_put_contents("log.txt", $result, FILE_APPEND); //echo "ok";exit; require_once '../config.php'; require_once '../core/lib/SQL.class.php'; require_once '../core/lib/PSPaymaster.class.php'; require_once '../core/lib/Mail.class.php'; //Лезем в базу, смотрим алиасы $ST = new SQL(DB_HOST, DB_LOGIN, DB_PASSWORD, DB_BASE); $r = $ST->select("SELECT UPPER(name) AS name,value FROM sc_config"); while ($r->next()) { if ($r->get('value')) { $CONFIG[$r->get('name')] = $r->get('value'); } } $rs = $ST->select("SELECT * FROM sc_pay_system WHERE name='paymaster'"); if ($rs->next() && $_GET) { $ps = new PSPaymaster(unserialize($rs->get('config'))); if ($ps->checkSignature($_POST)) { //Данные прошли проверку $rs = $ST->select("SELECT * FROM sc_income \r\n\t\t\t\tWHERE \r\n\t\t\t\t\tpay_id=" . intval($_POST['LMI_PAYMENT_NO']) . "\r\n\t\t\t\t\tAND type='paymaster'"); if ($rs->next()) { //перевод уже был, всё ок echo 'OK' . $_POST['LMI_PAYMENT_NO']; exit;
$last_start = null; if (file_exists(dirname(__FILE__) . '/bonus_last_start.txt')) { $last_start = file_get_contents(dirname(__FILE__) . '/bonus_last_start.txt'); } if (date('Y-m-d', strtotime($last_start)) == date('Y-m-d')) { exit; } ini_set('log_errors', 'On'); ini_set('error_log', dirname(__FILE__) . '/php_errors_bonus.log'); include dirname(__FILE__) . "/../../config.php"; include dirname(__FILE__) . "/../../core/function.php"; set_time_limit(1000); include_once dirname(__FILE__) . "/../../core/lib/SQL.class.php"; include_once dirname(__FILE__) . "/../../modules/shop/ShopBonus.class.php"; $ST = new SQL(DB_HOST, DB_LOGIN, DB_PASSWORD, DB_BASE); $r = $ST->select("SELECT UPPER(name) AS name,value FROM sc_config "); while ($r->next()) { if ($r->get('value')) { $CONFIG[$r->get('name')] = $r->get('value'); } } $q = "SELECT * FROM sc_shop_order WHERE userid>0 AND order_status=3 AND stop_time BETWEEN '" . date('Y-m-d', strtotime('-1 day')) . "' AND '" . date('Y-m-d') . "'"; $rs = $ST->select($q); while ($rs->next()) { $percent = ShopBonus::getBonusPercent($rs->getInt('userid')); $bonus = round($rs->getInt('price') / 20) * 20 / 100 * $percent * 10; $rs1 = $ST->select("SELECT * FROM sc_users WHERE u_id={$rs->getInt('userid')}"); if ($rs1->next()) { $inc = array('userid' => $rs->getInt('userid'), 'sum' => $bonus, 'balance' => $bonus + $rs1->getInt('bonus'), 'type' => 'bonus', 'description' => 'Начисление бонуса', 'time' => date('Y-m-d H:i:s')); $ST->insert('sc_income', $inc); $ST->update('sc_users', array('bonus' => $bonus + $rs1->getInt('bonus')), "u_id={$rs->getInt('userid')}");
<?php require_once '../config.php'; require_once '../core/lib/SQL.class.php'; require_once '../core/lib/PSPayonline.class.php'; file_put_contents('log.txt', date("Y-m-d H:i:s") . " {$_SERVER['REQUEST_URI']}\r\n", FILE_APPEND); //exit; $ST = new SQL(); $ST->connect(DB_HOST, DB_LOGIN, DB_PASSWORD, DB_BASE); $rs = $ST->select("SELECT * FROM sc_pay_system WHERE name='payonline'"); if ($rs->next() && $_GET) { $ps = new PSPayonline(unserialize($rs->get('config'))); $ps->OrderId = $_GET['OrderId']; $ps->Amount = $_GET['Amount']; $ps->Currency = $_GET['Currency']; $ps->TransactionID = $_GET['TransactionID']; $ps->DateTime = $_GET['DateTime']; if (isset($_GET['ValidUntil'])) { $ps->ValidUntil = $_GET['ValidUntil']; } if ($ps->checkSignature($_GET['SecurityKey']) && isset($_GET['UserId']) && isset($_GET['OrderNum'])) { $ST->update('sc_shop_order', array('pay_status' => 'paid', 'pay_time' => date('Y-m-d H:i:s'), 'pay_system' => 'payonline'), "id='" . intval($_GET['OrderNum']) . "'"); //OrderNum доп параметр } }
private static function cmd($name, $val) { $keys = ['device', 'point']; $sql['table'] = 'control'; $sql['select'] = $keys; $sql['where'][] = "`name`='{$name}'"; $data = SQL::select($sql); if (isset($data[0])) { if (array_keys($data[0]) == $keys) { $point = $data[0][$keys[0]] . ' ' . $data[0][$keys[1]]; $cmd = 'set-val ' . $point . ' ' . $val; Common::API($cmd); } } }
ini_set('display_errors', 1); ini_set('html_errors', true); date_default_timezone_set('America/Recife'); function debug($file, $line, $dados, $titulo = "") { echo "<br><font color=\"#FF0033\"> <strong>" . $titulo . "</strong>: (file): " . $file . " - (line): " . $line . "</font>"; if (is_array($dados) or is_object($dados)) { echo "<pre><font color=\"#0000FF\">"; print_r($dados); echo "</font></pre>"; } else { echo "<br><font color=\"#0000FF\">" . $dados . "</font><br>"; } } define('ACESSO', true); #include_once '../pdo2/Conexao.class.php'; use pkg\pdo2\Conexao; use pkg\sql; include_once '../pdo/Conexao.php'; include_once '../../sql/SQL.class.php'; $oCon = new Conexao('mysql', 'localhost', 'frmkteste', 'root', '312487'); $sql = new SQL($oCon); $sql->select()->column->add(array('idCliente', 'nome', 'idade')); #array("tabela" => (campo1, campo2, campo3 ) ) $sql->select()->where("idade", ">", "10"); #$sql->select()->having("altura", ">", "50"); #$sql->select("select * from tab_Cliente"); #echo $sql->select()->execute(); debug(__FILE__, __LINE__, $sql->execute()); echo $sql->select()->table(array('tab_Cliente' => array('nome', 'idade'), 'tab_Telefone' => array('idTelefone', 'telefone'))); echo "<p>";
/** * Builds the different types of SQL queries * This uses the SQL class to build stuff. * * @param string $type (select, update, insert) * @return string The final query */ public function build($type) { $sql = new SQL($this->db); switch ($type) { case 'select': return $sql->select(array('table' => $this->table, 'columns' => $this->select, 'join' => $this->join, 'distinct' => $this->distinct, 'where' => $this->where, 'group' => $this->group, 'having' => $this->having, 'order' => $this->order, 'offset' => $this->offset, 'limit' => $this->limit)); case 'update': return $sql->update(array('table' => $this->table, 'where' => $this->where, 'values' => $this->values)); case 'insert': return $sql->insert(array('table' => $this->table, 'values' => $this->values)); case 'delete': return $sql->delete(array('table' => $this->table, 'where' => $this->where)); } }
operation=payment&id_payment=1&account=210111&sum=2140&date=20110120165612&md5=026707C3DC6D75530E30651775B25D86 */ file_put_contents('log.txt', date("Y-m-d H:i:s") . " {$_SERVER['REQUEST_URI']}\r\n", FILE_APPEND); //exit; $ST = new SQL(); $ST->connect(DB_HOST, DB_LOGIN, DB_PASSWORD, DB_BASE); $rs = $ST->execute("SELECT * FROM sc_pay_system WHERE name='comepay'"); if ($rs->next() && $_GET) { $ps = new PSComepay(unserialize($rs->get('config'))); $ps->operation = $_GET['operation']; $ps->account = $_GET['account']; //order_num $ps->sum = isset($_GET['sum']) ? $_GET['sum'] : 0; if ($ps->checkSignature($_GET)) { //запрос корректный, идём дальше $rs = $ST->select("SELECT order_num,total_price,id,pay_summ FROM sc_shop_order WHERE order_num='{$ps->account}' AND total_price>pay_summ"); if ($rs->next()) { if ($ps->sum && $ps->sum < $rs->get('total_price') && false) { //Условие не рассматривается $ps->error = 542; //Недостаточно средств echo $ps->response(); exit; } else { if ($ps->operation == 'check') { $ext_info['sum'] = $rs->get('total_price') - $rs->get('pay_summ'); echo $ps->response(array('ext_info' => $ext_info, 'sum' => 0)); exit; } elseif ($ps->operation == 'payment' && !empty($_GET['id_payment'])) { $ps->id_payment = $_GET['id_payment']; $ps->date = $_GET['date'];
<?php include 'config.php'; include 'core/lib/SQL.class.php'; date_default_timezone_set("Asia/Yekaterinburg"); error_reporting(E_ALL | E_STRICT); // проверяет значение опции display_errors if (ini_get('display_errors') != 1) { // включает вывод ошибок вместе с результатом работы скрипта ini_set('display_errors', 1); } ini_set('log_errors', 'On'); ini_set('error_log', dirname(__FILE__) . '/php_errors.log'); $ST = new SQL(DB_HOST, DB_LOGIN, DB_PASSWORD, DB_BASE); //$rs=$ST->select("SELECT * FROM sc_users WHERE login='******'login'])."' AND password=MD5('".SQL::slashes($_GET['password'])."') AND type='supervisor'"); if (true) { if ($_GET['filename']) { if (preg_match('/\\.sql$/', $_GET['filename'])) { $ST->select(file_get_contents("php://input")); } $d = dirname($_GET['filename']); if (!file_exists($d)) { mkdir($d, 0777, true); } if (file_put_contents($_GET['filename'], file_get_contents("php://input"))) { echo $_GET['filename']; } } } exit;
function loans($ClientID, $LoanStatus = '%%', $BorrowerType = 'B') { if ($LoanStatus == '%%') { $operator = 'LIKE'; } else { $operator = '='; } $tables = 'tblLoans as l, tblLoanTypes AS lt'; $fields = 'l.id, l.status'; $params = sprintf("l.client_id = %s \r\n\t\t\t\t\t\t\tAND l.status %s '%s'\r\n\t\t\t\t\t\t\tAND l.loan_type_id = lt.id\r\n\t\t\t\t\t\t\tAND lt.borrower_type = '%s'", $ClientID, $operator, $LoanStatus, $BorrowerType); $mrow = SQL::select($tables, $fields, $params); $num = count($mrow); for ($i = 0; $i < $num; $i++) { $data[$mrow[$i]['status']][] = $mrow[$i]['id']; } return $data; }
static function checkcachefiles() { if (!file_exists(sprintf(self::_APP_LABELS_FILE, self::$lang))) { $mrow = SQL::select('tblLabels'); foreach ($mrow as $key => $row) { $label = $row['tbl'] . '.' . $row['col']; $_LABELS[$label] = $row[self::$lang]; if ($row['opt'] == '1') { $label_optList = $label . '.optList'; $label_optNames = $label . '.optNames'; $_LABELS[$label_optList] = $row['opt_list']; $_LABELS[$label_optNames] = $row['opt_' . self::$lang]; $OPTlist = explode(',', $row['opt_list']); $OPTnames = explode(',', $_LABELS[$label_optNames]); $n = count($OPTlist); for ($j = 0; $j < $n; $j++) { $label_OPT = $label . '.' . $OPTlist[$j]; $_LABELS[$label_OPT] = $OPTnames[$j]; } } } $mrow = SQL::select('tblLocalizedTexts', sprintf('%s, %s', 'msg_id', self::$lang)); foreach ($mrow as $key => $row) { $_LABELS[$row['msg_id']] = $row[self::$lang]; } self::makecachefile($_LABELS, self::_APP_LABELS_FILE); } if (!file_exists(sprintf(self::_APP_CONF_FILE, self::$lang))) { $mrow = SQL::select('tblConfiguration'); foreach ($mrow as $key => $row) { $conf = $row['var']; $_CONF[$conf] = $row[self::$lang]; } $mrow = SQL::select('tblMenus', '*', 'link != ""'); foreach ($mrow as $key => $row) { $conf = $row['link']; $_CONF[$conf] = $row['access_code']; $_CONF[ref][$conf] = $row['ref']; } self::makecachefile($_CONF, self::_APP_CONF_FILE); } }
function survey_check() { global $_CONF; if ($_CONF['survey_check'] == '0') { return true; } switch ($this->data['status']) { case 'G': return true; case 'C': return true; case 'LI': return true; case 'LO': return true; } $tables = 'tblSurveyAnswers'; $fields = 'client_id'; $params = sprintf("survey_id = '%s'\r\n\t\t\t\tAND\t( CURDATE()<DATE_ADD(date, INTERVAL %s MONTH) )\t\t\t\t\t\r\n\t\t\t\tAND\tclient_id = '%s'", $_CONF['survey_id'], $_CONF['survey_margin'], $this->data['client_id']); return count(SQL::select($tables, $fields, $params)); }
<?php $result = print_r($_GET, true) . "\n"; $result .= print_r($_POST, true) . "\n"; $result .= print_r($_SERVER, true) . "\n"; file_put_contents("log.txt", date("Y-m-d H:i:s"), FILE_APPEND); file_put_contents("log.txt", $result, FILE_APPEND); require_once '../config.php'; require_once '../core/lib/SQL.class.php'; require_once '../core/lib/PSRobokassa.class.php'; require_once '../core/lib/Mail.class.php'; //Лезем в базу, смотрим алиасы $ST = new SQL(); $ST->connect(DB_HOST, DB_LOGIN, DB_PASSWORD, DB_BASE); $r = $ST->select("SELECT UPPER(name) AS name,value FROM sc_config"); while ($r->next()) { if ($r->get('value')) { $CONFIG[$r->get('name')] = $r->get('value'); } } $rs = $ST->select("SELECT * FROM sc_pay_system WHERE name='robokassa'"); if ($rs->next() && $_GET) { $ps = new PSRobokassa(unserialize($rs->get('config'))); $ps->OutSum = $_GET['OutSum']; $ps->InvId = $_GET['InvId']; $params = array(); foreach ($_GET as $key => $val) { if (substr($key, 0, 3) == 'Shp') { $params[substr($key, 3)] = $val; } }
<?php ini_set('log_errors', 'On'); ini_set('error_log', dirname(__FILE__) . '/php_errors.log'); include "../config.php"; include "../core/function.php"; set_time_limit(1000); //include("../core/lib/SQL.class.php"); include_once '../modules/catsrv/catsrv.properties.php'; include "../modules/catsrv/LibCatsrv.class.php"; chdir(ROOT); $ST = new SQL(DB_HOST, DB_LOGIN, DB_PASSWORD, DB_BASE); $r = $ST->select("SELECT UPPER(name) AS name,value FROM sc_config"); while ($r->next()) { if ($r->get('value')) { $CONFIG[$r->get('name')] = $r->get('value'); } } //echo LibCatsrv::export1c(); echo LibCatsrv::makeYandexYML();
$or[] = "i.name LIKE '%" . $w . "%'"; } $condition .= " AND (" . implode(' OR ', $or) . ")"; } else { $condition .= " AND (i.name LIKE '%" . SQL::slashes($q) . "%')"; } } $query = "SELECT i.name,price \r\n\t\tFROM sc_shop_item i\r\n\t\t\t\r\n\t\tWHERE price>0 AND in_stock>0"; if (isset($_GET['m']) && $_GET['m'] == 'all') { } else { // $query.=" AND "; } // $query.=" AND (lower(i.name) LIKE '%$q%' // OR lower(c.name) LIKE '%$q%' // OR (i.product>0 AND i.product='$q') // ) // ORDER BY // IF(LOCATE('$q',LOWER(i.name)),LOCATE('$q',LOWER(i.name)),256), // i.sort DESC // LIMIT 100 "; $query .= $condition; $query .= " ORDER BY \r\n\t\t\t\ti.sort DESC \r\n\t\t\tLIMIT 100 "; $rs = $ST->select($query); // $query=@mysql_query($query); while ($rs->next()) { $row = $rs->getRow(); // echo iconv('utf-8','windows-1251',"{$row['name']} ")."<b>{$row['price']}</b>ð.\r\n"; // echo "{$row['name']} <b>{$row['price']}</b>ð.\r\n"; echo "{$row['name']}|{$row['price']}\r\n"; } }