当前位置: 首页>>代码示例>>PHP>>正文


PHP add_statistic函数代码示例

本文整理汇总了PHP中add_statistic函数的典型用法代码示例。如果您正苦于以下问题:PHP add_statistic函数的具体用法?PHP add_statistic怎么用?PHP add_statistic使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了add_statistic函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display_notice

                }
                ?>
						</tr>
					</tbody>
					</table>
					<?php 
            } else {
                $NOTICE++;
                $NOTICESTR[] = "<strong>No photos in this gallery.</strong><br /><br />" . (galleries_module_access($RECORD_ID, "add-photo") ? "If you would like to upload a new photo, <a href=\"" . COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=add-photo&id=" . $RECORD_ID . "\">click here</a>." : "Please check back later.");
                echo display_notice();
            }
            ?>
			</div>
			<?php 
            if ($LOGGED_IN) {
                add_statistic("community:" . $COMMUNITY_ID . ":galleries", "gallery_view", "cgallery_id", $RECORD_ID);
            }
        } else {
            if ($ERROR) {
                echo display_error();
            }
            if ($NOTICE) {
                echo display_notice();
            }
        }
    } else {
        application_log("error", "The provided photo gallery id was invalid [" . $RECORD_ID . "] (View Gallery).");
        header("Location: " . COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL);
        exit;
    }
} else {
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:view-gallery.inc.php

示例2: time

      * Email Notificaions.
      */
     if (isset($_POST["member_notify"])) {
         $PROCESSED["notify"] = $_POST["member_notify"];
     } else {
         $PROCESSED["notify"] = 0;
     }
     if (!$ERROR) {
         $PROCESSED["updated_date"] = time();
         $PROCESSED["updated_by"] = $ENTRADA_USER->getID();
         if ($db->AutoExecute("community_share_comments", $PROCESSED, "UPDATE", "`cscomment_id` = " . $db->qstr($RECORD_ID) . " AND `csfile_id` = " . $db->qstr($comment_record["csfile_id"]) . " AND `community_id` = " . $db->qstr($COMMUNITY_ID))) {
             $url = COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-file&id=" . $comment_record["csfile_id"] . "#comment-" . $RECORD_ID;
             $ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000)";
             $SUCCESS++;
             $SUCCESSSTR[] = "You have successfully edited your file comment.<br /><br />You will now be redirected back to this file; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
             add_statistic("community:" . $COMMUNITY_ID . ":shares", "comment_edit", "cscomment_id", $RECORD_ID);
             communities_log_history($COMMUNITY_ID, $PAGE_ID, $RECORD_ID, "community_history_edit_file_comment", 0, $comment_record["csfile_id"]);
         }
         if (!$SUCCESS) {
             $ERROR++;
             $ERRORSTR[] = "There was a problem editing this file comment. The MEdTech Unit was informed of this error; please try again later.";
             application_log("error", "There was an error editing a file comment. Database said: " . $db->ErrorMsg());
         }
     }
     if ($ERROR) {
         $STEP = 1;
     }
     break;
 case 1:
 default:
     $PROCESSED = $comment_record;
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:edit-comment.inc.php

