Location: PHPKode > scripts > M-Ariza Maintenance Follow-up Web Application > m-ariza-maintenance-follow-up-web-application/mariza/admin/updaterecord.php
<?
session_start();
include "../inc/logincheck.php";
include "../inc/conn.php";
$bugun=date("d.m.Y");
$date=explode('.',$bugun);
$bugun=mktime(0,0,0,$date[1],$date[0],$date[2]);

if (isset($_POST['guncelle'])){
	$sql="UPDATE arizalar SET durum = '{$_POST['durum']}', aciklama = '{$_POST['aciklama']}' ";
	if ((isset($_POST['teslimalan'])) and (isset($_POST['teslimtarihi']))){
		$checkdate=explode('.',$_POST['teslimtarihi']);
		if (!checkdate($checkdate[1],$checkdate[0],$checkdate[2])){echo"<script> alert(\"HatalĂ˝ Tarih Girdiniz!\"); history.back(1);</script>";exit;}
		if ($_POST['teslimalan']==""){echo"<script> alert(\"Please fill Checked out by field!\"); history.back(1);</script>";exit;}
		$teslimtarihi=mktime(0,0,0,$checkdate[1],$checkdate[0],$checkdate[2]);
		$sql= $sql.", teslimalan ='{$_POST['teslimalan']}',teslimtarihi ='{$_POST['teslimtarihi']}',durum ='Delivered'";
	}
	if ($_POST['durum']=="Repairing"){
		$sql=$sql.", tamirtarihi ='$bugun'";
	}
	if ($_POST['durum']=="Ready"){
		$sql=$sql.", bitistarihi ='$bugun', tamirtarihi='$bugun'";
	}
	$sql=$sql." WHERE fisno = '{$_POST['fisno']}'";
	if(mysql_query($sql)){
		
		echo "<script>location.href='records.php?msg=2'; </script>"; exit;
	}else{
		echo "<script>location.href='records.php?msg=5'; </script>"; exit;
	}
}
if (isset($_POST['delete'])){
	$sql="DELETE FROM arizalar  WHERE fisno = '{$_POST['fisno']}'";
	if(mysql_query($sql)){
		
		echo "<script>location.href='records.php?msg=3'; </script>"; exit;
	}else{
		echo "<script>location.href='records.php?msg=6'; </script>"; exit;
	}
}
?>
Return current item: M-Ariza Maintenance Follow-up Web Application