예제 #1
0
/images/logo.png" alt="<?php 
echo APPLICATION_NAME;
?>
" title="<?php 
echo APPLICATION_NAME;
?>
"/></a></h1>
                        </div>
                        <?php 
if (isset($_SESSION["isAuthorized"]) && $_SESSION["isAuthorized"]) {
    ?>
                            <div class="span5">
                                <div class="welcome-area">
                                    <div class="userAvatar">
                                        <a href="#"><?php 
    echo "<img src=\"" . webservice_url("photo", array($ENTRADA_USER->getID(), isset($uploaded_file_active) && $uploaded_file_active ? "upload" : (!file_exists(STORAGE_USER_PHOTOS . "/" . $ENTRADA_USER->getID() . "-official") && file_exists(STORAGE_USER_PHOTOS . "/" . $ENTRADA_USER->getID() . "-upload") ? "upload" : "official"))) . "\" width=\"32\" height=\"42\" style=\"width: 32px; height: 42px;\" alt=\"" . html_encode($_SESSION["details"]["firstname"] . " " . $_SESSION["details"]["lastname"]) . "\" class=\"img-polaroid\" />";
    ?>
</a>
                                    </div>
                                    <div class="welcome-block">
                                        Welcome <span class="userName"><?php 
    echo $ENTRADA_USER->getFirstname() . " " . $ENTRADA_USER->getLastname();
    ?>
</span>
                                        <br />
                                        <a href="<?php 
    echo ENTRADA_RELATIVE;
    ?>
/profile">My Profile</a> |
                                        <a href="<?php 
    echo ENTRADA_RELATIVE;
예제 #2
0
         if (trim($result["page_title"]) != "") {
             $page_text .= "<h1>" . html_encode($result["page_title"]) . ($LOGGED_IN && $COMMUNITY_ADMIN ? "<a id=\"community-edit-button\" href=\"" . COMMUNITY_URL . $COMMUNITY_URL . ":pages?action=edit&step=1&page=" . $result["cpage_id"] . "\" class=\"edit-community-page-btn pull-right\">Edit Page</a>" : "") . "</h1>";
         }
         if (trim($result["page_content"]) != "") {
             $page_text .= $result["page_content"] . "\n<br /><br />\n";
         }
     }
     $PAGE_CONTENT = $page_text . $PAGE_CONTENT;
 }
 $PAGE_META["title"] = $community_details["community_title"];
 $PAGE_META["description"] = trim(str_replace(array("\t", "\n", "\r"), " ", html_encode(strip_tags($community_details["community_description"]))));
 $PAGE_META["keywords"] = trim(str_replace(array("\t", "\n", "\r"), " ", html_encode(strip_tags($community_details["community_keywords"]))));
 "";
 if ($LOGGED_IN) {
     $member_name = html_encode($_SESSION["details"]["firstname"] . " " . $_SESSION["details"]["lastname"]);
     $sys_profile_photo = webservice_url("photo", array($ENTRADA_USER->getID(), isset($uploaded_file_active) && $uploaded_file_active ? "upload" : (!file_exists(STORAGE_USER_PHOTOS . "/" . $ENTRADA_USER->getID() . "-official") && file_exists(STORAGE_USER_PHOTOS . "/" . $ENTRADA_USER->getID() . "-upload") ? "upload" : "official")));
     /**
      * Cache any outstanding evaluations.
      */
     if (!isset($ENTRADA_CACHE) || !$ENTRADA_CACHE->test("evaluations_outstanding_" . AUTH_APP_ID . "_" . $ENTRADA_USER->getID())) {
         $evaluations_outstanding = Models_Evaluation::getOutstandingEvaluations($ENTRADA_USER->getID(), $ENTRADA_USER->getActiveOrganisation(), true);
         if (isset($ENTRADA_CACHE)) {
             $ENTRADA_CACHE->save($evaluations_outstanding, "evaluations_outstanding_" . AUTH_APP_ID . "_" . $ENTRADA_USER->getID());
         }
     } else {
         $evaluations_outstanding = $ENTRADA_CACHE->load("evaluations_outstanding_" . AUTH_APP_ID . "_" . $ENTRADA_USER->getID());
     }
     if ($evaluations_outstanding) {
         $sys_profile_evaluations = "<span class=\"badge badge-success\"><small>" . $evaluations_outstanding . "</small></span>";
     } else {
         $sys_profile_evaluations = "";
                if ($SUCCESS) {
                    echo display_success();
                }
                if ($NOTICE) {
                    echo display_notice();
                }
                if ($ERROR) {
                    echo display_error();
                }
                break;
            case 1:
            default:
                if ($ERROR) {
                    echo display_error();
                }
                $HEAD[] = "<script type=\"text/javascript\">\n\t\t\tvar updater = null;\n\t\t\tfunction provStateFunction(countries_id)\n\t\t\t{\t\n\t\t\t\tvar url='" . webservice_url("clerkship_prov") . "';\n\t\t\t\turl=url+'?countries_id='+countries_id+'&prov_state=" . rawurlencode(isset($_POST["prov_state"]) ? clean_input($_POST["prov_state"], array("notags", "trim")) : $PROCESSED["prov_state"]) . "';\n\t\t    \tnew Ajax.Updater(\$('prov_state_div'), url, \n\t\t\t\t\t{ \n\t\t\t\t\t\tmethod:'get',\n\t\t\t\t\t\tonComplete: function () {\n\t\t\t\t\t\t\tgenerateAutocomplete();\n\t\t\t\t\t\t\tif (\$('prov_state').selectedIndex || \$('prov_state').selectedIndex === 0) {\n\t\t\t\t\t\t\t\t\$('prov_state_label').removeClassName('form-nrequired');\n\t\t\t\t\t\t\t\t\$('prov_state_label').addClassName('form-required');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\$('prov_state_label').removeClassName('form-required');\n\t\t\t\t\t\t\t\t\$('prov_state_label').addClassName('form-nrequired');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tfunction generateAutocomplete() {\n\t\t\t\tif (updater != null) {\n\t\t\t\t\tupdater.url = '" . ENTRADA_URL . "/api/cities-by-country.api.php?countries_id='+\$('countries_id').options[\$('countries_id').selectedIndex].value+'&prov_state='+(\$('prov_state') !== null ? (\$('prov_state').selectedIndex || \$('prov_state').selectedIndex === 0 ? \$('prov_state').options[\$('prov_state').selectedIndex].value : \$('prov_state').value) : '');\n\t\t\t\t} else {\n\t\t\t\t\tupdater = new Ajax.Autocompleter('city', 'city_auto_complete', \n\t\t\t\t\t\t'" . ENTRADA_URL . "/api/cities-by-country.api.php?countries_id='+\$('countries_id').options[\$('countries_id').selectedIndex].value+'&prov_state='+(\$('prov_state') !== null ? (\$('prov_state').selectedIndex || \$('prov_state').selectedIndex === 0 ? \$('prov_state').options[\$('prov_state').selectedIndex].value : \$('prov_state').value) : ''), \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfrequency: 0.2, \n\t\t\t\t\t\t\tminChars: 2\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\t</script>\n";
                $ONLOAD[] = "provStateFunction(\$F(\$('addConferencePaperForm')['countries_id']))";
                ?>
			<form id="addConferencePaperForm" action="<?php 
                echo ENTRADA_URL;
                ?>
/annualreport/research?section=add_conference_papers&amp;step=2" method="post">
			<table style="width: 100%" cellspacing="0" cellpadding="2" border="0" summary="Adding Invited Lectures / Conference Papers">
			<colgroup>
				<col style="width: 3%" />
				<col style="width: 20%" />
				<col style="width: 77%" />
			</colgroup>
			<tr>
				<td colspan="3"><h2>Details</h2></td>
			</tr>						
예제 #4
0
 }
 /**
  * If the photo file actually exists, and
  * If the uploaded file is active in the user_photos table, and
  * If the proxy_id has their privacy set to "Basic Information" or higher.
  */
 $query = "SELECT `photo_active` FROM `" . AUTH_DATABASE . "`.`user_photos` WHERE `photo_type` = '1' AND `photo_active` = '1' AND `proxy_id` = " . $db->qstr($result["id"]);
 $photo_active = $db->GetOne($query);
 if (@file_exists(STORAGE_USER_PHOTOS . "/" . $result["id"] . "-upload") && $photo_active && $ENTRADA_ACL && $ENTRADA_ACL->amIAllowed(new PhotoResource($result["id"], (int) $result["privacy_level"], "upload"), "read")) {
     $uploaded_file_active = true;
 }
 if ($offical_file_active) {
     echo "\t\t<img id=\"official_photo_" . $result["id"] . "\" class=\"official\" src=\"" . webservice_url("photo", array($result["id"], "official")) . "\" width=\"72\" height=\"100\" alt=\"" . html_encode($result["prefix"] . " " . $result["firstname"] . " " . $result["lastname"]) . "\" title=\"" . html_encode($result["prefix"] . " " . $result["firstname"] . " " . $result["lastname"]) . "\" />\n";
 }
 if ($uploaded_file_active) {
     echo "\t\t<img id=\"uploaded_photo_" . $result["id"] . "\" class=\"uploaded\" src=\"" . webservice_url("photo", array($result["id"], "upload")) . "\" width=\"72\" height=\"100\" alt=\"" . html_encode($result["prefix"] . " " . $result["firstname"] . " " . $result["lastname"]) . "\" title=\"" . html_encode($result["prefix"] . " " . $result["firstname"] . " " . $result["lastname"]) . "\" />\n";
 }
 if (!$offical_file_active && !$uploaded_file_active) {
     echo "\t\t<img src=\"" . ENTRADA_URL . "/images/headshot-male.gif\" width=\"72\" height=\"100\" alt=\"No Photo Available\" title=\"No Photo Available\" />\n";
 }
 echo "\t\t\t</div>\n";
 echo "\t\t</td>\n";
 echo "\t\t<td style=\"font-size: 12px; color: #003366; vertical-align: top\">";
 echo "\t\t\t<div style=\"font-weight: bold; font-size: 13px;\">" . html_encode(($result["prefix"] ? $result["prefix"] . " " : "") . $result["firstname"] . " " . $result["lastname"]) . "</div>";
 echo "\t\t\t<div class=\"content-small\" style=\"margin-bottom: 15px\">" . ucwords($result["group"]) . " > " . ($result["group"] == "student" ? "Class of " : "") . ucwords($result["role"]) . "</div>\n";
 if ($result["privacy_level"] > 1 || $COMMUNITY_ADMIN) {
     echo "\t\t\t<a href=\"mailto:" . html_encode($result["email"]) . "\" style=\"font-size: 10px;\">" . html_encode($result["email"]) . "</a><br />\n";
     if ($result["email_alt"]) {
         echo "\t\t<a href=\"mailto:" . html_encode($result["email_alt"]) . "\" style=\"font-size: 10px;\">" . html_encode($result["email_alt"]) . "</a>\n";
     }
 }
예제 #5
0
						Effect.Fade($('keys_division'));
					} else {
						$('keys_from_super').checked = false;
						Effect.Appear($('keys_division'));
					}
				}
		


			function initialize() {
				googleMap = new GMap2($('mapData'));
			}

			function provStateFunction(countries_id) {
				var url='<?php 
            echo webservice_url("province");
            ?>
';
				url = url + '?countries_id=' + countries_id + '&prov_state=<?php 
            echo rawurlencode(isset($_POST["prov_state"]) ? clean_input($_POST["prov_state"], array("notags", "trim")) : $PROCESSED["prov_state"]);
            ?>
';
				new Ajax.Updater($('prov_state_div'), url,
					{
						method:'get',
						onComplete: function () {
							generateAutocomplete();
							
							if ($('prov_state').type == 'select-one') {
								$('prov_state').observe('change', updateAptData);
예제 #6
0
			},
			function() {
				jQuery("#profile-image-container .btn").fadeOut("fast");
			});
		});
		</script>

		<div id="profile-image-container" class="pull-right">
			<a href="#upload-image" id="upload-image-modal-btn" data-toggle="modal" class="btn btn-primary" id="upload-profile-image">Upload Photo</a>
			<?php 
        $query = "SELECT * FROM `" . AUTH_DATABASE . "`.`user_photos` WHERE `proxy_id` = " . $db->qstr($user_data["id"]);
        $uploaded_photo = $db->GetRow($query);
        ?>
			<span>
                <img src="<?php 
        echo webservice_url("photo", array($ENTRADA_USER->getID(), $uploaded_photo ? "upload" : "official")) . "/" . time();
        ?>
" width="192" height="250" class="img-polaroid" />
            </span>
			<div class="btn-group" id="btn-toggle" class="<?php 
        echo $uploaded_photo ? "uploaded" : "official";
        ?>
">
				<a href="#" class="btn btn-small <?php 
        echo $uploaded_photo["photo_active"] == "0" ? "active" : "";
        ?>
" id="image-nav-left">Official</a>
				<?php 
        if ($uploaded_photo) {
            ?>
                    <a href="#" class="btn btn-small <?php 
예제 #7
0
function load_system_navigator()
{
    global $db, $HEAD, $ONLOAD, $USER_ACCESS, $ENTRADA_USER;
    $output = "";
    if (isset($_SESSION["isAuthorized"]) && (bool) $_SESSION["isAuthorized"] && $_SESSION['details']['group'] != 'guest') {
        /**
         * Important: Make sure Prototype is loaded, or this will error out.
         *
         */
        $HEAD[] = "<link href=\"" . ENTRADA_RELATIVE . "/css/navigator.css?release=" . html_encode(APPLICATION_VERSION) . "\" rel=\"stylesheet\" type=\"text/css\" />";
        $output .= "<div id=\"navigator-container\">\n";
        $output .= "\t<div id=\"navigator\" style=\"display: none\">\n";
        $output .= "\t\t<div id=\"navigator-interior\">\n";
        $output .= "\t\t\t<table style=\"width: 98%; table-layout: fixed\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
        $output .= "\t\t\t<colgroup>\n";
        $output .= "\t\t\t\t<col style=\"width: 25%\" />\n";
        $output .= "\t\t\t\t<col style=\"width: 25%\" />\n";
        $output .= "\t\t\t\t<col style=\"width: 30%\" />\n";
        $output .= "\t\t\t\t<col style=\"width: 20%\" />\n";
        $output .= "\t\t\t</colgroup>\n";
        $output .= "\t\t\t<tbody>\n";
        $output .= "\t\t\t\t<tr>\n";
        $output .= "\t\t\t\t\t<td style=\"background-image: none\">\n";
        $output .= "\t\t\t\t\t\t<h3>" . APPLICATION_NAME . "</h3>\n";
        $output .= "\t\t\t\t\t\t<ul>\n";
        $output .= "\t\t\t\t\t\t\t<li><a href=\"" . ENTRADA_URL . "/dashboard\">Dashboard</a></li>\n";
        $output .= "\t\t\t\t\t\t\t<li><a href=\"" . ENTRADA_URL . "/communities\">Communities</a></li>\n";
        $output .= "\t\t\t\t\t\t\t<li><a href=\"" . ENTRADA_URL . "/courses\">Courses</a></li>\n";
        $output .= "\t\t\t\t\t\t\t<li><a href=\"" . ENTRADA_URL . "/events\">Learning Events</a></li>\n";
        $output .= "\t\t\t\t\t\t\t<li><a href=\"" . ENTRADA_URL . "/search\">Curriculum Search</a></li>\n";
        $output .= "\t\t\t\t\t\t\t<li><a href=\"" . ENTRADA_URL . "/people\">People Search</a></li>\n";
        $output .= "\t\t\t\t\t\t\t<li><a href=\"" . ENTRADA_URL . "/library\">Library</a></li>\n";
        $output .= "\t\t\t\t\t\t</ul>\n";
        $output .= "\t\t\t\t\t</td>\n";
        $output .= "\t\t\t\t\t<td>\n";
        $output .= "\t\t\t\t\t\t<h3>My Communities</h3>\n";
        $query = "\tSELECT b.`community_id`, b.`community_url`, b.`community_title`\n\t\t\t\t\tFROM `community_members` AS a\n\t\t\t\t\tLEFT JOIN `communities` AS b\n\t\t\t\t\tON b.`community_id` = a.`community_id`\n\t\t\t\t\tWHERE a.`proxy_id` = " . $db->qstr($ENTRADA_USER->getActiveId()) . "\n\t\t\t\t\tAND a.`member_active` = '1'\n\t\t\t\t\tAND b.`community_active` = '1'\n\t\t\t\t\tAND b.`community_template` <> 'course'\n\t\t\t\t\tORDER BY b.`community_title` ASC\n\t\t\t\t\tLIMIT 0, 16";
        if ($results = $db->CacheGetAll(CACHE_TIMEOUT, $query)) {
            $output .= "<ul>\n";
            foreach ($results as $key => $result) {
                if ($key < 15) {
                    $output .= "<li><a href=\"" . ENTRADA_URL . "/community" . $result["community_url"] . "\">" . html_encode($result["community_title"]) . "</a></li>\n";
                } else {
                    $output .= "<li><a href=\"" . ENTRADA_URL . "/communities\">...</a></li>\n";
                    break;
                }
            }
            $output .= "</ul>\n";
        } else {
            $output .= "You are not yet a member of any communities.\n";
            $output .= "<ul>\n";
            $output .= "\t<li><a href=\"" . ENTRADA_URL . "/communities\" style=\"font-size: 12px; font-weight: bold\">Click here to launch Communities</a></li>\n";
            $output .= "</ul>\n";
        }
        $output .= "\t\t\t\t\t</td>\n";
        $output .= "\t\t\t\t\t<td>\n";
        $output .= "\t\t\t\t\t\t<h3>Community Announcements &amp; Events</h3>\n";
        $query = "\tSELECT a.`community_id`, a.`member_acl`, b.`community_url`, b.`community_title`\n\t\t\t\t\t\tFROM `community_members` AS a\n\t\t\t\t\t\tLEFT JOIN `communities` AS b\n\t\t\t\t\t\tON a.`community_id` = b.`community_id`\n\t\t\t\t\t\tWHERE a.`proxy_id` = " . $db->qstr($ENTRADA_USER->getActiveId()) . "\n\t\t\t\t\t\tAND a.`member_active` = '1'";
        $results = $db->CacheGetAll(CACHE_TIMEOUT, $query);
        if ($results) {
            $community_ids = array();
            $page_ids = array();
            foreach ($results as $result) {
                $community_ids[(int) $result["community_id"]] = array("url" => $result["community_url"], "title" => $result["community_title"]);
            }
            $query = "\tSELECT a.`cpage_id` FROM `community_pages` AS a\n\t\t\t\t\t\tJOIN `communities` AS b\n\t\t\t\t\t\tON a.`community_id` = b.`community_id`\n\t\t\t\t\t\tJOIN `community_members` AS c\n\t\t\t\t\t\tON b.`community_id` = c.`community_id`\n\t\t\t\t\t\tAND c.`proxy_id` = " . $db->qstr($ENTRADA_USER->getActiveId()) . "\n\t\t\t\t\t\tAND c.`member_active` = '1'\n\t\t\t\t\t\tWHERE (a.`allow_member_view` = '1')\n\t\t\t\t\t\tOR (c.`member_acl` = '1')";
            $cpage_ids = $db->GetAll($query);
            if ($cpage_ids) {
                foreach ($cpage_ids as $page_id) {
                    $community_pages[] = $page_id["cpage_id"];
                }
            }
            if ($community_pages) {
                foreach ($community_pages as $key => $page_id) {
                    $page_ids[] = $page_id;
                }
            }
            if (@count($community_ids)) {
                $query = "\tSELECT a.*, b.`page_url`\n\t\t\t\t\t\t\t\tFROM `community_announcements` as a\n\t\t\t\t\t\t\t\tLEFT JOIN `community_pages` as b\n\t\t\t\t\t\t\t\tON a.`cpage_id` = b.`cpage_id`\n\t\t\t\t\t\t\t\tWHERE a.`cpage_id` IN ('" . implode("', '", $page_ids) . "')\n\t\t\t\t\t\t\t\tAND a.`announcement_active` = '1'\n\t\t\t\t\t\t\t\tAND b.`page_active` = '1'\n\t\t\t\t\t\t\t\tAND (a.`release_date` = '0' OR a.`release_date` <= '" . time() . "')\n\t\t\t\t\t\t\t\tAND (a.`release_until` = '0' OR a.`release_until` > '" . time() . "')\n\t\t\t\t\t\t\t\tAND a.`pending_moderation` = '0'\n\t\t\t\t\t\t\t\tORDER BY a.`release_date` DESC\n\t\t\t\t\t\t\t\tLIMIT 0, 3";
                $announcements = $db->CacheGetAll(CACHE_TIMEOUT, $query);
                if ($announcements) {
                    $output .= "<ul class=\"history\" style=\"margin-left: 0px; margin-right: 5px; padding-left: 0px\">";
                    $community_id = 0;
                    foreach ($announcements as $key => $result) {
                        if ($result["community_id"] != $community_id) {
                            $output .= "<li style=\"background-image: none; margin-left: 0px; padding-left: 0px\"><a href=\"" . COMMUNITY_URL . $community_ids[$result["community_id"]]["url"] . "\" style=\"font-weight: bold\">" . html_encode($community_ids[$result["community_id"]]["title"]) . "</a></li>";
                            $output .= "<li style=\"background-image: none; margin-left: 5px; padding-left: 5px\"><a href=\"" . COMMUNITY_URL . $community_ids[$result["community_id"]]["url"] . ":" . $result["page_url"] . "\" style=\"font-weight: bold\">" . html_encode($result["announcement_title"]) . "</a></li>";
                            $community_id = $result["community_id"];
                        } else {
                            $output .= "<li style=\"background-image: none; margin-left: 5px; padding-left: 5px\"><a href=\"" . COMMUNITY_URL . $community_ids[$result["community_id"]]["url"] . ":" . $result["page_url"] . "\" style=\"font-weight: bold\">" . html_encode($result["announcement_title"]) . "</a></li>";
                        }
                    }
                    $output .= "</ul>";
                }
            }
            if (@count($community_ids)) {
                $query = "\tSELECT a.*, b.`page_url`\n\t\t\t\t\t\t\t\tFROM `community_events` as a\n\t\t\t\t\t\t\t\tLEFT JOIN `community_pages` as b\n\t\t\t\t\t\t\t\tON a.`cpage_id` = b.`cpage_id`\n\t\t\t\t\t\t\t\tWHERE a.`community_id` IN ('" . implode("', '", @array_keys($community_ids)) . "')\n\t\t\t\t\t\t\t\tAND a.`event_active` = '1'\n\t\t\t\t\t\t\t\tAND b.`page_active` = '1'\n\t\t\t\t\t\t\t\tAND (a.`release_date` = '0' OR a.`release_date` <= '" . time() . "')\n\t\t\t\t\t\t\t\tAND (a.`release_until` = '0' OR a.`release_until` > '" . time() . "')\n\t\t\t\t\t\t\t\tAND (a.`event_finish` >= '" . time() . "')\n\t\t\t\t\t\t\t\tAND (a.`event_start` <= '" . strtotime("+1 month") . "')\n\t\t\t\t\t\t\t\tAND a.`pending_moderation` = '0'\n\t\t\t\t\t\t\t\tORDER BY a.`event_start` DESC\n\t\t\t\t\t\t\t\tLIMIT 0, 3";
                $events = $db->CacheGetAll(CACHE_TIMEOUT, $query);
                if ($events) {
                    $output .= "<ul class=\"history\" style=\"margin-left: 0px; margin-right: 5px; padding-left: 0px\">";
                    $community_id = 0;
                    foreach ($events as $key => $result) {
                        if ($result["community_id"] != $community_id) {
                            $output .= "<li style=\"background-image: none; margin-left: 0px; padding-left: 0px\"><a href=\"" . COMMUNITY_URL . $community_ids[$result["community_id"]]["url"] . "\" style=\"font-weight: bold\">" . html_encode($community_ids[$result["community_id"]]["title"]) . "</a></li>";
                            $output .= "<li style=\"background-image: none; margin-left: 5px; padding-left: 5px\"><a href=\"" . COMMUNITY_URL . $community_ids[$result["community_id"]]["url"] . ":" . $result["page_url"] . "\" style=\"font-weight: bold\">" . html_encode($result["event_title"]) . "</a></li>";
                            $community_id = $result["community_id"];
                        } else {
                            $output .= "<li style=\"background-image: none; margin-left: 5px; padding-left: 5px\"><a href=\"" . COMMUNITY_URL . $community_ids[$result["community_id"]]["url"] . ":" . $result["page_url"] . "\" style=\"font-weight: bold\">" . html_encode($result["event_title"]) . "</a></li>";
                        }
                    }
                    $output .= "</ul>";
                }
            }
            if (!$events && !$announcements) {
                $output .= "There are no new announcements or events in any communities that you are a member of.\n";
            }
        } else {
            $output .= "You are not yet a member of any communities.\n";
            $output .= "<ul>\n";
            $output .= "\t<li><a href=\"" . ENTRADA_URL . "/communities\" style=\"font-size: 12px; font-weight: bold\">Click here to launch Communities</a></li>\n";
            $output .= "</ul>\n";
        }
        $output .= "\t\t\t\t\t</td>\n";
        $output .= "\t\t\t\t\t<td>\n";
        $output .= "\t\t\t\t\t\t<h3>My Profile</h3>\n";
        $uploaded_file_active = $db->GetOne("SELECT `photo_active` FROM `" . AUTH_DATABASE . "`.`user_photos` WHERE `photo_type` = 1 AND `proxy_id` = " . $db->qstr($ENTRADA_USER->getID()));
        $output .= "\t\t\t\t\t\t<img src=\"" . webservice_url("photo", array($ENTRADA_USER->getID(), isset($uploaded_file_active) && $uploaded_file_active ? "upload" : (!file_exists(STORAGE_USER_PHOTOS . "/" . $ENTRADA_USER->getID() . "-official") && file_exists(STORAGE_USER_PHOTOS . "/" . $ENTRADA_USER->getID() . "-upload") ? "upload" : "official"))) . "\" width=\"72\" height=\"100\" alt=\"" . html_encode($_SESSION["details"]["firstname"] . " " . $_SESSION["details"]["lastname"]) . "\" title=\"" . html_encode($_SESSION["details"]["firstname"] . " " . $_SESSION["details"]["lastname"]) . "\" style=\"margin-top: 8px; background-color: #FFFFFF; border: 1px #EEEEEE solid\" />\n";
        $output .= "\t\t\t\t\t\t<ul>\n";
        $output .= "\t\t\t\t\t\t\t<li>" . html_encode($_SESSION["details"]["firstname"] . " " . $_SESSION["details"]["lastname"]) . "</li>\n";
        $output .= "\t\t\t\t\t\t\t<li><a href=\"mailto:" . html_encode($_SESSION["details"]["email"]) . "\">" . html_encode($_SESSION["details"]["email"]) . "</a></li>\n";
        if ($_SESSION['details']['group'] != 'guest') {
            $output .= "\t\t\t\t\t\t\t<li><a href=\"" . ENTRADA_URL . "/profile\">Update Profile</a></li>\n";
        }
        $output .= "\t\t\t\t\t\t\t<li style=\"margin-top: 15px\"><a href=\"" . ENTRADA_URL . "/?action=logout\" style=\"font-weight: bold\">Logout</a></li>\n";
        $output .= "\t\t\t\t\t\t</ul>\n";
        $output .= "\t\t\t\t\t</td>\n";
        $output .= "\t\t\t\t</tr>\n";
        $output .= "\t\t\t</tbody>\n";
        $output .= "\t\t\t</table>\n";
        $output .= "\t\t</div>\n";
        $output .= "\t</div>\n";
        $output .= "\t<div id=\"navigator-tab\">\n";
        $output .= "\t\t<a href=\"javascript: void(0);\" class=\"toc\" onclick=\"new Effect.toggle('navigator', 'slide', { duration: 0.4 }); return false;  \">Table of contents</a>\n";
        $output .= "\t</div>\n";
        $output .= "</div>\n";
    }
    return $output;
}
예제 #8
0
 public function getFilename()
 {
     return webservice_url("photo", array($this->getUserID(), $this->getPhotoType()));
 }
예제 #9
0
<script type="text/javascript">

document.observe('dom:loaded', function() {
	try {
		function get_modal_options() {
			return {
				overlayOpacity:	0.75,
				closeOnClick:	'overlay',
				className:		'modal-confirmation',
				fade:			true,
				fadeDuration:	0.30
			};
		}

	var api_url = '<?php 
        echo webservice_url("mspr-admin");
        ?>
&id=<?php 
        echo $PROXY_ID;
        ?>
&mspr-section=';
		
	var reject_modal = new Control.Modal('reject-submission-box', get_modal_options());

	var add_clineval_modal = new Control.Modal('add-clineval-box', get_modal_options());
	var edit_clineval_modal = new Control.Modal('update-clineval-box', get_modal_options());

	var edit_studentship_modal = new Control.Modal('update-studentship-box', get_modal_options());
	var add_studentship_modal = new Control.Modal('add-studentship-box', get_modal_options());
	
	var edit_int_act_modal = new Control.Modal('update-int-act-box', get_modal_options());
예제 #10
0
                        var edit_critical_enquiry_modal = new Control.Modal('update-critical-enquiry-box', get_modal_options());

                        var add_community_based_project_modal = new Control.Modal('add-community-based-project-box', get_modal_options());
                        var edit_community_based_project_modal = new Control.Modal('update-community-based-project-box', get_modal_options());

                        var add_research_modal = new Control.Modal('add-research-box', get_modal_options());
                        var edit_research_modal = new Control.Modal('update-research-box',get_modal_options());

                        var add_contribution_modal = new Control.Modal('add-contribution-box', get_modal_options());
                        var edit_contribution_modal = new Control.Modal('update-contribution-box', get_modal_options());

                        var add_external_award_modal = new Control.Modal('add-external-award-box', get_modal_options());
                        var edit_external_award_modal = new Control.Modal('update-external-award-box', get_modal_options());

                        var api_url = '<?php 
            echo webservice_url("mspr-profile");
            ?>
&id=<?php 
            echo $PROXY_ID;
            ?>
&mspr-section=';

                        var research_citations = new ActiveDataEntryProcessor({
                            url : api_url + 'research_citations',
                            data_destination: $('research_citations'),
                            remove_forms_selector: '#research .entry form.remove_form',
                            new_button: $('add_research_citation_link'),
                            section:'research_citations',
                            new_modal: add_research_modal
                        });
 /**
  * If the photo file actually exists, and
  * If the uploaded file is active in the user_photos table, and
  * If the proxy_id has their privacy set to "Basic Information" or higher.
  */
 $query = "SELECT `photo_active` FROM `" . AUTH_DATABASE . "`.`user_photos` WHERE `photo_type` = '1' AND `photo_active` = '1' AND `proxy_id` = " . $db->qstr($proxy_id);
 $photo_active = $db->GetOne($query);
 if (@file_exists(STORAGE_USER_PHOTOS . "/" . $proxy_id . "-upload") && $photo_active && $ENTRADA_ACL->amIAllowed(new PhotoResource($proxy_id, (int) $user["privacy_level"], "upload"), "read")) {
     $uploaded_file_active = true;
 }
 echo "<div id=\"img-holder-" . $proxy_id . "\" class=\"img-holder pull-left\">";
 if ($offical_file_active) {
     echo "\t\t<img id=\"official_photo_" . $proxy_id . "\" class=\"official people-search-thumb\" src=\"" . webservice_url("photo", array($proxy_id, "official")) . "\" width=\"72\" height=\"100\" alt=\"" . html_encode($user["prefix"] . " " . $user["firstname"] . " " . $user["lastname"]) . "\" title=\"" . html_encode($user["prefix"] . " " . $user["firstname"] . " " . $user["lastname"]) . "\" />\n";
 }
 if ($uploaded_file_active) {
     echo "\t\t<img id=\"uploaded_photo_" . $proxy_id . "\" class=\"uploaded people-search-thumb\" src=\"" . webservice_url("photo", array($proxy_id, "upload")) . "\" width=\"72\" height=\"100\" alt=\"" . html_encode($user["prefix"] . " " . $user["firstname"] . " " . $user["lastname"]) . "\" title=\"" . html_encode($user["prefix"] . " " . $user["firstname"] . " " . $user["lastname"]) . "\" />\n";
 }
 if ($offical_file_active || $uploaded_file_active) {
     echo "\t\t<a id=\"zoomin_photo_" . $proxy_id . "\" class=\"zoomin\" onclick=\"growPic(\$('official_photo_" . $proxy_id . "'), \$('uploaded_photo_" . $proxy_id . "'), \$('official_link_" . $proxy_id . "'), \$('uploaded_link_" . $proxy_id . "'), \$('zoomout_photo_" . $proxy_id . "'));\">+</a>";
     echo "\t\t<a id=\"zoomout_photo_" . $proxy_id . "\" class=\"zoomout\" onclick=\"shrinkPic(\$('official_photo_" . $proxy_id . "'), \$('uploaded_photo_" . $proxy_id . "'), \$('official_link_" . $proxy_id . "'), \$('uploaded_link_" . $proxy_id . "'), \$('zoomout_photo_" . $proxy_id . "'));\"></a>";
 } else {
     echo "\t\t<img class=\"media-object people-search-thumb\" src=\"" . ENTRADA_URL . "/images/headshot-male.gif\" width=\"72\" height=\"100\" alt=\"No Photo Available\" title=\"No Photo Available\" />\n";
 }
 if ($offical_file_active && $uploaded_file_active) {
     echo "\t\t<a id=\"official_link_" . $proxy_id . "\" class=\"img-selector one\" onclick=\"showOfficial(\$('official_photo_" . $proxy_id . "'), \$('official_link_" . $proxy_id . "'), \$('uploaded_link_" . $proxy_id . "'));\" href=\"javascript: void(0);\">1</a>";
     echo "\t\t<a id=\"uploaded_link_" . $proxy_id . "\" class=\"img-selector two\" onclick=\"hideOfficial(\$('official_photo_" . $proxy_id . "'), \$('official_link_" . $proxy_id . "'), \$('uploaded_link_" . $proxy_id . "'));\" href=\"javascript: void(0);\">2</a>";
 }
 echo "</div>";
 echo "<div class=\"media-body\">";
 echo "<div class=\"pull-left ps-media-body-margin\">";
 echo "<h5 class\"media-heading ps-media-heading\">" . html_encode(($user["prefix"] ? $user["prefix"] . " " : "") . $user["firstname"] . " " . $user["lastname"]) . "</h5>";
			}

			function checkStudent() {
				if ((document.getElementById('internal_award_user_name') != null) && (document.getElementById('internal_award_user_ref') != null) && (document.getElementById('internal_award_user_id') != null)) {
					if (document.getElementById('internal_award_user_name').value != document.getElementById('internal_award_user_ref').value) {
						document.getElementById('internal_award_user_id').value = '';
					}
				}

				return true;
			}

			new Ajax.Autocompleter(	'internal_award_user_name', 
					'internal_award_user_name_auto_complete', 
					'<?php 
        echo webservice_url("personnel");
        ?>
', 
					{	frequency: 0.2, 
						parameters: "type=learners",
						minChars: 2, 
						afterUpdateElement: function (text, li) {
							selectStudent(li.id); copyStudent();
						}
					});

			$('add_award_recipient_form').observe('submit',addRecipient);
			</script>
		</div>
	</div>
</div>
예제 #13
0
								<input type="hidden" name="coordinates" id="coordinates" value="" />
								<input type="hidden" name="dimensions" id="dimensions" value="" />
								<input type="file" name="image" id="image" />
							</form>
							<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
							<button id="upload-image-button" class="btn btn-primary">Upload</button>
						</div>
					</div>
					<div id="profile-image-container">
						<a href="#upload-image" id="upload-image-modal-btn" data-toggle="modal" class="btn btn-primary" id="upload-profile-image">Upload Photo</a>
						<?php 
            $query = "SELECT * FROM `" . AUTH_DATABASE . "`.`user_photos` WHERE `proxy_id` = " . $db->qstr($PROXY_ID);
            $uploaded_photo = $db->GetRow($query);
            ?>
						<span><img src="<?php 
            echo webservice_url("photo", array($PROXY_ID, $uploaded_photo ? "upload" : "official")) . "/" . time();
            ?>
" width="192" height="250" class="img-polaroid" /></span>
						<div class="btn-group" id="btn-toggle" class=" <?php 
            echo $uploaded_photo ? "uploaded" : "official";
            ?>
">
							<a href="#" class="btn btn-small <?php 
            echo $uploaded_photo["photo_active"] == "0" ? "active" : "";
            ?>
" id="image-nav-left">Official</a>
							<?php 
            if ($uploaded_photo) {
                ?>
<a href="#" class="btn btn-small <?php 
                echo $uploaded_photo["photo_active"] == "1" ? "active" : "";
예제 #14
0
            }
            if ($SUCCESS) {
                echo display_success();
            }
            if ($ERROR) {
                echo display_error();
            }
            break;
        case 1:
        default:
            if ($NOTICE) {
                echo display_notice();
            }
            $HEAD[] = "<link href=\"" . ENTRADA_URL . "/javascript/calendar/css/xc2_default.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />";
            $HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_URL . "/javascript/picklist.js\"></script>\n";
            $HEAD[] = "<script type=\"text/javascript\">\n            function checkInternational (flag) \n            {\n                if (flag == \"true\") {\n                    \$('international_notice').style.display = 'block';\n                } else {\n                    \$('international_notice').style.display = 'none';\n                }\n            }\n\n            function showOther() {\n                var obj = \$('schools_id');\n\n                var value = obj.options[obj.selectedIndex].value;\n\n                if (value == '99999') {\n                    \$('other_label').style.display = 'block';\n                    \$('other_medical_school').style.display = 'block';\n                    \$('other_span').style.display = 'block';\n                } else {\n                    \$('other_label').style.display = 'none';\n                    \$('other_medical_school').value = '';\n                    \$('other_medical_school').style.display = 'none';\n                    \$('other_span').style.display = 'none';\n                }\n            }\n\n            function changeDurationMessage() {\n                \$('auto_end_date').style.display = 'inline';\n                var value = \$('event_date').value;\n                newDate = toJSDate(value);\n                switch (\$F('event_finish')) {\n                    case '1':\n                        var days = 6;\n                        var weekText = ' week';\n                        break;\t\n                    case '2':\n                        var days = 13;\n                        var weekText = ' weeks';\n                        break;\n                    case '3':\n                        var days = 20;\n                        var weekText = ' weeks';\n                        break;\n                    case '4':\n                        var days = 27;\n                        var weekText = ' weeks';\n                        break;\n                    default:\n                        var days = 13;\n                        var weekText = ' weeks';\n                        break;\n                }\n                newDate.setDate(newDate.getDate()+days);\n                newDate = toCalendarDate(newDate);\n                \$('auto_end_date').innerHTML = '&nbsp;&nbsp;&nbsp;Ending in '+\$F('event_finish')+weekText+' on ' +newDate;\n            }\n\n            function setDateValue(field, date) {\n                \$('auto_end_date').style.display = 'inline';\n                newDate = toJSDate(date);\n                switch (\$F('event_finish')) {\n                    case '1':\n                        var days = 6;\n                        var weekText = ' weeks';\n                        break;\n                    case '2':\n                        var days = 13;\n                        var weekText = ' weeks';\n                        break;\n                    case '3':\n                        var days = 20;\n                        var weekText = ' weeks';\n                        break;\n                    case '4':\n                        var days = 27;\n                        var weekText = ' weeks';\n                        break;\n                    default:\n                        var days = 13;\n                        var weekText = ' weeks';\n                        break;\n                }\n                \n                newDate.setDate(newDate.getDate()+days);\n                newDate = toCalendarDate(newDate);\n                \$('auto_end_date').innerHTML = '&nbsp;&nbsp;&nbsp;Ending in '+\$F('event_finish')+weekText+' on ' +newDate;\n                \$('event_date').value = date;\n            }\n\n            var updater = null;\n            function AjaxFunction(cat_id) {\t\n                var url='" . webservice_url("clerkship_department") . "';\n                url=url+'?cat_id='+cat_id" . (isset($PROCESSED["department_id"]) && $PROCESSED["department_id"] ? "+'&dept_id=" . $PROCESSED["department_id"] . "'" : "") . ";\n                new Ajax.Updater(\$('department_category'), url, \n                    { \n                        method:'get'\n                    });\n            }\n\n            function provStateFunction(countries_id) {\t\n                var url='" . webservice_url("clerkship_prov") . "';\n                url=url+'?countries_id='+countries_id+'&prov_state=" . rawurlencode(isset($_POST["prov_state"]) ? clean_input($_POST["prov_state"], array("notags", "trim")) : DEFAULT_PROVINCE_ID) . "';\n                new Ajax.Updater(\$('prov_state_div'), url, \n                    { \n                        method:'get',\n                        onComplete: function () {\n                            generateAutocomplete();\n                            if (\$('prov_state').selectedIndex || \$('prov_state').selectedIndex === 0) {\n                                \$('prov_state_label').removeClassName('form-nrequired');\n                                \$('prov_state_label').addClassName('form-required');\n                            } else {\n                                \$('prov_state_label').removeClassName('form-required');\n                                \$('prov_state_label').addClassName('form-nrequired');\n                            }\n                        }\n                    });\n            }\n\n            function generateAutocomplete() {\n                if (updater != null) {\n                    updater.url = '" . ENTRADA_URL . "/api/cities-by-country.api.php?countries_id='+\$('countries_id').options[\$('countries_id').selectedIndex].value+'&prov_state='+(\$('prov_state') !== null ? (\$('prov_state').selectedIndex || \$('prov_state').selectedIndex === 0 ? \$('prov_state').options[\$('prov_state').selectedIndex].value : \$('prov_state').value) : '');\n                } else {\n                    updater = new Ajax.Autocompleter('city', 'city_auto_complete', \n                        '" . ENTRADA_URL . "/api/cities-by-country.api.php?countries_id='+\$('countries_id').options[\$('countries_id').selectedIndex].value+'&prov_state='+(\$('prov_state') !== null ? (\$('prov_state').selectedIndex || \$('prov_state').selectedIndex === 0 ? \$('prov_state').options[\$('prov_state').selectedIndex].value : \$('prov_state').value) : ''), \n                        {\n                            frequency: 0.2, \n                            minChars: 2\n                        });\n                }\n            }\n            </script>\n";
            $ONLOAD[] = "showOther()";
            $ONLOAD[] = "AjaxFunction(\$F(\$('addElectiveForm')['category_id']))";
            $ONLOAD[] = "provStateFunction(\$F(\$('addElectiveForm')['countries_id']))";
            $ONLOAD[] = "setMaxLength()";
            $ONLOAD[] = "changeDurationMessage()";
            if ($ERROR) {
                echo display_error();
            }
            ?>
            <form id="addElectiveForm" action="<?php 
            echo ENTRADA_URL;
            ?>
/admin/clerkship/electives?<?php 
            echo replace_query(array("step" => 2));
            ?>
예제 #15
0
<?php 
if ($ERROR) {
    echo display_error();
}
if ($NOTICE) {
    echo display_notice();
}
if ($SUCCESS) {
    echo display_success();
}
$HEAD[] = "<script type=\"text/javascript\"> var SITE_URL = '" . ENTRADA_URL . "';</script>";
$HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_URL . "/javascript/users.js?release=" . html_encode(APPLICATION_VERSION) . "\"></script>";
$HEAD[] = "<link href=\"" . ENTRADA_URL . "/javascript/calendar/css/xc2_default.css?release=" . html_encode(APPLICATION_VERSION) . "\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />";
$HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_URL . "/javascript/calendar/config/xc2_default.js?release=" . html_encode(APPLICATION_VERSION) . "\"></script>";
$HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_URL . "/javascript/calendar/script/xc2_inpage.js?release=" . html_encode(APPLICATION_VERSION) . "\"></script>";
$HEAD[] = "<script type=\"text/javascript\">\n\t\t\tfunction provStateFunction(countries_id) {\t\n\t\t\t\tvar url='" . webservice_url("clerkship_prov") . "';\n\t\t\t\turl=url+'?countries_id='+countries_id+'&prov_state=" . rawurlencode($OBSERVERSHIP->getProv() ? clean_input($OBSERVERSHIP->getProv(), array("notags", "trim")) : $PROCESSED["prov_state"]) . "';\n\t\t\t\tnew Ajax.Updater(\$('prov_state_div'), url, \n\t\t\t\t\t{ \n\t\t\t\t\t\tmethod:'get',\n\t\t\t\t\t\tonComplete: function () {\n\t\t\t\t\t\t\tgenerateAutocomplete();\n\t\t\t\t\t\t\tif (\$('prov_state').selectedIndex || \$('prov_state').selectedIndex === 0) {\n\t\t\t\t\t\t\t\t\$('prov_state_label').removeClassName('form-nrequired');\n\t\t\t\t\t\t\t\t\$('prov_state_label').addClassName('form-required');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\$('prov_state_label').removeClassName('form-required');\n\t\t\t\t\t\t\t\t\$('prov_state_label').addClassName('form-nrequired');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t}\n\t\t\t</script>\n";
$ONLOAD[] = "provStateFunction(\$F(\$('observership_form')['countries_id']))";
if (!$OBSERVERSHIP) {
    $OBSERVERSHIP = new Observership();
}
?>

	<script type="text/javascript">
		jQuery(document).ready(function(){		
			jQuery('#activity_type').change(function(){
				var type = jQuery(this).val();
				if (type == 'ipobservership') {
					jQuery('#observership_details').slideDown();
				} else {
					jQuery('#observership_details').slideUp();
				}
예제 #16
0
 switch ($STEP) {
     case 2:
         if ($SUCCESS) {
             echo display_success();
         }
         if ($NOTICE) {
             echo display_notice();
         }
         if ($ERROR) {
             echo display_error();
         }
         break;
     case 1:
     default:
         $PROCESSED["notification_send"] = true;
         $HEAD[] = "<script type=\"text/javascript\">\n\t\t\t\t\tfunction checkInternational (flag)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (flag == \"true\") {\n\t\t\t\t\t\t\t\$('international_notice').style.display = 'block';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\$('international_notice').style.display = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction showRejection (flag)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (flag == 'true') {\n\t\t\t\t\t\t\t\$('rejection_notice').style.display = 'block';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\$('rejection_notice').style.display = 'none';\n\t\t\t\t\t\t\t\$('rejection_notice').value = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction showNotification (flag)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (flag == 'approved') {\n\t\t\t\t\t\t\t\$('approval_notice').style.display = 'none';\n\t\t\t\t\t\t\t\$('notification_notice').style.display = 'block';\n\t\t\t\t\t\t\t\$('message').innerHTML = '<strong>Note:</strong> Uncheck this if you are making a simple edit and do not want the preceptor / student to be notified.';\n\t\t\t\t\t\t\tEffect.Pulsate('notification_notice', { pulses: 5,duration: 2.5 });\n\t\t\t\t\t\t} else if (flag == 'rejected') {\n\t\t\t\t\t\t\t\$('approval_notice').style.display = 'none';\n\t\t\t\t\t\t\t\$('notification_notice').style.display = 'block';\n\t\t\t\t\t\t\t\$('message').innerHTML = '<strong>Note:</strong> Uncheck this if you are making a simple edit and do not want the student to be notified.';\n\t\t\t\t\t\t\tEffect.Pulsate('notification_notice', { pulses: 5,duration: 2.5 });\n\t\t\t\t\t\t} else if (flag == 'false'){\n\t\t\t\t\t\t\t\$('notification_notice').style.display = 'none';\n\t\t\t\t\t\t\t\$('approval_notice').style.display = 'block';\n\t\t\t\t\t\t\tEffect.Pulsate('approval_notice', { pulses: 5, duration: 2.5 });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction showOther()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar obj = \$('schools_id');\n\n\t\t\t\t\t\tvar value = obj.options[obj.selectedIndex].value;\n\n\t\t\t\t\t\tif (value == '99999') {\n\t\t\t\t\t\t\t\$('other_label').style.display = 'block';\n\t\t\t\t\t\t\t\$('other_medical_school').style.display = 'block';\n\t\t\t\t\t\t\t\$('other_span').style.display = 'block';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\$('other_label').style.display = 'none';\n\t\t\t\t\t\t\t\$('other_medical_school').value = '';\n\t\t\t\t\t\t\t\$('other_medical_school').style.display = 'none';\n\t\t\t\t\t\t\t\$('other_span').style.display = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction changeDurationMessage() {\n\t\t\t\t\t\t\$('auto_end_date').style.display = 'inline';\n\t\t\t\t\t\tvar value = \$('event_date').value;\n\t\t\t\t\t\tnewDate = toJSDate(value);\n\t\t\t\t\t\tswitch (\$F('event_finish')) {\n\t\t\t\t\t\t\tcase '1':\n\t\t\t\t\t\t\t\tvar days = 6;\n\t\t\t\t\t\t\t\tvar weekText = ' week';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '2':\n\t\t\t\t\t\t\t\tvar days = 13;\n\t\t\t\t\t\t\t\tvar weekText = ' weeks';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '3':\n\t\t\t\t\t\t\t\tvar days = 20;\n\t\t\t\t\t\t\t\tvar weekText = ' weeks';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '4':\n\t\t\t\t\t\t\t\tvar days = 27;\n\t\t\t\t\t\t\t\tvar weekText = ' weeks';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tvar days = 13;\n\t\t\t\t\t\t\t\tvar weekText = ' weeks';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewDate.setDate(newDate.getDate()+days);\n\t\t\t\t\t\tnewDate = toCalendarDate(newDate);\n\t\t\t\t\t\t\$('auto_end_date').innerHTML = '&nbsp;&nbsp;&nbsp;Ending in '+\$F('event_finish')+weekText+' on ' +newDate;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction setDateValue(field, date) {\n\t\t\t\t\t\t\$('auto_end_date').style.display = 'inline';\n\t\t\t\t\t\tnewDate = toJSDate(date);\n\t\t\t\t\t\tswitch (\$F('event_finish')) {\n\t\t\t\t\t\t\tcase '1':\n\t\t\t\t\t\t\t\tvar days = 6;\n\t\t\t\t\t\t\t\tvar weekText = ' week';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '2':\n\t\t\t\t\t\t\t\tvar days = 13;\n\t\t\t\t\t\t\t\tvar weekText = ' weeks';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '3':\n\t\t\t\t\t\t\t\tvar days = 20;\n\t\t\t\t\t\t\t\tvar weekText = ' weeks';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '4':\n\t\t\t\t\t\t\t\tvar days = 27;\n\t\t\t\t\t\t\t\tvar weekText = ' weeks';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tvar days = 13;\n\t\t\t\t\t\t\t\tvar weekText = ' weeks';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewDate.setDate(newDate.getDate()+days);\n\t\t\t\t\t\tnewDate = toCalendarDate(newDate);\n\t\t\t\t\t\t\$('auto_end_date').innerHTML = '&nbsp;&nbsp;&nbsp;Ending in '+\$F('event_finish')+weekText+' on ' +newDate;\n\t\t\t\t\t\t\$('event_date').value = date;\n\t\t\t\t\t}\n\t\t\t\t\tvar updater = null;\n\t\t\t\t\tfunction AjaxFunction(cat_id)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar url='" . webservice_url("clerkship_department") . "';\n\t\t\t\t\t\turl=url+'?cat_id='+cat_id+'&dept_id=" . (isset($_POST["department_id"]) ? clean_input($_POST["department_id"], array("int")) : $PROCESSED["department_id"]) . "';\n\t\t\t\t    \tnew Ajax.Updater(\$('department_category'), url,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmethod:'get'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction provStateFunction(countries_id)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar url='" . webservice_url("clerkship_prov") . "';\n\t\t\t\t\t\turl=url+'?countries_id='+countries_id+'&prov_state=" . rawurlencode(isset($_POST["prov_state"]) ? clean_input($_POST["prov_state"], array("notags", "trim")) : $PROCESSED["prov_state"]) . "';\n\t\t\t\t    \tnew Ajax.Updater(\$('prov_state_div'), url,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmethod:'get',\n\t\t\t\t\t\t\t\tonComplete: function () {\n\t\t\t\t\t\t\t\t\tgenerateAutocomplete();\n\t\t\t\t\t\t\t\t\tif (\$('prov_state').selectedIndex || \$('prov_state').selectedIndex === 0) {\n\t\t\t\t\t\t\t\t\t\t\$('prov_state_label').removeClassName('form-nrequired');\n\t\t\t\t\t\t\t\t\t\t\$('prov_state_label').addClassName('form-required');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\$('prov_state_label').removeClassName('form-required');\n\t\t\t\t\t\t\t\t\t\t\$('prov_state_label').addClassName('form-nrequired');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction generateAutocomplete() {\n\t\t\t\t\t\tif (updater != null) {\n\t\t\t\t\t\t\tupdater.url = '" . ENTRADA_URL . "/api/cities-by-country.api.php?countries_id='+\$('countries_id').options[\$('countries_id').selectedIndex].value+'&prov_state='+(\$('prov_state') !== null ? (\$('prov_state').selectedIndex || \$('prov_state').selectedIndex === 0 ? \$('prov_state').options[\$('prov_state').selectedIndex].value : \$('prov_state').value) : '');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tupdater = new Ajax.Autocompleter('city', 'city_auto_complete',\n\t\t\t\t\t\t\t\t'" . ENTRADA_URL . "/api/cities-by-country.api.php?countries_id='+\$('countries_id').options[\$('countries_id').selectedIndex].value+'&prov_state='+(\$('prov_state') !== null ? (\$('prov_state').selectedIndex || \$('prov_state').selectedIndex === 0 ? \$('prov_state').options[\$('prov_state').selectedIndex].value : \$('prov_state').value) : ''),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfrequency: 0.2,\n\t\t\t\t\t\t\t\t\tminChars: 2\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t</script>\n";
         $ONLOAD[] = "showOther()";
         $ONLOAD[] = "AjaxFunction(\$F(\$('editElectiveForm')['category_id']))";
         $ONLOAD[] = "provStateFunction(\$F(\$('editElectiveForm')['countries_id']))";
         $ONLOAD[] = "setMaxLength()";
         $ONLOAD[] = "changeDurationMessage()";
         if (isset($PROCESSED["event_status"]) && $PROCESSED["event_status"] == "trash" || isset($_POST["event_status"]) && $_POST["event_status"] == "trash") {
             $ONLOAD[] = "showRejection('true')";
             $ONLOAD[] = "showNotification('rejected')";
         } else {
             if (isset($_POST["event_status"]) && $_POST["event_status"] == "published" || isset($PROCESSED["event_status"]) && $PROCESSED["event_status"] == "published") {
                 $ONLOAD[] = "showRejection('false')";
                 $ONLOAD[] = "showNotification('approved')";
             } else {
                 $ONLOAD[] = "showRejection('false')";
                 $ONLOAD[] = "showNotification('false')";