NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

<?php ob_start();
session_start();
if(!isset($_SESSION["login"])){
header("Location: error.php");
}

require('../static/header_admin.php'); ?>

<div class="row border">
<div class="col-md-9 col-sm-9 col-xs-12">

<div class="icerik">
<h3>Ziyaretçi Defteri</h3>
<hr>
<h2>Ziyaretçilerin yolladığı mesajlar</h2>

<table class="table table-bordered" style="background:#fff;">
<thead>
<tr>
<th>Ad</th>
<th>E-posta</th>
<th>Tarih / Saat</th>
</tr>
<tr>
<th>Mesaj</th>
<th>İşlem</th>
<th>Onay Durumu</th>
</tr>
</thead>
<tbody>

<?php

if($_GET)
{
@$id=trim(@$_GET['sil']);
@$onayla=trim(@$_GET['onayla']);
if(!is_null($id) and is_numeric($id) and !empty($id))
{
$db = new PDO("mysql:host=localhost;dbname=musa;charset=utf8", "root", "");
$query = $db->prepare("DELETE FROM ziy_def WHERE id = :id");
$delete = $query->execute(array(
'id' => $id
));

if($delete)
{
echo "<div class='alert alert-success'>Silme işlemi başarılı.</div>";
}
else{
echo "<div class='alert alert-danger'>Silme işlemi başarısız!</div>";
}
}



if(!is_null($onayla) and is_numeric($onayla) and !empty($onayla))
{

$db = new PDO("mysql:host=localhost;dbname=musa;charset=utf8", "root", "");
$db->query("SET CHARACTER SET utf8");


$query = $db->prepare("UPDATE ziy_def SET
onay = :onayla
WHERE id=".$onayla."");
$update = $query->execute(array(
"onayla" => 1,

));

if ( $update ){

echo "<div class='alert alert-success'>Mesaj onaylandı, ziyaretçi defteri sayfasında gözükecek.</div>";
}
else
{
echo "<div class='alert alert-danger'>Mesaj onaylama işlemi başarısız!</div>";
}


}

}

$db = new PDO("mysql:host=localhost;dbname=musa;charset=utf8", "root", "");
$db->query("SET CHARACTER SET utf8");
$query = $db->query("SELECT * FROM ziy_def", PDO::FETCH_ASSOC);

if ( $query->rowCount() > 0 ){
foreach( $query as $row ){
$date = new DateTime($row['tarih_saat']);
$date = $date->format('d-m-Y H:i:s');
echo " <tr>
<td>".$row['ad']."</td>
<td>".$row['e_mail']."</td>
<td>".$date."</td></tr>
<tr><td>".$row['mesaj']."</td> ";
if($row['onay'])
{
echo "<td>
<a href='?sil=".$row['id']."' class='btn btn-danger'>Sil</a></td>
<td><button class='btn btn-success'>Onaylandı</button></td>";

}
else{
echo "<td><a href='?onayla=".$row['id']."' class='btn btn-success'>Onayla</a>
<a href='?sil=".$row['id']."' class='btn btn-danger'>Sil</a></td>
<td><button class='btn btn-danger'>Onaylanmadı</button></td>";
}
echo "</tr>";

}
}







?>


</tbody>
</table>
</div>
</div>


<div class="col-md-3 col-sm-3 col-xs-12">
<?php require('../static/nav_admin.php'); ?>
</div>
<footer>

<div class="col-md-12 alt_bilgi" style="padding: 0;">
<?php require('../static/footer_admin.php'); ?>
</div>
</footer>

<script type="text/javascript">

$(document).ready(function($) {
$('#up').click(function() {
$('html,body').animate({scrollTop:0}, '2000');
});

$('#down').click(function() {
var height=$('body').innerHeight();

$('html,body').animate({scrollTop:height}, '2000');
});


});
</script>
</body>
</html>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.