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/myorumlarekle.php
Size15.79 kb
Permissionrw-r--r--
Owner
Create time02-Mar-2025 05:46
Last modified27-Dec-2021 14:18
Last accessed05-Apr-2025 10:01
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/myorumlar";

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);


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 = $_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'];
$dil = $_SESSION['dil'];
$sira = $_POST['sira'];
$veriekle = $DB->prepare("insert into myorumlar set baslik=?, metin=?, seo=?, resim=?, stitle=?, sseo=?, sdurum=?, durum=?, ingbaslik=?, ingmetin=?, albaslik=?, almetin=?, rusbaslik=?, rusmetin=?, tarih=?, hit=?, ititle=?, iseo=?, dil=?, sira=?");
$veriekle->execute(array($baslik,$metin,$seo,$yeniad,$stitle,$sseo,$sdurum,$durum,$ingbaslik,$ingmetin,$albaslik,$almetin,$rusbaslik,$rusmetin,$tarih,$hit,$ititle,$iseo,$dil,$sira));



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,'myorumlar',$id));
}
unset($_SESSION["tümresimler"]);

$not = '<div class="alert alert-success">
<button class="close" data-dismiss="success"><i class="pci-cross pci-circle"></i></button>
<strong>Tebrikler!</strong> Başarıyla Yorum eklediniz.
</div>' ;
}else{
$not = '<div class="alert alert-success">
<button class="close" data-dismiss="success"><i class="pci-cross pci-circle"></i></button>
<strong>Tebrikler!</strong> Başarıyla Yorum eklediniz.
</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/myorumlar";




$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 = $_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");
$dil = $_SESSION['dil'];
$sira = $_POST['sira'];

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);

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

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

}else{

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

if ($ekleme) {

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

$not = '<div class="alert alert-warning">
<button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button>
<strong>Güncellendi !</strong> Yorumu Başarıyla Güncellediniz.
<div></div></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 myorumlar 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>
Müşteri Yorumu
</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="myorumlar.html"> Müşteri Yorumu</a></li>
<li class="breadcrumb-item active">Yorum 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">
<input type="hidden" name="hit" value="1">
</br>
<div class="form-group">
<h5>Yorum Sırası ( En öne almak için en yüksek rakamı veriniz )</h5>
<div class="controls">
<input type="text" class="form-control" value="<?php echo $verial['sira']; ?>" name="sira">
</div>
</div>
<div class="form-group">
<h5>Adı Soyadı</h5>
<div class="controls">
<input type="text" class="form-control" value="<?php echo $verial['baslik']; ?>" name="baslik">
</div>
</div>

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


<div class="form-group">
<h5>Genel Resim</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/myorumlar/<?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>


<div class="form-group">
<h5>Bırakılan Yorum</h5>
<div class="controls">
<textarea name="metin" class="form-control" id="summernote" rows="10" cols="30"><?php echo $verial['metin']; ?></textarea>
</div>
</div>


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









</div>
</div>











</div>










<div class="tab-pane pad" id="messages1" role="tabpanel">


<div class="form-group">
<h5>Haber Titlesi</h5>
<div class="controls">
<input type="text" class="form-control" value="<?php echo $verial['stitle']; ?>" name="stitle">
</div>
</div>


<div class="form-group">
<h5>Haber Anahtar Kelimeleri</h5>
<div class="controls">
<input type="text" class="form-control" value="<?php echo $verial['sseo']; ?>" name="sseo" data-role="tagsinput">
</div>
</div>


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






</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-->