-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfonksiyonlar.php
98 lines (81 loc) · 2.66 KB
/
fonksiyonlar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
date_default_timezone_set('Europe/Istanbul');
function turkce($isim) {
$isim = trim($isim);
$search = array('Ç','ç','Ğ','ğ','ı','İ','Ö','ö','Ş','ş','Ü','ü',' ');
$replace = array('c','c','g','g','i','i','o','o','s','s','u','u','-');
$isim_fin = str_replace($search,$replace,$isim);
$yenisim = mb_strtolower($isim_fin, 'utf8');
return $yenisim;
};
function guvenlik($gelen){
//$giden = addslashes($gelen);
$giden = htmlspecialchars($gelen);
//$giden = htmlentities($giden);
$giden = strip_tags($giden);
return $giden;
};
function fileupload($gelenisim,$id,$db,$size,$plaka)
{
include_once 'islemler/class-upload.php';
$files = array();
foreach ($gelenisim as $k => $l) {
foreach ($l as $i => $v) {
if (!array_key_exists($i, $files))
$files[$i] = array();
$files[$i][$k] = $v;
}
}
foreach ($files as $file){
$handle = new Upload($file);
if ($handle->uploaded) {
$tarih=date('d-m-Y-H-i-s');
$handle->file_max_size="$size";
$handle->file_name_body_pre=$id."-".$plaka."-".$tarih."-";
$type=$handle->file_src_name_ext;
$tmp_dosyaismi=turkce($handle->file_src_name_body);
$handle->file_new_name_body=$tmp_dosyaismi;
$dosyaturu=$handle->file_src_name_ext;
$handle->Process("../img");
$dosyaismi=$handle->file_dst_name;
if ($handle->processed) {
$dosyayukle=$db->prepare("INSERT INTO islem_dosya SET
islem_id=:islem_id,
dosya_yolu=:dosya_yolu
");
$yukle=$dosyayukle->execute(array(
'islem_id' => $id,
'dosya_yolu' => $dosyaismi
));
} else {
$_SESSION['hata']=$handle->error;
//setcookie("error", $handle->error, time() - 3600);
return "hata";
}
$handle-> Clean();
} else {
$_SESSION['hata']=$handle->error;
//setcookie("error", $handle->error, time() - 3600);
return "hata";
}
}
}
function oturumkontrol()
{
if (empty($_SESSION['kul_mail']) OR empty($_SESSION['kul_id'])) {
session_destroy();
header("location:login.php");
exit;
}
}
function fnk(){
echo '<footer class="sticky-footer bg-white">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span>Copyright © 2019 Bu site <a class="btn-link" href="https://www.ihsankeskin.org" rel="follow" title="ihsan keskin">"İhsan Keskin"</a> tarafından hazırlanmıştır ve <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/deed.tr"> Creative Commons Lisansı</a> ile lisanslanmıştır. <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/deed.tr"><img alt="Creative Commons Lisansı" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png"></a>
</span>
</div>
</div>
</footer>';
}
?>