Current File : /home/inlingua/public_html/icentex/trainer_resource_trainee/download_documents.php
<?php
include "header_trainer.php";
?>
<h3>Download Documents</h3>
<b>Documents</b><br />
<?php
// Include the database connection details
require('../dbConnection.php');

// Include common functions
require('../commonFunc.php');

// Include common functions
require('../globalVars.php');

// Include the table handler class
require('../dbHandler.class.php');

// Init and connect to database
$dbObject = new dbHandler();
$dbObject->connect();
$sqlQuery = "SELECT a.recNo,a.workshop,a.download_document_status,b.instructorId,b.selfCancel FROM ingl_active_workshops a left join ingl_active_workshops_apply b on a.recNo=b.workshopId  where a.recNo='".$_REQUEST['kV']."' && b.instructorId='".$_SESSION['id']."' && b.selfCancel='Workshop Finalised' && a.download_document_status='Y'";


// Select records from table
$selectedRecords = $dbObject->Select($sqlQuery);
$objectData=$dbObject->SelectNext();



$getData = new dbHandler(); $getData->connect();
$workshop = $getData->SelectAndNext("select nameofWorkshop,files,videos	 from  ingl_workshops where recNo='" . $objectData['workshop']."'");


$download_docu="select * from ingl_workshop_doc where workshop='".$objectData['workshop']."' && allowedtotrainee='Y'";
$result_docu=mysqli_query($conn,$download_docu);
$count_docu=mysqli_num_rows($result_docu);

	if($count_docu>0)
	{
	echo"<table width='100%'>";
	//$files=explode("$~#",$workshop['files']);
	//$count=count($files)-1;
	
	while($num_docu=mysqli_fetch_array($result_docu))
	{
	
	$files_show="trainer_documents_download.php?file=".$num_docu['documents']."";
	if($num_docu['documents']!="")
	{
	?>
	<tr >
	<td width="40" style="border:#E6E6E6 1px solid;"><a   class="hlink"  href="<?php echo $files_show;?>" title="<?php echo $num_docu['documents']; ?>">	<img class="divimglink" height="40" src="../images/download_8.gif" alt="" border="0"></a></td>
	<td style="border:#E6E6E6 1px solid;" valign="top"><b><a href='<?php echo $files_show;?>'><?php echo $num_docu['documents']; ?></a></b></td>
	</tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<?php
	}
	}
	echo"</table>";
	}
	
	
	
	?>

<b>Videos</b><br />

<?php
if($workshop['videos']!="")
	{
	echo"<table width='100%'>";
	$videos=explode(",",$workshop['videos']);
	//$count=count($files)-1;
	$queryVideo="select * from ingl_video_doc where workshop='".$objectData['workshop']."' && allowedtotrainee='Y'";
	$resultVideo=mysqli_query($conn,$queryVideo);
	
	while($numVideo=mysqli_fetch_array($resultVideo))
	{
	
	$queryVideo="select * from trainer_resource_video where recNo='".$numVideo['documents']."'";
	$resultVideo=mysqli_query($conn,$queryVideo);
	$numVideo=mysqli_fetch_array($resultVideo);
	
	$files_show1="trainer_documents_download1.php?file=".$numVideo['video_file']."";
	
	?>
	<tr >
	<td width="40" style="border:#E6E6E6 1px solid;"><a   class="hlink"  href="<?php echo $files_show1;?>" title="<?php echo $numVideo['video_details']; ?>">	<img class="divimglink" height="40" src="../images/download_8.gif" alt="" border="0"></a></td>
	<td style="border:#E6E6E6 1px solid;" valign="top"><b><a href='<?php echo $files_show1;?>'><?php echo $numVideo['video_details']; ?></a></b></td>
	</tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<?php
	
	}
	echo"</table>";
	?>
<br />
<a href="http://download.cnet.com/3001-13632_4-10267151.html?spi=27c07607f081f568c22de547347728af" target="_blank"><b>Download VLC Player to view video files.</b></a>		
	<?php
	
	}
?>


<?php
include "footer_trainer.php";
?>