Ejemplo n.º 1
0
                    $query = "SELECT * FROM `events` WHERE `event_id` = " . $db->qstr($EVENT_ID);
                    $result = $db->GetRow($query);
                    if ($result) {
                        $PROCESSED["event_id"] = $EVENT_ID;
                        $PROCESSED["proxy_id"] = $ENTRADA_USER->getID();
                        $PROCESSED["parent_id"] = 0;
                        $PROCESSED["discussion_title"] = "RE: " . $result["event_title"];
                        $PROCESSED["discussion_comment"] = $DISCUSSION_COMMENT;
                        $PROCESSED["discussion_active"] = 1;
                        $PROCESSED["updated_date"] = time();
                        $PROCESSED["updated_by"] = $ENTRADA_USER->getID();
                        if (!$db->AutoExecute("event_discussions", $PROCESSED, "INSERT")) {
                            application_log("error", "Unable to add discussion comment to event id [" . $EVENT_ID . "]");
                        } elseif (($EDISCUSSION_ID = $db->Insert_Id()) && defined("NOTIFICATIONS_ACTIVE") && NOTIFICATIONS_ACTIVE) {
                            require_once "Models/notifications/NotificationUser.class.php";
                            NotificationUser::addAllNotifications("event_discussion", $EVENT_ID, 0, $ENTRADA_USER->getID(), $EDISCUSSION_ID);
                        }
                    }
                }
                header("Location: " . ENTRADA_URL . "/events?" . ($USE_QUERY ? (isset($_GET["drid"]) ? "drid" : "rid") . "=" . $RESULT_ID : "id=" . $EVENT_ID) . "#event_comments");
                exit;
            } else {
                header("Location: " . ENTRADA_URL . "/events");
                exit;
            }
            break;
        default:
            continue;
            break;
    }
}
Ejemplo n.º 2
0
 if ($STEP == 2) {
     if (isset($_POST["discussion_comment"]) && ($new_comments = clean_input($_POST["discussion_comment"], array("trim", "notags")))) {
         $PROCESSED["comments"] = $new_comments;
         $PROCESSED["clerk_id"] = $PROXY_ID;
         $PROCESSED["proxy_id"] = $ENTRADA_USER->getID();
         $PROCESSED["rotation_id"] = $rotation_id;
         $PROCESSED["updated_date"] = time();
         if ($db->AutoExecute(CLERKSHIP_DATABASE . ".logbook_rotation_comments", $PROCESSED, "INSERT")) {
             if (defined("NOTIFICATIONS_ACTIVE") && NOTIFICATIONS_ACTIVE) {
                 $lrcomment_id = $db->Insert_Id();
                 require_once "Models/notifications/NotificationUser.class.php";
                 $notification_user = NotificationUser::get($PROXY_ID, "logbook_rotation", $rotation_id, $PROXY_ID);
                 if (!$notification_user) {
                     $notification_user = NotificationUser::add($PROXY_ID, "logbook_rotation", $rotation_id, $PROXY_ID);
                 }
                 NotificationUser::addAllNotifications("logbook_rotation", $rotation_id, $PROXY_ID, $ENTRADA_USER->getID(), $lrcomment_id);
             }
             $SUCCESS++;
             $SUCCESSSTR[] = "You have succesfully added a comment to this rotation" . ($student ? "" : " for " . get_account_data("firstlast", $PROXY_ID)) . ".";
         } else {
             $ERROR++;
             $ERRORSTR[] = "There was an issue while attempting to add your comment to the system. <br /><br />If you if this error persists, please contact <a href=\"mailto:" . html_encode($AGENT_CONTACTS["administrator"]["email"]) . "\">" . html_encode($AGENT_CONTACTS["administrator"]["name"]) . "</a> for assistance.";
             application_log("error", "There was an error adding a clerkship rotation comment entry. Database said: " . $db->ErrorMsg());
         }
     }
     $STEP = 1;
 }
 // Display Content
 switch ($STEP) {
     case 2:
         break;