<?php
	$boom2='';
	$topcat22='';
	$Dfirstname=  '';
	$Dlastname=  '';
	
//	$port_idz=$row1daa1G1['zPersonalT'];
//$showchart=$row1daa1G1['zDoctor'];


//$Boo2=0; 
// 26,20,24,25,19,22,23,18,17
// 80,70,80,80,80,80,80,80,80


//$port_idz=$row1daa1G1['zPersonalT'];////videos
//$showchart=$row1daa1G1['zDoctor'];////tests
//$grade=$row1daa1G1['title3']; ///video titles
//$display_blockRA92='';

//$Tgrade=$row1daa1G1['title37'];//Pass score,=0=on all, 1 overall
//$Pgrade=$row1daa1G1['title4']; //saying for pass, saying for fail: times can take test
//2:Congratulations. You have passed this module.:You have scored below the required score. Please rewatch the video and retake the assessment.: You have scored below the required score. You must now contact CAP to be able to proceed.
//$PWgrade=$row1daa1G1['MemCardTitle']; //title of packages
	
////
	$boom2='';
	$text_account34=  '';
	$Ctext_account34=0;
	
	$jedID2U=3;
	
	$Portgrade2[0]='';
	$Portgrade2[1]='';
	$Portgrade2=explode(",", $port_idz);
			$Portgrade3=count($Portgrade2);
			
			
	$TPortgrade2[0]='';
	$TPortgrade2[1]='';
	$TPortgrade2=explode(",", $showchart);
			$TPortgrade3=count($TPortgrade2);	
			
	$TTPortgrade2[0]='';
	$TTPortgrade2[1]='';
	$TTPortgrade2=explode(",", $grade);
			$TTPortgrade3=count($TTPortgrade2);			
			
			
			$it1=0;
	  for ($it=0; $it<$Portgrade3; $it++) {		
	$dit=$it+1;		
		$sql33a8009 ="SELECT * FROM download_manager WHERE  download_id='$Portgrade2[$it]' ";
		$vimeoV[$it]='';	
	 $result112b1c = @mysqli_query($connection,$sql33a8009) or die(mysqli_error($connection));
	while ($row112b1c9 = mysqli_fetch_array($result112b1c)) {	
	$vimeoV[$it]=$row112b1c9['vimeo_link'];
	$bob=$vimeoV[$it];
//	echo $bob;
	//https://player.vimeo.com/video/224717547
	$VPortgrade2=explode("/", $bob);
	$bob1=$VPortgrade2[4];
	//echo "$bob1 <br/>";
	
	$test["$it"]='';
	$test["$bob1"]='';
	
	if ($TPortgrade2[$it]>0){
	$test["$it"]="<FORM  name=\"formcheck\" METHOD=\"POST\" ACTION=\"$loc2/survey/pmreg.php?test=$TPortgrade2[$it]&tword=Form&token=$tok&log=$logged\" target=\"_blank\" >
                <button class=\"fsSubmitButton\" type=\"input\">$TTPortgrade2[$it]</button>
         </form><br/><br/><br/>";
         
      $test["$bob1"]="<FORM  name=\"formcheck\" METHOD=\"POST\" ACTION=\"$loc2/survey/pmreg.php?test=$TPortgrade2[$it]&tword=Form&token=$tok&log=$logged\" target=\"_blank\" >
                <button class=\"fsSubmitButton\" type=\"input\">$TTPortgrade2[$it]</button>
         </form><br/><br/><br/>";   
		
	}
	
	//$vimeoV[$it]="https://player.vimeo.com/video/168368461";
		}
		
		$sql33a80091 ="SELECT * FROM download_description WHERE  download_id='$Portgrade2[$it]' ";
		$vimeoVN[$it]='';	
	 $result112b1c1 = @mysqli_query($connection,$sql33a80091) or die(mysqli_error($connection));
	while ($row112b1c91 = mysqli_fetch_array($result112b1c1)) {	
	$vimeoVN[$it]=$row112b1c91['name'];
				
		}	
		
		
		
		
		
		
		
		$it1=$it+1;
	$boom2.="<tr><td>$it1</td><td>$vimeoVN[$it]</td><td> <img style=\"cursor: pointer;\" src=\"image/video_play.png\" rel=\"$vimeoV[$it]\" class=\"video_link\" title=\"Play Video\" alt=\"Play Video\" \></td></tr>";
			
			
	}		
			
