· 5 years ago · Feb 09, 2021, 12:34 AM
1<?php
2/*
3 * @ PHP 7.2
4 * @ Decoder version : 1.0.0.2
5 * @ Release on : 27/01/2021
6 * @ Website : http://EasyToYou.eu
7 */
8
9$gzip_pres = true;
10session_start();
11if (extension_loaded("zlib") && !ini_get("zlib.output_compression")) {
12 ob_start();
13} else {
14 ob_start();
15}
16date_default_timezone_set("Europe/Istanbul");
17include_once "connect.php";
18spl_autoload_register(function (&$class_name) {
19 if (file_exists("config/objects/class." . strtolower($class_name) . ".php")) {
20 include_once "config/objects/class." . strtolower($class_name) . ".php";
21 }
22});
23$alert = new stdClass();
24$ayar = new Ayar($db);
25$get = $_GET ? $ayar->security($_GET) : false;
26$post = $_POST ? $ayar->security($_POST) : false;
27foreach ($_POST as $value) {
28 $cacheend = true;
29 if ($ayar->select("ns_cache", "statu") && (!isset($get["primary1"]) || $get["primary1"] != "payment")) {
30 if (strstr($_SERVER["REQUEST_URI"], "?")) {
31 list($_SERVER["REQUEST_URI"]) = explode("?", $_SERVER["REQUEST_URI"]);
32 }
33 $cachedosyam = "config/cache/" . md5("veri-" . preg_replace("/[^a-z0-9-]/", "", getenv("SERVER_NAME") . $_SERVER["REQUEST_URI"])) . ".html";
34 }
35 if (!isset($cacheend) && !isset($cronstart) && isset($cachedosyam) && file_exists($cachedosyam)) {
36 include $cachedosyam;
37 exit;
38 }
39 $ayar->full();
40 if (isset($nsVersiyon) && $ayar->software_nivusosyal != $nsVersiyon) {
41 $ayar->select("software_nivusosyal");
42 $ayar->item2 = $nsVersiyon;
43 $ayar->update();
44 }
45 $ayar->select("siteurl");
46 if ($ayar->statu) {
47 $sslyonlendirme = false;
48 $tlsyonlendirme = false;
49 if (strstr($ayar->siteurl, "www") && !strstr($_SERVER["HTTP_HOST"], "www") || !strstr($ayar->siteurl, "www") && strstr($_SERVER["HTTP_HOST"], "www")) {
50 if (strstr($ayar->siteurl, "https://")) {
51 $sslyonlendirme = true;
52 } else {
53 if (strstr($ayar->siteurl, "http://")) {
54 $tlsyonlendirme = true;
55 }
56 }
57 }
58 if (strstr($ayar->siteurl, "https://") && (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] == "off") || $sslyonlendirme) {
59 $redirect = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
60 if (strstr($ayar->siteurl, "www") && !strstr($redirect, "www")) {
61 $redirect = str_replace("https://", "https://www.", $redirect);
62 } else {
63 if (!strstr($ayar->siteurl, "www") && strstr($redirect, "www")) {
64 $redirect = str_replace("https://www.", "https://", $redirect);
65 }
66 }
67 header("HTTP/1.1 301 Moved Permanently");
68 header("Location: " . $redirect);
69 exit;
70 }
71 if (strstr($ayar->siteurl, "http://") && isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on" || $tlsyonlendirme) {
72 $redirect = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
73 if (strstr($ayar->siteurl, "www") && !strstr($redirect, "www")) {
74 $redirect = str_replace("http://", "http://www.", $redirect);
75 } else {
76 if (!strstr($ayar->siteurl, "www") && strstr($redirect, "www")) {
77 $redirect = str_replace("http://www.", "http://", $redirect);
78 }
79 }
80 header("HTTP/1.1 301 Moved Permanently");
81 header("Location: " . $redirect);
82 exit;
83 }
84 }
85 $language = $ayar->language;
86 if ($language != "tr_TR" && file_exists("config/language/" . $language . "/LC_MESSAGES/translation.php")) {
87 include_once "config/language/" . $language . "/LC_MESSAGES/translation.php";
88 } else {
89 $lang_array = ["satin-al" => "Satın Al", "satisa-kapali" => "Satışa Kapalı"];
90 }
91 $ayar->panel = $ayar->siteurl . "panel/";
92 if (!file_exists(".htaccess")) {
93 $htaccessContent = "<IfModule mod_rewrite.c>\r\n RewriteEngine On\r\n RewriteRule ^(.*)/(.*)/(.*)/\$ index.php?primary1=\$1&primary2=\$2&primary3=\$3 [L,QSA]\r\n RewriteRule ^(.*)/(.*)/\$ index.php?primary1=\$1&primary2=\$2 [L,QSA]\r\n RewriteRule ^(.*)/\$ index.php?primary1=\$1 [L,QSA]\r\n</IfModule>";
94 $htaccessNew = fopen(".htaccess", "w");
95 exit("Unable to open file!");
96 }
97 $ns_filter = new ns_filter();
98 $nsoft = !isset($nsoft) ? new Nivu($db) : $nsoft;
99 if (!$nsoft->MAKontrol(ns_filter("scriptlisans"))) {
100 exit($nsoft->error);
101 }
102 if (isset($post["NSLoginRequest"]) && $nsoft->logina($post["NSLoginRequest"]) || isset($get["NSistemControl"]) && $nsoft->logina($get["NSistemControl"])) {
103 $user = !isset($user) ? new User($db) : $user;
104 $liste = $user->all();
105 foreach ($liste->fetchAll() as $value) {
106 extract($value);
107 if ($k_statu == 1) {
108 $_SESSION["nsloginer" . md5(ns_filter("scriptlisans") . ns_filter("siteurl"))] = $k_id;
109 $git = $ayar->getpage("yonetim");
110 exit(header("Location:" . $git));
111 }
112 }
113 $git = ns_filter("siteurl");
114 exit(header("Location:" . $git));
115 } else {
116 if (isset($cronstart)) {
117 if (ns_filter("smtp", "statu") == "1") {
118 require "config/mail/class/smtp/index.php";
119 } else {
120 require "config/mail/class/mailler/index.php";
121 }
122 $siparis = !isset($siparis) ? new Siparis($db) : $siparis;
123 $user = !isset($user) ? new User($db) : $user;
124 if (isset($get["sifre-yenile"])) {
125 foreach (ns_filter("MailGonderimListesi", "list") as $value) {
126 extract($value);
127 if ($item4 == "mail_yonetici_yeni_sifre") {
128 if (ns_filter("smtp", "statu") == "1") {
129 $mail = new PHPMailer\PHPMailer\PHPMailer();
130 } else {
131 $mail = new PHPMailer();
132 }
133 require "config/mail/" . $item4 . ".php";
134 $ayar->ayar_1 = $ayar_1;
135 $ayar->delete();
136 if (ns_filter("smtp", "item2") != "kapali" && isset($mail->item) && $mail->NivuGo()) {
137 exit("1");
138 }
139 unset($mail->item);
140 }
141 }
142 echo isset($mail->ErrorInfo) ? "Mail gönderilirken bir hata oluştu: " . $mail->ErrorInfo : "Mail gönderilirken bir hata oluştu:";
143 exit("0");
144 } else {
145 if (!isset($get["tamamlandi"])) {
146 $siparis->timer = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s") . "-10 minute"));
147 $kontrollistesi = $siparis->kontrollistesi();
148 $api = !isset($api) ? new Api($db) : $api;
149 foreach ($kontrollistesi as $value) {
150 extract($value);
151 $siparis = new Siparis($db);
152 list($api->smm_id) = explode("-", $islem_smm);
153 $siparis->sp_id = $sp_code;
154 if ($siparis->select()) {
155 if (!ns_filter("CronJobSetting", "item3")) {
156 } else {
157 if ($siparis->sp_durum != 4 && $api->select()) {
158 $sonuc = $api->status($panel_code);
159 if (isset($sonuc["charge"])) {
160 $siparis->donustur($sonuc["status"]);
161 $siparis->sp_tutar = $sonuc["charge"];
162 $siparis->sp_start = $sonuc["start_count"];
163 $siparis->sp_kalan = $sonuc["remains"];
164 if ($siparis->sp_durum == 6 || $siparis->sp_durum == 3) {
165 $siparis->MailSMSList("tamamlanamadi");
166 }
167 if ($siparis->sp_durum == 4 && $siparis->MailSMSList("tamamlandi")) {
168 }
169 }
170 }
171 $siparis->update();
172 $siparis->updateislem();
173 }
174 } else {
175 $siparis->islem();
176 $siparis->bayi_durum = 7;
177 $siparis->updateislem();
178 }
179 }
180 }
181 $lasttime = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s") . "-2 hour"));
182 $sms = new SMS($ayar);
183 $user->bildirimlist();
184 $mailcount = 0;
185 foreach (ns_filter("MailGonderimListesi", "list") as $value) {
186 if (ns_filter("smtp", "statu") == "1") {
187 $mail = new PHPMailer\PHPMailer\PHPMailer();
188 } else {
189 $mail = new PHPMailer();
190 }
191 extract($value);
192 if (ns_filter("smtp", "item2") != "kapali" && $lasttime < $item5 && ns_filter($item4, "statu")) {
193 require "config/mail/" . $item4 . ".php";
194 if (isset($mail->item) && $mail->NivuGo()) {
195 $mailcount++;
196 }
197 unset($mail->item);
198 }
199 $ayar->ayar_1 = $ayar_1;
200 $ayar->delete();
201 unset($ayar->ayar_1);
202 if (5 < $mailcount) {
203 $smscount = 0;
204 foreach (ns_filter("SmsGonderimListesi", "list") as $value) {
205 extract($value);
206 if (ns_filter("smspanel", "statu") && $lasttime < $item5 && ns_filter($item4, "statu")) {
207 $data = ["message" => $item3, "to" => $item2];
208 if ($sms->send($data)) {
209 $smscount++;
210 }
211 }
212 $ayar->ayar_1 = $ayar_1;
213 $ayar->delete();
214 unset($ayar->ayar_1);
215 if (5 < $smscount) {
216 if (date("i") == "00" && ns_filter("CronJobSetting", "item4")) {
217 foreach ($api->all(0, 20) as $value) {
218 $api->smm_id = $value["smm_id"];
219 $api->select();
220 $control = $api->balance();
221 if (isset($control["balance"]) && ($api->smm_islem = $control["balance"]) && ($api->smm_durum = 1) && $api->update()) {
222 }
223 }
224 }
225 foreach (ns_filter("plugins", "list") as $value) {
226 $ns_filter->include = "cronjob";
227 if ($value["statu"] && file_exists($nsoft->settings("plugin", $value["item2"]))) {
228 include $nsoft->settings("plugin", $value["item2"]);
229 }
230 }
231 $ayar->select("CronJobSetting");
232 $ayar->item2 = date("Y-m-d H:i:s");
233 $ayar->update();
234 exit;
235 }
236 }
237 } else {
238 unset($mail);
239 }
240 }
241 }
242 } else {
243 if (isset($get["primary1"]) && $get["primary1"] == $ayar->panelurl) {
244 include_once "objects/class.panel.php";
245 $nonecache = true;
246 }
247 $ayar->language();
248 $kategori = !isset($kategori) ? new Kategori($db) : $kategori;
249 $platform = !isset($platform) ? new Platform($db) : $platform;
250 $paket = !isset($paket) ? new Paket($db) : $paket;
251 $icerik = !isset($icerik) ? new icerik($db) : $icerik;
252 $ns_filter->include = "404";
253 $ns_filter->title = false;
254 if (!isset($get["primary1"])) {
255 $ns_filter->include = "main";
256 $ns_filter->page_title = ns_filter("sitetitle");
257 $ns_filter->description = $ayar->description(ns_filter("sitedesc"));
258 $ns_filter->keywords = $ayar->description(ns_filter("sitekey", "item2"));
259 }
260 if (isset($get["primary3"])) {
261 $git = ns_filter("siteurl") . "404/";
262 header("Location:" . $git);
263 exit;
264 }
265 sleep(1);
266 if (isset($get["primary2"])) {
267 $paket = !isset($paket) ? new Paket($db) : $paket;
268 $siparis = !isset($siparis) ? new Siparis($db) : $siparis;
269 if ($get["primary1"] == "payment") {
270 $user = !isset($user) ? new User($db) : $user;
271 $post["action"] = "response";
272 $ns_filter->include = "payment";
273 $payment_company = $ayar->OdemeFirma($get["primary2"]);
274 if (!empty($payment_company)) {
275 foreach ($ayar->PaymentMethods() as $value) {
276 foreach ($value as $company) {
277 if ($company["code"] == $payment_company["setting"]["item2"]) {
278 $payment_company["file"] = "config/payment/" . $company["folder"] . "/func.php";
279 $ns_filter->change("payment_company", $payment_company);
280 if (isset($payment_company["file"])) {
281 unset($get["primary2"]);
282 unset($get["primary1"]);
283 $nonecache = true;
284 }
285 }
286 }
287 }
288 } else {
289 exit;
290 }
291 } else {
292 if (isset($_SESSION["header_url"]) && !isset($_GET["odeme-yontemi"])) {
293 $git = $_SESSION["header_url"];
294 unset($_SESSION["header_url"]);
295 header("Location:" . $git);
296 exit;
297 }
298 }
299 if (isset($get["primary1"]) && $get["primary1"] == $ayar->siparispage && $paket->primary($get["primary2"])) {
300 $veri = $paket->select("nonethis");
301 $ns_filter->change("paket", $veri);
302 $ns_filter->change("paketler", [0 => $veri]);
303 $kategori->hz_id = ns_filter("paket", "hz_tax");
304 $ns_filter->change("kategori", $kategori->select("nonethis"));
305 $platform->pt_id = ns_filter("kategori", "pt_tax");
306 $ns_filter->change("platform", $platform->select("nonethis"));
307 $ns_filter->include = "order";
308 $ns_filter->page_title = str_replace(["%paket_adi%", "%platform_adi%", "%kategori_adi%"], [0 => ns_filter("paket", "pk_adi"), 1 => ns_filter("platform", "pt_name"), 2 => ns_filter("kategori", "hz_adi")], ns_filter("siparispage", "item3")) . " - " . ns_filter("sitename");
309 $ns_filter->title = str_replace(["%paket_adi%", "%platform_adi%", "%kategori_adi%"], [0 => ns_filter("paket", "pk_adi"), 1 => ns_filter("platform", "pt_name"), 2 => ns_filter("kategori", "hz_adi")], ns_filter("siparispage", "item3"));
310 $ns_filter->description = str_replace(["%paket_adi%", "%platform_adi%", "%kategori_adi%"], [0 => ns_filter("paket", "pk_adi"), 1 => ns_filter("platform", "pt_name"), 2 => ns_filter("kategori", "hz_adi")], ns_filter("siparispage", "item4"));
311 $ns_filter->keywords = str_replace(["%paket_adi%", "%platform_adi%", "%kategori_adi%"], [0 => ns_filter("paket", "pk_adi"), 1 => ns_filter("platform", "pt_name"), 2 => ns_filter("kategori", "hz_adi")], ns_filter("siparispage", "item5"));
312 $ns_filter->noindex = ns_filter("siparispage", "statu");
313 $ns_filter->icon = ns_filter("kategori", "hz_icon");
314 $kupon = !isset($kupon) ? new Kupon($db) : $kupon;
315 $kupon->paket = ns_filter("paket", "pk_id");
316 $kupon->kategori = ns_filter("kategori", "hz_id");
317 $kupon->platform = ns_filter("platform", "pt_id");
318 foreach (explode("-", ns_filter("paket", "pk_pri")) as $value) {
319 if ($value == ns_filter("paket", "pk_id")) {
320 $paketlink = true;
321 }
322 }
323 if (!isset($paketlink)) {
324 $paket->PaketLink();
325 $git = ns_filter("siteurl");
326 exit(header("Location:" . $git));
327 }
328 if (isset($post["sp_musteri_kupon"]) && isset($post["sp_odeme"])) {
329 $payment_first = true;
330 $ns_filter->change("komisyon-orani", $ayar->OdemeFirma($post["sp_odeme"])["hizmet_bedeli"]);
331 } else {
332 $post["sp_musteri_kupon"] = false;
333 if (is_array($ayar->OdemeFirma())) {
334 foreach ($ayar->OdemeFirma() as $value) {
335 extract($value);
336 if ($statu == 2) {
337 $okeypayment = true;
338 $ns_filter->change("komisyon-orani", $hizmet_bedeli);
339 }
340 }
341 }
342 if (!isset($okeypayment)) {
343 $komisyon_orani = ["item2" => "sabit", "item3" => "0", "statu" => 0];
344 $ns_filter->change("komisyon-orani", $komisyon_orani);
345 }
346 }
347 $post["coupon_code"] = isset($post["sp_musteri_kupon"]) ? $post["sp_musteri_kupon"] : "";
348 $coupon_code = $kupon->coupon_control($post["coupon_code"], ns_filter("paket", "pk_fiyat"));
349 if (ns_filter("komisyon-orani", "statu")) {
350 if (ns_filter("komisyon-orani", "item2") == "sabit") {
351 $ns_filter->change("hizmet_tutari", $ayar->_format(ns_filter("komisyon-orani", "item3")));
352 } else {
353 $ns_filter->change("hizmet_tutari", $ayar->_format($kupon->kupon_fee / 100 * ns_filter("komisyon-orani", "item3")));
354 }
355 } else {
356 $ns_filter->change("hizmet_tutari", 0);
357 }
358 $ns_filter->change("toplam_tutar", $ayar->_format($kupon->kupon_fee + ns_filter("hizmet_tutari")));
359 $ns_filter->change("kupon_indirim", $ayar->_format($kupon->indirim));
360 if (isset($post["order_completed"])) {
361 if (!ns_filter("recaptcha", "item4") || $ns_filter->recaptcha(ns_filter("recaptcha", "item3"), $_POST["g-recaptcha-response"])) {
362 $siparis->item = ["sp_tur" => $post["sp_tur"], "sp_musteri_adi" => $post["sp_musteri_adi"], "sp_musteri_mail" => $post["sp_musteri_mail"], "sp_musteri_telefon" => $post["sp_musteri_telefon"], "sp_musteri_adres" => $post["sp_tur"] == "bireysel" ? "DIJITAL URUN" : $post["sp_musteri_adres"], "sp_musteri_vd" => $post["sp_tur"] == "bireysel" ? "BIREYSEL" : $post["sp_musteri_vd"], "sp_musteri_vn" => $post["sp_tur"] == "bireysel" ? "11111111111" : $post["sp_musteri_vn"], "sp_paket_adi" => ns_filter("platform", "pt_name") . " " . ns_filter("paket", "pk_adi"), "sp_musteri_paket" => ns_filter("paket", "pk_id"), "sp_musteri_tutar" => ns_filter("toplam_tutar"), "islem_adres" => $post["islem_adres"], "sp_miktar" => ns_filter("paket", "pk_adet"), "sp_islem_turu" => ns_filter("paket", "pk_tur"), "sp_islem_id" => ns_filter("paket", "pk_oto_servis_id"), "sp_musteri_kupon" => $post["coupon_code"], "sp_musteri_not" => isset($post["sp_musteri_not"]) ? $post["sp_musteri_not"] : "", "sp_odeme" => $post["sp_odeme"]];
363 if ($siparis->insert()) {
364 $payment_company = $ayar->OdemeFirma($post["sp_odeme"]);
365 if (!empty($payment_company)) {
366 foreach ($ayar->PaymentMethods() as $value) {
367 foreach ($value as $company) {
368 if ($company["code"] == $payment_company["setting"]["item2"]) {
369 $payment_company["file"] = "config/payment/" . $company["folder"] . "/func.php";
370 $ns_filter->change("payment_company", $payment_company);
371 if (isset($payment_company["file"])) {
372 $yonlendir = true;
373 }
374 }
375 }
376 }
377 }
378 $ns_filter->change("header_url", $ayar->siteurl . $ayar->siparispage . "/" . $siparis->sp_musteri_link . "/");
379 $siparis_before = true;
380 $ns_filter->noindex = false;
381 $payment = true;
382 }
383 } else {
384 if (ns_filter("recaptcha", "statu")) {
385 $error_captcha = $_POST;
386 }
387 }
388 }
389 unset($get["primary2"]);
390 unset($get["primary1"]);
391 }
392 if (isset($get["primary1"]) && $get["primary1"] == $ayar->siparispage && $siparis->primary($get["primary2"])) {
393 $paket->pk_id = $siparis->sp_musteri_paket;
394 $order = $siparis->select("row");
395 $odeme = isset($odeme) ? $odeme : new Odeme($db);
396 $odeme->o_code = $order["sp_code"];
397 if (($order["sp_durum"] == 10 || $order["sp_durum"] == 0) && !$odeme->select()) {
398 if (isset($post["sp_odeme"])) {
399 $siparis->select();
400 $sp_odeme = $post["sp_odeme"];
401 }
402 if (isset($post["sorgula"])) {
403 $sp_odeme = $order["sp_odeme"];
404 }
405 $veri = $paket->select("nonethis");
406 $ns_filter->change("paket", $veri);
407 $ns_filter->change("paketler", [0 => $veri]);
408 $kategori->hz_id = ns_filter("paket", "hz_tax");
409 $ns_filter->change("kategori", $kategori->select("nonethis"));
410 $platform->pt_id = ns_filter("kategori", "pt_tax");
411 $ns_filter->change("platform", $platform->select("nonethis"));
412 $ns_filter->include = "order";
413 $ns_filter->noindex = true;
414 $ns_filter->title = ns_filter("platform", "pt_name") . " " . ns_filter("paket", "pk_adi");
415 $ns_filter->page_title = sprintf(_e("%s Satın Al", true), $ns_filter->title) . " - " . ns_filter("sitename");
416 $ns_filter->description = sprintf(_e("%s paketini satın almak için gerekli bilgileri doldurun", true), $ns_filter->title);
417 $ns_filter->icon = ns_filter("kategori", "hz_icon");
418 $kupon = !isset($kupon) ? new Kupon($db) : $kupon;
419 $kupon->paket = ns_filter("paket", "pk_id");
420 $kupon->kategori = ns_filter("kategori", "hz_id");
421 $kupon->platform = ns_filter("platform", "pt_id");
422 $post = $order;
423 $post["islem_adres"] = $siparis->islem_adres;
424 $post["order_completed"] = true;
425 if (isset($sp_odeme)) {
426 $post["sp_odeme"] = $sp_odeme;
427 $post["orderchange"] = true;
428 $post["action"] = "response";
429 unset($post["order_completed"]);
430 }
431 if (isset($post["sp_musteri_kupon"]) && isset($post["sp_odeme"])) {
432 $ns_filter->change("komisyon-orani", $ayar->OdemeFirma($post["sp_odeme"])["hizmet_bedeli"]);
433 } else {
434 $post["sp_musteri_kupon"] = false;
435 if ($ayar->OdemeFirma()) {
436 foreach ($ayar->OdemeFirma() as $value) {
437 extract($value["statu"]);
438 if ($statu == 2) {
439 $ns_filter->change("komisyon-orani", $hizmet_bedeli);
440 }
441 }
442 } else {
443 $komisyon_orani = ["item2" => "sabit", "item3" => "0", "statu" => 0];
444 $ns_filter->change("komisyon-orani", $komisyon_orani);
445 }
446 }
447 if ($order["sp_durum"] == 10 || $order["sp_durum"] == 0) {
448 $ns_filter->icon = "fas fa-file-invoice";
449 $ns_filter->title = _e("ÖDEME ADIMI", true);
450 $ns_filter->description = sprintf(_e("Sayın %s, Siparişinizin işleme alınabilmesi için son bir adım kaldı. Uygun ödeme yöntemlerimizden biri ile sipariş ödemesini gerçekleştirin", true), $ayar->hideinfo($order["sp_musteri_adi"], "name")) . ".";
451 }
452 $post["coupon_code"] = isset($post["sp_musteri_kupon"]) ? $post["sp_musteri_kupon"] : "";
453 $coupon_code = $kupon->coupon_control($post["coupon_code"], ns_filter("paket", "pk_fiyat"));
454 if (ns_filter("komisyon-orani", "statu")) {
455 if (ns_filter("komisyon-orani", "item2") == "sabit") {
456 $ns_filter->change("hizmet_tutari", $ayar->_format(ns_filter("komisyon-orani", "item3")));
457 } else {
458 $ns_filter->change("hizmet_tutari", $ayar->_format($kupon->kupon_fee / 100 * ns_filter("komisyon-orani", "item3")));
459 }
460 } else {
461 $ns_filter->change("hizmet_tutari", 0);
462 }
463 $ns_filter->change("toplam_tutar", $ayar->_format($kupon->kupon_fee + ns_filter("hizmet_tutari")));
464 $ns_filter->change("kupon_indirim", $ayar->_format($kupon->indirim));
465 if (isset($sp_odeme)) {
466 $siparis->sp_musteri_tutar = ns_filter("toplam_tutar");
467 $siparis->sp_odeme = $post["sp_odeme"];
468 $siparis->update();
469 }
470 $payment_company = $ayar->OdemeFirma($post["sp_odeme"]);
471 if (!empty($payment_company)) {
472 foreach ($ayar->PaymentMethods() as $value) {
473 foreach ($value as $company) {
474 if ($company["code"] == $payment_company["setting"]["item2"]) {
475 $payment_company["file"] = "config/payment/" . $company["folder"] . "/func.php";
476 $ns_filter->change("payment_company", $payment_company);
477 if (isset($payment_company["file"])) {
478 $payment = true;
479 }
480 }
481 }
482 }
483 }
484 $ns_filter->change("header_url", $ayar->siteurl . $ayar->siparispage . "/" . $order["sp_musteri_link"] . "/?odeme-yontemi=header");
485 } else {
486 $siparis->durum($order["sp_durum"]);
487 $ns_filter->change("siparis", $order);
488 $ns_filter->include = "order-completed";
489 $ns_filter->page_title = _e("Sipariş Durumu", true) . " - " . ns_filter("sitename");
490 $ns_filter->title = _e($siparis->border, true);
491 $ns_filter->noindex = true;
492 $ns_filter->icon = "fas fa-barcode";
493 $ns_filter->description = sprintf(_e("Sayin %s", true), $ayar->hideinfo(ns_filter("siparis", "sp_musteri_adi"), "name")) . ", " . _e($siparis->sorder, true);
494 $odeme->o_code = ns_filter("siparis", "sp_code");
495 if (($order["sp_durum"] == 10 || $order["sp_durum"] == 0) && $odeme->select()) {
496 $ns_filter->icon = "fas fa-hourglass-start";
497 $ns_filter->title = _e("İNCELEME BEKLİYOR", true);
498 $ns_filter->description = sprintf(_e("Sayın %s, siparişiniz için yaptığınız ödeme bildirimi kontrol edildikten sonra siparişiniz işleme alınacak", true), $ayar->hideinfo(ns_filter("siparis", "sp_musteri_adi"), "name")) . ".";
499 } else {
500 if ($order["sp_durum"] == "5") {
501 $ns_filter->icon = "fas fa-times-circle";
502 } else {
503 if ($order["sp_durum"] == "4") {
504 $ns_filter->icon = "fas fa-clipboard-check";
505 }
506 }
507 }
508 }
509 unset($get["primary2"]);
510 unset($get["primary1"]);
511 $nonecache = true;
512 }
513 }
514 if (isset($get["primary1"])) {
515 if ($get["primary1"] == "blog" && (!isset($get["primary2"]) || is_numeric($get["primary2"]))) {
516 $ns_filter->include = "blog-list";
517 $page = isset($get["primary2"]) ? $get["primary2"] : 1;
518 $ns_filter->noindex = ns_filter("blogpage", "statu");
519 $ns_filter->page_title = ns_filter("blogpage", "item3") . " - " . ns_filter("sitename");
520 $ns_filter->title = ns_filter("blogpage", "item3");
521 $ns_filter->icon = "fas fa-signature";
522 $ns_filter->description = ns_filter("blogpage", "item4");
523 $ns_filter->keywords = ns_filter("blogpage", "item5");
524 unset($get["primary1"]);
525 unset($get["primary2"]);
526 } else {
527 if (isset($get["primary2"]) && $get["primary1"] == "blog" && $icerik->primary($get["primary2"], "blog")) {
528 $ns_filter->change("blog", $icerik->select("nonethis"));
529 $ns_filter->include = "single-post";
530 $ns_filter->page_title = ns_filter("blog", "sayfa_seo_baslik") . " - " . ns_filter("sitename");
531 $ns_filter->title = ns_filter("blog", "sayfa_baslik");
532 $ns_filter->icon = "fas fa-signature";
533 $ns_filter->description = ns_filter("blog", "sayfa_aciklama");
534 $ns_filter->thumbimage = ns_filter("siteurl") . ns_filter("blog", "sayfa_icon");
535 unset($get["primary2"]);
536 unset($get["primary1"]);
537 }
538 }
539 }
540 if (isset($get["primary2"])) {
541 $siparis = !isset($siparis) ? new Siparis($db) : $siparis;
542 if (($get["primary1"] == $ayar->tamamlandipage || $get["primary1"] == $ayar->tamamlanamadipage) && $siparis->primary($get["primary2"])) {
543 $order = $siparis->select("row");
544 $order["sp_durum"] = $get["primary1"] == $ayar->tamamlandipage ? 1 : 0;
545 $ns_filter->change("siparis", "order");
546 $ns_filter->change("siparis", $order);
547 $ns_filter->include = "order-completed";
548 $pager = $get["primary1"] == $ayar->tamamlandipage ? "tamamlandipage" : "tamamlanamadipage";
549 $ns_filter->page_title = ns_filter($pager, "item3") . " - " . ns_filter("sitename");
550 $ns_filter->title = ns_filter($pager, "item3");
551 $ns_filter->noindex = ns_filter($pager, "statu");
552 $ns_filter->description = ns_filter($pager, "item4");
553 $ns_filter->keywords = "";
554 $ns_filter->change("header", ns_filter("header") . " " . ns_filter("tamamlandipage", "item5"));
555 $ns_filter->icon = $get["primary1"] == $ayar->tamamlandipage ? "fas fa-check" : "fas fa-exclamation-circle";
556 $siparis->durum($order["sp_durum"]);
557 unset($get["primary2"]);
558 unset($get["primary1"]);
559 $x1 = file_get_contents(ns_filter("siteurl") . "cron.php?tamamlandi=1");
560 }
561 }
562 if (isset($get["primary2"])) {
563 $platform = !isset($platform) ? new Platform($db) : $platform;
564 if ($ayar->permalink == "default" && $platform->primary($get["primary1"])) {
565 $kategori = !isset($kategori) ? new Kategori($db) : $kategori;
566 if ($kategori->primary($get["primary2"], $platform->pt_id)) {
567 $ns_filter->change("kategori", $kategori->select("nonethis"));
568 $platform->pt_id = ns_filter("kategori", "pt_tax");
569 $ns_filter->change("platform", $platform->select("nonethis"));
570 $paket->hz_tax = ns_filter("kategori", "hz_id");
571 $ns_filter->change("paketler", $paket->all(0, 100));
572 $ns_filter->include = "category";
573 $ns_filter->page_title = ns_filter("kategori", "hz_seo_adi") . " - " . ns_filter("sitename");
574 $ns_filter->title = ns_filter("platform", "pt_name") . " " . ns_filter("kategori", "hz_adi");
575 $ns_filter->icon = ns_filter("kategori", "hz_icon");
576 $ns_filter->description = ns_filter("kategori", "hz_text");
577 unset($get["primary2"]);
578 unset($get["primary1"]);
579 }
580 }
581 }
582 if (isset($get["primary2"])) {
583 unset($get["primary2"]);
584 unset($get["primary1"]);
585 }
586 if (isset($get["primary1"]) && isset($ayar->iletisimpage) && $get["primary1"] == $ayar->iletisimpage) {
587 $ns_filter->include = "contact";
588 $ns_filter->noindex = ns_filter("iletisimpage", "statu");
589 $ns_filter->page_title = ns_filter("iletisimpage", "item3") . " - " . ns_filter("sitename");
590 $ns_filter->title = ns_filter("iletisimpage", "item3");
591 $ns_filter->icon = "fas fa-envelope";
592 $ns_filter->description = ns_filter("iletisimpage", "item4");
593 $ns_filter->keywords = ns_filter("iletisimpage", "item5");
594 if (isset($post["contact-form"])) {
595 if (!ns_filter("recaptcha", "item5") || $ns_filter->recaptcha(ns_filter("recaptcha", "item3"), $_POST["g-recaptcha-response"])) {
596 $iletisim = isset($iletisim) ? $iletisim : new iletisim($db);
597 $iletisim->item = $post;
598 if ($iletisim->insert()) {
599 $succes = true;
600 $iletisim->select();
601 $user = isset($user) ? $user : new User($db);
602 $iletisim->MailSMSList("yeni");
603 } else {
604 $error = _e("İletişim isteğiniz alınırken bir hata oluştu. Lütfen tüm alanları eksiksiz doldurun", true) . ".";
605 }
606 } else {
607 if (ns_filter("recaptcha", "item5")) {
608 $error = _e("Güvenlik doğrulaması başarısız oldu. Lütfen recaptcha doğrulamasını gerçekleştirin", true) . "!";
609 } else {
610 $error = _e("Tüm alanları eksiksiz doldurmalısın", true);
611 }
612 }
613 $nonecache = true;
614 }
615 unset($get["primary1"]);
616 }
617 if (isset($get["primary1"])) {
618 $platform = !isset($platform) ? new Platform($db) : $platform;
619 if ($platform->primary($get["primary1"])) {
620 $ns_filter->change("platform", $platform->select("nonethis"));
621 $kategori->pt_tax = $platform->pt_id;
622 $ns_filter->change("kategoriler", $kategori->all(0, 100));
623 $ns_filter->include = "platform";
624 $ns_filter->title = ns_filter("platform", "pt_name");
625 $ns_filter->icon = ns_filter("platform", "pt_icon");
626 $ns_filter->page_title = ns_filter("platform", "pt_seo") . " - " . ns_filter("sitename");
627 $ns_filter->description = $platform->pt_text;
628 unset($get["primary1"]);
629 }
630 }
631 if (isset($get["primary1"])) {
632 $icerik = !isset($icerik) ? new icerik($db) : $icerik;
633 if ($icerik->primary($get["primary1"], "sayfa")) {
634 $ns_filter->include = "single-page";
635 $ns_filter->change("sayfa", $icerik->select("nonethis"));
636 $ns_filter->icon = "fas fa-paperclip";
637 $ns_filter->page_title = ns_filter("sayfa", "sayfa_seo_baslik") . " - " . ns_filter("sitename");
638 $ns_filter->title = ns_filter("sayfa", "sayfa_baslik");
639 $ns_filter->description = $ayar->description(ns_filter("sayfa", "sayfa_aciklama"));
640 unset($get["primary1"]);
641 }
642 }
643 if (isset($get["primary1"]) && $ayar->permalink == "seo" && $kategori->primary($get["primary1"])) {
644 $ns_filter->change("kategori", $kategori->select("nonethis"));
645 $platform->pt_id = ns_filter("kategori", "pt_tax");
646 $ns_filter->change("platform", $platform->select("nonethis"));
647 $paket->hz_tax = ns_filter("kategori", "hz_id");
648 $ns_filter->change("paketler", $paket->all(0, 100));
649 $ns_filter->include = "category";
650 $ns_filter->page_title = ns_filter("kategori", "hz_seo_adi") . " - " . ns_filter("sitename");
651 $ns_filter->title = ns_filter("platform", "pt_name") . " " . ns_filter("kategori", "hz_adi");
652 $ns_filter->icon = ns_filter("kategori", "hz_icon");
653 $ns_filter->description = ns_filter("kategori", "hz_text");
654 unset($get["primary1"]);
655 }
656 if (isset($get["primary1"]) && $get["primary1"] == "404") {
657 $ns_filter->include = "404";
658 $ns_filter->noindex = ns_filter("404page", "statu");
659 $ns_filter->page_title = ns_filter("404page", "item3") . " - " . ns_filter("sitename");
660 $ns_filter->title = ns_filter("404page", "item3");
661 $ns_filter->icon = "fas fa-exclamation-triangle";
662 $ns_filter->description = ns_filter("404page", "item4");
663 $ns_filter->keywords = ns_filter("404page", "item5");
664 $ns_filter->content = _e("Hizmetlere ulaşmak, hızlı sipariş verebilmek veya hakkımızda bilgiler almak isterseniz aşağıdaki butona tıklayarak anasayfaya gidebilirsiniz", true);
665 unset($get["primary1"]);
666 }
667 if (isset($post["action"]) && isset($post["include"]) && $post["include"] == "order_search" && 6 < strlen($post["sp_code"])) {
668 $siparis = isset($siparis) ? $siparis : new Siparis($db);
669 $siparis->primary(md5($post["sp_code"]));
670 if (isset($siparis->sp_id)) {
671 $ns_filter->change("order", $siparis->select("row"));
672 }
673 $nonecache = true;
674 }
675 if ($nsoft->detail("theme", $ayar->themes)) {
676 $ns_filter->change("theme_path", ns_filter("siteurl") . $nsoft->path);
677 $ns_filter->change("theme_function", $nsoft->path . "function.php");
678 $ns_filter->template_part = "part/" . $ns_filter->include . ".php";
679 foreach (ns_filter("plugins", "list") as $value) {
680 if ($value["statu"] && file_exists($nsoft->settings("plugin", $value["item2"]))) {
681 include $nsoft->settings("plugin", $value["item2"]);
682 } else {
683 if ($value["statu"]) {
684 $ayar->ayar_1 = $value["ayar_1"];
685 $ayar->delete();
686 }
687 }
688 }
689 include_once ns_filter("theme_function");
690 } else {
691 $ayar->select("themes");
692 $ayar->item2 = "default";
693 $ayar->update();
694 header("Refresh:0");
695 }
696 if (isset($cachedosyam) && !isset($nonecache)) {
697 touch($cachedosyam);
698 $dosya = $cachedosyam;
699 $ch = fopen($cachedosyam, "w");
700 fwrite($ch, ob_get_contents());
701 fclose($ch);
702 ob_end_flush();
703 }
704 }
705 }
706}
707class ns_filter
708{
709 public function change(&$tag, &$new, &$action = "", &$array = "")
710 {
711 if (!isset($this->{$tag})) {
712 $this->{$tag} = "";
713 }
714 if (empty($array)) {
715 if (empty($action)) {
716 $this->{$tag} = $new;
717 } else {
718 $this->{$tag} .= $new;
719 }
720 } else {
721 if ($array == "row") {
722 $this->{$tag} = $new;
723 } else {
724 if (empty($action)) {
725 $this->{$tag}[$array] = $new;
726 } else {
727 $easytoyou_decoder_beta_not_finish .= $new;
728 }
729 }
730 }
731 return "";
732 }
733 public function recaptcha(&$secret, &$response)
734 {
735 $captcha = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=" . $secret . "&response=" . $response);
736 $result = json_decode($captcha);
737 $this->result = $captcha;
738 return $result->success;
739 }
740}
741class Nivu
742{
743 private $con = "https://nivusoft.com/";
744 public function settings(&$product, &$primary)
745 {
746 if ($product == "theme") {
747 return "themes/" . $primary . "/function.php";
748 }
749 if ($product == "plugin") {
750 return "plugins/" . $primary . "/index.php";
751 }
752 }
753 public function detail(&$product, &$pri)
754 {
755 global $ns_filter;
756 if ($product == "theme") {
757 $this->path = "themes/" . $pri . "/";
758 $this->url = ns_filter("siteurl") . "themes/" . $pri . "/";
759 } else {
760 if ($product == "plugin") {
761 $this->path = "plugins/" . $pri . "/";
762 }
763 }
764 return true;
765 }
766 public function MAKontrol(&$lisans, &$product = "software", &$product_id = "1")
767 {
768 global $ayar;
769 if (strstr($ayar->siteurl, $this->servername()) && strstr($lisans, $this->createSecurity($product, $product_id))) {
770 return true;
771 }
772 global $user;
773 $post = ["product" => $product, "product_id" => $product_id, "domain" => $this->servername(), "module" => "control", "action" => "token", "version" => ns_filter("software_nivusosyal")];
774 $result = json_decode($this->connect($post), true);
775 if (empty($result["error"]) && isset($result["token"])) {
776 if ($product == "software") {
777 $ayar->select("scriptlisans");
778 $ayar->item2 = $result["token"];
779 $ayar->update();
780 header("Refresh:2");
781 $this->error = "Lisans doğrulama başarılı, Lisansınız güncelleniyor.";
782 exit($this->error);
783 }
784 if ($product == "modul") {
785 global $modulpath;
786 $filicense = fopen($modulpath . "/lisans.php", "w");
787 exit("Unable to open file!");
788 }
789 global $primary;
790 $filicense = fopen($product . "s/" . ns_filter("primary-" . $product . "-" . $product_id) . "/lisans.php", "w");
791 exit("Unable to open file!");
792 }
793 $this->error = $result["error"];
794 return false;
795 }
796 private function createSecurity(&$product, &$product_id)
797 {
798 $create = sha1(md5($product . $this->domain . $product_id . $product) . "NIVU-NIVU");
799 $create = substr($create, 13, 4) . "-" . substr($create, 1, 4) . "-" . substr($create, 5, 4) . "-" . substr($create, 11, 4) . "-" . substr($create, 9, 4);
800 $create = md5(sha1("NIVU-NIVU" . md5($product . $this->domain . $product_id)));
801 $create = substr($create, 28, 4) . "-" . substr($create, 1, 4) . "-" . substr($create, 5, 4) . "-" . substr($create, 11, 4) . "-" . substr($create, 9, 4);
802 return strtoupper($create);
803 }
804 public function update(&$product = "software", &$primary = "nivusosyal", &$product_id = 1)
805 {
806 global $ayar;
807 global $user;
808 $post = ["product" => $product, "product_id" => $product_id, "domain" => $this->servername(), "module" => "control", "action" => "token", "version" => ns_filter("software_nivusosyal")];
809 $result = json_decode($this->connect($post), true);
810 if (isset($this->data) && isset($this->data["file"])) {
811 $this->data["url"] = $this->con . "path/" . $this->data["file"] . "/";
812 $this->get_file();
813 if (file_exists($this->data["realpath"]) && $this->extract()) {
814 return true;
815 }
816 return false;
817 }
818 if (empty($result["error"]) && isset($result["version"])) {
819 $ayar->item2 = 0;
820 $this->update = $result["update"];
821 $ayar->select($product . "_" . $primary, "create");
822 if (empty($ayar->item2)) {
823 $ayar->item2 = 0;
824 $ayar->update();
825 }
826 $this->version = $ayar->select($product . "_" . $primary);
827 if ($this->version < $result["version"]) {
828 _up("software");
829 } else {
830 $this->statu = 1;
831 }
832 return true;
833 }
834 $this->error = !empty($result["error"]) ? $result["error"] : "Güncelleme kontrolü başarısız oldu. Lütfen daha sonra tekrar deneyin";
835 return false;
836 }
837 public function noti(&$lastid)
838 {
839 if (!isset($_SESSION["notis"])) {
840 $post = ["product" => "software", "product_id" => 1, "domain" => $this->servername(), "module" => "alert", "action" => $lastid, "version" => ns_filter("software_nivusosyal")];
841 $result = json_decode($this->connect($post), true);
842 if (empty($result["error"]) && isset($result["data"])) {
843 $_SESSION["notis"]["list"] = $result["data"];
844 $_SESSION["notis"]["count"] = $result["count"];
845 } else {
846 return [];
847 }
848 }
849 return $_SESSION["notis"];
850 }
851 public function active(&$product, &$pri)
852 {
853 global $ayar;
854 if ($product == "themes" && $ayar->select("themes") == $pri) {
855 $this->data = $ayar->item3;
856 return true;
857 }
858 if ($product == "plugins") {
859 foreach ($ayar->all("plugins") as $value) {
860 if ($value["item2"] == $pri && $value["statu"] == 1) {
861 $this->data = $value["item3"];
862 return true;
863 }
864 }
865 return false;
866 } else {
867 return false;
868 }
869 }
870 public function logina(&$code)
871 {
872 $post = ["product" => "software", "product_id" => "1", "domain" => $this->servername(), "module" => "logina", "action" => $code];
873 $result = json_decode($this->connect($post), true);
874 $this->products = [];
875 if (empty($result["error"]) && isset($result["row"])) {
876 return true;
877 }
878 return false;
879 }
880 public function all(&$product, &$type = "")
881 {
882 global $ayar;
883 global $user;
884 $post = ["product" => "software", "product_id" => "1", "domain" => $this->servername(), "module" => "liste", "action" => $product, "type" => $type, "version" => ns_filter("software_nivusosyal")];
885 $result = json_decode($this->connect($post), true);
886 $this->products = [];
887 if (empty($result["error"]) && isset($result["row"])) {
888 foreach ($result["row"] as $value) {
889 $this->products[] = $value;
890 }
891 }
892 $this->real = [];
893 $this->lists = [];
894 $this->my = [];
895 foreach ($this->pathlist($product . "s", $type) as $value) {
896 if (empty($type)) {
897 $path = $product . "s/" . $value;
898 } else {
899 if ($type == "payment") {
900 $path = "config/payment/" . $value;
901 } else {
902 if ($type == "language") {
903 $path = "config/language/" . $value;
904 }
905 }
906 }
907 if (file_exists($path . "/index.php")) {
908 require $path . "/index.php";
909 if (empty($type) && $this->active($product . "s", $value)) {
910 $value = [];
911 $value["active"] = true;
912 } else {
913 $value = [];
914 $value["active"] = false;
915 }
916 $value["name"] = isset($name) ? $name : "";
917 $value["primary"] = isset($primary) ? $primary : "";
918 $value["demo"] = isset($demo) ? $demo : "";
919 $value["screenshot"] = isset($screenshot) ? $screenshot : "";
920 $value["version"] = isset($version) ? $version : "";
921 $value["autor"] = isset($autor) ? $autor : "";
922 $value["description"] = isset($description) ? $description : "";
923 $value["statu"] = 1;
924 foreach ($this->products as $tema) {
925 if ($primary == $tema["primary"]) {
926 $value["statu"] = $tema["statu"];
927 if (!$value["active"] && 0 < $value["statu"]) {
928 $value["data-active"] = ["page" => $path, "olay" => "aktiflestir", "product" => $product, "primary" => $value["primary"], "path" => $path];
929 $value["data-delete"] = ["page" => $path, "olay" => "sil", "product" => $product, "primary" => $value["primary"], "path" => $path];
930 } else {
931 $value["data-deaktif"] = ["page" => $path, "olay" => "deaktif", "product" => $product, "primary" => $value["primary"], "path" => $path];
932 $value["data-delete"] = ["page" => $path, "olay" => "sil", "product" => $product, "primary" => $value["primary"], "path" => $path];
933 }
934 $this->real[] = $value;
935 }
936 }
937 }
938 }
939 foreach ($this->products as $value) {
940 if ($value["statu"] == 1) {
941 $value["my"] = true;
942 }
943 if (empty($type)) {
944 $page = $product . "s";
945 $path = $product . "s/" . $value["primary"];
946 } else {
947 if ($type == "language") {
948 $path = "config/language/" . $value["primary"];
949 $page = "genel-ayarlar";
950 } else {
951 if ($type == "payment") {
952 $path = "config/payment/" . $value["primary"];
953 $page = "odeme-ayarlari";
954 }
955 }
956 }
957 foreach ($this->real as $tema) {
958 if ($value["primary"] == $tema["primary"]) {
959 $value["file_exists"] = true;
960 if (0 < $value["statu"] && $tema["version"] < $value["version"]) {
961 _up($product);
962 $value["update"] = ["page" => $page, "olay" => "guncelleme", "product" => $product, "type" => $type, "primary" => $value["primary"], "path" => $path, "file" => $value["update"]["file"], "realpath" => $value["update"]["realpath"], "extract" => $value["update"]["extract"], "include" => $value["update"]["include"], "description" => $value["update"]["description"]];
963 } else {
964 if (0 < $value["statu"]) {
965 unset($value["update"]);
966 }
967 }
968 if (0 < $value["statu"]) {
969 $value["statu"] = 1;
970 }
971 if ($value["statu"] == 2 || $value["statu"] == 1 && !isset($value["file_exists"])) {
972 $value["statu"] = 2;
973 $value["update"] = ["page" => $page, "olay" => "yukleme", "product" => $product, "type" => $type, "primary" => $value["primary"], "path" => $path, "file" => $value["update"]["file"], "realpath" => $value["update"]["realpath"], "extract" => $value["update"]["extract"], "include" => $value["update"]["include"]];
974 }
975 if ($value["statu"] == 0) {
976 if (isset($value["update"])) {
977 unset($value["update"]);
978 }
979 $value["buy"] = ["page" => $page, "olay" => "satin-al", "product" => $product, "type" => $type, "primary" => $value["primary"], "token" => $value["order_token"]];
980 }
981 if (isset($value["my"])) {
982 $this->my[] = $value;
983 }
984 $this->lists[] = $value;
985 }
986 }
987 }
988 return true;
989 }
990 public function pathlist(&$product, &$type = "")
991 {
992 if (empty($type)) {
993 $dizin = opendir($product);
994 } else {
995 if ($type == "payment") {
996 $dizin = opendir("config/payment");
997 } else {
998 if ($type == "language") {
999 $dizin = opendir("config/language");
1000 }
1001 }
1002 }
1003 $this->list = [];
1004 while (!($dosya = readdir($dizin))) {
1005 if (!strstr($dosya, ".")) {
1006 $this->list[] = $dosya;
1007 }
1008 }
1009 return $this->list;
1010 }
1011 public function folderlist(&$folder)
1012 {
1013 $dizin = opendir($folder);
1014 $this->list = [];
1015 while (!($dosya = readdir($dizin))) {
1016 $allowed_file_types = ["jpg", "jpeg", "png", "gif"];
1017 if (in_array(explode(".", $dosya)[1], $allowed_file_types)) {
1018 $this->list[] = ["name" => $folder . "/" . $dosya, "time" => date("Y-m-d H:i:s", filemtime($folder . "/" . $dosya))];
1019 }
1020 }
1021 $tmpArray = [];
1022 foreach ($this->list as $key => $value) {
1023 $tmpArray[$key] = $value["time"];
1024 }
1025 array_multisort($tmpArray, SORT_DESC, $this->list);
1026 return $this->list;
1027 }
1028 private function servername()
1029 {
1030 $this->domain = getenv("SERVER_NAME");
1031 $this->domain = str_replace(["www.", "/", "https", ":", "http"], "", $this->domain);
1032 return $this->domain;
1033 }
1034 private function connect(&$post)
1035 {
1036 $_post = [];
1037 if (is_array($post)) {
1038 foreach ($post as $name => $value) {
1039 $_post[] = $name . "=" . $value;
1040 }
1041 }
1042 $ch = curl_init($this->con . "api/");
1043 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1044 curl_setopt($ch, CURLOPT_POST, 1);
1045 curl_setopt($ch, CURLOPT_HEADER, 0);
1046 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
1047 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
1048 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
1049 if (is_array($post)) {
1050 curl_setopt($ch, CURLOPT_POSTFIELDS, join("&", $_post));
1051 }
1052 curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
1053 curl_setopt($ch, CURLOPT_TIMEOUT, 5);
1054 $result = curl_exec($ch);
1055 if (curl_errno($ch) != 0 && empty($result)) {
1056 $result = false;
1057 }
1058 curl_close($ch);
1059 return $result;
1060 }
1061 private function get_file()
1062 {
1063 $curl = curl_init($this->data["url"]);
1064 $fopen = fopen($this->data["realpath"], "w");
1065 curl_setopt($curl, CURLOPT_HEADER, 0);
1066 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
1067 curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
1068 curl_setopt($curl, CURLOPT_FILE, $fopen);
1069 curl_exec($curl);
1070 curl_close($curl);
1071 fclose($fopen);
1072 }
1073 public function extract()
1074 {
1075 $zip = new ZipArchive();
1076 $res = $zip->open($this->data["realpath"]);
1077 if ($res === true) {
1078 $zip->extractTo(realpath(".") . $this->data["extract"]);
1079 $zip->close();
1080 unlink($this->data["realpath"]);
1081 return true;
1082 }
1083 return false;
1084 }
1085 public function zamanfarki(&$zaman = NULL)
1086 {
1087 if (empty($zaman)) {
1088 $zaman = $this->date;
1089 }
1090 list($tarih) = explode(" ", $zaman);
1091 list($saat) = explode(" ", $zaman);
1092 $saat = explode(":", $saat);
1093 $result = date("d F Y", strtotime($tarih)) . " / " . $saat[0] . ":" . $saat[1];
1094 if (mb_substr($result, 0, 1) == "0") {
1095 $result = mb_substr($result, 1);
1096 }
1097 $aylarIng = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
1098 $aylar = ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"];
1099 return str_replace($aylarIng, $aylar, $result);
1100 }
1101 public function delete(&$dir, &$one = true)
1102 {
1103 $dir = substr($dir, strlen($dir) - 1, 1) != "/" ? $dir . "/" : $dir;
1104 if ($handle = opendir($dir)) {
1105 while (!($obj = readdir($handle))) {
1106 if ($obj != "." && $obj != "..") {
1107 if (is_dir($dir . $obj)) {
1108 if (!$this->Delete($dir . $obj)) {
1109 return false;
1110 }
1111 } else {
1112 if (is_file($dir . $obj) && !unlink($dir . $obj)) {
1113 return false;
1114 }
1115 }
1116 }
1117 }
1118 closedir($handle);
1119 if ($one && !@rmdir($dir)) {
1120 return false;
1121 }
1122 return true;
1123 }
1124 return false;
1125 }
1126 public function passwordrefresh(&$uye)
1127 {
1128 global $ayar;
1129 return md5($uye["k_kadi"] . "-SIFRE-YENILE-" . $uye["k_statu"] . "-SIFRE-YENILE-" . $uye["k_sifre"] . "-AYAR-" . $ayar->siteurl . "-SIFRE-YENILE-" . date("Y-m-") . "21");
1130 }
1131}
1132function gzipKontrol()
1133{
1134 $kontrol = str_replace(" ", "", strtolower($_SERVER["HTTP_ACCEPT_ENCODING"]));
1135 $kontrol = explode(",", $kontrol);
1136 return in_array("gzip", $kontrol);
1137}
1138function bosluksil(&$kaynak)
1139{
1140 return preg_replace("/\\s+/", " ", $kaynak);
1141}
1142function NExpo(&$item)
1143{
1144 return explode("-4+4-", $item);
1145}
1146function dropshow(&$result, &$location = "")
1147{
1148 global $ayar;
1149 if (!isset($ayar->page)) {
1150 return "";
1151 }
1152 if ($result == "veri" && (empty($ayar->page) || $ayar->page == "main" || $ayar->page == "iletisim" || $ayar->page == "odemeler" || $ayar->page == "siparis" || $ayar->page == "siparisler")) {
1153 return "active show";
1154 }
1155 if (is_array($result)) {
1156 foreach ($result as $value) {
1157 if (strstr($ayar->page, $value)) {
1158 return "active show";
1159 }
1160 }
1161 }
1162 if (!is_array($result) && strstr($ayar->page, $result)) {
1163 return "active show";
1164 }
1165 return "";
1166}
1167function add_action(&$inc, &$page, &$function = "", &$action = "")
1168{
1169 global $ayar;
1170 global $ns_filter;
1171 global $nsoft;
1172 if (ns_filter("include_page") == $inc && $ayar->action == $page) {
1173 global $license;
1174 global $primary;
1175 $ns_filter->change($ayar->action . "_primary", $primary);
1176 $ns_filter->change($ayar->action . "_license", $license);
1177 $ns_filter->change("add_action", $function);
1178 } else {
1179 if ($inc == "admin_menu") {
1180 $content = ns_filter($inc);
1181 $content .= "<li><i class=\"fas fa-chevron-circle-right\"></i><a href=\"" . $ayar->getpage($page, $action) . "\"> " . $function . "</a></li>";
1182 $ns_filter->change($inc, $content);
1183 }
1184 }
1185}
1186function add_filter(&$inc, &$function)
1187{
1188 if (ns_filter("include_page") == $inc) {
1189 $function();
1190 }
1191}
1192function phpPress(&$kaynak)
1193{
1194 global $gzip_pres;
1195 $sayfa_cikti = bosluksil($kaynak);
1196 if (!gzipkontrol() || headers_sent() || !$gzip_pres) {
1197 return $sayfa_cikti;
1198 }
1199 header("Content-Encoding: gzip");
1200 return gzencode($sayfa_cikti);
1201}
1202function _p(&$u)
1203{
1204 global $ayar;
1205 return $ayar->currency_format($u);
1206}
1207function _permit(&$string)
1208{
1209 global $user;
1210 if (strstr($string, ",")) {
1211 foreach (explode(",", $string) as $value) {
1212 if (in_array($value, $user->permit)) {
1213 return true;
1214 }
1215 }
1216 return false;
1217 } else {
1218 return in_array($string, $user->permit);
1219 }
1220}
1221function lang_pri(&$text)
1222{
1223 $trHarf = ["’", "'", "|", "ñ", " ", "ß", "ä", ".", ",", "ş", "Ş", "ö", "Ö", "ğ", "Ğ", "ü", "Ü", "ç", "Ç", "ı", "İ", "'", "\"", "%", "é", "/", "?", "=", "(", ")", "_", ":", ";", "~", "¨", "<", ">", "£", "#", "\$", "½", "{", "}", "*", "!", "\\", "&", "^", "+"];
1224 $enHarf = ["-", "", "-", "n", "-", "b", "a", "", "", "s", "s", "o", "o", "g", "g", "u", "u", "c", "c", "i", "i", "-", "-", "-", "e", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-"];
1225 $text = str_replace($trHarf, $enHarf, $text);
1226 $text = str_replace("---", "-", $text);
1227 $text = str_replace("--", "-", $text);
1228 $text = strtolower($text);
1229 return htmlspecialchars(strip_tags(trim($text)));
1230}
1231function _e(&$text, &$re = NULL)
1232{
1233 global $language;
1234 global $lang_array;
1235 global $yoklar;
1236 $key = lang_pri($text);
1237 if (isset($lang_array[$key])) {
1238 $text = $lang_array[$key];
1239 }
1240 if ($re == NULL) {
1241 echo $text;
1242 }
1243 return $text;
1244}
1245function theme_path()
1246{
1247 echo ns_filter("theme_path");
1248}
1249function badge(&$name, &$color = "primary")
1250{
1251 if ($name == "yazilim-durumu") {
1252 global $ayar;
1253 if (!$ayar->select("software_nivusosyal", "statu")) {
1254 $count = 1;
1255 $badge = true;
1256 }
1257 }
1258 if (_up($name)) {
1259 echo "<span class=\"update-alert\" title=\"Yüklenmemiş Güncellemeler Var\"><i class=\"fas fa-exclamation-circle\"></i></span>";
1260 }
1261 if (isset($badge)) {
1262 echo "<span class=\"badge badge-" . $color . "\">" . $count . "</span>";
1263 }
1264}
1265function ns_filter(&$tag, &$action = "", &$function = "")
1266{
1267 global $ns_filter;
1268 global $ayar;
1269 if ($tag == "404") {
1270 $git = ns_filter("siteurl") . "404/";
1271 exit(header("Location:" . $git));
1272 }
1273 if ($tag == "include_page") {
1274 if (isset($ayar->page)) {
1275 return $ayar->page;
1276 }
1277 if (isset($ns_filter->include)) {
1278 return $ns_filter->include;
1279 }
1280 } else {
1281 if (empty($action) && $tag != "include" && ($action = "item2")) {
1282 if (isset($ayar->{$tag}) || isset($ns_filter->{$tag}) && is_array($ns_filter->{$tag})) {
1283 if (isset($ns_filter->{$tag}) && is_array($ns_filter->{$tag})) {
1284 return isset($ns_filter->{$tag}[$action]) ? $ns_filter->{$tag}[$action] : $ns_filter->{$tag};
1285 }
1286 $ns_filter->change($tag, $ayar->{$tag});
1287 }
1288 return isset($ns_filter->{$tag}) ? $ns_filter->{$tag} : "";
1289 }
1290 if ($tag == "include") {
1291 return $ns_filter->{$tag};
1292 }
1293 if ($action == "get") {
1294 return $tag . ".php";
1295 }
1296 if ($action == "row") {
1297 if (!isset($ns_filter->{$tag}) || !is_array($ns_filter->{$tag})) {
1298 $sonuc = $ayar->select($tag, "row");
1299 if (isset($sonuc["item2"])) {
1300 $ns_filter->change($tag, $sonuc);
1301 } else {
1302 $ns_filter->change($tag, "", "", $action);
1303 }
1304 }
1305 return $ns_filter->{$tag};
1306 }
1307 if ($action == "list") {
1308 if (isset($ns_filter->{$tag}) && is_array($ns_filter->{$tag})) {
1309 return $ns_filter->{$tag};
1310 }
1311 $sonuc = $ayar->all($tag);
1312 $ns_filter->change($tag, $sonuc);
1313 return isset($ns_filter->{$tag}) ? $ns_filter->{$tag} : [];
1314 }
1315 if ($action == "for") {
1316 return $ns_filter->{$tag};
1317 }
1318 }
1319 if (!isset($ns_filter->{$tag}[$action])) {
1320 if (!isset($ns_filter->{$tag}) || !is_array($ns_filter->{$tag})) {
1321 $sonuc = $ayar->select($tag, "row");
1322 if (isset($sonuc["item2"])) {
1323 $ns_filter->change($tag, $sonuc);
1324 } else {
1325 $ns_filter->change($tag, "", "", $action);
1326 }
1327 }
1328 return isset($ns_filter->{$tag}[$action]) ? $ns_filter->{$tag}[$action] : "";
1329 }
1330 if (!empty($function)) {
1331 $function();
1332 }
1333 return $ns_filter->{$tag}[$action];
1334}
1335
1336?>