<?php
function showClassSubjectFromSid($con,$subjectID)
{
   $sql = "SELECT s.cs_id,s.cs_name,c.sclass FROM class_subject AS s INNER JOIN class AS c ON s.cs_class = c.sid WHERE s.cs_id ='$subjectID'";
    $run = mysqli_query($con, $sql);
    $rows = mysqli_fetch_assoc($run);
    $showCS = array(
      "showClass"=>"$rows[sclass]", 
      "showSubject"=>"$rows[cs_name]"
    );
    return  $showCS;
}

function showClass($con,$classID)
{
  $cf_sql = "SELECT sid,sclass FROM class WHERE sid='$classID'";
  $cf_run = mysqli_query($con, $cf_sql);
  $cf_rows = mysqli_fetch_assoc($cf_run);
  return $cf_rows["sclass"];
}

function showFullDate($dt) 
  {
    $date=date_create();
    date_timestamp_set($date,
    strtotime("$dt"));
    return date_format($date,"M j, Y");
  }

function showTime($t) 
  {
    $time=date_create();
    date_timestamp_set($time,
    strtotime("$t"));
    return date_format($time,"g:i a");
  }


?>