示例3: application_log

                         $NOTICESTR[] = "Unable to set this photo as the gallery thumbnail; the MEdTech Unit has been informed of this error, please try again later.";
                         application_log("error", "Failed to set this photo as the gallery thumbnail. Database said: " . $db->ErrorMsg());
                     }
                 } elseif ((int) $photo_record["gallery_cgphoto_id"] == (int) $RECORD_ID && (!isset($_POST["gallery_cgphoto_id"]) || (int) trim($_POST["gallery_cgphoto_id"]) != 1)) {
                     if (!$db->AutoExecute("community_galleries", array("gallery_cgphoto_id" => 0), "UPDATE", "`community_id` = " . $db->qstr($COMMUNITY_ID) . " AND `cpage_id` = " . $db->qstr($PAGE_ID) . " AND `cgallery_id` = " . $db->qstr($photo_record["cgallery_id"]))) {
                         $NOTICE++;
                         $NOTICESTR[] = "Unable to unset this photo as the gallery thumbnail; the MEdTech Unit has been informed of this error, please try again later.";
                         application_log("error", "Failed to unset this photo as the gallery thumbnail. Database said: " . $db->ErrorMsg());
                     }
                 }
             }
             $url = COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-photo&id=" . $RECORD_ID;
             $ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000)";
             $SUCCESS++;
             $SUCCESSSTR[] = "You have successfully updated this photo.<br /><br />You will now be redirected to this image; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
             add_statistic("community:" . $COMMUNITY_ID . ":galleries", "photo_edit", "cgphoto_id", $RECORD_ID);
             communities_log_history($COMMUNITY_ID, $PAGE_ID, $RECORD_ID, "community_history_edit_photo", 1, $photo_record["cgallery_id"]);
         } else {
             $ERROR++;
             $ERRORSTR[] = "Unable to update this photo at this time; the MEdTech Unit has been informed of this error, please try again later.";
             application_log("error", "Failed to update a photo. Database said: " . $db->ErrorMsg());
         }
     }
     if ($ERROR) {
         $STEP = 1;
     }
     break;
 case 1:
 default:
     $PROCESSED = $photo_record;
     break;
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:edit-photo.inc.php

示例4: time

         $ERRORSTR[] = "The <strong>Release Start</strong> field is required.";
     }
     if (isset($release_dates["finish"]) && (int) $release_dates["finish"]) {
         $PROCESSED["release_until"] = (int) $release_dates["finish"];
     } else {
         $PROCESSED["release_until"] = 0;
     }
     if (!$ERROR) {
         $PROCESSED["updated_date"] = time();
         $PROCESSED["updated_by"] = $ENTRADA_USER->getID();
         if ($db->AutoExecute("community_shares", $PROCESSED, "UPDATE", "`community_id` = " . $db->qstr($COMMUNITY_ID) . " AND `cpage_id` = " . $db->qstr($PAGE_ID) . " AND `cshare_id` = " . $db->qstr($RECORD_ID))) {
             $url = COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL;
             $ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000)";
             $SUCCESS++;
             $SUCCESSSTR[] = "You have successfully updated the <strong>" . html_encode($PROCESSED["folder_title"]) . "</strong> shared folder.<br /><br />You will now be redirected to the index; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
             add_statistic("community:" . $COMMUNITY_ID . ":shares", "folder_edit", "cshare_id", $RECORD_ID);
             communities_log_history($COMMUNITY_ID, $PAGE_ID, $RECORD_ID, "community_history_edit_share", 1);
         }
         if (!$SUCCESS) {
             $ERROR++;
             $ERRORSTR[] = "There was a problem updating this shared folder in the system. The MEdTech Unit was informed of this error; please try again later.";
             application_log("error", "There was an error updating a shared folder. Database said: " . $db->ErrorMsg());
         }
     }
     if ($ERROR) {
         $STEP = 1;
     }
     break;
 case 1:
 default:
     $PROCESSED = $folder_record;
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:edit-folder.inc.php

示例5: elseif

 * along with Entrada.  If not, see <http://www.gnu.org/licenses/>.
 *
 * This file displays the edit restricted day interface.
 * 
 * @author Organisation: Queen's University
 * @author Unit: School of Medicine
 * @author Developer: James Ellis <james.ellis@queensu.ca>
 * @copyright Copyright 2013 Queen's University. All Rights Reserved.
 *
