<?php
ob_start();
session_start();
include("../../../config.php");
$dte=date('d/m/Y');
$dtdoc=date('Y-m-d');
$dteE=date('Y-m-d h:i:s');
$added_by=$_SESSION['user'];
$added_on=date('Y-m-d h:i:s');
$sqll1="insert into lastupdated(pagename,dtype,date,sts)";
$sqll1.=" values(";
$sqll1.="'Book Publication',";
$sqll1.="'edit',";
$sqll1.="'".$dte."',";
$sqll1.="'1')";
/* echo $sqll1; */
$UsQueryy1 =mysqli_query($conn,$sqll1);
$filephoto=$_FILES['img']['name'];
$uploadphoto=$_SERVER['DOCUMENT_ROOT'].$download_path;
$fileNamephoto=$filephoto;
$target_pathphoto = $uploadphoto . $fileNamephoto;
move_uploaded_file($_FILES['img']['tmp_name'], $target_pathphoto);
$sq=mysqli_fetch_array(mysqli_query($conn,"select img from book where id='".$_POST['idD']."'"));
if($fileNamephoto!=''){
$fileNamephotoo=$fileNamephoto;
}else{
$fileNamephotoo=$sq['img'];
}
$sqlBl="UPDATE book SET ";
$sqlBl=$sqlBl."booktype='".$_POST['booktype']."',";
$sqlBl=$sqlBl."img='".$fileNamephotoo."',";
$sqlBl=$sqlBl."edition='".$_POST['edition']."',";
$sqlBl=$sqlBl."title='".$_POST['title']."',";
$sqlBl=$sqlBl."namee='".$_POST['namee']."',";
$sqlBl=$sqlBl."yearr='".$_POST['yearr']."',";
$sqlBl=$sqlBl."pages='".$_POST['pages']."',";
$sqlBl=$sqlBl."issbn='".$_POST['issbn']."',";
$sqlBl=$sqlBl."purlink='".$_POST['purlink']."',";
$sqlBl=$sqlBl."added_by='".$added_by."',";
$sqlBl=$sqlBl."added_on='".$added_on."'";
$sqlBl=$sqlBl." where id='".$_POST['idD']."'";
$UsQuery=mysqli_query($conn,$sqlBl);
if($UsQuery){
header('location:'.$home_path.'/pages/master/editbook.php?msg=success&id='.$_POST['idD']);
}else{
header('location:'.$home_path.'/pages/master/editbook.php?msg=error&id='.$_POST['idD']);
}
?>
|