Viewing file: profile_outer_update_action.php (4.4 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
require 'connection.php';
session_start();
$target_dir = "profileImages/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
// Check if image file is a actual image or fake image
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
if($check !== false) {
echo "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
echo "File is not an image.";
$uploadOk = 0;
}
if ($uploadOk == 0) {
echo "Sorry, your file was not uploaded.";
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo "The file ". htmlspecialchars( basename( $_FILES["fileToUpload"]["name"])). " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
}
$profileImage = $_FILES["fileToUpload"]["name"];
$uname = $_SESSION['user_name'];
$u_id = $_SESSION['user_id'];
$studName=$_POST['studName'];
//$dob=$_POST['dob'];
//$age=$_POST['age'];
$email=$_POST['email'];
$address1=$_POST['address1'];
$address2=$_POST['address2'];
$address3=$_POST['address3'];
$pincode=$_POST['pincode'];
//$paddress1=$_POST['paddress1'];
//$paddress2=$_POST['paddress2'];
//$paddress3=$_POST['paddress3'];
// $ppincode=$_POST['ppincode'];
//$check=$_POST['check'];
// $state=$_POST['state'];
// $country=$_POST['country'];
$mobile=$_POST['mobile'];
$altmobile=$_POST['altmobile'];
$course=$_POST['course'];
$board=$_POST['board'];
$passyear=$_POST['passyear'];
$specification=$_POST['specification'];
$mark=$_POST['mark'];
$skills=$_POST['skills'];
$companyname=$_POST['companyname'];
$position=$_POST['position'];
$duration=$_POST['duration'];
$projectName=$_POST['projectName'];
$description=$_POST['description'];
$technology=$_POST['technology'];
$achievements=$_POST['achievements'];
$strengths=$_POST['strengths'];
$interests=$_POST['interests'];
$acadamic=$_POST['acadamic'];
$stud_id=$_POST['stud_id'];
$acadamicval=$_POST['acadamicval'];
$career_objective=$_POST['career_objective'];
$public_profile_val=$_POST['public_profile_val'];
// $exp=implode(" , ",$experience);
$achie=implode(" , ",$achievements);
$sql="INSERT INTO `student_reg`( `name`,`email`, `permanent_address1`, `permanent_address2`, `permanent_address3`,`permanent_pincode`, `mobile`, `alternate_mobile`, `core_skill`, `strengths`, `interest`,`achievements`,`isResumeActive`,`user_id`,`profileImage`,`career_objective`)values('$studName','$email','$address1','$address2','$address3','$pincode','$mobile','$altmobile','$skills','$strengths','$interests','$achie',1,'$u_id','$profileImage','$career_objective')";
$result=$con->query($sql);
$last_id = $con->insert_id;
$que="update user_details set name='$studName' ,email='$email',phone='$mobile',public_profile_val='$public_profile_val' where user_id='$u_id'";
$r=$con->query($que);
foreach($companyname as $key => $value)
{
$data4['company_name']=$value;
$data4['position']=$position[$key];
$data4['duration']=$duration[$key];
$sql4="INSERT INTO `experience`( `company_name`, `position`, `duration`, `stud_id`) values('".$data4['company_name']."','".$data4['position']."','".$data4['duration']."',$last_id)";
$result4=$con->query($sql4);
}
foreach($projectName as $key => $value)
{
$data['pro_name']=$value;
$data['description']=$description[$key];
$data['technology']=$technology[$key];
$data['acadamic']=$acadamic[$key];
$sql1="insert into `resume_projects`(pro_name,description,technology,acadamic,stud_id)values('".$data['pro_name']."','".$data['description']."','".$data['technology']."','".$data['acadamic']."',$last_id)";
$result1=$con->query($sql1);
}
foreach($course as $key => $value)
{
$data1['course']=$value;
$data1['board']=$board[$key];
$data1['year']=$passyear[$key];
$data1['specification']=$specification[$key];
$data1['mark']=$mark[$key];
$sql3="INSERT INTO `education`( `course`, `board`, `year`, `specification`, `mark`, `stud_id`) values('".$data1['course']."','".$data1['board']."','".$data1['year']."','".$data1['specification']."','".$data1['mark']."',$last_id)";
$result3=$con->query($sql3);
}
$count=$con->affected_rows;
if($count>0&& $last_id!=""){
header("location:resume.php");
}
else{
header("location:application.php?failed");
}
?>
|