} else {
             $PROCESSED["required"] = 0;
         }
         $PROCESSED["updated_date"] = time();
         $PROCESSED["updated_by"] = $ENTRADA_USER->getID();
         if (!$ERROR) {
             $query = "SELECT * FROM `event_links` WHERE `event_id` = " . $db->qstr($EVENT_ID) . " AND `link` = " . $db->qstr($PROCESSED["link"]);
             $result = $db->GetRow($query);
             if ($result) {
                 $modal_onload[] = "alert('A link to " . addslashes($PROCESSED["link"]) . " already exists in this teaching event.')";
                 $ERROR++;
                 $ERRORSTR[] = "q5";
                 $JS_INITSTEP = 3;
             } else {
                 if ($db->AutoExecute("event_links", $PROCESSED, "INSERT") && ($ELINK_ID = $db->Insert_Id())) {
                     last_updated("event", $EVENT_ID);
                 } else {
                     $modal_onload[] = "alert('The new link was not successfully saved. The MEdTech Unit has been informed of this error, please try again later.')";
                     $ERROR++;
                     $ERRORSTR[] = "q5";
                     $JS_INITSTEP = 3;
                     application_log("error", "Unable to insert the link into the database for event ID [" . $EVENT_ID . "]. Database said: " . $db->ErrorMsg());
                 }
             }
         }
     }
     if ($ERROR) {
         $STEP = 1;
     }
     break;
 case 1:
Beispiel #2
0
if (isset($_GET['show'])) {
    if (in_array($_GET['show'], ['groups', 'countries', 'parties', 'people'])) {
        $show = $_GET['show'];
    } else {
        $show = 'countries';
    }
} else {
    $show = 'countries';
}
$smarty->assign('show', $show);
// CALCULATE 1/3s
$thirds = thirds($show, $dbconn);
$smarty->assign('thirds', $thirds);
// DATA
switch ($show) {
    case 'people':
        $as = get('activities_people', $dbconn, $filter);
        break;
    case 'parties':
        $as = get('activities_parties', $dbconn, $filter);
        break;
    case 'groups':
        $as = get('activities_groups', $dbconn, $filter);
        break;
    case 'countries':
        $as = get('activities_countries', $dbconn, $filter);
}
#print_r($as);die();
$smarty->assign('data', $as);
$smarty->assign('last_updated', last_updated("activities.json"));
$smarty->display('table.tpl');