<?php

require 'db.php';
//require 'chklogin.php';
$id="";
if(isset($_SESSION["user"]["uid"]))$id=$_SESSION["user"]["uid"];

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

//echo "<pre>";print_r($objindex->profile($_SESSION['user']['uid']));exit;


$total_detail=$objindex->mydetail($_SESSION['user']['uid']);

 if($_REQUEST['pid']>0 && $_REQUEST['uid']>0)
  {
	  //$papername=papername($_REQUEST['pid']);
	
	$result=getResult($_REQUEST['pid'],$_REQUEST['uid']);

$smarty->assign("result",$result);	  
	 
	
  }else{
	  
	  $pprs=$db->getRows("select * from result where student_id=".$_SESSION['user']['uid']." and status =1 "); 
	  
	  foreach($pprs as $ppr)
	  {
		$result[]=getResult($ppr['paper_id'],$ppr['student_id']);
	  }

//echo "<pre>";print_r($result);	exit;  
$smarty->assign("result",$result);	  

  }

//echo "<pre>";print_r($result);exit;
$smarty->display('result.html');