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.0.7.0
- * @ Author : DeZender
- * @ Release on : 22.06.2017
- * @ 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 . ')';
- return $this->query( $sql, $bindValues );
- }
- public function update($table, $data, $where = NULL)
- {
- $values = '';
- $bindValues = array( );
- $i = 0;
- foreach ($data as $key => $val) {
- $bindValues[$key] = $val;
- $values .= (($i == 0 ? $key . ' = :' . $key : ',' . $key . ' = :' . $key));
- ++$i;
- }
- $sql = 'UPDATE ' . $table . ' SET ' . $values;
- if (isset( $where ) && $where) {
- if (is_array( $where )) {
- $_where = '';
- $i = 0;
- foreach ($where as $key => $value) {
- $bindValues[$key] = $value;
- $_where .= (($i == 0 ? $key . ' = :' . $key : ' AND ' . $key . ' = :' . $key));
- ++$i;
- }
- $where = $_where;
- }
- $sql .= ' WHERE ' . $where . ' ';
- }
- return $this->query( $sql, $bindValues );
- }
- public function delete($table, $where = NULL, $bindValues = NULL)
- {
- $values = '';
- $i = 0;
- $sql = 'DELETE FROM ' . $table . ' ';
- if (isset( $where ) && $where) {
- if (is_array( $where )) {
- $_where = '';
- $i = 0;
- foreach ($where as $key => $value) {
- $bindValues[$key] = $value;
- $_where .= (($i == 0 ? $key . ' = :' . $key : ' AND ' . $key . ' = :' . $key));
- ++$i;
- }
- $where = $_where;
- }
- $sql .= ' WHERE ' . $where . ' ';
- }
- return $this->query( $sql, $bindValues );
- }
- }
- class main_controller
- {
- public $Model = null;
- public $Models = null;
- public function __construct()
- {
- global $Utilities;
- global $ayarlar;
- $script_name = str_replace( '/', '\\', $_SERVER['SCRIPT_FILENAME'] );
- $script_name = str_replace( '\\', '/', $script_name );
- $script_name = str_replace( realpath( dirname( __FILE__ ) ), '', $script_name );
- $scr = pathinfo( $script_name );
- $base_name = $scr['basename'];
- $_do = $scr['basename'] . ((isset( $_GET['do'] ) ? '_' . $_GET['do'] : ''));
- $queryString = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY );
- parse_str( $queryString, $queryString );
- if (isset( $queryString ) && (0 < count( $queryString ))) {
- foreach ($queryString as $key => $val) {
- if (!(isset( $_GET[$key] ))) {
- $_GET[$key] = $val;
- }
- }
- }
- if ($scr['basename'] == 'login.php') {
- if ($this->IsAuthenticated( )) {
- yonlendir( base_url( ) );
- }
- else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $giris = $Utilities->query( 'SELECT * FROM ayarlar WHERE kullanici_adi = :kullanici_adi and kullanici_sifre = :kullanici_sifre and id = \'1\' ', array(
- 'kullanici_adi' => $username,
- 'kullanici_sifre' => $password
- ) );
- if (0 < $giris->rowCount) {
- ...........................................................................................................
- ......................................................
- .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement