<?php
include("db.php");
if(isset($_SESSION["admin"]) && $_SESSION["admin"]["uid"]!=""){
?>
WELCOME ADMIN 
<?php
exit;
}elseif(isset($_SESSION["user"]["uid"])){

$profiledetail=$objindex->profile($_SESSION['user']['uid']);

//echo "<pre>";print_r($profiledetail);exit;

//echo "<pre>";print_r($LinksDetails);exit;

//$smarty->assign("msg",$_SESSION['omg']);

$smarty->assign("meta_title", $LinksDetails["general_meta_title"]);
$smarty->assign("meta_tag", $LinksDetails["general_meta_tags"]);
$smarty->assign("meta_description", $LinksDetails["general_meta_desc"]);
$smarty->assign("silder",$objindex->slider());
$smarty->assign("side_silder",$objindex->slider("SIDE"));

//echo "<pre>";print_r($objindex->slider("SIDE"));exit;

$smarty->assign("latest_stories",$objindex->extra_content('Latest Stories'));

$smarty->assign("photoGallery",$objindex->solo_extra_content('photo_gallery'));

$smarty->assign("videoGallery",$objindex->solo_extra_content('video_gallery'));

$smarty->assign("extradata",$objindex->extra_content('extra'));

$smarty->assign("advertisements",$objindex->extra_content('advertiesments'));

$smarty->assign("photos",$objindex->extra_content('Photos'));


$smarty->assign("course",$objindex->extra_content('COURSE'));
$smarty->assign("newupdate",$objindex->extra_content('NEW_UPDATES'));

$smarty->assign("profile",$objindex->profile($_SESSION['user']['uid']));

$smarty->assign("vacancies",$objindex->extra_content('VACANCIES'));

$smarty->assign("jobs",$objindex->extra_content('JOBS'));

$smarty->assign("forms",$objindex->extra_content('FORMS'));

$smarty->assign("cname",$objindex->cname());

$pprs=$db->getRows("select * from result where student_id=".$_SESSION['user']['uid']." and status =1  ORDER BY date DESC LIMIT 4"); 

$notice=$db->getRows("select * from student_notice where (class='".$profiledetail['class']."' or class='') and status =1  ORDER BY date DESC LIMIT 4"); 
$i=0;

foreach($notice as $ntc)
{
	$i++;
$stu_notice[$i]=$ntc;
   if(count($ntc)>0)
   {
	   $stu_notice[$i]['notice_type_name']=$db->getVal("select notice_type from notice where id=".$ntc['notice_type']);
       $stu_notice[$i]['date']=date('d-M-Y',$ntc['date']);

   }
}

//echo"<pre>";print_r($stu_notice);echo"</pre>";exit;
//if(count($notice)>0){echo "<pre>";print_r($notice);exit;}else{echo "u don't have any notice ".$db->getLastQuery();exit;}

$i=0;
foreach($pprs as $ppr){

	$recent_exams[]=getResult($ppr['paper_id'],$ppr['student_id']);
    $recent_exams[$i]['date']=date('d-M-Y',$ppr['date']);

$i++;}

//echo "<pre>";print_r($recent_exams);exit;

$smarty->assign("pprs",$recent_exams);

$smarty->assign("stu_notice",$stu_notice);

$smarty->display('dashboard.html');

}else{
redirect(URL_ROOT."index.php");
}
?>