$divisions .= "," . $departmentID;
     $multipleDivisions = true;
 }
 $divisionTotals = array();
 $totals = array();
 $firstTotalOutput = true;
 $query = "SELECT DISTINCT `proxy_id`, `firstname`, `lastname`, `department_title`, `dep_id`\n\t\t\tFROM `" . DATABASE_NAME . "`.`ar_undergraduate_teaching`, `" . AUTH_DATABASE . "`.`user_data`, `" . AUTH_DATABASE . "`.`user_departments`, `" . AUTH_DATABASE . "`.`departments`\n\t\t\tWHERE `year_reported` = " . $db->qstr($PROCESSED["year_reported"]) . $type_where . "\n\t\t\tAND `" . DATABASE_NAME . "`.`ar_undergraduate_teaching`.`proxy_id` = `" . AUTH_DATABASE . "`.`user_data`.`id` \n\t\t\tAND `" . AUTH_DATABASE . "`.`user_data`.`id` = `" . AUTH_DATABASE . "`.`user_departments`.`user_id`\n\t\t\tAND `" . AUTH_DATABASE . "`.`user_departments`.`dep_id` = `" . AUTH_DATABASE . "`.`departments`.`department_id`\n\t\t\tAND `dep_id` IN(" . $divisions . ")\n\t\t\tORDER BY `department_title` ASC, `lastname` ASC, `firstname` ASC";
 $results = $db->GetAll($query);
 if ($results) {
     echo "<h2>Annual Report Undergraduate Medical Education data for " . $departmentString . "</h2>";
     echo "<div class=\"content-small\" style=\"margin-bottom: 10px\">\n";
     echo "\t<strong>Reporting Period:</strong> " . $PROCESSED["year_reported"] . " <strong>";
     echo "</div>\n";
     foreach ($results as $result) {
         if ($multipleDivisions && $prevDepartment != $result["dep_id"]) {
             $divisionString = fetch_department_title($result["dep_id"]);
             if ($prevDepartment != "") {
                 if (isset($divisionTotals) && count($divisionTotals) > 0) {
                     foreach ($divisionTotals as $key => $outputTotals) {
                         if ($firstTotalOutput == true) {
                             $firstTotalOutput = false;
                             echo "\t<tr><td style=\"width: 5%; font-weight: bold\">Totals:</td>\n";
                         } else {
                             echo "\t<tr><td style=\"width: 5%; font-weight: bold\">&nbsp;</td>\n";
                         }
                         echo "\t<td style=\"width: 3%; font-weight: bold\">" . $key . "</td>\n";
                         echo "\t<td style=\"width: 1%; font-weight: bold\">" . number_format($outputTotals["lecture_hours"], 2) . "</td>\n";
                         echo "\t<td style=\"width: 1%; font-weight: bold\">" . number_format($outputTotals["lab_hours"], 2) . "</td>\n";
                         echo "\t<td style=\"width: 1%; font-weight: bold\">" . number_format($outputTotals["small_group_hours"], 2) . "</td>\n";
                         echo "\t<td style=\"width: 1%; font-weight: bold\">" . number_format($outputTotals["patient_contact_session_hours"], 2) . "</td>\n";
                         echo "\t<td style=\"width: 1%; font-weight: bold\">" . number_format($outputTotals["symposium_hours"], 2) . "</td>\n";
Exemplo n.º 2
0
                            </div>
                        </div> <!--/control-group -->
                        <div class="form-actions" style="padding-left:335px;padding-top:0">
                            <input type="submit" value="Search" class="btn btn-primary"/>
                        </div>

                    </fieldset>
                </form>
            </div>
        </div>
		<?php 
        /**
         * If a department is selected, display the schedule.
         */
        if (isset($_SESSION[APPLICATION_IDENTIFIER][$MODULE]["department_id"]) && (int) $_SESSION[APPLICATION_IDENTIFIER][$MODULE]["department_id"]) {
            $department_title = fetch_department_title($_SESSION[APPLICATION_IDENTIFIER][$MODULE]["department_id"]);
            ?>
            <h2><?php 
            echo html_encode($department_title);
            ?>
</h2>
            <table style="width: 100%" cellspacing="0" cellpadding="0" border="0" summary="Weekly Student Calendar">
            <tr>
                <td style="padding-bottom: 3px; text-align: left; vertical-align: middle; white-space: nowrap">
                    <table style="width: 375px; height: 23px" cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="width: 22px; height: 23px"><a href="<?php 
            echo ENTRADA_URL;
            ?>
/clerkship?<?php 
            echo replace_query(array("dstamp" => strtotime("-1 month", $DATE_START)));
Exemplo n.º 3
0
/**
 * Function used by public events and admin events index to output the HTML for both the filter
 * controls and current filter status (Showing Events That Include:) box.
 */
function events_output_filter_controls($module_type = "")
{
    global $db, $ENTRADA_ACL, $ENTRADA_USER, $translate;
    /**
     * Determine whether or not this is being called from the admin section.
     */
    if ($module_type == "admin") {
        $module_type = "/admin";
    } else {
        $module_type = "";
    }
    /**
     * Retrieve this from the language file for this template.
     */
    $filter_controls = $translate->_("events_filter_controls");
    ?>

	<table id="filterList" style="clear: both; width: 100%" cellspacing="0" cellpadding="0" border="0" summary="Event Filters">
		<tr>
			<td style="width: 53%; vertical-align: top">
				<form action="<?php 
    echo ENTRADA_RELATIVE . $module_type;
    ?>
/events" method="get" id="filter_edit" name="filter_edit" style="position: relative;" class="form-horizontal">
				<input type="hidden" name="action" value="filter_edit" />
				<input type="hidden" id="filter_edit_type" name="filter_type" value="" />
				<input type="hidden" id="multifilter" name="filter" value="" />
				<div class="control-group">
				 <label for="filter_select" class="control-label" style="width:100px;font-weight:bold;text-align:left;vertical-align: middle">Apply Filter:</label>
				 <div class="controls" style="margin-left:100px">
				 <select id="filter_select" onchange="showMultiSelect();">
					 <option>Select Filter</option>
					 <?php 
    if ($filter_controls) {
        foreach ($filter_controls as $value => $control) {
            echo "<option value=\"" . $value . "\">" . $control["label"] . "</option>";
        }
    }
    ?>
				 </select>
				 </div>
				</div>
				<span id="filter_options_loading" style="display:none; vertical-align: middle"><img src="<?php 
    echo ENTRADA_RELATIVE;
    ?>
/images/indicator.gif" width="16" height="16" alt="Please Wait" title="" style="vertical-align: middle" /> Loading ... </span>
				<span id="options_container"></span>
				</form>
				<script type="text/javascript">
				var multiselect = [];
				var id;
				function showMultiSelect() {
					$$('select_multiple_container').invoke('hide');
					id = $F('filter_select');

					if (multiselect[id]) {
						multiselect[id].container.show();
					} else {
						new Ajax.Request('<?php 
    echo ENTRADA_URL . "/api/events_filters.api.php";
    ?>
', {
							parameters: {options_for: id},
							method: "GET",
							onLoading: function() {
								$('filter_options_loading').show();
							},
							onSuccess: function(response) {
								$('options_container').insert(response.responseText);
								if ($(id+'_options')) {
									$('filter_edit_type').value = id;
									$(id+'_options').addClassName('multiselect-processed');

									multiselect[id] = new Control.SelectMultiple('multifilter',id+'_options',{
										checkboxSelector: 'table.select_multiple_table tr td input[type=checkbox]',
											nameSelector: 'table.select_multiple_table tr td.select_multiple_name label',
											filter: id+'_select_filter',
											resize: id+'_scroll',
											afterCheck: function(element) {
												var tr = $(element.parentNode.parentNode);
												tr.removeClassName('selected');
												if (element.checked) {
													tr.addClassName('selected');
												}
											}
									});

									$(id+'_cancel').observe('click',function(event){
										this.container.hide();
										$('filter_select').options.selectedIndex = 0;
										$('filter_select').show();
										return false;
									}.bindAsEventListener(multiselect[id]));

									$(id+'_close').observe('click',function(event){
										this.container.hide();
										$('filter_edit').submit();
										return false;
									}.bindAsEventListener(multiselect[id]));

									multiselect[id].container.show();
								}
							},
							onError: function(response) {
								alert("There was an error retrieving the events filter requested. Please try again.")
							},
							onComplete: function() {
								$('filter_options_loading').hide();
							}
						});
					}
					return false;
				}

				function setDateValue(field, date) {
					timestamp = getMSFromDate(date);
					if (field.value != timestamp) {
						window.location = '<?php 
    echo ENTRADA_URL . $module_type . "/events?" . ($_SERVER["QUERY_STRING"] != "" ? replace_query(array("dstamp" => false)) . "&" : "");
    ?>
dstamp='+timestamp;
					}
					return;
				}
				</script>
			</td>
			<td style="width: 47%; vertical-align: top">
				<?php 
    if (is_array($_SESSION[APPLICATION_IDENTIFIER]["events"]["filters"]) && count($_SESSION[APPLICATION_IDENTIFIER]["events"]["filters"])) {
        echo "<div summary=\"Selected Filter List\" id=\"filter-list\" class=\"inner-content-box\">\n";
        echo "    <div class=\"inner-content-box-head\">\n";
        echo "        Showing Events That Include:\n";
        echo "    </div>\n";
        echo "    <div class=\"clearfix inner-content-box-body\">\n";
        echo "        <div id=\"filter-list-resize-handle\">";
        echo "\t\t      <div id=\"filter-list-resize\">\n";
        foreach ($_SESSION[APPLICATION_IDENTIFIER]["events"]["filters"] as $filter_type => $filter_contents) {
            if (is_array($filter_contents)) {
                echo $filter_name = filter_name($filter_type);
                echo "\t      <div>\n";
                foreach ($filter_contents as $filter_key => $filter_value) {
                    echo "\t      <div id=\"" . $filter_type . "_" . $filter_key . "\">";
                    echo "\t\t      <a href=\"" . ENTRADA_URL . $module_type . "/events?action=filter_remove&amp;filter=" . $filter_type . "_" . $filter_key . "\" title=\"Remove this filter\">";
                    switch ($filter_type) {
                        case "teacher":
                        case "student":
                            echo get_account_data("fullname", $filter_value);
                            break;
                        case "course":
                            echo fetch_course_title($filter_value);
                            break;
                        case "group":
                            echo fetch_group_title($filter_value);
                            break;
                        case "eventtype":
                            echo fetch_eventtype_title($filter_value);
                            break;
                        case "term":
                            echo fetch_term_title($filter_value);
                            break;
                        case "cp":
                        case "co":
                            echo fetch_objective_title($filter_value);
                            break;
                        case "topic":
                            echo fetch_event_topic_title($filter_value);
                            break;
                        case "department":
                            echo fetch_department_title($filter_value);
                            break;
                        default:
                            echo strtoupper($filter_value);
                            break;
                    }
                    echo "            </a>";
                    echo "        </div>\n";
                }
                echo "        </div>\n";
            }
        }
        echo "            </div>\n";
        echo "        </div>\n";
        echo "    </div>\n";
        echo "</div>\n";
        echo "<script type=\"text/javascript\">";
        echo "\tnew ElementResizer(\$('filter-list-resize'), {handleElement: \$('filter-list-resize-handle'), min: 40});";
        echo "</script>";
    }
    ?>
			</td>
		</tr>
	</table>
	<?php 
}
 $publicationTypes = $_POST["type_id"];
 $dateWhere = "";
 $departmentMembers = array();
 if (isset($_POST['start_year']) && $_POST['start_year'] != "") {
     $startYear = (int) $_POST['start_year'];
 } else {
     $startYear = $AR_PAST_YEARS;
 }
 if (isset($_POST['end_year']) && $_POST['end_year'] != "") {
     $endYear = (int) $_POST['end_year'];
 } else {
     $endYear = $AR_FUTURE_YEARS;
 }
 $dateWhere = " AND ((SUBSTRING(status_date, -4, 4) >= {$startYear} AND SUBSTRING(status_date, -4, 4) <= {$endYear}) OR status_date IS NULL OR status_date = 00)";
 $listOfDepartmentMembers = array();
 $departmentOutput = fetch_department_title($departmentID);
 if ($isParentDepartment = fetch_department_children($departmentID)) {
     foreach ($isParentDepartment as $userDepartment) {
         $thisDept = $userDepartment["department_id"];
         $departmentQuery .= " OR `dep_id`=" . $db->qstr($thisDept);
     }
 }
 if (substr($departmentOutput, -1, 1) == "s") {
     $departmentOutput = $departmentOutput . "'";
 } else {
     $departmentOutput = $departmentOutput . "'s";
 }
 echo "<h1 style=\"page-break-before: avoid\">Department of " . $departmentOutput . " Publications by Member</h1>";
 echo "<div class=\"content-small\" style=\"margin-bottom: 10px\">\n";
 echo "\t<strong>Date Range:</strong> " . $startYear . " <strong>to</strong> " . $endYear;
 echo "</div>";
Exemplo n.º 5
0
     $ERRORSTR[] = "You do not have the permissions required to use this module.<br /><br />If you believe you are receiving this message in error please contact <a href=\"mailto:" . html_encode($AGENT_CONTACTS["administrator"]["email"]) . "\">" . html_encode($AGENT_CONTACTS["administrator"]["name"]) . "</a> for assistance.";
     echo display_error();
     application_log("error", "Group [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["group"] . "] and role [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["role"] . "] do not have access to this module [" . $MODULE . "]");
 } else {
     // Meta information for this page.
     $PAGE_META["title"] = "Add Activity Profile";
     $PAGE_META["education"] = "Activity Profile portion of your annual report should be entered / located here.";
     $PAGE_META["keywords"] = "";
     $BREADCRUMB[] = array("url" => ENTRADA_URL . "/annualreport/activityprofile?section=add_profile", "title" => "Add Activity Profile");
     // This grid should be expanded upon redirecting back to the profile index.
     $_SESSION["profile_expand_grid"] = "profile_grid";
     echo "<h1>Add Activity Profile</h1>";
     $departments = get_user_departments($ENTRADA_USER->getActiveId());
     foreach ($departments as $department) {
         if ($parent = fetch_department_parent($department["department_id"])) {
             $department["department_title"] = fetch_department_title($parent);
         }
         if (isset($departmentString)) {
             $departmentString = $departmentString . ", " . $department["department_title"];
         } else {
             $departmentString = $department["department_title"];
         }
     }
     if (!$ENTRADA_USER->getClinical()) {
         // Error Checking
         switch ($STEP) {
             case 2:
                 /**
                  * Required field "education" / Education
                  */
                 if (isset($_POST["percentage_education"]) && ($education = clean_input($_POST["percentage_education"], array("float", "trim")))) {