*/
if (!defined("PARENT_INCLUDED") || !defined("IN_CONFIGURATION")) {
    exit;
} elseif (!isset($_SESSION["isAuthorized"]) || !$_SESSION["isAuthorized"]) {
    header("Location: " . ENTRADA_URL);
    exit;
} elseif (!$ENTRADA_ACL->amIAllowed('configuration', 'read')) {
    $ONLOAD[] = "setTimeout('window.location=\\'" . ENTRADA_URL . "/admin/" . $MODULE . "\\'', 15000)";
    $ERROR++;
    $ERRORSTR[] = "Your account does not have the permissions required to use this feature of 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"] . "] does not have access to this module [" . $MODULE . "]");
} else {
    if (isset($_GET["day_id"]) && ($tmp_input = clean_input($_GET["day_id"], "numeric"))) {
        $day_id = $tmp_input;
    }
    add_statistic("restricted_day", "edit", "orday_id", $day_id, $ENTRADA_USER->getID());
    $BREADCRUMB[] = array("url" => ENTRADA_URL . "/admin/settings/manage/restricteddays?org=" . $ORGANISATION_ID . "&section=edit&day_id=" . $day_id, "title" => "Edit Restricted Day");
    echo "<h1>Edit Restricted Day</h1>";
    define("EDIT_RESTRICTED_DAY", true);
    require_once "form.inc.php";
}
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:edit.inc.php

示例6: time

         $PROCESSED["cdiscussion_id"] = $RECORD_ID;
         $PROCESSED["community_id"] = $COMMUNITY_ID;
         $PROCESSED["proxy_id"] = $ENTRADA_USER->getActiveId();
         $PROCESSED["topic_active"] = 1;
         $PROCESSED["updated_date"] = time();
         $PROCESSED["updated_by"] = $ENTRADA_USER->getID();
         if ($db->AutoExecute("community_discussion_topics", $PROCESSED, "INSERT")) {
             if ($TOPIC_ID = $db->Insert_Id()) {
                 if (isset($notifications) && COMMUNITY_NOTIFICATIONS_ACTIVE && $_SESSION["details"]["notifications"]) {
                     $db->Execute("INSERT INTO `community_notify_members` (`proxy_id`, `record_id`, `community_id`, `notify_type`, `notify_active`) VALUES (" . $db->qstr($PROCESSED["proxy_id"]) . ", " . $db->qstr($TOPIC_ID) . ", " . $db->qstr($COMMUNITY_ID) . ", 'reply', '" . ($notifications ? "1" : "0") . "')");
                 }
                 $url = COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-post&id=" . $TOPIC_ID;
                 $ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000)";
                 $SUCCESS++;
                 $SUCCESSSTR[] = "You have successfully created a new discussion post.<br /><br />You will now be redirected to this thread; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
                 add_statistic("community:" . $COMMUNITY_ID . ":discussions", "post_add", "cdtopic_id", $TOPIC_ID);
                 communities_log_history($COMMUNITY_ID, $PAGE_ID, $TOPIC_ID, "community_history_add_post", 1, $RECORD_ID);
             }
         }
         if (!$SUCCESS) {
             $ERROR++;
             $ERRORSTR[] = "There was a problem inserting this discussion post into the system. The MEdTech Unit was informed of this error; please try again later.";
             application_log("error", "There was an error inserting a discussion forum post. Database said: " . $db->ErrorMsg());
         }
     }
     if ($ERROR) {
         $STEP = 1;
     }
     break;
 case 1:
 default:
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:add-post.inc.php

