diff --git a/dir_api.php b/dir_api.php index 831c1af..53075a2 100644 --- a/dir_api.php +++ b/dir_api.php @@ -620,6 +620,11 @@ if (isset($_REQUEST['a']) && $_REQUEST['a']=='add/letter') { update_welcome_lett // GET LIST OF ALL SESSIONS / WORKSHOPS / EVENTS // function get_sessions() { global $c, $AY; + // If a specific session id is requested, return it regardless of date range + if (isset($_REQUEST['id']) && preg_match('/^\d+$/', $_REQUEST['id'])) { + $ID = ok($_REQUEST['id']); + return multi_row_select("SELECT c.id,c.title,c.desc,c.length,c.starttime,c.track,c.location,c.location_irl,c.mode,c.gets_survey,c.category,c.parent,c.recording,c.instructions,c.image_url,c.is_flex_approved,c.cal_uid,sst.type AS typeStr, sst.id AS type, GROUP_CONCAT(ctg.tag) AS tags FROM conf_sessions c LEFT JOIN conf_sessiontypes sst ON c.type=sst.id LEFT JOIN conf_tagmember ct ON c.id=ct.session LEFT JOIN conf_tags ctg ON ctg.id=ct.tag WHERE c.id='{$ID}' GROUP BY c.id ORDER BY c.track, c.starttime;",0); + } $date_clause = api_date_clause('c.starttime'); return multi_row_select("SELECT c.id,c.title,c.desc,c.length,c.starttime,c.track,c.location,c.location_irl,c.mode,c.gets_survey,c.category,c.parent,c.recording,c.instructions,c.image_url,c.is_flex_approved,c.cal_uid,sst.type AS typeStr, sst.id AS type, GROUP_CONCAT(ctg.tag) AS tags FROM conf_sessions c LEFT JOIN conf_sessiontypes sst ON c.type=sst.id LEFT JOIN conf_tagmember ct ON c.id=ct.session LEFT JOIN conf_tags ctg ON ctg.id=ct.tag WHERE $date_clause GROUP BY c.id ORDER BY c.track, c.starttime;",0); } @@ -640,6 +645,10 @@ function multi_row_1d($qry) { global $c; // GET LIST OF ALL SESSIONS + HOSTS // function get_ses_hosts() { global $c, $AY; + if (isset($_REQUEST['id']) && preg_match('/^\d+$/', $_REQUEST['id'])) { + $ID = ok($_REQUEST['id']); + return multi_row_select("select s.id, s.title, s.starttime, u.name, u.email, u.id AS hostid from conf_sessions as s LEFT OUTER JOIN conf_hosts as h ON h.session=s.id LEFT OUTER JOIN conf_users AS u ON h.host=u.id WHERE s.id='{$ID}' ORDER BY u.name;",1); + } $date_clause = api_date_clause('s.starttime'); return multi_row_select("select s.id, s.title, s.starttime, u.name, u.email, u.id AS hostid from conf_sessions as s LEFT OUTER JOIN conf_hosts as h ON h.session=s.id LEFT OUTER JOIN conf_users AS u ON h.host=u.id WHERE $date_clause ORDER BY u.name;",1); } @@ -765,6 +774,10 @@ if (isset($_GET['a'])&& preg_match('/get\/questions\/(\d+)$/', $_GET['a'], $matc // ALL Survey ANSWERS function get_answers_all() { global $c; + if (isset($_REQUEST['id']) && preg_match('/^\d+$/', $_REQUEST['id'])) { + $ID = ok($_REQUEST['id']); + return multi_row_select( "SELECT ses.id AS ses_id, ses.title as s_title, ses.starttime, qq.id as q_id, qq.question as question, qq.type as type, ans.answer AS answer FROM conf_sessions AS ses JOIN conf_signups as sup on ses.id = sup.session JOIN conf_users as cus on cus.id = sup.user JOIN conf_q_set as qset on ses.gets_survey = qset.q_set RIGHT JOIN conf_questions as qq on qset.question = qq.id LEFT OUTER JOIN conf_answers as ans on ans.user = sup.user AND ans.question = qq.id AND ans.session = ses.id WHERE ses.id='{$ID}' AND ans.answer is not null ORDER BY ses.starttime, ses.track asc, qset.order", 0); + } $date_clause = api_date_clause('ses.starttime'); return multi_row_select( "SELECT ses.id AS ses_id, ses.title as s_title, ses.starttime, qq.id as q_id, qq.question as question, qq.type as type, ans.answer AS answer FROM conf_sessions AS ses JOIN conf_signups as sup on ses.id = sup.session JOIN conf_users as cus on cus.id = sup.user JOIN conf_q_set as qset on ses.gets_survey = qset.q_set RIGHT JOIN conf_questions as qq on qset.question = qq.id LEFT OUTER JOIN conf_answers as ans on ans.user = sup.user AND ans.question = qq.id AND ans.session = ses.id WHERE $date_clause AND ans.answer is not null ORDER BY ses.starttime, ses.track asc, qset.order", 0); } diff --git a/js/dir_app.js b/js/dir_app.js index 76a7fa3..f439bf1 100644 --- a/js/dir_app.js +++ b/js/dir_app.js @@ -2285,7 +2285,7 @@ const WorkshopHistory = Vue.component('workshophistory', {