<?php
	//collect the course id
	if(isset($_GET['cid'],$_GET['pid'],$_GET['ses'],$_GET['sem']))
	{
		$course_id = $_GET['cid'];

    $pid = $_GET['pid'];

    $session = $_GET['ses'];


    $semester = $_GET['sem'];
	}



//get course category to know which to show
  $course_category = get_course_category_by_md5($course_id);


//get user id to keep track of the staff
 //$user_id = get_user_id();

?>


<form action='gateway.php' method='post'>
 <!-- form ends in  -->


<div class="row">

    <div class="alert well" style="min-height:100px;">
        <div class="col-sm-1"> <img src="images/courses.png"> </div>

        <div class="col-sm-6"> <h3>Course Manager  >> Assessments >> Students</h3>	</div>
        <div class="col-sm-5" >


          <?php

            if(is_admin($user_id))
            {
          ?>



          <a href="gateway.php?act=view_enter_course_assessments_students_list&cid=<?php echo $course_id.'&mis='.md5('Jaydeeeee').'&pid='.$pid.'&ses='.$session.'&sem='.$semester; ?>"><img src="images/enter_scores.png" data-toggle ="tooltip" title="Click here to enter scores online"/>Enter Online</a>
           <?php

            }

          ?>



         <!--  <a href="gateway.php?act=view_print_course_assessments_students_list&cid=<?php //echo $course_id.'&mis='.md5('Jaydeeeee'); ?>" target="_blank"><img src="images/print_big.png" data-toggle ="tooltip" title="Print Entered Scores"/>Print </a> -->


           <a href="print_course_assessments_students_list
.php?cid=<?php echo $course_id.'&mis='.md5('Jaydeeeee').'&pid='.$pid.'&ses='.$session.'&sem='.$semester; ?>" target="_blank"><img src="images/print_big.png" data-toggle ="tooltip" title="Print Entered Scores"/>Print </a>

        &nbsp&nbsp&nbsp&nbsp&nbsp

        <!-- check if course category before giving the access to download

        get course category
         -->
         <?php

          if($course_category == 0)
          {

          ?>
          <a href="includes/tab_menu/tab_view_course_export_students_list.php?cid=<?php echo $course_id.'&mis='.md5('Jaydeeeee').'&pid='.$pid.'&ses='.$session.'&sem='.$semester; ?>"><img src="images/download.png" data-toggle ="tooltip" title="Click here to download"/> Download</a>
               &nbsp&nbsp&nbsp&nbsp&nbsp


          <?php

          }
          else if($course_category == 1 || $course_category == 2)//if the course is gst
          {
          ?>

              <?php if(is_admin($user_id)){ // if the user is super admin?>

              <a href="includes/tab_menu/tab_view_course_export_students_listgsa.php?cid=<?php echo $course_id.'&mis='.md5('Jaydeeeee').'&pid='.$pid.'&ses='.$session.'&sem='.$semester; ?>"><img src="images/download.png" data-toggle ="tooltip" title="Click here to download"/> Download</a>
                   &nbsp&nbsp&nbsp&nbsp&nbsp

                 <?php }else{ //if the guy is ordinary staff?>

                   <a href="includes/tab_menu/tab_view_course_export_students_list2a.php?cid=<?php echo $course_id.'&mis='.md5('Jaydeeeee').'&pid='.$pid.'&ses='.$session.'&sem='.$semester; ?>"><img src="images/download.png" data-toggle ="tooltip" title="Click here to download"/> Download</a>
                   &nbsp&nbsp&nbsp&nbsp&nbsp


             <?php } ?>


         <?php
          }


          else
          {
          ?>

         <a href="includes/tab_menu/tab_view_course_export_students_list.php?cid=<?php echo $course_id.'&mis='.md5('Jaydeeeee').'&pid='.$pid.'&ses='.$session.'&sem='.$semester; ?>"><img src="images/download.png" data-toggle ="tooltip" title="Click here to download"/> Download</a>
               &nbsp&nbsp&nbsp&nbsp&nbsp


         <?php
          }


          ?>


					<?php
					//upload button
					if(is_admin($user_id))
					{

					?>

               <a href="#" data-toggle="modal" data-target="#myModallUpload" ><img src="images/upload.png"  title="Click here to upload"/>Upload</a>

          <?php
					}//end of is is_admin
					else
				  {
						

						//check if score is entered using user id course id session semester pid
						if(!check_if_staff_entered_score($user_id, $course_id, $session, $semester, $pid))
						{


							?>


							<a href="#" data-toggle="modal" data-target="#myModallUpload" ><img src="images/upload.png"  title="Click here to upload"/>Upload</a>




					<?php }else{ ?>

							<a href="#" data-toggle="tooltip" title="You can't upload again, contact admin" ><img src="images/upload.png"  title="You can't upload again, contact admin"/>Upload</a>


			   <?php }

				}
        ?>

        </div>

        <div>.</div>
    </div>
</div>
