コード例 #1
0
 $lastDiscipline = "";
 $weeksCounter = 0;
 $disciplines = array();
 foreach ($results as $result) {
     $discipline = clerkship_fetch_specific_discipline($result["discipline_id"]);
     if ($lastDiscipline == "" || $lastDiscipline == $discipline) {
         $difference = ($result["event_finish"] - $result["event_start"]) / 604800;
         $weeksCounter = $weeksCounter + ceil($difference);
     } else {
         $disciplines[$lastDiscipline] = $weeksCounter;
         $difference = ($result["event_finish"] - $result["event_start"]) / 604800;
         $weeksCounter = ceil($difference);
     }
     $lastDiscipline = $discipline;
 }
 $currentDiscipline = clerkship_fetch_specific_discipline($result["discipline_id"]);
 $disciplines[$currentDiscipline] = $weeksCounter;
 $xTicks = "";
 $testCounter = 0;
 foreach ($disciplines as $key => $value) {
     if ($xTicks != "") {
         // The following comment is an example of what to pass to PlotKit.
         //[{label: '01', v: 0}, {label: '02', v: 1}, {label: '03', v: 2}, {label: '04', v: 3}, {label: '05', v: 4}, {label: '06', v: 5}, {label: '07', v: 6}, {label: '08', v: 7}, {label: '09', v: 8}, {label: '10', v: 9}, {label: '11', v: 10}, {label: '12', v: 11}, {label: '13', v: 12}, {label: '14', v: 13}, {label: '15', v: 14}, {label: '16', v: 15}, {label: '17', v: 16}, {label: '18', v: 17}, {label: '19', v: 18}, {label: '20', v: 19}, {label: '21', v: 20}, {label: '22', v: 21}, {label: '23', v: 22}, {label: '24', v: 23}, {label: '25', v: 24}, {label: '26', v: 25}, {label: '27', v: 26}, {label: '28', v: 27}, {label: '29', v: 28}, {label: '30', v: 29}, {label: '31', v: 30}]
         $xTicks .= ", {label: '" . addslashes($key) . "', v: " . (int) $testCounter . "}";
         $javaResultString .= ", [" . $testCounter . ", " . $value . "]";
     } else {
         $xTicks = "[{label: '" . addslashes($key) . "', v: " . (int) $testCounter . "}";
         $javaResultString = "[[" . $testCounter . ", " . $value . "]";
     }
     $testCounter++;
     $phpOutPutArray[$key] = $value;
コード例 #2
0
						</tr>
						<tr>
							<td style="width: 25%">Elective Department</td>
							<?php 
                        $query = "\tSELECT `category_name`\n\t\t\t\t\t\t\tFROM `" . CLERKSHIP_DATABASE . "`.`categories`\n\t\t\t\t\t\t\tWHERE `category_id` = " . $db->qstr($PROCESSED["department_id"]);
                        $result = $db->GetRow($query);
                        ?>
							<td style="width: 75%"><?php 
                        echo $result["category_name"];
                        ?>
</td>
						</tr>
						<tr>
							<td style="width: 25%">Elective Discipline</td>
							<td style="width: 75%"><?php 
                        echo clerkship_fetch_specific_discipline($PROCESSED["discipline_id"]);
                        ?>
</td>
						</tr>
						<tr>
							<td style="width: 25%">Sub-Discipline</td>
							<td style="width: 75%"><?php 
                        echo !isset($PROCESSED["sub_discipline"]) || $PROCESSED["sub_discipline"] == "" ? "N/A" : $PROCESSED["sub_discipline"];
                        ?>
</td>
						</tr>
						<tr>
							<td style="width: 25%">Host School</td>
							<td style="width: 75%"><?php 
                        echo clerkship_fetch_specific_school($PROCESSED["schools_id"]);
                        ?>