示例7: header

                         header("Expires: 0");
                         header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
                         header("Content-Type: application/force-download");
                         header("Content-Type: application/octet-stream");
                         header("Content-Type: " . $result["file_type"] . "");
                         header("Content-Disposition: attachment; filename=\"" . $result["file_name"] . "\"");
                         header("Content-Length: " . $filesize);
                         header("Content-Transfer-Encoding: binary");
                         break;
                 }
                 while (!feof($fc)) {
                     echo fread($fc, 10240);
                 }
                 fclose($fc);
                 $db->Execute("UPDATE `course_files` SET `accesses` = '" . ($accesses + 1) . "' WHERE `id` = " . $db->qstr($FILE_ID));
                 add_statistic("courses", "file_download", "file_id", $FILE_ID);
                 exit;
             } else {
                 $TITLE = "Not Found: " . html_encode($result["file_name"]);
                 $BODY = display_notice(array("The file that you are trying to download (<strong>" . html_encode($result["file_name"]) . "</strong>) does not exist in the filesystem.<br /><br />Please contact a system administrator or the course directory listed on the <a href=\"" . ENTRADA_URL . "/courses?id=" . $result["course_id"] . "\" style=\"font-weight: bold\">course website</a>."));
                 $template_html = fetch_template("global/external");
                 if ($template_html) {
                     echo str_replace(array("%DEFAULT_CHARSET%", "%ENTRADA_URL%", "%TITLE%", "%BODY%"), array(DEFAULT_CHARSET, ENTRADA_URL, $TITLE, $BODY), $template_html);
                 }
                 exit;
             }
         }
     }
 } else {
     $TITLE = "Not Authorized";
     $BODY = display_notice(array("The file that you are trying to access is only accessible by authorized users."));
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:file-course.php

示例8: application_log

                     $MEMBERS["proxy_id"] = $memberValue;
                     if ($db->AutoExecute("community_polls_access", $MEMBERS, "INSERT")) {
                         $SUCCESS = TRUE;
                     }
                 }
                 if (!$SUCCESS) {
                     $ERROR++;
                     $ERRORSTR[] = "There was a problem inserting the specific member permissions for this " . $terminology . " into the system. The MEdTech Unit was informed of this error; please try again later.";
                     application_log("error", "There was an error inserting the specific member permissions to a poll (ID: " . $RECORD_ID . "). Database said: " . $db->ErrorMsg());
                 }
             }
             $url = COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL;
             $ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000)";
             $SUCCESS++;
             $SUCCESSSTR[] = "You have successfully updated a " . $terminology . " to the community.<br /><br />You will now be redirected to the index; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
             add_statistic("community_polling", "poll_edit", "cpolls_id", $RECORD_ID);
             communities_log_history($COMMUNITY_ID, $PAGE_ID, $RECORD_ID, "community_history_edit_poll", 0);
         }
         if (!$SUCCESS) {
             $ERROR++;
             $ERRORSTR[] = "There was a problem editing this " . $terminology . " in the system. The MEdTech Unit was informed of this error; please try again later.";
             application_log("error", "There was an error editing a poll. Database said: " . $db->ErrorMsg());
         }
     }
     if ($ERROR) {
         $STEP = 1;
     }
     break;
 case 1:
 default:
     $PROCESSED = $poll_record;
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:edit-poll.inc.php

示例9: time

      */
     if (isset($_POST["member_notify"])) {
         $PROCESSED["notify"] = $_POST["member_notify"];
     } else {
         $PROCESSED["notify"] = 0;
     }
     if (!$ERROR) {
         $PROCESSED["updated_date"] = time();
         $PROCESSED["updated_by"] = $ENTRADA_USER->getID();
         if ($db->AutoExecute("assignment_comments", $PROCESSED, "UPDATE", "`acomment_id` = " . $db->qstr($RECORD_ID) . " AND `assignment_id` = " . $db->qstr($ASSIGNMENT_ID))) {
             //$url			= ENTRADA_URL."/profile/gradebook/assignments?section=view&assignment_id=".$ASSIGNMENT_ID.(isset($assignment_contact) && $assignment_contact?"&amp;pid=".$comment_record["file_owner"]:"")."#comment-".$RECORD_ID;
             $url = ENTRADA_URL . "/profile/gradebook/assignments?section=view&assignment_id=" . $ASSIGNMENT_ID . (isset($assignment_contact) && $assignment_contact ? "&pid=" . $comment_record["file_owner"] : "") . "#comment-" . $RECORD_ID;
             $ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000)";
             $SUCCESS++;
             $SUCCESSSTR[] = "You have successfully edited your file comment.<br /><br />You will now be redirected back to this file; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
             add_statistic("assignment:" . $ASSIGNMENT_ID, "comment_edit", "acomment_id", $RECORD_ID);
         }
         if (!$SUCCESS) {
             $ERROR++;
             $ERRORSTR[] = "There was a problem editing this file comment. The MEdTech Unit was informed of this error; please try again later.";
             application_log("error", "There was an error editing a file comment. Database said: " . $db->ErrorMsg());
         }
     }
     if ($ERROR) {
         $STEP = 1;
     }
     break;
 case 1:
 default:
     $PROCESSED = $comment_record;
     break;
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:edit-comment.inc.php

