session_cache_limiter('private, must-revalidate');
include"../include/conn.php";
session_start();
$userId=$_SESSION["userId"];
$loginid=$_SESSION["loginid"];
if(!isset($userId))
header("Location: ../profile/newaccount.php?a=displayLogin");
$display_sql= "select count(*) as COUNT from CSS_APP_GENERAL where CSS_APPLICANT_ID=$userId";
$rpos=OCIParse($conn,$display_sql);
OCIExecute($rpos);
OCIFetchInto($rpos,$disarr,OCI_ASSOC);
$iocoount=$disarr["COUNT"];
if($iocoount==0)
header("Location: ../profile/applicationdetail.php?a=Add&aid=$userId");
if(count($_POST)){
foreach ($HTTP_POST_VARS as $key => $value) {
$$key = $value;
}
}
$a=$_REQUEST["a"];
switch (@$a) {
case "Save & add another research":
insert_data($conn,1);
break;
case "Save & move to next section":
insert_data($conn,2);
?>
break;
default:
displayform();
}
function displayform()
{
global $conn,$temp,$userId;
?>
|
include("../include/top.php"); ?>
|
include("../include/userleft.php"); ?>
include("../include/profileleft.php"); ?>
|
|
| include("../include/bottom.php"); ?> |
|
}
function insert_data($conn,$flage)
{
global $Title,$Journal,$Publisher,$P_Date,$Check,$userId;
$P_Date=explode("-",$P_Date);
$P_Date = "$P_Date[2]-$P_Date[1]-$P_Date[0]";
if ($Check=='on')
$Check='1';
else
$Check='0';
$query = "insert into CSS_RESEARCH_PUB_DETAILS(CSS_RESEARCH_ID,CSS_TITLE,CSS_CONFERENCE,CSS_PUBLISHER,CSS_PUBLISHER_DATE,CSS_REQ_ADVERTISEMENT,CSS_APPLICANT_ID) values(SQ_CSS_RESEARCH_ID.nextval,'$Title','$Journal','$Publisher',to_timestamp('$P_Date','YYYY-MM-DD'),'$Check',$userId)";
$stmt = OCIParse($conn, $query);
if(OCIExecute($stmt))
{
$temp="Successfuly Addedd";
if($flage == 1)
displayform();
}
}
?>