<?php
session_start();
	
include_once("../class/class.MySQL.php");
require '../class/resizeImage.php';
$db=new MySQL();



$action	= $_GET['action'];
if ($action == 'update') {

	$shtlist_id = $_GET['shtlist_id'];
	$data=array();
	$data['sht_name_cand'] = $_POST['sht_name'];
	$data['sht_intv_dt']   = date('Y-m-d H:i:s',strtotime($_POST['sht_intv_date']));
	$data['sht_desg'] 	   = $_POST['recdesg'];
	$data['sht_dept'] 	   = $_POST['department'];
	$data['sht_loc'] 	   = $_POST['sht_loc'];
	$data['sht_qual'] 	   = $_POST['sht_qual'];
	$data['sht_exp']	   = $_POST['sht_exp'];
	$data['sht_exp_month'] = $_POST['sht_exp_month'];
	$data['sht_contdt']	   = $_POST['sht_cont_dt'];
	$data['sht_email']	   = $_POST['sht_email'];
	$data['sht_phone']	   = $_POST['sht_phone'];
	$data['sht_curnt_sal'] = $_POST['sht_curnt_sal'];
	$data['sht_exp_sal']   = $_POST['sht_exp_sal'];
	$data['sht_notice_prd'] = $_POST['sht_notice_prd'];
	$data['sht_status']    = $_POST['sht_status'];
	$data['sht_remarks']   = $_POST['sht_remark'];
	$data['sht_gender']   = $_POST['sht_gender'];
	
	$shortlistedadd		   = $db->Update('shortlisted',$data,array('shtlist_id'=>$shtlist_id));
	
	//upload image and resume and enter it to file
	
	
	/*
	
	$data2['rect_resumeup']=$_FILES["resume"]["name"];
	
	$allowedExts = array("doc", "docx", "pdf" ,"zip","rar");
	$temp = explode(".", $_FILES["resume"]["name"]);
	$extension = end($temp);
	if (in_array($extension, $allowedExts))
	  {
	  if ($_FILES["resume"]["error"] > 0)
		{
		echo "Return Code: " . $_FILES["resume"]["error"] . "<br>";
		}
	  else
		{
	   "Upload: " . $_FILES["resume"]["name"] . "<br>";
		"Type: " . $_FILES["resume"]["type"] . "<br>";
		"Size: " . ($_FILES["resume"]["size"] / 1024) . " kB<br>";
		"Temp file: " . $_FILES["resume"]["tmp_name"] . "<br>";
	
		if(file_exists("../upload/resume/". $_FILES['resume']['name']))
		  {
		  echo "<script>alert('filename already exists.')</script> ";
		  }
		else
		  {
		  move_uploaded_file($_FILES["resume"]["tmp_name"],
		  "../upload/resume/". $_FILES["resume"]["name"]);
		   echo "<script>alert('Your Resume has Been Submitted!!')</script> ";
		  }
		}
	  }
	
	$where['rect_id']			= $employee1;
	$db->Update('recruitment',$data2,$where);*/
		
		
		
}
if ($action == 'get') {
	$shtlist_id = $_GET['shtlist_id'];
	$short_list  = $db->fetchQuery('select * from shortlisted where shtlist_id="'.$shtlist_id.'"');
	echo '{"short_list":'.json_encode($short_list).'}';
}

 



		

	
	
	
	?>