示例10: elseif

    exit;
} elseif (!$COMMUNITY_LOAD) {
    exit;
}
if ($RECORD_ID) {
    /**
     * Check if pv variable is set and see if it's a valid page, other wise page 1 it is.
     */
    if (isset($_GET["pv"])) {
        $PAGE_CURRENT = (int) trim($_GET["pv"]);
    } else {
        $PAGE_CURRENT = 0;
    }
    $query = "\tSELECT * FROM `community_events` \n\t\t\t\t\t\tWHERE `community_id` = " . $db->qstr($COMMUNITY_ID) . " \n\t\t\t\t\t\tAND `cpage_id` = " . $db->qstr($PAGE_ID) . " \n\t\t\t\t\t\tAND `event_active` = '1'\n\t\t\t\t\t\tAND `cevent_id` = " . $db->qstr($RECORD_ID);
    $event_record = $db->GetRow($query);
    if ($event_record) {
        if ($db->AutoExecute("community_events", array("event_active" => 0), "UPDATE", "`community_id` = " . $db->qstr($COMMUNITY_ID) . " AND `cpage_id` = " . $db->qstr($PAGE_ID) . " AND `event_active` = '1' AND `cevent_id` = " . $db->qstr($RECORD_ID))) {
            communities_deactivate_history($COMMUNITY_ID, $PAGE_ID, $RECORD_ID);
            delete_notifications("event:" . $event_record["cevent_id"]);
            add_statistic("community:" . $COMMUNITY_ID . ":events", "delete", "cevent_id", $RECORD_ID);
        } else {
            application_log("error", "Failed to delete [" . $RECORD_ID . "] event from community. Database said: " . $db->ErrorMsg());
        }
    } else {
        application_log("error", "The provided event record [" . $RECORD_ID . "] was invalid.");
    }
} else {
    application_log("error", "No event record was provided for deletion.");
}
header("Location: " . COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . ($PAGE_CURRENT ? "?pv=" . $PAGE_CURRENT : ""));
exit;
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:delete.inc.php

