<?php 
	$utils = new Utils;
	
	$db = new EO_DB;
	$db1 = new EO_DB;

	// Set this page to the Section title for the left navigation bar
	$thispagebookmark = "classquestlecture";
	$expedition = new Expedition;


	$euser = new EUser;
	$username = $euser->getUserName();
	$cq = new ClassQuest;
	if (!$pageno)
	{
		$pageno = 1;
	}
	
	if ($expcatid <= 0)
		unset($expcatid);
	
	if ($doSearch == 9 && $txtsearch)
	{
		$cq = new ClassQuest;
		$iexps = $cq->getLecturesByCat($expcatid,$pageno,$txtsearch);
		//echo "Here : ".count($iexps)."-";
	}
	else
	if ($expcatid)
	{
		$iexps = $cq->getLecturesByCat($expcatid,$pageno);
	}
?>
<html>
<head>
<title>Expedition Quest - Lectures</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript" src="/ell/functions.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" >
	function open_addwin()
	{
		open("/classroom/addlecture.ell","addlecture","width=560,height=500,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1");
	}
</SCRIPT>
</head>

<body bgcolor="#FFFFFF" leftmargin=0 topmargin=0>
<table width="<?=$t1_width?>" border="0" cellspacing="0" cellpadding="0">
  <?php
	$UI=new UserInterface;
	$UI->DisplayHeader();
	$UI->DisplayTab($thispagebookmark);
  ?>  <tr valign="top"> 
    <td height="163"> 
      <table width="<?=$t2_width?>" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <?php include "ell/left_navigation_bar.inc"; ?>
          <td width="<?=$t3_width?>" valign="top" height="398"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td rowspan="6" width="30"><img src="/images/dot.GIF" width="20" height="1"></td>
                <td height="6" colspan="2"> 
                  <?php include "ell/welcome_banner.ell"; ?>
                </td>
              </tr>
              <tr> 
                <td colspan="2">&nbsp;</td>
              </tr>
              <tr> 
                <td colspan="2"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Our 
                  lecture series allows returning expeditions to present their 
                  project as a slide show or video for review by EQ members at 
                  any time.</font></td>
              </tr>
              <tr> 
                <td colspan="2">&nbsp;</td>
              </tr>
              <tr> 
                <td width="305" valign="top" height="2"> 
                  <table width="280" border="0" cellspacing="0" cellpadding="0" height="70">
                    <tr> 
                      <td width="52%" bgcolor="1E55DF" height="9"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFFF">&nbsp;<b>Search 
                        Lectures</b></font></td>
                      <td width="48%" valign="bottom" height="9"><img src="/images/sub_tab_right.gif"></td>
                    </tr>
                    <tr bgcolor="#666666"> 
                      <td colspan="2" height="1"><img src="/images/dot.GIF" width="1" height="1"></td>
                    </tr>
                    <tr align="left" bgcolor="#EFEFEF"> 
                      <td colspan="2" height="10"><img src="../images/dot.GIF" width="1" height="1"></td>
                    </tr>
                    <tr align="left" bgcolor="#EFEFEF"> 
                      <form action="lecture.ell" method="POST">
                        <td colspan="2" height="30"><font face="Arial, Helvetica, sans-serif" size="2">&nbsp;<font face="Verdana, Arial, Helvetica, sans-serif" size="1">Keywords 
                          : 
                          <input type="text" name="txtsearch" size="15">
                          <input type="image" border="0" name="imageField" src="../images/search_button.gif">
                          <input type="hidden" name="doSearch" value="9">
                          </font> </font> 
                          <div align="left"></div>
                        </td>
                        <input type="hidden" name="doSearch2" value="9">
                      </form>
                    </tr>
                    <tr align="left" bgcolor="#EFEFEF"> 
                      <td colspan="2" height="10"><img src="../images/dot.GIF" width="1" height="1"></td>
                    </tr>
                  </table>
                </td>
                <td width="307" valign="top" height="2"> 
                  <table width="265" border="0" cellspacing="0" cellpadding="0" height="70">
                    <tr> 
                      <td width="44%" bgcolor="1E55DF" height="10"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFFF">&nbsp;<b>Add 
                        Lectures </b></font></td>
                      <td valign="bottom" height="10"><img src="/images/sub_tab_right.gif"></td>
                    </tr>
                    <tr bgcolor="#666666"> 
                      <td colspan="2" height="1"><img src="/images/dot.GIF" width="1" height="1"></td>
                    </tr>
                    <tr align="left" bgcolor="#EFEFEF"> 
                      <td colspan="2" height="10"><img src="../images/dot.GIF" width="1" height="1"></td>
                    </tr>
                    <tr align="left" bgcolor="#EFEFEF"> 
                      <form action="dirclassroom.ell" method="POST">
                        <td colspan="2" height="33"> 
                          <div align="left"><font size="2" face="Arial, Helvetica,sans-serif"> 
                            &nbsp;<font face="Verdana, Arial, Helvetica, sans-serif" size="1">To 
                            add a new Lecture, click <a href="javascript:open_addwin()">here</a></font></font></div>
                        </td>
                        <input type="hidden" name="doSearch22" value="9">
                      </form>
                    </tr>
                    <tr align="left" bgcolor="#EFEFEF"> 
                      <td colspan="2" height="10"><img src="../images/dot.GIF" width="1" height="1"></td>
                    </tr>
                  </table>
                </td>
              </tr>
	      <?php
			if ($expcatid || $txtsearch)
				$pagingtext = $cq->doLecturePagenums($expcatid,$pageno,$txtsearch);
	      ?>
              <tr> 
                <td valign="top" colspan="2" height="77"> <br>
                  <table width="570" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td colspan="3" height="20"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><a href="index.ell"><font color="#0000CC">ClassQuest</font></a> 
                        &gt; <a href="lessonplan.ell"><font color="#0000CC">Lectures</font></a> 
                        <?php
				if($expcatid)
					print " &gt;<font color=\"#666666\"> <b> ".$expedition->getExpeditionCategoryName($expcatid);
			?> </font></td>
                    </tr>
                    <tr bgcolor="#99CCFF"> 
                      <td colspan="2" height="15"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000">&nbsp;<b>Expedition 
                        Lectures </b></font></td>
                      <td valign="bottom" height="15" align="right" width="41%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000"> 
                        <?php
				if($pagingtext != "-1")
				{
					echo $pagingtext;
				}
			?> </font></td>
                    </tr>
                    <tr valign="top"> 
                      <td colspan="3" height="10"><img src="/images/dot.GIF" width="1" height="1"></td>
                    </tr>
                    <?php
		    if (!$expcatid && !$txtsearch)
		     {
		    ?> 
                    <tr valign="top"> 
                      <td colspan="3" height="2"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1">
			<?php
							$Set_URL = "./lecture.ell?expcatid=";
							/* Browse by Category */
							include("ed/exp_category_list.ell");
					  ?> 		      </font></td>
                    </tr>
                    <?php
		    }
		    ?> 
                    <tr valign="top"> 
                      <td colspan="3" height="9"> 
                        <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
                          <?php 
			  if ($expcatid || ($doSearch == 9 && $txtsearch))
			  {
				  print "<tr><td colspan=\"3\"><font face=\"Arial,Verdana,Helvetica\" size=2>";
				  if ($doSearch == 9 && $txtsearch)
				  {
					print "Search results for '<b>".$txtsearch."</b>'";
				  }
				  else
				  {
			        print "Click on a lecture title to download it.";
				  }
				  print "</font></td></tr><tr><td>&nbsp;</td></tr>";
			 ?> <?php
				for ($i = 0;$i < count($iexps);$i++)
				{
			  ?> 
                          <tr> 
                            <td colspan="2" height="25"> 
                              <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><img src="../images/a2.gif"></font></div>
                            </td>
                            <td width="96%" height="25"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> 
                              <?php
    				echo "<a href=\"/classroom/send2user.ell?fn=".$DOCUMENT_ROOT.$upldir.$upllecture."/".$iexps[$i]["filename"]."&mt=".$iexps[$i]["mimetype"]."\"><b>".$iexps[$i]["title"]."</b></a>";
			      ?> &nbsp;&nbsp;( <?php 
					echo "Uploaded by: <b>".$euser->getFirstName($iexps[$i]["username"])." ".$euser->getLastName($iexps[$i]["username"])."</b>";
			      ?> ) </font></td>
                          </tr>
                          <tr> 
                            <td colspan="2" height="25"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> 
                              </font></td>
                            <td width="96%" height="25"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> 
                              <?php 
				echo $utils->putbreaks($iexps[$i]["desc"],80);
			      ?> </font></td>
                          </tr>
                          <tr> 
                            <td colspan="3" height="10"><img src="../images/dot.GIF" width="1" height="1"></td>
                          </tr>
                          <?php
				}
			    }
			    if ($i==0 && ($expcatid || ($doSearch == 9 && $txtsearch)))
			    {
			      echo "<tr><td colspan=3><font face=arial size=2 color=#660000>No lectures found </td></tr>";
			    }	
			?> 
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr> 
                <td colspan="3" height="2">&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
        <tr> 
          <td width="128" height="2"><img src="/images/dot.GIF" width="1" height="1"></td>
          <td width="642" height="2"><img src="/images/dot.GIF" width="1" height="1"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<?php
	$UI->DisplayMap();
?>

</body>
</html>