Warning: mysqli::mysqli(): Headers and client library minor version mismatch. Headers:101106 Library:100505 in /home/u136381340/domains/aymont.com.tr/public_html/core/php/classes/sql.class.php on line 21
setlocale(LC_ALL, 'tr_TR.UTF-8', 'tr_TR', 'tr', 'turkish');
function error_inline($message) {
echo "$message
";
}
function success_inline($message) {
echo "$message
";
}
function is_all_full(array $datas = []) {
$full = true;
foreach ($datas as $data) {
if (empty($data)) {
$full = false;
}
}
return $full;
}
function go_to($location) {
header('location: /admin/' . $location . '.php');
}
function get($name) {
return empty($_GET[$name]) ? NULL : $_GET[$name];
}
function post($name) {
return empty($_POST[$name]) ? NULL : $_POST[$name];
}
function date2db($date) {
$timestamp = DateTime::createFromFormat('d.m.Y', $date);
return $timestamp->format('Y-m-d');
}
function db2date($date) {
$timestamp = DateTime::createFromFormat('Y-m-d', $date);
return $timestamp->format('d.m.Y');
}
function ts2date($date) {
$timestamp = DateTime::createFromFormat('Y-m-d H:i:s', $date);
return print_date($timestamp->format('d.m.Y'));
}
function db2date4input($date) {
$timestamp = DateTime::createFromFormat('Y-m-d', $date);
return $timestamp->format('m.d.Y');
}
function print_date($date) {
$months = [0, 'Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'];
$timestamp = DateTime::createFromFormat('d.m.Y', $date);
$day = $timestamp->format('d');
$month = $timestamp->format('n');
$year = $timestamp->format('Y');
$result = $day . ' ' . $months[$month] . ' ' . $year;
$result .= $year == date('Y') ? NULL : $year;
return $result;
}
function br2nl($string) {
return preg_replace('/\
/i', "\n", $string);
}
function array_squeeze($sira, $string, $dizi) {
$end = array_slice($dizi, $sira);
$durulecek = count($dizi) - $sira;
for ($i = 0; $i < $durulecek; $i++) {
array_pop($dizi);
}
$dizi[$sira] = $string;
return array_merge($dizi, $end);
}
function now_date() {
return date('Y-m-d');
}
function now_time() {
return date('H:i:s');
}
function time2time($time1, $time2) {
$timestamp1 = DateTime::createFromFormat('d.m.Y H:i:s', $time1);
$timestamp2 = DateTime::createFromFormat('d.m.Y H:i:s', $time2);
$first = mktime($timestamp1->format('H'), $timestamp1->format('i'), $timestamp1->format('s'), $timestamp1->format('n'), $timestamp1->format('j'), $timestamp1->format('Y'));
$second = mktime($timestamp2->format('H'), $timestamp2->format('i'), $timestamp2->format('s'), $timestamp2->format('n'), $timestamp2->format('j'), $timestamp2->format('Y'));
if ($first > $second) {
$fark = $first - $second;
} else {
$fark = $second - $first;
}
$gunyazi = '';
$saatyazi = '';
$dakikayazi = '';
$saniyeyazi = '';
$gun = floor($fark / 86400);
$saat = floor(($fark - ($gun * 86400)) / 3600);
$dakika = floor(($fark - ($gun * 86400) - ($saat * 3600)) / 60);
$saniye = floor(($fark - ($gun * 86400) - ($saat * 3600) - ($dakika * 60)));
if ($gun > 0) {
$gunyazi = "$gun gün, ";
}
if ($saat > 0) {
$saatyazi = "$saat saat, ";
}
if ($dakika > 0) {
$dakikayazi = "$dakika dakika, ";
}
if ($saniye > 0) {
$saniyeyazi = "$saniye saniye";
}
return "$gunyazi$saatyazi$dakikayazi$saniyeyazi";
}
function GetIP() {
if (getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
} elseif (getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
if (strstr($ip, ',')) {
$tmp = explode(',', $ip);
$ip = trim($tmp[0]);
}
} else {
$ip = getenv("REMOTE_ADDR");
}
return $ip;
}
function toUpperCase($input) {
return strtoupper(strtr($input, 'ğüşıiöç', 'ĞÜŞIİÖÇ'));
}
function toLowerCase($input) {
return strtolower(strtr($input, 'ĞÜŞIİÖÇ', 'ğüşıiöç'));
}
function toMoney($var) {
$nf = new NumberFormatter('tr_TR', NumberFormatter::CURRENCY);
$money = str_replace(['₺', 'TL', ' '], ['', '', ''], $nf->formatCurrency((float) $var, 'TRY'));
return $money . ' ';
}
function chart($data = [], $chart_type = 'Bar', $labels = NULL, $name = '') {
$contents = file_get_contents(_CORE . 'php/functions/chart.html');
$keys = NULL;
$data_string = NULL;
$j = 0;
foreach ($data as $cont) {
$ayracj = $j < count($data) - 1 ? ',' : NULL;
$data_string .= '{';
$array_keys = [];
$key_i = -1;
foreach (array_keys($cont) as $key) {
if (is_string($key) && $key_i > 0) {
array_push($array_keys, $key);
} else {
$key_i++;
is_string($key) ? $xkey = $key : false;
}
}
$keys = join("','", $array_keys);
$i = 0;
foreach ($cont as $key => $c) {
$i++;
$ayrac = $i < count($cont) - 1 ? ',' : NULL;
if (!is_int($key)) {
$data_string .= "$key: '$c'$ayrac";
}
}
$data_string .= "}$ayracj";
}
$vars = [
'chart_type' => $chart_type,
'element' => md5(uniqid()) . '_chart',
'data' => $data_string,
'keys' => $keys,
'xkey' => $xkey,
'labels' => $labels,
'name' => $name
];
foreach ($vars as $name => $content) {
$contents = str_replace("__$name" . '__', $content, $contents);
}
return $contents;
}
function get_socials(array $attribute = []) {
$att = NULL;
foreach ($attribute as $att_key => $att_val) {
$att .= "$att_key='$att_val' ";
}
$s = new sql;
$result = "";
$data = $s->select(['table' => 'socials']);
foreach ($data as $social) {
$result .= " ";
}
$result .= '
';
return $result;
}
function toupper($string) {
$search = ['ç', 'ş', 'ğ', 'ü', 'ö', 'ı', 'i'];
$replace = ['Ç', 'Ş', 'Ğ', 'Ü', 'Ö', 'I', 'İ'];
$string = str_replace($search, $replace, $string);
return strtoupper($string);
}
function get_map($coordinate, $element_id) {
$coor = empty($coordinate) ? '39.927171,32.83586300000002' : $coordinate;
?>
}
function getiffull(&$var, $ifnullreturn = NULL) {
return empty($var) ? $ifnullreturn : $var;
}
function phonemask($phone) {
if (preg_match('/^(\d{3})(\d{3})(\d{2})(\d{2})$/', $phone, $matches)) {
$result = '0(' . $matches[1] . ') ' . $matches[2] . ' ' . $matches[3] . ' ' . $matches[4];
return $result;
}
}
function phoneunmask($phone) {
return substr(str_replace(['(', ')', ' '], ['', '', ''], $phone), 1);
}
function customError($error_level, $error_message, $error_file, $error_line, $error_context) {
$user = new user;
$mail = new mail;
$masters = $user->get_webmaster_mails();
foreach ($masters as $master) {
$mail->sendmail([
'subject' => 'Hata',
'mail_path' => 'error',
'mail_change' => ['file_path' => "$error_file [$error_line]", 'message' => $error_message, 'request_page' => $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']],
'send' => [$master['email'], SITENAME]
]);
}
}
set_error_handler("customError");
Warning: mysqli::mysqli(): Headers and client library minor version mismatch. Headers:101106 Library:100505 in /home/u136381340/domains/aymont.com.tr/public_html/core/php/classes/sql.class.php on line 21
Warning: mysqli::mysqli(): Headers and client library minor version mismatch. Headers:101106 Library:100505 in /home/u136381340/domains/aymont.com.tr/public_html/core/php/classes/sql.class.php on line 21
Fatal error: Call to undefined function get() in /home/u136381340/domains/aymont.com.tr/public_html/core/php/classes/page.class.php on line 22