示例11: html_encode

 $PROCESSED["updated_by"] = $ENTRADA_USER->getID();
 if ($db->AutoExecute("assignment_files", $PROCESSED, "INSERT")) {
     if ($FILE_ID = $db->Insert_Id()) {
         $PROCESSED["afile_id"] = $FILE_ID;
         if ($db->AutoExecute("assignment_file_versions", $PROCESSED, "INSERT")) {
             if ($VERSION_ID = $db->Insert_Id()) {
                 if (assignments_process_file($_FILES["uploaded_file"]["tmp_name"], $VERSION_ID)) {
                     $url = ENTRADA_URL . "/profile/gradebook/assignments?section=view&assignment_id=" . $RECORD_ID;
                     $ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000)";
                     $SUCCESS++;
                     if (!DEMO_MODE) {
                         $SUCCESSSTR[] = "You have successfully uploaded " . html_encode($PROCESSED["file_filename"]) . " (version 1).<br /><br />You will now be redirected to this files page; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
                     } else {
                         $SUCCESSSTR[] = "Entrada is in demo mode therefore the Entrada demo assignment file was used for this import instead of the file you attempted to upload.<br /><br />You will now be redirected to this files page; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue.";
                     }
                     add_statistic("assignment:" . $RECORD_ID, "file_add", "afile_id", $FILE_ID);
                 }
             }
         }
     }
 }
 if (!$SUCCESS) {
     /**
      * Because there was no success, check if the file_id was set... if it
      * was we need to delete the database record :( In the future this will
      * be handled with transactions like it's supposed to be.
      */
     if ($FILE_ID) {
         $query = "DELETE FROM `assignment_files` WHERE `afile_id` = " . $db->qstr($FILE_ID) . " AND `assignment_id` = " . $db->qstr($RECORD_ID) . " AND LIMIT 1";
         @$db->Execute($query);
         /**
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:submit.inc.php

示例12: time

         if (!$ERROR) {
             $PROCESSED["proxy_id"] = $ENTRADA_USER->getID();
             $PROCESSED["updated_by"] = $ENTRADA_USER->getID();
             $PROCESSED["updated_date"] = time();
             if (defined("EDIT_ENTRY") && EDIT_ENTRY) {
                 if ($entry->fromArray($PROCESSED)->update()) {
                     add_success("The entry has successfully been updated. You will be redirected to the logbook index in 5 seconds, or you can <a href=\"" . ENTRADA_URL . "/logbook\">click here</a> if you do not wish to wait.");
                     add_statistic("encounter_tracking", "update", "lentry_id", $PROCESSED["lentry_id"], $ENTRADA_USER->getID());
                 } else {
                     add_error("An error occurred when attempting to update a logbook entry [" . $PROCESSED["lentry_id"] . "], an administrator has been informed, please try again later.");
                     application_log("error", "Error occurred when updating logbook entry, DB said: " . $db->ErrorMsg());
                 }
             } else {
                 if ($entry->fromArray($PROCESSED)->insert()) {
                     add_success("The entry has successfully been updated. You will be redirected to the logbook index in 5 seconds, or you can <a href=\"" . ENTRADA_URL . "/logbook\">click here</a> if you do not wish to wait.");
                     add_statistic("encounter_tracking", "insert", "lentry_id", $db->Insert_ID(), $ENTRADA_USER->getID());
                 } else {
                     add_error("An error occurred when attempting to create a new logbook entry, an administrator has been informed, please try again later.");
                     application_log("error", "Error occurred when updating logbook entry, DB said: " . $db->ErrorMsg());
                 }
             }
         } else {
             $entry = new Models_Logbook_Entry();
             $entry->fromArray($PROCESSED);
             $STEP = 1;
         }
         break;
     default:
         break;
 }
 switch ($STEP) {
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:form.inc.php

示例13: date

	<?php 
    $query = "\tSELECT a.*, b.`course_name`, b.`course_code`, b.`organisation_id`\n\t\t\t\tFROM `events` AS a\n\t\t\t\tLEFT JOIN `courses` AS b\n\t\t\t\tON b.`course_id` = a.`course_id`\n\t\t\t\tWHERE a.`event_id` = " . $db->qstr($event_id);
    $event_info = $db->GetRow($query);
    if ($event_info) {
        $LASTUPDATED = $event_info["updated_date"];
        if ($event_info["release_date"] && $event_info["release_date"] > time()) {
            $ERROR++;
            $ERRORSTR[] = "The event you are trying to view is not yet available. Please try again after " . date("r", $event_info["release_date"]);
            echo display_error();
        } elseif ($event_info["release_until"] && $event_info["release_until"] < time()) {
            $ERROR++;
            $ERRORSTR[] = "The event you are trying to view is no longer available; it expired " . date("r", $event_info["release_until"]);
            echo display_error($errorstr);
        } else {
            if ($ENTRADA_ACL->amIAllowed(new EventResource($event_id, $event_info["course_id"], $event_info["organisation_id"]), "read")) {
                add_statistic("events", "view", "event_id", $event_id);
                $event_resources = events_fetch_event_resources($event_id, "all");
                $event_files = is_array($event_resources["files"]) ? count($event_resources["files"]) : 0;
                $event_links = is_array($event_resources["links"]) ? count($event_resources["links"]) : 0;
                $event_quizzes = is_array($event_resources["quizzes"]) ? count($event_resources["quizzes"]) : 0;
                $event_discussions = is_array($event_resources["discussions"]) ? count($event_resources["discussions"]) : 0;
                ?>
				<div id="eventToolTip">
					<div class="colLeft">
						<table style="width: 100%" cellspacing="1" cellpadding="1" border="0">
						<tr>
							<td colspan="2" style="padding-bottom: 5px"><a href="<?php 
                echo ENTRADA_URL;
                ?>
/courses?id=<?php 
                echo $event_info["course_id"];
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:events.api.php

示例14: header

                     case 0:
                     default:
                         header("Pragma: public");
                         header("Expires: 0");
                         header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
                         header("Content-Type: application/force-download");
                         header("Content-Type: application/octet-stream");
                         header("Content-Type: " . $result["file_type"] . "");
                         header("Content-Disposition: attachment; filename=\"" . $result["file_name"] . "\"");
                         header("Content-Length: " . @filesize(FILE_STORAGE_PATH . "/" . $EFILE_ID));
                         header("Content-Transfer-Encoding: binary");
                         break;
                 }
                 echo file_get_contents(FILE_STORAGE_PATH . "/" . $EFILE_ID, FILE_BINARY);
                 $db->Execute("UPDATE `event_files` SET `accesses` = '" . ($accesses + 1) . "' WHERE `efile_id` = " . $db->qstr($EFILE_ID));
                 add_statistic("events", "file_download", "file_id", $EFILE_ID);
                 exit;
             } else {
                 $TITLE = "Not Found: " . html_encode($result["file_name"]);
                 $BODY = display_notice(array("The file that you are trying to download (<strong>" . html_encode($result["file_name"]) . "</strong>) does not exist in the filesystem.<br /><br />Please contact a system administrator or a teacher listed on the <a href=\"" . ENTRADA_URL . "/events?id=" . $result["event_id"] . "\" style=\"font-weight: bold\">event page</a>."));
                 $template_html = fetch_template("global/external");
                 if ($template_html) {
                     echo str_replace(array("%DEFAULT_CHARSET%", "%ENTRADA_URL%", "%TITLE%", "%BODY%"), array(DEFAULT_CHARSET, ENTRADA_URL, $TITLE, $BODY), $template_html);
                 }
                 exit;
             }
         }
     }
 } else {
     $TITLE = "Not Authorized";
     $BODY = display_notice(array("The file that you are trying to access is only accessible by authorized users."));
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:file-event.php

示例15: elseif

 * along with Entrada.  If not, see <http://www.gnu.org/licenses/>.
 *
 * This file displays the edit entry interface.
 * 
 * @author Organisation: Queen's University
 * @author Unit: School of Medicine
 * @author Developer: James Ellis <james.ellis@queensu.ca>
 * @copyright Copyright 2013 Queen's University. All Rights Reserved.
 *
*/
if (!defined("PARENT_INCLUDED") || !defined("IN_ENCOUNTER_TRACKING")) {
    exit;
} elseif (!isset($_SESSION["isAuthorized"]) || !$_SESSION["isAuthorized"]) {
    header("Location: " . ENTRADA_URL);
    exit;
} elseif (!$ENTRADA_ACL->amIAllowed('encounter_tracking', 'read')) {
    $ONLOAD[] = "setTimeout('window.location=\\'" . ENTRADA_URL . "/admin/" . $MODULE . "\\'', 15000)";
    $ERROR++;
    $ERRORSTR[] = "Your account does not have the permissions required to use this feature of 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"] . "] does not have access to this module [" . $MODULE . "]");
} else {
    if (isset($_GET["entry_id"]) && ($tmp_input = clean_input($_GET["entry_id"], "numeric"))) {
        $entry_id = $tmp_input;
    }
    add_statistic("encounter_tracking", "edit", "lentry_id", $entry_id, $ENTRADA_USER->getID());
    $BREADCRUMB[] = array("url" => ENTRADA_URL . "/logbook?section=edit&entry_id=" . $entry_id, "title" => "Edit Encounter");
    echo "<h1>Edit Encounter</h1>";
    define("EDIT_ENTRY", true);
    require_once "form.inc.php";
}
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:edit.inc.php


注:本文中的add_statistic函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。