//echo "<Br>Hi $grade $Mgrade3";
	
	if($Mgrade3<2){
	$Mgrade2[1]='';
	
	}
	
	if($Mgrade3<1){
	$Mgrade2[0]='';
		$Mgrade2[1]='';
	}
	
	if (isset($_POST['Boo2'])) {
  	$Boo2=$_POST['Boo2'];
}
	
////
	
//$port_idz=$row1daa1G1['zPersonalT'];////videos
//$showchart=$row1daa1G1['zDoctor'];////tests
//$grade=$row1daa1G1['title3']; ///video titles
//$display_blockRA92='';

//$Tgrade=$row1daa1G1['title37'];//Pass score,=0=on all, 1 overall
//$Pgrade=$row1daa1G1['title4']; //saying for pass, saying for fail: times can take test
//$PWgrade=$row1daa1G1['MemCardTitle']; //title of packages
	
////
	
	

	  /// $sql33a800 ="SELECT * FROM $table_name36 WHERE salesrep_id='$text_account3' AND status='1' ORDER BY lastname ";
	    $sql33a800 ="SELECT * FROM $table_name36 WHERE  status='1' ORDER BY lastname ";

$result33a800 = @mysqli_query($connection,$sql33a800) or die(mysqli_error($connection));

$num3334bT29z = mysqli_num_rows($result33a800);






  ///new while

	$topcat22.= "
	


	<table class=\"sortable\" id=\"RE\"> <thead> <tr>
	<td class=\"filterable\">Media Name #</td>
	<td>Lesson</td>
	<td>Media Link</td>


	</tr></thead><tbody>
	<tr class=\"filter\">
	<td align=\"left\"><input type=\"text\" name=\"filter_req\" value=\"\" size=\"6\" onkeyup=\"Table.filter(this,this)\"/></td>
	<td align=\"left\"><input type=\"text\" name=\"filter_req1\" value=\"\" size=\"6\" onkeyup=\"Table.filter(this,this)\"/></td>
	
<td></td>

	</tr>$boom2</tbody></table>
	
	
	<div id=\"video_iframe\" style=\"display: none; height:305px;\">
					<div id=\"video_iframe_header\" style=\"margin: 0 auto; width: 490px; height: 24px; text-align: right; padding-right: 10px; background: #000; color: #FFF; font-size: 14px; font-weight: bold; padding-top: 3px;\"><span class=\"close_video\" style=\"cursor: pointer;\">X</span></div>
					<div id=\"video_iframe_content\" style=\"margin: 0 auto; width: 500px; height: 281px;\">
						<iframe id=\"vimeo_link_player\" width=\"500\" height=\"281\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
				$test[224717547]	</div>
				</div>
				<div id=\"audio_iframe\" style=\"display: none;height:50px;\">
					<div style=\"margin: 0 auto; width: 400px;\">
						<div id=\"audioplayer\">
							<audio id=\"audio-loader\" preload=\"none\"></audio>
					
						</div>
					</div>
				</div>
	
	
				<script type=\"text/javascript\"><!--
					$(document).ready(function() {
						$('.audio_link').on('click', function() {
							$('#video_iframe').hide();
							if ($('#audiojs_wrapper0').hasClass('ap-playing')) {
								$('.ap-pause').trigger('click');
							}
							var audiolink = $(this).attr('rel');
							$('#audio-href').attr('data-src', audiolink);
							$('#audio-loader').attr('src', audiolink);
							$('#audio_iframe').show();
							$('.ap-play').trigger('click');
							$('html, body').animate({
								scrollTop: $('#audio_iframe').offset().top
							}, 1000);					
						});
						$('.video_link').on('click', function() {
							if ($('#audiojs_wrapper0').hasClass('ap-playing')) {
								$('.ap-pause').trigger('click');
							}
							$('#audio_iframe').hide();
							$('#vimeo_link_player').attr('src', $(this).attr('rel'));
							$('#video_iframe').show();
							$('html, body').animate({
								scrollTop: $('#video_iframe').offset().top
							}, 1000);					
						});
						$('.close_video').on('click', function() {
							$('#video_iframe').hide();
						});
					});
				//--></script>
				
<br/><br/><br/>
	";

$display_blockRA92=$topcat22;

?>