function _AdvisingScreen::z__old__draw_progress_boxes

5.x _AdvisingScreen.php _AdvisingScreen::z__old__draw_progress_boxes()

This function calls drawPieChart to construct the student's 3 progress pie charts.

Return value

string

File

classes/_AdvisingScreen.php, line 1906

Class

_AdvisingScreen

Code

function z__old__draw_progress_boxes() 
 {
  global $user;
  // Draw the boxes for student progress (where
  // the pie charts go!)
  $rtn = "";


  if ($this->degree_plan->total_degree_hours < 1) 
   {
    $this->degree_plan->calculate_progress_hours();
    $this->degree_plan->calculate_progress_quality_points();
  }


  $total_major_hours = $this->degree_plan->total_major_hours;
  $total_core_hours = $this->degree_plan->total_core_hours;
  $total_degree_hours = $this->degree_plan->total_degree_hours;
  $fulfilled_major_hours = $this->degree_plan->fulfilled_major_hours;
  $fulfilled_core_hours = $this->degree_plan->fulfilled_core_hours;
  $fulfilled_degree_hours = $this->degree_plan->fulfilled_degree_hours;
  $major_qpts = $this->degree_plan->major_qpts;
  $degree_qpts = $this->degree_plan->degree_qpts;
  $core_qpts = $this->degree_plan->core_qpts;


  $rtn .= "<tr><td colspan='2'>
				";

  if (!$this->db) {
    $this->db = get_global_database_handler();
  }

  $user->settings = $this->db->get_user_settings($user->id);

  if ($user->settings ["hide_charts"] != "hide" && $this->bool_print == false && $this->bool_blank == false && $this->page_is_mobile == false) 
   { // Display the pie charts unless the student's settings say to hide them.


    $rtn .= "
				<div style='margin-bottom: 10px;'>
				<table width='100%' cellspacing='0' cellpadding='0' border='0'>
				<td width='33%' style='padding-right:5px;'>
					" . $this->draw_pie_chart_box(t("Progress - Core Courses"), $fulfilled_core_hours, $total_core_hours, "core") . "
				</td>
				
				<td width='33%' style='padding-right: 5px;'>
					" . $this->draw_pie_chart_box(t("Progress - Major Courses"), $fulfilled_major_hours, $total_major_hours, "major") . "
				</td>
				
				<td width='33%'>
					" . $this->draw_pie_chart_box(t("Progress - Degree"), $fulfilled_degree_hours, $total_degree_hours, "cumulative") . "
				</td>
				

				
				</table>
				";

    $rtn .= "
				
				<div style='font-size: 8pt; text-align:right;'>
					<a href='javascript:hideShowCharts(\"hide\");'>" . t("hide charts") . "</a>
				</div>";

    $rtn .= "
				</div>";
  }
  else {
    // Hide the charts!  Show a "show" link....
    $rtn .= "
 			<table border='0' width='100%'  class='elevenpt blueBorder' cellpadding='0' cellspacing='0' >
 			<tr>
  				<td colspan='4' class='blueTitle' align='center' height='20'>
    			" . fp_render_square_line(t("Progress")) . "
  				</td>
 			</tr>
 			<tr>
 				<td class='tenpt' width='33%' align='center'>
 					" . t("Core:") . " $fulfilled_core_hours / $total_core_hours
 				</td>
 				<td class='tenpt' width='33%' align='center'>
 					" . t("Major:") . " $fulfilled_major_hours / $total_major_hours
 				</td>
 				<td class='tenpt' width='33%' align='center'>
 					" . t("Degree:") . " $fulfilled_degree_hours / $total_degree_hours
 				</td>
 				
 			</tr>

			</table>
			";

    if ($this->bool_print != true && $this->bool_blank != true && $this->page_is_mobile != true) 
     {

      $rtn .= "<div style='font-size: 8pt; text-align:right;'>
					<a href='javascript:hideShowCharts(\"show\");'>" . t("show charts") . "</a>
				</div>
					";
    }
    else {
      $rtn .= "<div> &nbsp; </div>";
    }
  }
  $rtn .= "
				</td></tr>";



  return $rtn;
}