<?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');
$filephoto1=$_FILES['photo']['name'];
$uploadphoto1=$_SERVER['DOCUMENT_ROOT'].$download_path;
$fileNamephoto1=$filephoto1;
$target_pathphoto1 = $uploadphoto1 . $fileNamephoto1;
move_uploaded_file($_FILES['photo']['tmp_name'], $target_pathphoto1);
$filephoto=$_FILES['pdf']['name'];
$uploadphoto=$_SERVER['DOCUMENT_ROOT'].$download_path;
$fileNamephoto=$filephoto;
$target_pathphoto = $uploadphoto . $fileNamephoto;
move_uploaded_file($_FILES['pdf']['tmp_name'], $target_pathphoto);
$sql="insert into research(restype,name,yeaar,month,title,coguide,photo,dorder,affil,pdf,added_by,added_on)";
$sql.=" values(";
$sql.="'".$_POST['restype']."',";
$sql.="'".$_POST['name']."',";
$sql.="'".$_POST['yeaar']."',";
$sql.="'".$_POST['month']."',";
$sql.="'".$_POST['title']."',";
$sql.="'".$_POST['coguide']."',";
$sql.="'".$fileNamephoto1."',";
$sql.="'".$_POST['dorder']."',";
$sql.="'".$_POST['affil']."',";
$sql.="'".$fileNamephoto."',";
$sql.="'".$added_by."',";
$sql.="'".$added_on."')";
//echo $sql;
//die();
$UsQuery =mysqli_query($conn,$sql);
if($UsQuery){
header('location:'.$home_path.'/pages/master/addresearch.php?msg=success&rcpt=');
}else{
header('location:'.$home_path.'/pages/master/addresearch.php?msg=error');
}
?>
|