-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfaturalar-faturakapat.php
49 lines (40 loc) · 1.18 KB
/
faturalar-faturakapat.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
<?php
session_start();
if((!isset($_SESSION["login"]))||($_SESSION["yetki"]=="0")){
?>
<meta http-equiv="refresh" content="0;URL=giris.php">
<?php
} else
{
?>
<!-- GİRİŞ KONTROL -->
<?php include("header.php") ?>
<?php include("kontrol/veritabani.php") ?>
<section id="content">
<?php
$id=$_GET['id'];
$faturacek=$connection->query("select * from faturalar where id='$id'")->fetchAll(PDO::FETCH_ASSOC);
foreach ($faturacek as $fcek)
{
if($fcek['durum']=='0' || $fcek['durum']=='2')
{
$ayarguncelle=$connection->query("UPDATE faturalar set faturaKapatan='".$_SESSION['girenid']."',kapatmaTarihi='".date("Y-m-d")."' where id='$id'") or die ("Bir Hata Oluştu");
$ayarguncelle1=$connection->query("UPDATE faturalar set durum='1' where id='$id'") or die ("Bir Hata Oluştu");
echo" <meta http-equiv=\"refresh\" content=\"0;url=faturalar.php?faturakapatildi=1\"> ";
}
else
{
echo" <meta http-equiv=\"refresh\" content=\"0;url=faturalar.php?faturakapatildi=0\"> ";
}
}
if($ayarguncelle){
$durum="<h2>İşlem Başarılı</h2>";
}else{
$durum="<h2>Hiç veri girmediniz..</h2>";
}
echo"$durum";
?>
</section>
<!-- GİRİŞ KONTROL -->
<?php include("footer.php"); ?>
<?php } ?>