<?php 
session_start();
include 'dbc.php';

date_default_timezone_set("Asia/Karachi");

$userid=$_SESSION["userid"];
$today=date("d-m-Y");
$class_name=$_POST["class_name"];

$home_work=$_POST["remarks"];
$picid=$_POST["adm_no"];
$cls_sec=$_POST["cls_sec"];

$img_name=$picid . "_" . $_FILES["app_file"]["name"];
move_uploaded_file($_FILES["app_file"]["tmp_name"],"app_images3_diary/".$img_name);

$filename= $_FILES["uploaded"]["name"];
move_uploaded_file($_FILES["uploaded"]["tmp_name"],"upload/".$filename);

	$sql = "Insert into diary (id,date,month_name,notice,user_id,app_file,filename,cls_sec) values (null,'$today','$class_name','$home_work','$userid','$img_name','$filename','$cls_sec')";
$conn->query($sql);

	

header("location:Add_Diary.php");

?>
