<?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');
$filephoto=$_FILES['pdff']['name'];
$uploadphoto=$_SERVER['DOCUMENT_ROOT'].$download_path;
$fileNamephoto=$filephoto;
$target_pathphoto = $uploadphoto . $fileNamephoto;
move_uploaded_file($_FILES['pdff']['tmp_name'], $target_pathphoto);
$sql=mysqli_query($conn,"select * from cv where id='".$_POST['idD']."'");
$rw=mysqli_fetch_array($sql);
$pdff=$rw['pdff'];
if($_FILES['pdff']['name']==''){
$pdfff=$pdff;
}else{
$pdfff=$fileNamephoto;
}
$sqlBl="UPDATE cv SET ";
$sqlBl=$sqlBl."pdff='".$pdfff."',";
$sqlBl=$sqlBl."added_by='".$added_by."',";
$sqlBl=$sqlBl."added_on='".$added_on."'";
$sqlBl=$sqlBl." where id='3'";
$UsQuery=mysqli_query($conn,$sqlBl);
if($UsQuery){
header('location:'.$home_path.'/pages/master/viewcv.php?msg=success&id='.$_POST['idD']);
}else{
header('location:'.$home_path.'/pages/master/viewcv.php?msg=error&id='.$_POST['idD']);
}
?>
|