Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.5.0.0
- * @ Author : DeZender
- * @ Release on : 22.06.2018
- * @ Official site : http://DeZender.Net
- *
- */
- ini_set('memory_limit', '-1');
- ini_set('max_execution_time', 60);
- ini_set('displayerrors', 0);
- ob_implicit_flush();
- error_reporting(32767);
- ini_set('display_errors', 0);
- ignore_user_abort(false);
- $config = include 'config.php';
- extract($config);
- session_start();
- $Utilities = new Utilities();
- $ayarlar = get_option();
- $lisansCheck = lisansCheck();
- $main_controller = new main_controller();
- define('CR', "\r");
- define('LF', "\n");
- define('CRLF', "\r\n");
- define('BR', '<br />' . LF);
- class Utilities
- {
- private static $instance = null;
- public $cache_time = 1800;
- private $con = null;
- private $result = null;
- private $ayarlar = null;
- public function __construct()
- {
- global $config;
- self::$instance = &$this;
- if (isset($config) && !empty($config) && is_array($config)) {
- extract($config);
- $this->con = new PDO('mysql:host=' . $DB_SERVER . ';dbname=' . $DB_DATABASE, $DB_USERNAME, $DB_PASSWORD);
- $this->con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
- $queries = array("SET NAMES 'utf8'");
- foreach ($queries as $query) {
- $this->con->query($query);
- }
- }
- }
- public function __destruct()
- {
- $this->con = null;
- $this->result = null;
- }
- public function query($queryString, $bindValues = null, $fetch_style = PDO::FETCH_OBJ)
- {
- $result = null;
- $queryType = null;
- if (preg_match('/update\\s([a-zA-Z0-9_]{1,20}+)\\sset/siU', $queryString, $table_match)) {
- $queryType = 'UPDATE';
- } else {
- if (preg_match('/insert\\sinto\\s([a-zA-Z0-9_]{1,20}+)/siU', $queryString, $table_match)) {
- $queryType = 'INSERT';
- } else {
- if (preg_match('/delete\\sfrom\\s([a-zA-Z0-9_]{1,20}+)/siU', $queryString, $table_match)) {
- $queryType = 'DELETE';
- } else {
- if (preg_match('/from\\s*([a-zA-Z0-9_]{1,20}+)/siU', $queryString, $table_match)) {
- $queryType = 'SELECT';
- }
- }
- }
- }
- $query = $this->con->prepare($queryString);
- if (isset($bindValues) && is_array($bindValues)) {
- foreach ($bindValues as $key => $value) {
- $key = ':' . $key;
- $query->bindValue($key, $value, PDO::PARAM_STR);
- }
- }
- $query->execute();
- if ($queryType == 'INSERT') {
- $lastInsertId = $this->con->lastInsertId();
- return $lastInsertId;
- }
- $result = new stdClass();
- $rowCount = $query->rowCount();
- $result->rowCount = $rowCount;
- if ($queryType == 'SELECT') {
- $result->fetchAll = $query->fetchAll($fetch_style);
- if (0 < count($result->fetchAll)) {
- $result->fetch = $result->fetchAll[0];
- }
- }
- return $result;
- }
- public function insert($table, $data)
- {
- $values = '';
- $i = 0;
- $keys = '';
- $bindValues = array();
- foreach ($data as $key => $val) {
- $bindValues[$key] = $val;
- $keys .= ($i == 0 ? $key : ',' . $key);
- $values .= ($i == 0 ? ':' . $key : ', :' . $key);
- $i++;
- }
- $sql = 'INSERT INTO ' . $table . ' (' . $keys . ') values(' . $values . ')';
- ...................................................................
- .......................................
- .....................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement