HOME SHELL

NULLCOMMUNITY
 LiteSpeed
 Linux server2.poyrazhosting.com 3.10.0-962.3.2.lve1.5.77.el7.x86_64 #1 SMP Mon Dec 12 07:06:14 EST 2022 x86_64
 safemode : OFF
 MySQL: OFF | Perl: OFF | cURL: ON | WGet: OFF
  >  / home / cuneytsener53 / kurumsal41.snrsoft.com.tr / yonetim /

Server Ip : 104.21.78.54




Filename/home/cuneytsener53/kurumsal41.snrsoft.com.tr/yonetim/dillerekle.php
Size19.91 kb
Permissionrw-r--r--
Owner
Create time02-Mar-2025 05:46
Last modified27-Dec-2021 14:18
Last accessed05-Apr-2025 10:16
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
<?php

class SimpleImage {

var $image;
var $image_type;

function load($filename) {

$image_info = getimagesize($filename);
$this->image_type = $image_info[2];
if( $this->image_type == IMAGETYPE_JPEG ) {

$this->image = imagecreatefromjpeg($filename);
} elseif( $this->image_type == IMAGETYPE_GIF ) {

$this->image = imagecreatefromgif($filename);
} elseif( $this->image_type == IMAGETYPE_PNG ) {

$this->image = imagecreatefrompng($filename);
}
}
function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) {

if( $image_type == IMAGETYPE_JPEG ) {
imagejpeg($this->image,$filename,$compression);
} elseif( $image_type == IMAGETYPE_GIF ) {

imagegif($this->image,$filename);
} elseif( $image_type == IMAGETYPE_PNG ) {

imagepng($this->image,$filename);
}
if( $permissions != null) {

chmod($filename,$permissions);
}
}
function output($image_type=IMAGETYPE_JPEG) {

if( $image_type == IMAGETYPE_JPEG ) {
imagejpeg($this->image);
} elseif( $image_type == IMAGETYPE_GIF ) {

imagegif($this->image);
} elseif( $image_type == IMAGETYPE_PNG ) {

imagepng($this->image);
}
}
function getWidth() {

return imagesx($this->image);
}
function getHeight() {

return imagesy($this->image);
}
function resizeToHeight($height) {

$ratio = $height / $this->getHeight();
$width = $this->getWidth() * $ratio;
$this->resize($width,$height);
}

function resizeToWidth($width) {
$ratio = $width / $this->getWidth();
$height = $this->getheight() * $ratio;
$this->resize($width,$height);
}

function scale($scale) {
$width = $this->getWidth() * $scale/100;
$height = $this->getheight() * $scale/100;
$this->resize($width,$height);
}

function resize($width,$height) {
$new_image = imagecreatetruecolor($width, $height);
imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());
$this->image = $new_image;
}

}



if($_POST['baslik'] && $_GET['ok']=="")
{
$resimkonum = $_FILES['resim']['tmp_name'];
$resimad = $_FILES['resim']['name'];
$resimtip = $_FILES['resim']['type'];
$uzanti = substr($resimad, -5,5);
$yeniad = md5(time($resimad)).$uzanti;
$yol = "../images/diller";

$dosyakonum = $_FILES['video']['tmp_name'];
$dosyaad = $_FILES['video']['name'];
$dosyatip = $_FILES['video']['type'];
$dosyauzanti = substr($dosyaad, -5,5);
$dosya = md5(time($dosyaad)).$dosyauzanti;
$dosyayol = "../images/diller";








$dosyakonum = $_FILES['video']['tmp_name'];
$dosyaad = $_FILES['video']['name'];
$dosyatip = $_FILES['video']['type'];
$uzanti = substr($dosyaad, -5,5);
$dosya = md5(time($dosyaad)).$uzanti;
$yol = "../images/diller";
if(strpos($uzanti,"mp4")) {
$id = $DB->lastInsertId();

$veriekle = $DB->prepare("update diller set video=? where id=?");
$veriekle->execute(array($dosyaad,$id));
$veriekle = move_uploaded_file($dosyakonum, $yol.'/'.$dosyaad);





} else {


$not = '
<div class="alert alert-danger">
<button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button>
<strong>Lütfen !</strong> MP4 uzantılı video yükleyiniz ....
</div>
';
}






if($resimtip != 'image/jpeg' && $resimtip != 'image/png' && $uzanti != '.jpg' && $uzanti != '.png' && $uzanti != '.jpeg'){
$not = ' <div class="alert alert-danger">
<button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button>
<strong>Lütfen !</strong> Jpg ve Png uzantılı resim yükleyiniz ....
</div>' ;
}else{

$ekle = move_uploaded_file($resimkonum, $yol.'/'.$yeniad);
$image = new SimpleImage();
$image->load("../images/diller/".$yeniad);
$image->resize(848,500);
$image->save('../images/diller/thumb-'.$yeniad);

if ($ekle) {

$baslik = $_POST['baslik'];
$metin = $_POST['metin'];
$seo = seo($baslik);
$stitle = $_POST['stitle'];
$sseo = $_POST['sseo'];
$sdurum = $_POST['sdurum'];
$durum = $_POST['durum'];
$ingbaslik = $_POST['ingbaslik'];
$ingmetin = stripslashes($_POST["ingmetin"]);
$albaslik = $_POST['albaslik'];
$almetin = $_POST['almetin'];
$rusbaslik = $_POST['rusbaslik'];
$rusmetin = $_POST['rusmetin'];
$tarih = date("d-m-Y H:i:s");
$hit = $_POST['hit'];
$ititle = $_POST['ititle'];
$iseo = $_POST['iseo'];
$veriekle = $DB->prepare("insert into diller set baslik=?, metin=?, seo=?, resim=?, stitle=?, sseo=?, sdurum=?, durum=?, ingbaslik=?, ingmetin=?, albaslik=?, almetin=?, rusbaslik=?, rusmetin=?, tarih=?, hit=?, ititle=?, iseo=?");
$veriekle->execute(array($baslik,$metin,$seo,$yeniad,$stitle,$sseo,$sdurum,$durum,$ingbaslik,$ingmetin,$albaslik,$almetin,$rusbaslik,$rusmetin,$tarih,$hit,$ititle,$iseo));
touch("../dil/".$metin.".php");
file_put_contents("../dil/".$metin.".php",$ingmetin);



if($ekle){
$id = $DB->lastInsertId();
foreach ($_SESSION["tümresimler"] as $r) {

$ekle = $DB->prepare("insert into sayfa_resim set sayfaresim=?, konu=?, resim_id=?");
$ekle->execute(array($r,'diller',$id));
}
unset($_SESSION["tümresimler"]);

$not = '
<div class="alert alert-success">
<button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button>
<strong>Tebrikler!</strong> Başarıyla Dil oluşturdunuz.
</div>


';
}else{
$not = ' <div class="alert alert-success">
<button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button>
<strong>Tebrikler!</strong> Başarıyla Dil oluşturdunuz.
</div>
' ;
}
}
}
}

// Veri Güncelleme İşlemi...

if($_POST['baslik'] && $_GET['ok']=="gn")
{
$id = intval($_GET['id']);
$resimkonum = $_FILES['resim']['tmp_name'];
$resimad = $_FILES['resim']['name'];
$resimtip = $_FILES['resim']['type'];
$uzanti = substr($resimad, -5,5);
$yeniad = md5(time($resimad)).$uzanti;
$yol = "../images/diller";




$dosyakonum = $_FILES['video']['tmp_name'];
$dosyaad = $_FILES['video']['name'];
$dosyatip = $_FILES['video']['type'];
$uzanti = substr($dosyaad, -5,5);
$dosya = md5(time($dosyaad)).$uzanti;
$yol = "../images/diller";
if(strpos($uzanti,"mp4")) {
$id = $_GET['id'] ;

$veriekle = $DB->prepare("update diller set video=? where id=?");
$veriekle->execute(array($dosyaad,$id));
$veriekle = move_uploaded_file($dosyakonum, $yol.'/'.$dosyaad);





} else {


$not = '
<div class="alert alert-danger">
<button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button>
<strong>Lütfen !</strong> MP4 uzantılı video yükleyiniz ....
</div>
';
}





$baslik = $_POST['baslik'];
$metin = $_POST['metin'];
$seo = seo($baslik);
$stitle = $_POST['stitle'];
$sseo = $_POST['sseo'];
$sdurum = $_POST['sdurum'];
$durum = $_POST['durum'];
$ingbaslik = $_POST['ingbaslik'];
$ingmetin = stripslashes($_POST["ingmetin"]);
$albaslik = $_POST['albaslik'];
$almetin = $_POST['almetin'];
$rusbaslik = $_POST['rusbaslik'];
$rusmetin = $_POST['rusmetin'];
$ititle = $_POST['ititle'];
$iseo = $_POST['iseo'];
$tarih = date("d-m-Y H:i:s");







if (!empty($_FILES['resim']['name'])) {

if($resimtip != 'image/jpeg' && $resimtip != 'image/png' && $uzanti != '.jpg' && $uzanti != '.png' && $uzanti != '.jpeg'){
$not = '

<div class="alert alert-danger">
<button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button>
<strong>Lütfen !</strong> Jpg ve Png uzantılı resim yükleyiniz ....
</div>

' ;
}else{
$ekle = move_uploaded_file($resimkonum, $yol.'/'.$yeniad);
$image = new SimpleImage();
$image->load("../images/diller/".$yeniad);
$image->resize(848,500);
$image->save('../images/diller/thumb-'.$yeniad);

$ekleme = $DB->prepare("update diller set baslik=?, metin=?, seo=?, resim=?, stitle=?, sseo=?, sdurum=?, durum=?, ingbaslik=?, ingmetin=?, albaslik=?, almetin=?, rusbaslik=?, rusmetin=?, ititle=?, iseo=? where id=$id ");
$ekleme->execute(array($baslik,$metin,$seo,$yeniad,$stitle,$sseo,$sdurum,$durum,$ingbaslik,$ingmetin,$albaslik,$almetin,$rusbaslik,$rusmetin,$ititle,$iseo));

file_put_contents("../dil/".$metin.".php",$ingmetin);


}
if ($ekleme) {

$not = ' <div class="alert alert-success">
<button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button>
<strong>Güncellendi!</strong> Başarıyla Dili güncellediniz.
</div> ';
}

}else{

$ekleme = $DB->prepare("update diller set baslik=?, metin=?, seo=?, stitle=?, sseo=?, sdurum=?, durum=?, ingbaslik=?, ingmetin=?, albaslik=?, almetin=?, rusbaslik=?, rusmetin=?, ititle=?, iseo=? where id=$id ");
$ekleme->execute(array($baslik,$metin,$seo,$stitle,$sseo,$sdurum,$durum,$ingbaslik,$ingmetin,$albaslik,$almetin,$rusbaslik,$rusmetin,$ititle,$iseo));
file_put_contents("../dil/".$metin.".php",$ingmetin);
if ($ekleme) {

foreach ($_SESSION["tümresimler"] as $r) {
$ekle = $DB->prepare("insert into sayfa_resim set sayfaresim=?, konu=?, resim_id=?");
$ekle->execute(array($r,'diller',$id));
}
unset($_SESSION["tümresimler"]);

$not = '<div class="alert alert-success">
<button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button>
<strong>Güncellendi!</strong> Başarıyla Dili güncellediniz.
</div>
' ;
}else{
$not = ' <div class="alert alert-danger">
<button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button>
<strong>Hata !</strong> Bir hata oluştu tekrar deneyiniz.
</div>
' ;
}
}

}




if($_GET['ok']=="gn")
{
$id = intval($_GET['id']);
$verial = $DB->query("select * from diller where id=$id")->fetch(PDO::FETCH_ASSOC);

}




if(isset($_GET["yes"]) && $_GET['yes'] == "del" && isset($_GET["sid"])) {
$sid = intval($_GET['sid']);
$verisil = $DB->prepare("delete from sayfa_resim where id='$sid'");
$verisil->execute(array($id));

if ($verisil) {

$not = ' <div class="alert alert-warning">
<button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button>
<strong>SİLİNDİ !</strong> Diğer Resim Silindi ....
</div>' ;
}

}


?>

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Sistem Dilleri
</h1>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html"><i class="fa fa-home"></i> Anasayfa</a></li>
<li class="breadcrumb-item"><a href="diller.html"> Sistem Dilleri</a></li>
<li class="breadcrumb-item active">Dil Ekle</li>
</ol>
<?=$not?>
</section>

<!-- Main content -->
<section class="content">

<div class="row">
<div class="col-12">

<div class="box box-default">

<!-- /.box-header -->
<div class="box-body">

<form class="form-horizontal" action="#" method="post" enctype="multipart/form-data">
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active show" id="home1" role="tabpanel">

</br>

<div class="form-group">
<h5>Dil Adı</h5>
<div class="controls">
<input type="text" class="form-control" value="<?php echo $verial['baslik']; ?>" name="baslik">
</div>
</div>


<div class="form-group">
<h5>Dil Kısaltılmış Adı</h5>
<div class="controls">
<input type="text" class="form-control" value="<?php echo $verial['metin']; ?>" name="metin">
</div>
</div>


<div class="form-group">
<h5>Dil İkonu</h5>
<div class="controls">
<div class="fileupload fileupload-new" data-provides="fileupload">
<div class="fileupload-new thumbnail" style="width: 200px; height: 150px;">
<?php if($_GET['ok']=="gn"){?>
<img src="../images/diller/<?php echo $verial['resim']; ?>" style="width: 200px; height: 200px;" alt="" />
<?php } else { ?>
<img src="img/anaresimyok.jpg" alt="" />
<?php }?>
</div>
<div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div>
<div>
<span class="btn btn-default btn-file">
<span class="fileupload-new"><i class="fa fa-paper-clip"></i> Resim Seç</span>
<span class="fileupload-exists"><i class="fa fa-undo"></i> Değiştir</span>
<input name="resim" type="file" class="default" />
</span>
<a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload"><i class="fa fa-trash"></i> Sil</a>
</div>
</div>













<?php if($_GET['ok']=="gn"){?>
<div class="form-group">
<h5>Dil Durumu</h5>
<div class="controls">
<input value="1" <?php if($verial['durum'] == '1') {?> checked="" <?php } ?>
name="durum" data-toggle="toggle" type="checkbox">
</div>
</div>
<?php }else{?>
<div class="form-group">
<h5>Dil Durumu</h5>
<div class="controls">
<input type="checkbox" name="durum" value="1" checked="" data-toggle="toggle">
</div>
</div>
<?php }?>




<?php if($_GET['ok']=="gn"){?>

<div class="form-group">

<div style="width:100%;">
<textarea class="form-control" rows="20" id="kod_duzenle" name="ingmetin"><?=@file_get_contents("../dil/".$verial["metin"].".php");?></textarea>
</div>
</div>

<?php }else{?>


<div class="form-group">

<div style="width:100%;">
<textarea class="form-control" rows="20" id="kod_duzenle" name="ingmetin"><?=@file_get_contents("../dil/tr.php");?></textarea>
</div>
</div>

<?php }?>

<div class="form-group">
<h5>Slider Videosu</h5>
<div class="controls">
<div class="fileupload fileupload-new" data-provides="fileupload">
<div class="fileupload-new thumbnail" style="width: 200px; height: 150px;">
<?php if($_GET['ok']=="gn"){?>
<img src="../images/diller/<?php echo $verial['video']; ?>" style="width: 200px; height: 200px;" alt="" />
<?php } else { ?>
<img src="img/anaresimyok.jpg" alt="" />
<?php }?>
</div>
<div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div>
<div>
<span class="btn btn-default btn-file">
<span class="fileupload-new"><i class="fa fa-paper-clip"></i> Video Seç</span>
<span class="fileupload-exists"><i class="fa fa-undo"></i> Değiştir</span>
<input name="video" type="file" class="default" />
</span>
<a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload"><i class="fa fa-trash"></i> Sil</a>
</div>
</div>







<div class="form-group">
<h5>Bakım Modu Metni</h5>
<div class="controls">
<textarea name="albaslik" class="form-control" id="summernote" rows="10" cols="30"><?php echo $verial['albaslik']; ?></textarea>
</div>
</div>



<?php if($_GET['ok']=="gn"){?>
<button type="submit" id="button3" class="btn btn-block btn-success">Güncelle</button>
<?php }else{?>
<button type="submit" id="button3" class="btn btn-block btn-warning">Kaydet</button>
<?php } ?>







</div>
</form>
</div>
<!-- /.box-body -->
</div>



</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<!-- include summernote css/js-->

<link href="jss/codemirror.css" rel="stylesheet" type="text/css" />
<link href="jss/neat.css" rel="stylesheet" type="text/css" />
<link href="jss/material.css" rel="stylesheet" type="text/css" />

<script src="jss/codemirror.js" type="text/javascript"></script>
<script src="jss/matchbrackets.js" type="text/javascript"></script>
<script src="jss/htmlmixed.js" type="text/javascript"></script>
<script src="jss/xml.js" type="text/javascript"></script>
<script src="jss/javascript.js" type="text/javascript"></script>
<script src="jss/css.js" type="text/javascript"></script>
<script src="jss/clike.js" type="text/javascript"></script>
<script src="jss/php.js" type="text/javascript"></script>

<style>
.CodeMirror {
height: 2500px;
max-width:100%;
}
</style>
<script type="text/javascript">
var myTextarea = document.getElementById('kod_duzenle');
var editor = CodeMirror.fromTextArea(myTextarea, {
lineNumbers: true,
matchBrackets: true,
mode: "text/x-php",
indentUnit: 4,
indentWithTabs: true,
theme : "material"
});
</script>