Initial commit

This commit is contained in:
Coding with Peter 2023-12-18 11:02:11 -08:00
commit e58bd8628a
66 changed files with 29729 additions and 0 deletions

7
.htaccess Normal file
View File

@ -0,0 +1,7 @@
LimitRequestBody 20971520
RewriteEngine On
RewriteEngine on
RewriteRule ^calendar([0-9]+).ics$ calendar4.php?u=$1 [QSA]
RewriteRule ^api/(.*)$ api2.php?query=$1 [L,QSA]

67
act.php Normal file
View File

@ -0,0 +1,67 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
include 'semester.php';
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = "Events, Training, & Workshops";
$MY_CRUMB = "Activities";
$MY_PATH = $_SERVER['PHP_SELF'];
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="js/vue27max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="content">
<div class="breadcrumb">
<?php echo $CRUMB_START . $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<activitylist :static="1" :itineraryview="false" :focus="'<?php echo $FOCUS;?>'" zoom_on="0" survey_on="0"></activitylist>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 spacer">
&nbsp;
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

102
admin.php Normal file
View File

@ -0,0 +1,102 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
include 'semester.php';
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = "Flex App - All Pages";
$MY_CRUMB = "Admin";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="content">
<div class="breadcrumb">
<?php echo $CRUMB_START . $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<h3>Public</h3>
<ul>
<li><a href="index.php">Index / Itinerary</a></li>
<li><a href="chart.php">Visual Schedule of Activities</a></li>
<li><a href="act.php">Activities List / Signup</a></li>
<li><a href="flex.php">Flex</a></li>
<li><a href="survey.php">Survey</a></li>
</ul>
<h3>Admin</h3>
<ul>
<li><a href="settings.php">Settings</a></li>
<li><a href="ed_act.php">Create / Edit Activity</a></li>
<li><a href="overview.php">Overview: Signups Table</a></li>
<li><a href="report.php">Report</a></li>
<li><a href="sessions.php">Sessions (with edit links)</a></li>
</ul>
<h3>Unused</h3>
<ul>
<li><a href="cal.php">Calendar</a></li>
<li><a href="dir.php">Directory Editor</a></li>
</ul>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 spacer">
&nbsp;
</div>
<div class="pure-u-1-12"></div>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

407
api2.php Normal file
View File

@ -0,0 +1,407 @@
<?php
$TESTSITE = 1;
if ($TESTSITE) {
$DBUser = 'phowell'; $DBServer = '192.168.1.6';
$DBPass = 'rolley34'; $DBName = 'db';
} else {
$DBUser = 'phowell'; $DBServer = 'localhost';
$DBPass = 'p^howell'; $DBName = 'PeterDB';
}
// Establish database connection
//
$c = new mysqli($DBServer, $DBUser, $DBPass, $DBName);
if ($c->connect_error) { die('Database connection failed: ' . $c->connect_error ); }
if (!mysqli_select_db($c, $DBName)) { die("Uh oh, couldn't select database $DBName"); }
mysqli_set_charset($c, 'utf8');
$server = $_SERVER['SERVER_NAME'];
$DEBUG = 0;
function p($s) { echo "<p>{$s}</p>\n"; }
function p2($val){ echo '<pre>'; print_r($val); echo "</pre>\n"; }
function d_err($s) { global $DEBUG; if ($DEBUG) { p($s); } }
function ok($str) { global $c; return mysqli_real_escape_string($c, strip_tags($str, '<p><br><ul><ol><li><b><i><strong><em>')); }
function okh($str) { global $c; return mysqli_real_escape_string($c, $str); }
function sanitizeAndValidate($s) { return okh($s); }
function unescape_commas($s) { return preg_replace('/\[CMA\]/', ',', $s); }
function single_row_select($qry, $j=1) {
global $c;
$r = mysqli_query($c, $qry); d_err($qry);
$e = mysqli_error($c); if($e) { d_err("sql error: " . $e ); }
if (!$r) { return $r; }
$a = mysqli_fetch_assoc($r);
$e = mysqli_error($c); if($e) { d_err("sql error: " . $e ); }
if (! $j) { return $a; } return json_encode($a); }
function single_row_insert($qry) { global $c;
$r = mysqli_query($c, $qry);
return mysqli_insert_id($c); }
function single_row_update($qry, $j=1) { global $c;
$r = mysqli_query($c, $qry);
return 1; }
function multi_row_select($qry, $j=1) { global $c; $rows = array();
$result = mysqli_query($c, $qry);
while($r = mysqli_fetch_assoc($result)) { $rows[] = $r; }
if (! $j) { return $rows; } return json_encode( $rows); }
function multi_row_1d($qry) { global $c;
$savedQuery = mysqli_query($c, $qry);
while($savedResult = mysqli_fetch_array($savedQuery)) {
$savedArray[] = $savedResult[0]; }
return $savedArray; }
// _____ _____ _ _ _____ _ ______ _ ____ _ _
// / ____|_ _| \ | |/ ____| | | ____| (_) / __ \| \ | |
// | (___ | | | \| | | __| | | |__ ___ _ __ _ _ __ | | | | \| |
// \___ \ | | | . ` | | |_ | | | __| / __| |/ _` | '_ \ | | | | . ` |
// ____) |_| |_| |\ | |__| | |____| |____ \__ \ | (_| | | | | | |__| | |\ |
// |_____/|_____|_| \_|\_____|______|______| |___/_|\__, |_| |_| \____/|_| \_|
// __/ |
// |___/
// SSO
//
// Set GLOBAL VARS corresponding to current logged in user.
// They may only edit their own dir info.
//
if ( $server == 'intranet1.gavilan.edu' ) { // The SSO check should have happened on the actual page. If it gets
// // stuck on an api call the app will break.
if ( session_id() == '' ) { // session_status() == PHP_SESSION_ACTIVE // newer php uses this
require 'mAuth.php';
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
?>
<!--
<?php print_r($attributes); ?>
-->
<?php
session_start();
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
} else { // already logged in....
$USER_TYPE = $_SESSION['USER_TYPE'];
$USER_GOO = $_SESSION['USER_GOO'];
$USER_EMAIL = $_SESSION['USER_EMAIL'];
}
} else { // just testing on a different server...
$USER_TYPE = 'FACULTY'; $USER_GOO = 'G00102586'; $USER_EMAIL = 'phowell@gavilan.edu';
session_start();
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
// No email? Might be a problem. Look up by goo
if (! $USER_EMAIL) {
$goo = substr($USER_GOO, 3);
$q0 = "SELECT email,name FROM conf_users WHERE goo='{$goo}'";
$temp_usr = single_row_select($q0,0);
$USER_NAME = '';
// Is this a "MISSING USER?" Create an account for them.
if (is_null($temp_usr)) {
$LC_EMAIL = strtolower($USER_EMAIL);
$result = single_row_insert("INSERT INTO conf_users (goo, email, name) VALUES ('{$goo}','{$LC_EMAIL}','{$USER_NAME}');");
//echo "INSERT INTO conf_users (goo, email, name) VALUES ('{$goo}','{$LC_EMAIL}','{$USER_NAME}');";
//print_r($result);
//$logaction = log_it("Made a new conf_users row for {$USER_NAME} / {$LC_EMAIL} / {$USER_GOO}");
}
$USER_NAME = $temp_usr['name'];
$USER_EMAIL = strtolower($temp_usr['email']);
}
//
//
//
//
// Set up user global
$usr_qry = "SELECT id AS conf_id, goo AS conf_goo, email AS conf_email, name AS conf_name, active AS conf_active FROM conf_users WHERE LOWER(email)='{$USER_EMAIL}'";
$USER = single_row_select($usr_qry, 0);
// Check again for missing user entry. Create an account for them.
if (is_null($USER)) {
$LC_EMAIL = strtolower($USER_EMAIL);
$goo = substr($USER_GOO, 3);
$USER_NAME = '';
$result = single_row_insert("INSERT INTO conf_users (goo, email, name) VALUES ('{$goo}','{$LC_EMAIL}','{$USER_NAME}');");
//echo "INSERT INTO conf_users (goo, email, name) VALUES ('{$goo}','{$LC_EMAIL}','{$USER_NAME}');";
//print_r($result);
//$logaction = log_it("Made a new conf_users row for {$USER_NAME} / {$LC_EMAIL} / {$USER_GOO}");
$usr_qry = "SELECT id AS conf_id, goo AS conf_goo, email AS conf_email, name AS conf_name, active AS conf_active FROM conf_users WHERE LOWER(email)='{$USER_EMAIL}'";
$USER = single_row_select($usr_qry, 0);
}
// Define URL templates and associated SQL queries
$queries = [
'/users/{id}' => 'SELECT * FROM users WHERE id = :id',
'/users' => 'SELECT * FROM users',
'/products' => 'SELECT * FROM products',
'/sessions' => '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 GROUP BY c.id ORDER BY c.track, c.starttime;',
'/ses/{day}' => '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.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.starttime LIKE \'%:day%\' GROUP BY c.id ORDER BY c.track, c.starttime;',
'/settings' => 'SELECT * FROM conf_uinforecord;'
];
$functions = [
'/app' => 'appdata',
'/start' => 'startup',
'/update/activity' => 'set_sessioninfo',
];
if (1) { //// ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (isset($_REQUEST['query'])) {
$requestUrl = '/' . $_REQUEST['query']; /// $_SERVER['REQUEST_URI'];
// Check if a matching URL template exists
// Execute corresponding SQL query based on the request URL
foreach ($queries as $urlTemplate => $sqlTemplate) {
$pattern = preg_replace('/{([\-_\w]+)}/', '([\-_\w]+)', $urlTemplate);
if (preg_match("#^$pattern$#", $requestUrl, $matches)) {
// Extract parameter values
$params = [];
preg_match_all('/{([\-_\w]+)}/', $urlTemplate, $paramNames);
foreach ($paramNames[1] as $index => $paramName) {
$paramValue = $matches[$index + 1];
//echo ". . index:" . $index . ". . paramName:" . $paramName . ". . paramValue:" . $paramValue . "<br>";
// Sanitize and validate the parameter value
// Store the sanitized value in the $params array
$params[':' . $paramName] = sanitizeAndValidate($paramValue);
}
// Prepare the SQL query with the parameter values
$sql = strtr($sqlTemplate, $params);
// Execute the SQL query and retrieve data
//echo "query:" . $sql . "<br>";
$result = mysqli_query($c, $sql);
$rows = array();
while($r = mysqli_fetch_assoc($result)) { $rows[] = $r; }
$jsonString = json_encode($rows);
$sizeInBytes = strlen($jsonString);
echo json_encode(array(
"size" => $sizeInBytes,
"result" => "success",
//"query" => $sql,
"data" => $rows,
"err" => mysqli_error($c)
));
}
}
foreach ($functions as $urlTemplate => $functionCall) {
$pattern = preg_replace('/{([\-_\w]+)}/', '([\-_\w]+)', $urlTemplate);
if (preg_match("#^$pattern$#", $requestUrl, $matches)) {
// Extract parameter values
$params = [];
preg_match_all('/{([\-_\w]+)}/', $urlTemplate, $paramNames);
foreach ($paramNames[1] as $index => $paramName) {
$paramValue = $matches[$index + 1];
// Sanitize and validate the parameter value
// Store the sanitized value in the $params array
$params[':' . $paramName] = sanitizeAndValidate($paramValue);
}
$rows = call_user_func($functionCall);
$jsonString = json_encode($rows);
$sizeInBytes = strlen($jsonString);
echo json_encode(array(
"size" => $sizeInBytes,
"result" => "success",
"data" => $rows,
"err" => mysqli_error($c)
));
}
}
}
} /*elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Handle updates / inserts
$tableName = $_GET['table'];
$postData = $_POST;
$recordId = isset($postData['id']) ? $postData['id'] : null;
$date = date('Y-m-d H:i:s');
$columns = explode(',', $_REQUEST['cols']);
$values = explode(',', $_REQUEST['vals']);
$values = array_map('unescape_commas', $values);
$columnValuePairs = array_combine($columns, $values);
// Build the update/insert query
if ($recordId) {
$query = "UPDATE $tableName SET ";
$query .= join(", ", array_map(function ($column, $value) {
return okh($column) . " = '" . okh($value) . "'";
}, array_keys($columnValuePairs), $columnValuePairs));
$query .= ", changed = '$date'";
$query .= " WHERE id = $recordId";
} else {
$query = "INSERT INTO $tableName (";
$query .= join(", ", array_map('okh', $columns));
$query .= ", changed) VALUES ('";
$query .= join("', '", array_map('okh', $values));
$query .= "', '$date')";
}
// Execute the query
echo "Query: " . $query . "<br>";
exit();
$r = mysqli_query($c, $query);
echo json_encode(array(
"rawvalstr" => $_REQUEST['vals'],
"result" => "success",
"action" => ($recordId ? "updated" : "inserted"),
"logaction" => $logaction,
"query" => $query,
"err" => mysqli_error($c)
));
exit();
} */
function startup() {
global $USER;
$ddd = multi_row_select('SELECT * FROM gavi_departments ORDER BY name',0);
$ttt = multi_row_select('SELECT * FROM gavi_titles ORDER BY name',0);
$rrr = multi_row_select("SELECT * FROM gavi_roles ORDER BY 'descr'",0);
$ccc = multi_row_select('SELECT * FROM gavi_committees ORDER BY name',0);
$sss = multi_row_select('SELECT * FROM conf_sessiontypes ORDER BY id',0);
$aya = multi_row_select('SELECT * FROM conf_academicyears ORDER BY id',0);
$set = multi_row_select('SELECT id,label,value FROM conf_uinforecord',0);
$ppp = multi_row_select("SELECT * FROM `conf_sessions` WHERE `type` = '20' OR `type` = '21' ORDER BY starttime",0);
$SET = array();
foreach ($set as $setting) {
$SET[$setting['label']] = $setting['value'];
}
echo json_encode( array( 'user'=>$USER, 'departments'=>$ddd, 'titles'=>$ttt, 'roles'=>$rrr, 'committees'=>$ccc,
'sessiontypes'=>$sss, 'settings'=>$SET, 'ay'=>$aya, 'parents'=>$ppp ) );
exit();
}
function appdata() {
global $USER;
// mysessions
$m = 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,sst.type,sst.id AS typeId, GROUP_CONCAT(ctg.tag) AS tags FROM conf_sessions c LEFT JOIN conf_signups as sup on c.id=sup.session LEFT JOIN conf_hosts as h ON h.session=c.id 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 (h.host='{$USER['conf_id']}' OR sup.user='{$USER['conf_id']}') GROUP BY c.id ORDER BY c.track, c.starttime;",0);
// sessions
$s = 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 GROUP BY c.id ORDER BY c.track, c.starttime;',0);
// hosts
$hh = multi_row_1d("select session FROM conf_hosts WHERE host='{$USER['conf_id']}';");
// conferences
$c = multi_row_select('SELECT * FROM conf_conferences;',0);
$y = multi_row_select('SELECT * FROM conf_academicyears',0);
// options
$o = multi_row_select('SELECT * FROM conf_uinforecord',0);
echo json_encode(array(
"mysessions" => $m,
"sessions" => $s,
"host" => $hh,
"user" => $USER,
"conference" => $c,
"ay" => $y,
"options" => $o,
));
exit();
}
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// Editing of session info
//
function reducer ($memo, $a) { return $memo . "`" . ok($a[0]) . "` = '" . okh($a[1]) . "', "; }
function set_sessioninfo() {
global $c, $USER;
$table = 'conf_sessions';
if (isset($_POST['id'])) {
$ID = ok($_REQUEST['id']);
$WHERECLAUSE = " WHERE id={$ID}";
$date = date('Y-m-d H:i:s');
$cols = explode(',', $_REQUEST['cols']); $vals = explode(',', $_REQUEST['vals']);
$vals = array_map('unescape_commas', $vals);
$cv = array_map(null,$cols,$vals);
$q = array_reduce($cv, 'reducer', "UPDATE `{$table}` SET ");
$q = substr($q, 0, -2);
$q .= $WHERECLAUSE;
single_row_update($q,0,$c2);
echo json_encode( array("rawvalstr"=>$_REQUEST['vals'], "result"=>"success","action"=>"updated", "query"=>$q,"err"=>mysqli_error($c2)));
} else {
echo json_encode( array("result"=>"fail", "err"=>"no activity id specified") ); }
exit();
}
// Return an appropriate response indicating success or failure
// ...
// Close the database connection
// ...
// later... permission check
// Check if the user has permission to update the record
/*if (isset($_POST['id'])) { // Editing another person's data
if (!check_permission($USER->id, $_POST['id'], 'personnel')) {
echo json_encode(array("result" => "fail", "err" => "You don't have permission to edit this"));
exit();
} else {
$logaction = log_it("Updating $tableName record with id {$_POST['id']}");
$recordId = $_POST['id'];
}
} else {
$logaction = log_it("Updating $tableName record");
$recordId = $USER->id;
}*/

82
bio.php Normal file
View File

@ -0,0 +1,82 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$MY_TITLE = "Staff Bio Page Editor";
$MY_CRUMB = "<a href='index.php'>Personnel Directory</a> &gt; Staff Bio Page";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12">
</div>
<div class="pure-u-20-24 content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<form class="pure-form pure-form-aligned">
<checkbox table="personnel" qid="web_on"
question="Activate Bio Web Page Link" :answer="this.user.web_on"></checkbox>
<tfield table="webpages" qid="bio" question="Brief biography" :answer="this.user.bio"></tfield>
<tfield table="webpages" qid="education" question="Education summary" :answer="this.user.education"></tfield>
<field table="webpages" qid="title" question="Title" :answer="this.user.title"></field>
<tfield table="webpages" qid="officehours" question="Office hours" :answer="this.user.officehours"></tfield>
<field table="webpages" qid="personal_page" question="Personal web site" :answer="this.user.personal_page"></field>
<br />
<div class="pure-controls">
<img class="staffpic" :src="this.user.picture" />
</div>
</form>
<!-- <div class="formpush">
<p>Upload a new picture (only small files)</p>
<form action="dir_api_tester.php"
class="dropzone"
id="my-awesome-dropzone"></form>
</div>
<div id="bio2"></div> -->
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

65
cal.php Normal file
View File

@ -0,0 +1,65 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$MY_TITLE = "Events, Training, & Workshops";
$MY_CRUMB = "<a href='index.php'>Personnel Directory</a> &gt; Activity Signups";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12">
</div>
<div class="pure-u-20-24 content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<h2>Calendar View</h2>
<p>Sign up for events here</p>
<mycal></mycal>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

101
chart.php Normal file
View File

@ -0,0 +1,101 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
include 'semester.php';
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = $monthName . " " . $d . " " . $y . " Overview";
$MY_CRUMB = "Overview";
$MY_PATH = $_SERVER['PHP_SELF'];
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="js/vue27max.js"/></script>
<script>
var dirapi_output="";
</script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<link rel="stylesheet" type="text/css" href="css/chart.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="content">
<div class="breadcrumb">
<?php echo $CRUMB_START . $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php
/* require 'nav.php'; */
require 'dir_api.php';
navigation( $USER_GOO );
?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<!-- Subscribe to this link in Outlook for your events feed: <br />
<b>{{ my_subscribe_calendar() }} </b> &nbsp;
<button v-on:click="clip_copy">Copy Link</button>
<span class="success"> Copied! </span>
-->
<chartview day="<?php echo $day; ?>"></chartview>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 spacer">
&nbsp;
</div>
<div class="pure-u-1-12"></div>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

187
css/chart.css Normal file
View File

@ -0,0 +1,187 @@
/*************************
* GRID SCHEDULE LAYOUT
*************************/
@media screen and (min-width:700px) {
.schedule {
display: grid;
column-gap: 0.5em;
row-gap:0.7em;
grid-template-rows:
[tracks] auto
/*[time-0800] 0.005fr
[time-0805] 0.005fr
[time-0810] 0.005fr
[time-0815] 0.005fr
[time-0820] 0.005fr
[time-0825] 0.005fr
[time-0830] 0.005fr
[time-0835] 0.005fr
[time-0840] 0.005fr
[time-0845] 0.005fr
[time-0850] 0.005fr
[time-0855] 0.005fr */
[time-0900] 0.005fr
[time-0905] 0.005fr
[time-0910] 0.005fr
[time-0915] 0.005fr
[time-0920] 0.005fr
[time-0925] 0.005fr
[time-0930] 0.005fr
[time-0935] 0.005fr
[time-0940] 0.005fr
[time-0945] 0.005fr
[time-0950] 0.005fr
[time-0955] 0.005fr
[time-1000] 0.005fr
[time-1005] 0.005fr
[time-1010] 0.005fr
[time-1015] 0.005fr
[time-1020] 0.005fr
[time-1025] 0.005fr
[time-1030] 0.005fr
[time-1035] 0.005fr
[time-1040] 0.005fr
[time-1045] 0.005fr
[time-1050] 0.005fr
[time-1055] 0.005fr
[time-1100] 0.005fr
[time-1105] 0.005fr
[time-1110] 0.005fr
[time-1115] 0.005fr
[time-1120] 0.005fr
[time-1125] 0.005fr
[time-1130] 0.005fr
[time-1135] 0.005fr
[time-1140] 0.005fr
[time-1145] 0.005fr
[time-1150] 0.005fr
[time-1155] 0.005fr
[time-1200] 0.005fr
[time-1205] 0.005fr
[time-1210] 0.005fr
[time-1215] 0.005fr
[time-1220] 0.005fr
[time-1225] 0.005fr
[time-1230] 0.005fr
[time-1235] 0.005fr
[time-1240] 0.005fr
[time-1245] 0.005fr
[time-1250] 0.005fr
[time-1255] 0.005fr
[time-1300] 0.005fr
[time-1305] 0.005fr
[time-1310] 0.005fr
[time-1315] 0.005fr
[time-1320] 0.005fr
[time-1325] 0.005fr
[time-1330] 0.005fr
[time-1335] 0.005fr
[time-1340] 0.005fr
[time-1345] 0.005fr
[time-1350] 0.005fr
[time-1355] 0.005fr
[time-1400] 0.005fr
[time-1405] 0.005fr
[time-1410] 0.005fr
[time-1415] 0.005fr
[time-1420] 0.005fr
[time-1425] 0.005fr
[time-1430] 0.005fr
[time-1435] 0.005fr
[time-1440] 0.005fr
[time-1445] 0.005fr
[time-1450] 0.005fr
[time-1455] 0.005fr
[time-1500] 0.005fr
[time-1505] 0.005fr
[time-1510] 0.005fr
[time-1515] 0.005fr
[time-1520] 0.005fr
[time-1525] 0.005fr
[time-1530] 0.005fr
[time-1535] 0.005fr
[time-1540] 0.005fr
[time-1545] 0.005fr
[time-1550] 0.005fr
[time-1555] 0.005fr
[time-1600] 0.005fr
[time-1605] 0.005fr
[time-1610] 0.005fr
[time-1615] 0.005fr
[time-1620] 0.005fr
[time-1625] 0.005fr
[time-1630] 0.005fr
[time-1635] 0.005fr
[time-1640] 0.005fr
[time-1645] 0.005fr
[time-1650] 0.005fr
[time-1655] 0.005fr
[time-1700] 0.005fr
[time-1705] 0.005fr
[time-1710] 0.005fr
[time-1715] 0.005fr
[time-1720] 0.005fr
[time-1725] 0.005fr
[time-1730] 0.005fr
[time-1735] 0.005fr
[time-1740] 0.005fr
[time-1745] 0.005fr
[time-1750] 0.005fr
[time-1755] 0.005fr;
/* Note 1:
Use 24hr time for gridline names for simplicity
Note 2: Use "auto" instead of "1fr" for a more compact schedule where height of a slot is not proportional to the session length.
Implementing a "compact" shortcode attribute might make sense for this!
Try 0.5fr for more compact equal rows. I don't quite understand how that works :)
*/
grid-template-columns:
[times] 4em
[track-1-start] 1fr
[track-1-end track-2-start] 1fr
[track-2-end track-3-start] 1fr
[track-3-end track-4-start] 1fr
[track-4-end track-5-start] 1fr
[track-5-end track-6-start] 1fr
[track-6-end];
}
}
.time-slot { grid-column: times; }
.track-slot { display: none; }
/* hidden on small screens and browsers without grid support */
@supports(display:grid ) { @media screen and(min-width:700px) {
.track-slot { display: block; padding: 10px 5px 5px; position: sticky; top: 0; z-index: 1000; background-color: rgba(255,255,255,.9); } } }
/* Small-screen & fallback styles */
@supports(display:grid ) { @media screen and(min-width: 700px) { .session { margin: 0; } } }
/* VISUAL STYLES * Design-y stuff ot particularly important to the demo */
body { padding: 50px; /*max-width: 1100px;*/ margin: 0 auto; line-height: 1.5; }
.session { padding: .5em; border-radius: 2px; font-size: 14px; }
/* box-shadow: rgba(255,255,255,.6) 1px 1px 0, rgba(0,0,0,.3) 4px 4px 0; */
.session-title, .session-time, .session-track, .session-presenter { display: block; }
.session-title, .time-slot { margin: 0; font-size: 1em; }
.session-title a { color: #fff; text-decoration-style: dotted; &:hover { font-style: italic; }
&:focus { outline: 2px dotted rgba(255,255,255,.8); }
}
.track-slot, .time-slot { font-weight: bold; font-size:.75em; }
.track-123 { background-color: #ffa8ca; color: #000; }
.track-0 { background-color: #ffa8ca; color: #000; }
.track-1 { background-color: #f3ba59; color: #fff; }
.track-2 { background-color: #e96b8f; color: #fff; }
.track-3 { background-color: #ff9ffc; color: #fff; }
.track-4 { background-color: #b4d3c0; color: #fff; }
.track-5 { background-color: #dad9ff; color: #fff; }
.track-6 { background-color: #9ccae1; color: #fff; }
.track-all { display: flex; justify-content: center; align-items: center; background: #ccc; color: #000; box-shadow: none; }
.text { max-width: 750px; font-size: 18px; margin: 0 auto 50px; }
.session h3, .session { color: #272727; }
.meta { color: #555; font-style: italic; }
.meta a { color: #555; }
.chart_timebox { color:lightgrey; border:1px solid lightgrey; padding:5px; }
.chart_time { color:#5c5b5b; font-size: 80%; }
hr { margin: 40px 0; }

200
css/intranet2021.css Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
{ "what_expect": "sample text for <i>what to expect</i>",
"assessments": "the assessments",
"textbook": "textbook or oei",
"other_info": "oi",
"introduction": "Introduction to this class",
"additional_resources": "Subsections like AEC, Tutoring/STEM/Academic Success/ Library Fresh success and more"
}

125
dir.php Normal file
View File

@ -0,0 +1,125 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = "Personnel Directory Editor";
$MY_CRUMB = "Personnel Directory";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12">
</div>
<div class="pure-u-20-24 content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<form class="pure-form pure-form-aligned">
<field table="personnel" qid="first_name" question="First name" :answer="this.user.first_name"></field>
<field table="personnel" qid="last_name" question="Last name" :answer="this.user.last_name"></field>
<div class="pure-control-group"><label class="question">Email</label>
<span class="lighter">{{ user.email }}</span></div>
<div class="pure-control-group"><label class="question">G Number</label>
<span class="lighter">G00{{ user.conf_goo }}</span></div>
<!-- <field table="personnel" qid="department" question="Department" :answer="this.user.department"></field> -->
<field table="personnel" qid="phone_number" question="Phone Number" :answer="this.user.phone_number"></field>
<field table="personnel_ext" qid="zoom" question="Zoom link" :answer="this.user.zoom"></field>
<field table="personnel" qid="room" question="Room" :answer="this.user.room"></field>
<div class="pure-control-group">
<label for="dept1" class="question">Department</label>
<selectmenu table="personnel_ext" qid="dept1" :answer="this.user.dept1" menu="depts_menu" :targetid="this.user.ext_id" labelfield="name"></selectmenu>
</div>
<div class="pure-control-group">
<label for="dept2" class="question">Optional Additional Department</label>
<selectmenu table="personnel_ext" qid="dept2" :answer="this.user.dept2" menu="depts_menu" :targetid="this.user.ext_id" labelfield="name"></selectmenu>
</div>
<div class="pure-control-group">
<label for="gtitle" class="question">Job Title</label>
<selectmenu table="personnel_ext" qid="gtitle" :answer="this.user.gtitle" menu="titles_menu" :targetid="this.user.ext_id" labelfield="name"></selectmenu>
</div>
<checkbox table="personnel_ext" qid="espanol" question="I speak spanish" :answer="this.user.espanol"></checkbox>
<checkbox table="personnel_ext" qid="use_dir_photo" question="Publish my photo on staff directory" :answer="this.user.use_dir_photo"></checkbox>
<checkbox table="personnel_ext" qid="general_photo_release" question="I allow Gavilan College to use my directory photo in promotions and publicity." :answer="this.user.general_photo_release"></checkbox>
<div class="pure-controls">
<img class="staffpic" :src="'https://www.gavilan.edu/staff/' + this.user.dir_pic_path" />
</div>
<!-- #### NO PIC UPLOADS FOR NOW
<div class="formpush">
<p>Upload a new picture (only small files)</p>
<form action="dir_api_tester.php"
class="dropzone"
id="my-awesome-dropzone"></form>
</div>
-->
<!-- <div id="bio2"></div> <div class="pure-u-1-4"></div> -->
</form>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

822
dir_api.20211021php Normal file
View File

@ -0,0 +1,822 @@
<?php
$DEBUG = 0;
function p($s) { echo "<p>{$s}</p>\n"; }
function p2($val){ echo '<pre>'; print_r($val); echo "</pre>\n"; }
function d_err($s) { global $DEBUG; if ($DEBUG) { p($s); } }
include('underscore.php');
////////////////////
////////////////////
//
// PHP SESSIONS .... needed?
//
/*
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Allow-Methods: get,post");
header("Access-Control-Allow-Headers: Content-Type, Accept");
session_start();
function logout() { session_destroy(); }
*/
////////////////////
////////////////////
//
// DATABASE
//
// Yes, there's two different databases.
//
// $c = gavi_db
// $c2 = PeterDB
//
// Why? Just to keep you on your toes.
//
// The $j argument is true for a json result, or false for a raw db object result.
//
$DBServer = 'localhost'; $DBUser = 'www';
$DBPass = '@$df'; $DBName = 'gavi_db';
$c = new mysqli($DBServer, $DBUser, $DBPass, $DBName);
if ($c->connect_error) { die('Database connection failed: ' . $c->connect_error ); }
if (!mysqli_select_db($c, $DBName)) { die("Uh oh, couldn't select database $DBName"); }
$c2 = new mysqli($DBServer, "phowell", 'p^howell', 'PeterDB');
if ($c2->connect_error) { die('Database connection failed: ' . $c2->connect_error ); }
if (!mysqli_select_db($c2, 'PeterDB')) { die("Uh oh, couldn't select database 'PeterDB'"); }
// Generic string cleaner
function ok($str) { global $c; return mysqli_real_escape_string($c, strip_tags($str, '<p><br><ul><ol><li><b><i><strong><em>')); }
// 1. lookups, like a username
function single_row_select($qry, $j=1, $c) {
$r = mysqli_query($c, $qry); d_err($qry);
$e = mysqli_error($c); if($e) { d_err("sql error: " . $e ); }
$a = mysqli_fetch_assoc($r);
$e = mysqli_error($c); if($e) { d_err("sql error: " . $e ); }
if (! $j) { return $a; } return json_encode($a); }
// 1a. inserts
function single_row_insert($qry, $j=1, $c) {
$r = mysqli_query($c, $qry); d_err($qry);
$e = mysqli_error($c); if($e) { d_err("sql error: " . $e ); }
$a = mysqli_fetch_assoc($c);
$e = mysqli_error($c); if($e) { d_err("sql error: " . $e ); }
if (! $j) { return $a; } return json_encode($a); }
// 2. grid or fancier joins, like get all sessions, rosters, todos, etc
function multi_row_select($qry, $j=1, $db) {
$rows = array();
$result = mysqli_query($db, $qry);
while($r = mysqli_fetch_assoc($result)) { $rows[] = $r; }
if (! $j) { return $rows; } return json_encode( $rows); }
// 3. Check if an entry exists
function does_exist($qry, $full_record=0, $db) { global $c, $c2;
$r = mysqli_query($db, $qry);
$a = mysqli_num_rows($r);
$row = mysqli_fetch_array($r, MYSQLI_NUM);
$id = $row[0]; // getting the id of that which exists... assuming first column has it.
d_err("does exist: {$a}");
$e = mysqli_error($db); if($e) { d_err("sql error: " . $e); }
if ($a && $full_record) { return $row; } if ($a) { return $id; } return 0; }
////////////////////
////////////////////
//
// SSO
//
// Set GLOBAL VARS corresponding to current logged in user.
// They may only edit their own dir info.
//
$server = $_SERVER['SERVER_NAME'];
if ( preg_match('/intranet1/', $server )) {
require 'mAuth.php';
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = strtolower($attributes['http://wso2.org/claims/emailaddress'][0]);
/*$USER_TYPE = "FACULTY"; //$attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = "G00102586"; //$attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = "phowell@gavilan.edu"; //$attributes['http://wso2.org/claims/emailaddress'][0];
$status = "<b>ID:</b>{$USER_GOO}<br />";
$status .= "<b>Email:</b>{$USER_EMAIL}<br />";
$status .= "<b>Employee type:</b>{$USER_TYPE}<br />";
d_err($status); */
} else {
echo json_encode( array("result"=>"not on intranet1") );
//exit();
$USER = 0;
$USER_NAME = 0;
$USER_PERS_ID = 0;
$USER_CONF_U_ID = 0;
$USER_PERS_EXT_ID = 0;
}
// Current academic year
$AY = single_row_select("SELECT * FROM conf_academicyears WHERE label='2021-2022';",0, $c2);
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// Fetching a person's records
//
// 1. use their email to lookup PERSONNEL
// - basic directory info
//
// 2. use their email to lookup CONF_USERS
// - flex app, workshop signups
//
// 3. use conf_users.id to lookup in gavi_personnel_ext.c_users
// - goo, depts, job title, image active
//
// 4. use personnel.id to lookup [webpages, welcomepages, etc]
function user_record() { global $USER, $USER_EMAIL, $USER_NAME, $USER_PERS_ID, $USER_CONF_U_ID, $USER_PERS_EXT_ID, $c, $c2;
$q1 = "SELECT last_name, first_name, department, extension, phone_number, LOWER(email) AS email, room, user_id, time_updated, id, web_on FROM personnel WHERE email='" . $USER_EMAIL . "'";
//p2($q1);
$usr_dir = single_row_select($q1, 0, $c);
//p2($usr_dir);
$q2 = "SELECT id AS id_c_users, goo, LOWER(email) AS email_c_users, name, active FROM conf_users WHERE LOWER(email)='" . $USER_EMAIL . "'";
//p2($q2);
$usr_conf = single_row_select($q2, 0, $c2);
//p2($usr_conf);
$mega = __::extend( (object) $usr_dir, (object) $usr_conf );
$q3 = 'SELECT id AS ext_id, personnel AS personnel_id, role, goo_short, c_users AS c_users_id_ext, ilearn_id, sched_alias, dept1, dept2, gtitle, active, use_dir_photo, general_photo_release, etc FROM gavi_personnel_ext WHERE c_users=' . $mega->id_c_users;
//p2($q3);
$usr_ext = single_row_select($q3,0,$c2);
//p2($usr_ext);
$mega = __::extend( (object) $mega, (object) $usr_ext );
$q4 = 'SELECT person, officehours, title, picture, education, bio, courses, personal_page, changed FROM webpages WHERE person=' . $mega->id; // personnel=1');
//p2($q3);
$usr_web = single_row_select($q4,0,$c);
//p2($usr_ext);
$mega = __::extend( (object) $mega, (object) $usr_web );
$USER = $mega;
}
if ($USER_EMAIL) { user_record(); }
// //
// //
// // LOG ENTRIES
// //
// //
// Enter or get browser log entry
function insert_or_get_browser($b) {
global $c2;
$BROWSER = ok($b);
$existing = does_exist( "SELECT id FROM www_browsers WHERE string='$BROWSER'", 0, $c2);
if ($existing) {
return $existing;
} else {
$q = "INSERT INTO www_browsers (string) VALUES ('$BROWSER')";
single_row_select($q,0,$c2);
return does_exist( "SELECT id FROM www_browsers WHERE string='$BROWSER'",0,$c2);
}
return 0; }
// Log everything!
function log_it($action,$extra='') {
global $USER, $c2;
if (! $USER) {
$USER = array( 'name'=>'unknown', 'id'=>-1 ); }
$user_browser = $_SERVER['HTTP_USER_AGENT'];
$user_ip = $_SERVER['REMOTE_ADDR'];
$BROWSER = insert_or_get_browser($user_browser);
$ACTION = ok($action);
$EXTRA = ok($extra);
//$id = ok($_POST['id']);
$qupdate = "INSERT INTO gavi_logs SET action='{$action}', personnel_id='{$USER->id}', name='{$USER->name}', extra='{$EXTRA}', browser=$BROWSER, ip='$user_ip'";
single_row_select($qupdate,0,$c2);
return array("result"=>"success","action"=>"logged","query"=>$qupdate,"err"=>mysqli_error($c2));
}
function unescape_commas($s) { return preg_replace('/\[CMA\]/', ',', $s); }
function name_to_lc($fn,$ln) {
$fn = str_replace( array( '-', ' '), '', strtolower($fn) );
$ln = str_replace( array( '-', ' '), '', strtolower($ln) );
return $fn . "_" . $ln;
}
function name_to_file($fn,$ln) {
$fn = str_replace( array( '-', ' '), '', strtolower($fn) );
$ln = str_replace( array( '-', ' '), '', strtolower($ln) );
return $fn . "_" . $ln . ".jpg";
}
function check_dir_photo($fn,$ln) { global $USER;
$filename = name_to_file( $fn,$ln );
$path = '/gavilan.edu/staff/images_sm/' . $filename;
$dir_pic_exists = 0;
$dir_pic_path = 'images_sm/nobody.jpg';
if (file_exists($path)) {
$dir_pic_exists = 1;
$dir_pic_path = 'images_sm/' . $filename; }
$USER->dir_pic_exists = $dir_pic_exists;
$USER->dir_pic_path = $dir_pic_path;
return $dir_pic_exists;
}
check_dir_photo($USER->first_name, $USER->last_name);
//
//
//
////////////////////
////////////////////
//require __DIR__ . '/vendor/autoload.php';
// Sample URL
//
// https://www.gavilan.edu/staff/dir_api.php?a=update&cols=name,msg&vals=peter,hello
//
// https://intranet1.gavilan.edu/dir/dir_api.php?a=update&cols=name,msg&vals=peter,hello
/*
NEXT STEPS:
- figure out permissions system
- which means knowing dept / hierarchy
- which means cross referencing PERSONNEL and EXT and CONF_USERS.....
## Permissions summary
0. There is a list of table+column combos that users are allowed to edit.
0.5 An activity "belongs" to the user who owns it (or created it).
1. Simple cases:
- current user is updating their own (allowable) record. Allow.
2. Superuser:
- current user is executive, hr, it, or root. (7,2,8,3) Allow.
3. User is "Dept Editor" (4) and
-is updating a record belonging to someone in their dept. Allow.
4. Harder: Updating events
5. Updating attendance, approvals, or other restricted tables. Only FPLC (1) or superusers.
*/
function check_permission( $acting_user, $target_user, $table ) {
// TODO
return true;
}
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// Everyone. Basic dir. Include status==0 which is unpublished.
function staff_dir() { global $c;
return multi_row_select('SELECT first_name,last_name,department,status, room,phone_number,email,web_on,id FROM personnel',1, $c);
// WHERE status IS null OR status=1
}
// Everyone. Basic dir
function staff_dir_ext() { global $c;
//return multi_row_select('SELECT p.first_name,p.last_name,p.department,p.status, p.room,phone_number,p.email,p.web_on, p.id, e.id AS ext_id, e.role, e.goo_short, e.c_users AS c_users_id_ext, e.ilearn_id, e.sched_alias, e.dept1, e.dept2, e.gtitle, e.active, e.use_dir_photo, e.general_photo_release, e.dir_photo_path, e.etc FROM gavi_db.personnel p LEFT JOIN PeterDB.gavi_personnel_ext e ON p.id=e.personnel ORDER BY p.last_name LIMIT 5000',1, $c);
return multi_row_select('SELECT p.first_name,p.last_name,p.department,p.status, p.room,phone_number,p.email,p.web_on, p.id, e.id AS ext_id, e.role, e.goo_short, e.c_users AS c_users_id_ext, e.ilearn_id, e.sched_alias, e.dept1, e.dept2, e.gtitle, e.active, e.use_dir_photo, e.general_photo_release, e.dir_photo_path, e.etc, c.id AS conf_id, c.goo AS conf_goo, c.name AS conf_name FROM gavi_db.personnel p LEFT JOIN PeterDB.gavi_personnel_ext e ON p.id=e.personnel LEFT JOIN PeterDB.conf_users c ON LOWER(p.email)=LOWER(c.email) ORDER BY p.last_name LIMIT 5000',1, $c);
// WHERE p.status IS null OR p.status=1
}
if (isset($_REQUEST['a']) && $_REQUEST['a']=='list') {
echo staff_dir_ext(); exit(); }
// TODO what about people who don't have all three rows?
//
//
//
//
//
//
//
// Helper tables
function sub_menus() { global $c2;
$ddd = multi_row_select('SELECT * FROM gavi_departments ORDER BY name',0, $c2);
$ttt = multi_row_select('SELECT * FROM gavi_titles ORDER BY name',0, $c2);
$rrr = multi_row_select("SELECT * FROM gavi_roles ORDER BY 'descr'",0, $c2);
$ccc = multi_row_select('SELECT * FROM gavi_committees ORDER BY name',0, $c2);
return json_encode( array( 'departments'=>$ddd, 'titles'=>$ttt, 'roles'=>$rrr, 'committees'=>$ccc ) );
exit();
}
if (isset($_REQUEST['a']) && $_REQUEST['a']=='menus') {
echo sub_menus(); exit(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// GET LIST OF ALL SESSIONS / WORKSHOPS / EVENTS
//
function get_sessions() {
global $c2, $AY;
echo json_encode( multi_row_select("SELECT c.id,c.title,c.desc,c.length,c.starttime,c.track,c.location,c.gets_survey,c.category,c.parent,c.recording,c.instructions,c.image_url,c.is_flex_approved,c.cal_uid,sst.type,sst.id AS typeId, GROUP_CONCAT(ctg.tag) AS tags FROM conf_sessions c 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.starttime BETWEEN CAST('{$AY['begin']}' AS DATE) AND CAST('{$AY['end']}' AS DATETIME) GROUP BY c.id ORDER BY c.track, c.starttime;",0, $c2)); exit(); }
if (isset($_GET['a']) && $_GET['a'] == 'get/sessions') { get_sessions(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// LIST THE CURRENT USER'S SIGNED UP, (OR HOSTING,) SESSIONS / WORKSHOPS / EVENTS
//
function get_user_sessions() {
global $c2, $AY, $USER;
$my_sessions = multi_row_select("SELECT c.id,c.title,c.desc,c.length,c.starttime,c.track,c.location,c.gets_survey,c.category,c.parent,c.recording,c.instructions,c.image_url,c.is_flex_approved,sst.type,sst.id AS typeId, GROUP_CONCAT(ctg.tag) AS tags FROM conf_sessions c JOIN conf_signups as sup on c.id=sup.session JOIN conf_hosts as h ON h.session=c.id 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 (h.host='{$USER->id_c_users}' OR sup.user='{$USER->id_c_users}') AND c.starttime BETWEEN CAST('{$AY['begin']}' AS DATE) AND CAST('{$AY['end']}' AS DATETIME) GROUP BY c.id ORDER BY c.track, c.starttime;",0,$c2);
echo json_encode($my_sessions);
exit(); }
if (isset($_GET['a']) && $_GET['a'] == 'get/mysessions') { get_user_sessions(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// SIGNUP for (possibly overlapping time) session ...
//
function signup() {
global $c2, $AY, $USER;
preg_match('/signup\/(\d+)$/', $_GET['a'], $matches);
$ses = $matches[1];
$ts = date("Y-m-d H:i:s");
$logaction = log_it("Signed up for session: {$ses}");
$existing = does_exist(
"SELECT i.id FROM conf_signups AS i JOIN conf_sessions AS s ON i.session=s.id WHERE s.id={$ses} AND i.user={$USER->id_c_users}",0,$c2);
if ($existing) {
$qupdate = "UPDATE conf_signups SET session={$ses}, timestamp='{$ts}' WHERE session={$ses} AND user={$USER->id_c_users}";
single_row_select($qupdate,1,$c2);
echo json_encode( array("result"=>"success","action"=>"updated","logaction"=>$logaction, "query"=>$qupdate,"err"=>mysqli_error($c2)));
} else {
$q = "INSERT INTO conf_signups (session,user,timestamp) VALUES ({$ses},{$USER->id_c_users},'{$ts}')";
single_row_select($q,1,$c2);
echo json_encode( array("result"=>"success","action"=>"inserted","logaction"=>$logaction, "ses"=>$_SESSION,"query"=>$q,"err"=>mysqli_error($c2)));
} exit(); }
if (isset($_GET['a']) && preg_match('/signup\/(\d+)$/', $_GET['a'], $matches)) { signup(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// CANCEL a signup
//
function signdown() {
global $c2, $AY, $USER;
preg_match('/signdown\/(\d+)$/', $_GET['a'], $matches);
$ses = $matches[1];
$q = "DELETE FROM conf_signups WHERE session={$ses} AND user={$USER->id_c_users}";
single_row_select($q,1,$c2);
$logaction = log_it("Canceled signup for session: $ses");
echo json_encode( array("result"=>"success","action"=>"deleted","logaction"=>$logaction, "query"=>$q,"err"=>mysqli_error($c2)));
exit(); }
if (isset($_GET['a']) && preg_match('/signdown\/(\d+)$/', $_GET['a'], $matches)) { signdown(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// NEW SESSION
//
function new_session() {
global $c2, $AY, $USER;
$title = ok($_POST['title']); $starttime = ok($_POST['starttime']);
$length = ok($_POST['length']); if ($length=='') { $length=1; }
$track = ok($_POST['track']); $gets_survey = ok($_POST['gets_survey']);
$is_flex_approved = ok($_POST['is_flex_approved']); $category = ok($_POST['title']);
if ($category=='') { $category=0; }
$author = ok($_POST['author']); if ($author=='') { $author=1; } // $USER->id_c_users; }
$is_custom = ok($_POST['is_custom']); $parent = ok($_POST['parent']);
$desc = ok($_POST['desc']); $location = ok($_POST['location']);
$recording = ok($_POST['recording']); $instructions = ok($_POST['instructions']);
$type = ok($_POST['type']); if ($type=='') { $type=19; }
$cal_uid = ok($_POST['cal_uid']);
$q = "INSERT INTO conf_sessions (`title`,`starttime`,`length`,`track`,`gets_survey`,`is_flex_approved`,`category`,`author`,`is_custom`,`parent`,`desc`,`location`,`recording`,`instructions`,`type`,`cal_uid`) VALUES ('{$title}', '{$starttime}', '{$length}', '{$track}', '{$gets_survey}', '{$is_flex_approved}', '{$category}', '{$author}', '{$is_custom}', '{$parent}', '{$desc}', '{$location}', '{$recording}', '{$instructions}', '{$type}', '{$cal_uid}');";
$ins = single_row_insert($q,0,$c2);
$logaction = log_it("created new session: {$title}");
echo json_encode( array("result"=>"success","action"=>"inserted new session","insert"=>$ins, "query"=>$q,"logaction"=>$logaction,"err"=>mysqli_error($c2)));
exit(); }
if (isset($_REQUEST['a']) && $_REQUEST['a']=='set/newsession') { new_session(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// Editing of session info
//
function set_sessioninfo() {
global $c, $c2, $AY, $USER;
$table = 'conf_sessions';
if (isset($_POST['id'])) {
$ID = ok($_REQUEST['id']);
if (! check_permission( $USER->id, $ID, $table)) {
echo json_encode( array("result"=>"fail", "err"=>"dont have permission to edit this") );
exit();
} else {
$logaction = log_it("edited session id: {$ID}");
$WHERECLAUSE = " WHERE id={$ID}";
$date = date('Y-m-d H:i:s');
$cols = explode(',', $_REQUEST['cols']); $vals = explode(',', $_REQUEST['vals']);
$vals = __::map($vals, unescape_commas);
$cv = __::zip($cols,$vals);
$q = __::reduce($cv, function($memo, $a) { return $memo . ok($a[0]) . "='" . ok($a[1]) . "', "; }, "UPDATE {$table} SET ");
$q = substr($q, 0, -2);
$q .= $WHERECLAUSE;
single_row_select($q,0,$c1);
echo json_encode( array("rawvalstr"=>$_REQUEST['vals'], "result"=>"success","action"=>"updated","logaction"=>$logaction, "query"=>$q,"err"=>mysqli_error($c2)));
}
} else {
echo json_encode( array("result"=>"fail", "err"=>"no activity id specified") ); }
exit();
}
/*$title = ok($_POST['title']);
$desc = ok($_POST['desc']);
$location = ok($_POST['location']);
$recording = ok($_POST['recording']);
$instructions = ok($_POST['instructions']);
$id = ok($_POST['id']);
$qupdate = "UPDATE conf_sessions SET title='$title', `desc`='$desc', location='$location', recording='$recording', instructions='$instructions' WHERE id=$id";
single_row_select($qupdate,0,$c2);
$logaction = log_it("edited session id: {$id}");
echo json_encode( array("result"=>"success","action"=>"updated","logaction"=>$logaction,"query"=>$qupdate,"err"=>mysqli_error($c2)));
//print_r($_POST);
exit();}
*/
//if (isset($_POST['a']) && $_POST['a']=='update/activity') { set_sessioninfo(); }
if (isset($_REQUEST['a']) && $_REQUEST['a']=='update/activity') { set_sessioninfo(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// update a name, lname, dept, phone, extension, email, type, room, status, user_id, or web_on
function update_dir() {
global $USER, $c, $c2;
$WHERECLAUSE = " WHERE id={$USER->id}";
if (isset($_POST['id'])) { // editing another person's data
if (! check_permission( $USER->id, $_POST['id'], 'personnel')) {
echo json_encode( array("result"=>"fail", "err"=>"dont have permission to edit this") );
exit();
} else {
$logaction = log_it("updating personnel record of personnel id {$_POST['id']}");
$WHERECLAUSE = " WHERE id={$_POST['id']}";
}
} else {
$logaction = log_it("updating personnel record");
}
// date modified is now
$date = date('Y-m-d H:i:s');
$cols = explode(',', $_REQUEST['cols']); $vals = explode(',', $_REQUEST['vals']);
$vals = __::map($vals, unescape_commas);
$cv = __::zip($cols,$vals);
$q = __::reduce($cv, function($memo, $a) { return $memo . ok($a[0]) . "='" . ok($a[1]) . "', "; }, "UPDATE personnel SET ");
//$q = substr($q, 0, -2);
$q .= "time_updated='" . $date . "'";
$q .= $WHERECLAUSE;
if ($USER->id) {
single_row_select($q,0,$c);
echo json_encode( array("rawvalstr"=>$_REQUEST['vals'], "result"=>"success","action"=>"updated","logaction"=>$logaction, "query"=>$q,"err"=>mysqli_error($c)));
}
else {
$logaction2 = log_it("failed to update personnel record");
echo json_encode( array("result"=>"fail", "err"=>"dont have an id for user") );
}
exit();
}
//if (isset($_POST['a']) && $_POST['a']=='update') { update_dir(); }
if (isset($_REQUEST['a']) && $_REQUEST['a']=='update') { update_dir(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// update goo, dept1/dept2, title, active, use_dir_photo
function update_dir_ext() {
global $USER, $c, $c2;
$WHERECLAUSE = " WHERE id={$USER->ext_id}";
if (isset($_POST['id'])) { // editing another person's data
if (! check_permission( $USER->id, $_POST['id'], 'personnel')) {
echo json_encode( array("result"=>"fail", "err"=>"dont have permission to edit this") );
exit();
} else {
$logaction = log_it("updating personnel_ext record of personnel id {$_POST['id']}");
$WHERECLAUSE = " WHERE id={$_POST['id']}";
}
} else {
$logaction = log_it("updating personnel_ext record");
}
// date modified is now
$date = date('Y-m-d H:i:s');
$cols = explode(',', $_REQUEST['cols']); $vals = explode(',', $_REQUEST['vals']);
$vals = __::map($vals, unescape_commas);
$cv = __::zip($cols,$vals);
$q = __::reduce($cv, function($memo, $a) { return $memo . ok($a[0]) . "='" . ok($a[1]) . "', "; }, "UPDATE gavi_personnel_ext SET ");
$q = substr($q, 0, -2);
$q .= $WHERECLAUSE;
if ($USER->ext_id) {
single_row_select($q,0,$c2);
echo json_encode( array("result"=>"success","action"=>"updated","logaction"=>$logaction, "query"=>$q,"err"=>mysqli_error($c2)));
}
else {
$logaction2 = log_it("failed to update gavi_personnel_ext record. dont have id for user.",var_dump($USER) );
echo json_encode( array("result"=>"fail", "err"=>"dont have an id for user") );
}
exit();
}
//if (isset($_POST['a']) && $_POST['a']=='update_xt') { update_dir_ext(); }
if (isset($_REQUEST['a']) && $_REQUEST['a']=='update_xt') { update_dir_ext(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// update person, officehours, title, picture, education, bio, courses, personal_page, changed
function update_webpage() {
global $USER_PERS_ID, $USER, $c, $c2;
$WHERECLAUSE = " WHERE person={$USER->id}";
if (isset($_POST['id'])) { // editing another person's data
if (! check_permission( $USER->id, $_POST['id'], 'personnel')) {
echo json_encode( array("result"=>"fail", "err"=>"dont have permission to edit this") );
exit();
} else {
$logaction = log_it("updating bio webpage record of personnel id {$_POST['id']}");
$WHERECLAUSE = " WHERE person={$_POST['id']}";
}
} else {
$logaction = log_it("updating bio webpage record");
}
$date = date('Y-m-d H:i:s');
$cols = explode(',', $_REQUEST['cols']); $vals = explode(',', $_REQUEST['vals']);
$vals = __::map($vals, unescape_commas);
$cv = __::zip($cols,$vals);
$q = __::reduce($cv, function($memo, $a) { return $memo . ok($a[0]) . "='" . ok($a[1]) . "', "; }, "UPDATE webpages SET ");
$q .= "changed='" . $date . "'";
$q .= $WHERECLAUSE;
if ($USER->id) {
single_row_select($q,0,$c);
echo json_encode( array("rawvalstr"=>$_REQUEST['vals'], "result"=>"success","action"=>"updated","logaction"=>$logaction, "query"=>$q,"err"=>mysqli_error($c)));
}
else {
$logaction2 = log_it("failed to update bio webpage record");
echo json_encode( array("result"=>"fail", "err"=>"dont have an id for user") );
}
exit();
}
//if (isset($_POST['a']) && $_POST['a']=='update_web') { update_webpage(); }
if (isset($_REQUEST['a']) && $_REQUEST['a']=='update_web') { update_webpage(); }
function handle_pic_upload() { global $USER;
$uploaddir = '/gavilan.edu/staff/uploads/';
$date = date('Ymd_Hi');
$uploadfile = $uploaddir . name_to_lc($USER->first_name,$USER->last_name) . "_" . $date . "_" . basename($_FILES['file']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
}
//if (isset($_POST['a']) && $_POST['a']=='update_web') { update_webpage(); }
//if (isset($_REQUEST['file'])) { handle_pic_upload(); }
if (isset($_FILES['file'])) { handle_pic_upload(); }
function get_a_user($user_email) { global $c, $c2;
$q1 = "SELECT last_name, first_name, department, extension, phone_number, email, room, user_id, time_updated, id, web_on FROM personnel WHERE email='" . $user_email . "'";
//p2($q1);
$usr_dir = single_row_select($q1, 0, $c);
//p2($usr_dir);
$q2 = "SELECT id AS id_c_users, goo, email AS email_c_users, name, active FROM conf_users WHERE email='" . $user_email . "'";
//p2($q2);
$usr_conf = single_row_select($q2, 0, $c2);
//p2($usr_conf);
$mega = __::extend( (object) $usr_dir, (object) $usr_conf );
$q3 = 'SELECT id AS ext_id, personnel AS personnel_id, goo_short, c_users AS c_users_id_ext, ilearn_id, sched_alias, dept1, dept2, title, active, use_dir_photo, etc FROM gavi_personnel_ext WHERE personnel=' . $mega->id;
//p2($q3);
$usr_ext = single_row_select($q3,0,$c2);
//p2($usr_ext);
$mega = __::extend( (object) $mega, (object) $usr_ext );
$q4 = 'SELECT person, officehours, title, picture, education, bio, courses, personal_page, changed FROM webpages WHERE person=' . $mega->id; // personnel=1');
//p2($q3);
$usr_web = single_row_select($q4,0,$c);
//p2($usr_ext);
$mega = __::extend( (object) $mega, (object) $usr_web );
if (!isset($mega->use_dir_photo)) {
$mega->pic_exists = check_dir_photo($mega->first_name, $mega->last_name);
if ($mega->pic_exists) {
$filename = "images_sm/" . name_to_file( $mega->first_name, $mega->last_name );
$mega->bbqueryfix = "UPDATE gavi_personnel_ext SET use_dir_photo=1, dir_photo_path='{$filename}' WHERE id='{$mega->ext_id}'";
} else {
$mega->bbqueryfix = "UPDATE gavi_personnel_ext SET use_dir_photo=0 WHERE id='{$mega->ext_id}'";
}
}
if (! isset($mega->ext_id)) {
$mega->aaqueryfix = "INSERT INTO gavi_personnel_ext (personnel) VALUES('{$mega->id}')"; }
elseif ($mega->id && ! $mega->personnel_id) {
$mega->aaqueryfix = "UPDATE gavi_personnel_ext SET personnel='{$mega->id}' WHERE id='{$mega->ext_id}'"; }
return $mega;
}
function insert_c2($q) {
global $c2;
$result = single_row_insert($q,0,$c2);
return $result; }
function merge_tables() { global $c;
$all_personnel = multi_row_select('SELECT first_name,last_name,department,room,phone_number,email,web_on,id FROM personnel WHERE status IS null OR status=1',0, $c);
$emails = __::pluck($all_personnel, 'email');
//echo json_encode($emails);
//exit();
//$emails = array_slice($emails, 0, 10);
$full = __::map( $emails, get_a_user );
//echo json_encode($full);
//$results = __::map( __::pluck($full,'aaqueryfix'), insert_c2);
//$results = __::pluck($full,'bbqueryfix');
//$results = __::map( $results, insert_c2);
echo json_encode( $full );
exit();
}
if (isset($_REQUEST['merge'])) { merge_tables(); }
//echo json_encode($_FILES);
//echo json_encode($_REQUEST);
// If no arguments were given:
if ($USER_EMAIL) {
// log it as an access
$logaction = log_it("accessed personnel record editor");
$USER->logresult = $logaction;
// Default case is current user data to be embedded in editor page
echo json_encode($USER);
} else {
echo json_encode( array("result"=>"not logged in") );
exit();
}
?>

1765
dir_api.php Normal file

File diff suppressed because it is too large Load Diff

1235
dir_api20211102.php Normal file

File diff suppressed because it is too large Load Diff

78
ed_act.php Normal file
View File

@ -0,0 +1,78 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = "Edit Activity";
$MY_CRUMB = "<a href='index.php'>Activities &amp; Events</a> &gt; Edit Activity";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
$WHICH = 0;
if (isset($_REQUEST['w'])) { $WHICH = $_REQUEST['w']; }
else {
$MY_TITLE = "Create Activity";
}
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<activityedit :which="<?php echo $WHICH; ?>"></activitylist>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

81
flex.php Normal file
View File

@ -0,0 +1,81 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = "Flex Activities Record";
$MY_CRUMB = "<a href='index.php'>Staff</a> &gt; Activities";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
if (isset($_GET['s'])) { $FOCUS = "'" . $_GET['s'] . "'"; }
else { $FOCUS = "'all'"; }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<i>choose academic year</i> <br /> &nbsp; <br /> &nbsp; <br /> &nbsp; <br />
<i>dates / hours of flex days</i> <br /> &nbsp; <br /> &nbsp; <br /> &nbsp; <br />
<i>add a conf, workshop, meeting</i> <br /> &nbsp; <br /> &nbsp; <br /> &nbsp; <br />
<i>add, edit, display project</i> <br /> &nbsp; <br /> &nbsp; <br /> &nbsp; <br />
<i>add, edit, display courses</i> <br /> &nbsp; <br /> &nbsp; <br /> &nbsp; <br />
<i>show required hours</i> <br /> &nbsp; <br /> &nbsp; <br /> &nbsp; <br />
<i>show total planned / actual hours</i> <br /> &nbsp; <br /> &nbsp; <br /> &nbsp; <br />
<i>show timeline / deadlines / stage</i> <br /> &nbsp; <br /> &nbsp; <br /> &nbsp; <br />
<i>ask achievements</i> <br /> &nbsp; <br /> &nbsp; <br /> &nbsp; <br />
<i>icons for approved, clarification</i> <br /> &nbsp; <br /> &nbsp; <br /> &nbsp; <br />
<i>show overall status</i> <br /> &nbsp; <br /> &nbsp; <br /> &nbsp;
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 spacer">
&nbsp;
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

BIN
graf/X_simple_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

BIN
graf/bird_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
graf/flag_1_red.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

BIN
graf/pic_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

BIN
graf/pic_1_add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

BIN
graf/play_video.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

BIN
graf/profile_card.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

BIN
graf/profile_close_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

BIN
graf/smile_happy_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

BIN
graf/smile_meh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

BIN
graf/smile_sad_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

BIN
graf/textlogo_120.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

BIN
graf/time_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

BIN
graf/time_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

BIN
graf/video_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

BIN
graf/zm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

BIN
graf/zoom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

99
index.php Normal file
View File

@ -0,0 +1,99 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
include 'semester.php';
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = "Itinerary";
$MY_CRUMB = $MY_TITLE;
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="js/vue27max.js"/></script>
<script>
var dirapi_output="";
</script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="content">
<div class="breadcrumb">
<?php echo $CRUMB_START . $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php
require 'nav.php';
/*require 'dir_api.php';
navigation( $USER_GOO );
*/
?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<!-- Subscribe to this link in Outlook for your events feed: <br />
<b>{{ my_subscribe_calendar() }} </b> &nbsp;
<button v-on:click="clip_copy">Copy Link</button>
<span class="success"> Copied! </span>
-->
<activitylist :itineraryview="1"></activitylist>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 spacer">
&nbsp;
</div>
<div class="pure-u-1-12"></div>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

94
index20211021.php Normal file
View File

@ -0,0 +1,94 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
require 'mAuth.php';
$MY_TITLE = "Personnel Directory Editor";
$MY_CRUMB = "Personnel Directory";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12">
</div>
<div class="pure-u-20-24 content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<a href="/">
<img border="0" class="headerimg" src="graf/bird_logo.png" alt="Gavilan College Intranet" />
</a>
<ul>
<li><a href="#">Edit Directory Info</a></li>
<li style="list-style:none;">&nbsp;</li>
<li><a href="bio.php">Edit Bio Page</a></li>
<li style="list-style:none;">&nbsp;</li>
<!--<li><a href="/pio/events.php"><span>Events Manager</span></a></li>
<li><a href="/pio/events_multi.php"><span>Events (Multiple)</span></a></li>
<li><a href="https://intranet1.gavilan.edu/pio/listevents.php" target="_blank"><span>View All Events</span></a></li>
-->
</ul>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<form class="pure-form pure-form-aligned">
<field table="personnel" qid="first_name" question="First name" :answer="this.user.first_name"></field>
<field table="personnel" qid="last_name" question="Last name" :answer="this.user.last_name"></field>
<field table="personnel" qid="department" question="Department" :answer="this.user.department"></field>
<field table="personnel" qid="phone_number" question="Phone Number" :answer="this.user.phone_number"></field>
<field table="personnel" qid="room" question="Room" :answer="this.user.room"></field>
<checkbox table="personnel_ext" qid="use_dir_photo" question="Publish my photo on staff directory" :answer="this.user.use_dir_photo"></checkbox>
<checkbox table="personnel_ext" qid="general_photo_release" question="I allow Gavilan College to use my directory photo in promotions and publicity." :answer="this.user.general_photo_release"></checkbox>
<div class="pure-controls">
<img class="staffpic" :src="'//www.gavilan.edu/staff/' + this.user.dir_pic_path" />
</div>
<!-- #### NO PIC UPLOADS FOR NOW
<div class="formpush">
<p>Upload a new picture (only small files)</p>
<form action="dir_api_tester.php"
class="dropzone"
id="my-awesome-dropzone"></form>
</div>
-->
<!-- <div id="bio2"></div> -->
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

2296
js/dir_app.js Normal file

File diff suppressed because it is too large Load Diff

767
js/dir_app20211021.js Normal file
View File

@ -0,0 +1,767 @@
function init_file_dropzone(parameter_name) {
Dropzone.options.myGreatDropzone = { // camelized version of the `id`
paramName: parameter_name, // The name that will be used to transfer the file
maxFilesize: 6 }; // MB
}
// init_file_dropzone("staffpicupload")
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// VISUAL EFFECTS
//
function fade_message() {
var a_dom = document.querySelector('#alert');
TinyAnimate.animateCSS(a_dom, 'opacity', '', 1.0, 0.0, 750, 'easeInOutQuart', function() {
});
}
function alert_message(msg,color='yellow') {
var a = $('#alert')
a.text(msg)
a.css('background-color',color)
var a_dom = document.querySelector('#alert');
TinyAnimate.animateCSS(a_dom, 'opacity', '', 0.0, 1.0, 500, 'easeInOutQuart', function() {
setTimeout( fade_message, 2500 )
});
//a.css('visibility','visible')
}
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// FORM COMPONENTS
//
// TODO these should know if they're modifying the current user or someone else.
// A single text style question
const TQuestion = Vue.component('field', {
props: [ 'table', 'qid', 'question', 'answer', 'placeholder', 'targetid', ],
data: function () {
return { "a":this.answer } },
watch: {
"answer": function(val,Oldval) { this.a = val },
"a": function (val, oldVal) {
this.$root.events.trigger('changed',[this.qid,this.table, val, this.targetid]) }, },
template: `<div class="pure-control-group"><label v-if="this.question" :for="this.qid" class="question">{{ question }}</label>
<input :id="this.qid" type="text" class="form-control" v-model="a" :placeholder="placeholder" /></div>`,
})
// A single INLINE text style question
const TIQuestion = Vue.component('ifield', {
props: [ 'table', 'qid', 'question', 'answer', 'placeholder', 'myclass', 'targetid', ],
data: function () {
return { "a":this.answer } },
watch: {
"answer": function(val,Oldval) { this.a = val },
"a": function (val, oldVal) {
this.$root.events.trigger('changed',[this.qid,this.table, val, this.targetid]) }, },
template: `<input :id="this.qid" type="text" v-model="a" :placeholder="placeholder" :class="this.myclass" />`,
})
// A single checkbox
const Checkbox = Vue.component('checkbox', {
props: [ 'table', 'qid', 'question', 'answer', 'targetid', ],
data: function () {
return { "a":this.answer } },
watch: {
"answer": function(val,Oldval) { this.a = val },
"a": function (val, oldVal) {
var newVal = 0
if (val==true) { newVal = 1 }
this.$root.events.trigger('changed',[this.qid,this.table, newVal, this.targetid]) }, },
template: `<div class="pure-controls">
<label :for="this.qid" class="question pure-checkbox">
<input :id="this.qid" type="checkbox" class="form-control" v-model="a" />
{{ question }}</label></div>`
})
// A single long format text question
const TAQuestion = Vue.component('tfield', {
props: [ 'table', 'qid', 'question', 'answer', 'targetid', ],
data: function () {
return { "a": this.answer } },
watch: {
"a": function (val, oldVal) {
this.$root.events.trigger('changed',[this.qid,this.table, val, this.targetid]) },
"answer": function (val, oldVal) { this.a = val },
},
template: `<div class="pure-control-group"><label :for="this.qid" class="question">{{ question }} </label>
<textarea :id="this.qid" v-model="a"></textarea></div>` })
// Select menu
const SelMenu = Vue.component('selectmenu', {
props: [ 'table', 'qid', 'question', 'answer', 'menu', 'labelfield', 'targetid', ],
data: function () {
return { "a": this.answer } },
watch: {
"a": function (val, oldVal) {
this.$root.events.trigger('changed',[this.qid,this.table, val, this.targetid]) },
"answer": function (val, oldVal) { this.a = val },
},
template: `<select :id="this.qid" v-model="a" class="pure-input-1-12">
<option v-for="o in this.$root[menu]" :value="o.id">{{o[labelfield]}}</option>
</select>` })
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// ONE LINE OF THE STAFF DIR LISTING
//
const StaffLine = Vue.component('staff_line', {
props: [ 's', 'i' ],
//data: function() { return { } },
methods: {
nope: function() { return 1; },
odd: function(i) { if (i % 2 ==0) { return "even" } return "odd" },
bio: function() { return "bio.php?p=" + this.s.id },
gtitle: function() { if (this.s.gtitle) {return _.findWhere(this.$root.titles_menu, {id:this.s.gtitle}).name}; return "" },
gdept1: function() { if (this.s.dept1) {return _.findWhere(this.$root.depts_menu, {id:this.s.dept1}).name}; return "" },
grole: function() { if (this.s.role) {return _.findWhere(this.$root.roles_menu, {id:this.s.role}).descr}; return "" },
swapedit: function() { console.log("edit " + this.s.first_name + " " + this.s.last_name)
this.$emit('swapout', this.s.id) }
},
template: `<div><div :class="odd(i) + ' pure-g'">
<div class="pure-u-1-24"></div>
<div class="pure-u-1-4">{{s.first_name}} {{s.last_name}}</div>
<div class="pure-u-1-6">{{s.department}}</div>
<div class="pure-u-1-6">{{s.email}}</div>
<div class="pure-u-1-6">{{s.phone_number}}</div>
<div class="pure-u-1-6">{{s.room}}</div>
<div class="pure-u-1-24 clicky" v-on:click="swapedit"><span class="pure-button button-inlist">edit</span></div>
</div><div :class="odd(i) + ' pure-g'">
<div class="pure-u-1-24"></div>
<div class="pure-u-1-4 subtle">{{gtitle()}}</div>
<div class="pure-u-1-6 subtle">{{gdept1()}}</div>
<div class="pure-u-1-6 subtle">{{grole()}}</div>
<div class="pure-u-1-6 subtle">
Published: <span v-if="s.status!=0">Yes</span><span v-else>No</span><br />
personnel_ext: <span v-if="s.ext_id!=null">Yes</span><span v-else>No</span><br />
c_users: <span v-if="s.c_users_id_ext!=null || s.conf_id!=null">Yes</span><span v-else>No</span>
</div>
<div class="pure-u-1-6 subtle"></div>
<div class="pure-u-1-24 subtle"></div>
</div></div>
`
});
//
//
// STAFF DIR LISTING
//
// ONE LINE - BUT EDITING!
//
const StaffLineEdit = Vue.component('staff_line_edit', {
props: [ 's', 'i' ],
//data: function() { return { } },
methods: {
nope: function() { return 1; },
odd: function(i) { if (i % 2 ==0) { return "even" } return "odd" },
bio: function() { return "bio.php?p=" + this.s.id },
done: function() { this.$emit('done_edit') },
}, //v-lazy-container="{ selector: 'img' }"
template: `<form class="pure-form">
<div :class="odd(i) + ' pure-g'">
<div class="pure-u-1-24"><img :src="'//www.gavilan.edu/staff/' + s.dir_pic_path" width="25" height="auto" /></div>
<div class="pure-u-1-4">
<ifield myclass="double" table="personnel" qid="first_name" :answer="s.first_name" :targetid="s.id" placeholder="First Name"></ifield>
<ifield myclass="double" table="personnel" qid="last_name" :answer="s.last_name" :targetid="s.id" placeholder="Last Name"></ifield>
</div>
<div class="pure-u-1-6">
<ifield table="personnel" qid="department" :answer="s.department" :targetid="s.id" placeholder="Department"></ifield>
</div>
<div class="pure-u-1-6">
<ifield table="personnel" qid="email" :answer="s.email" :targetid="s.id" placeholder="Email"></ifield>
</div>
<div class="pure-u-1-6">
<ifield table="personnel" qid="phone_number" :answer="s.phone_number" :targetid="s.id" placeholder="Phone Number"></ifield>
</div>
<div class="pure-u-1-6">
<ifield table="personnel" qid="room" :answer="s.room" :targetid="s.id" placeholder="Room"></ifield>
</div>
<div class="pure-u-1-24 clicky" v-on:click="done"><span class="pure-button button-inlist-action">done</span></div>
</div>
<div :class="odd(i) + ' pure-g'">
<div class="pure-u-1-24"></div>
<div class="pure-u-1-4">
<selectmenu table="personnel_ext" qid="gtitle" :answer="s.gtitle" menu="titles_menu" :targetid="s.ext_id" labelfield="name"></selectmenu>
</div>
<div class="pure-u-1-6">
<selectmenu table="personnel_ext" qid="dept1" :answer="s.dept1" menu="depts_menu" :targetid="s.ext_id" labelfield="name"></selectmenu>
</div>
<div class="pure-u-1-6">
<selectmenu table="personnel_ext" qid="role" :answer="s.role" menu="roles_menu" :targetid="s.ext_id" labelfield="descr"></selectmenu>
</div>
<div class="pure-u-1-6">
</div>
<div class="pure-u-1-62">
</div>
</div>
</form>
`
});
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// STAFF DIR LISTING MAIN CONTAINER
//
const DirList = Vue.component('dirlist', {
data: function () {
return { "personnel":[], sortby:'last_name', search:'', reversed: false,
components: {n:StaffLine, e: StaffLineEdit }, editing: -1, } },
mounted: function() {
var self = this;
this.$root.fetch_menus();
fetch('dir_api.php?a=list', { method: 'GET' }).then(function (response) {
// The API call was successful!
if (response.ok) {
response.json().then( function(r2) {
self.personnel = r2;
_.each( self.personnel, function(x) {
if (x.dir_photo_path==null) { x.dir_photo_path='images_sm/nobody.jpg' }
x.searchable = x.first_name.toLowerCase() + ' ' + x.last_name.toLowerCase()
if (x.department) { x.searchable += ' ' + x.department.toLowerCase() }
} )
//if (self.user.use_dir_photo == "0") { self.user.use_dir_photo = false }
//if (self.user.general_photo_release == "0") { self.user.general_photo_release = false }
// pause half a second for the children to get populated before registering update events...
setTimeout(function() {
//self.active = true;
// fancier text editors...
//pell.init( { element: document.getElementById('bio2'), onChange: function(h) { console.log(h) } } )
}, 1600);
} )
} else { return Promise.reject(response) }
}).then(function (data) {
}).catch(function (err) { console.warn('Something went wrong.', err); });
},
methods: {
setsort: function(ss) {
if (this.sortby == ss) { this.reversed = ! this.reversed }
else {
this.reversed = false
this.sortby = ss
}
},
swapme: function(x) {
this.editing = x
},
done_edit: function(id) {
this.editing = -1
},
am_editing: function(id) {
if (id == this.editing) { return StaffLineEdit }
return StaffLine
},
},
computed: {
filtered: function() {
var ff = this.personnel
var self = this
if (this.search) {
var ss = self.search.toLowerCase()
ff = ff.filter(function(x) { return x.searchable.includes(ss) }) }
ff = _.sortBy(ff, function(x) {
if (x[self.sortby]) {
var s = x[self.sortby];
return s.trim().toLowerCase() }
return '' })
if (this.reversed) {
ff.reverse()
}
return ff
}
},
watch: {
},
template: `<div class="">
<div class="pure-g pure-form">
<div class="pure-u-1-24"></div>
<div class="pure-u-3-4"><b>Filter: </b><input type="text" v-model="search" name="dirfilter" class="double" /></div>
</div>
<br />
<div class="pure-g pure-form">
<div class="pure-u-1-24">&nbsp;</div>
</div>
<div class="pure-g pure-form">
<div class="pure-u-1-24"></div>
<div v-on:click="setsort('last_name')" class="pure-u-1-4 clicky"><b>Name</b></div>
<div v-on:click="setsort('department')" class="pure-u-1-6 clicky"><b>Dept</b></div>
<div v-on:click="setsort('email')" class="pure-u-1-6 clicky"><b>Email</b></div>
<div class="pure-u-1-6"><b>Phone</b></div>
<div v-on:click="setsort('room')" class="pure-u-1-6 clicky"><b>Room</b></div>
</div>
<!-- <staff_line_edit :s="this.$root.user" :i="0" :key="'staff_000'"></staff_line_edit> -->
<component :is="am_editing(p.id)" v-on:swapout="swapme" v-on:done_edit="done_edit" v-for="p,i in filtered" :s="p" :i="i" :key="'staff_'+p.id + '_' + i"></component>
</div>` })
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// ACTIVITIES LIST MAIN CONTAINER
//
const ActivityList = Vue.component('activitylist', {
data: function () {
return { activities:[], sortby:'title', reversed:false, editing: -1, } },
mounted: function() {
var self = this;
this.$root.fetch_menus();
fetch('dir_api.php?a=get/sessions', { method: 'GET' }).then(function (response) {
// The API call was successful!
if (response.ok) {
response.json().then( function(r2) {
self.activities = r2;
_.each( self.activities, function(x) {
x.searchable = x.title.toLowerCase() + ' ' + x.desc.toLowerCase()
//if (x.department) { x.searchable += ' ' + x.department.toLowerCase() }
} )
//if (self.user.use_dir_photo == "0") { self.user.use_dir_photo = false }
//if (self.user.general_photo_release == "0") { self.user.general_photo_release = false }
// pause half a second for the children to get populated before registering update events...
setTimeout(function() {
//self.active = true;
// fancier text editors...
//pell.init( { element: document.getElementById('bio2'), onChange: function(h) { console.log(h) } } )
}, 1600);
} )
} else { return Promise.reject(response) }
}).then(function (data) {
}).catch(function (err) { console.warn('Something went wrong.', err); });
},
methods: {
setsort: function(ss) {
if (this.sortby == ss) { this.reversed = ! this.reversed }
else {
this.reversed = false
this.sortby = ss
}
},
swapme: function(x) {
this.editing = x
},
done_edit: function(id) {
this.editing = -1
},
am_editing: function(id) {
return 0;
},
},
computed: {
filtered: function() {
var ff = this.activities
var self = this
if (this.search) {
var ss = self.search.toLowerCase()
ff = ff.filter(function(x) { return x.searchable.includes(ss) }) }
ff = _.sortBy(ff, function(x) {
if (x[self.sortby]) {
var s = x[self.sortby];
return s.trim().toLowerCase() }
return '' })
if (this.reversed) {
ff.reverse()
}
return ff
}
},
watch: {
},
template: `<div class="">
<div class="pure-g pure-form">
<div class="pure-u-1-24"></div>
<div class="pure-u-3-4"><b>Filter: </b><input type="text" v-model="search" name="dirfilter" class="double" /></div>
</div>
<br />
<div class="pure-g pure-form">
<div class="pure-u-1-24">&nbsp;</div>
</div>
<div class="pure-g pure-form">
<div class="pure-u-1-24"></div>
<div v-on:click="setsort('last_name')" class="pure-u-1-4 clicky"><b>Name</b></div>
<div v-on:click="setsort('department')" class="pure-u-1-6 clicky"><b>Dept</b></div>
<div v-on:click="setsort('email')" class="pure-u-1-6 clicky"><b>Email</b></div>
<div class="pure-u-1-6"><b>Phone</b></div>
<div v-on:click="setsort('room')" class="pure-u-1-6 clicky"><b>Room</b></div>
</div>
<!-- <staff_line_edit :s="this.$root.user" :i="0" :key="'staff_000'"></staff_line_edit> -->
<component :is="am_editing(p.id)" v-on:swapout="swapme" v-on:done_edit="done_edit" v-for="p,i in filtered" :s="p" :i="i" :key="'staff_'+p.id + '_' + i"></component>
</div>` })
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// VERY SIMPLE CALENDAR
//
const MyCal = Vue.component('mycal', {
data: function () {
return { today:new Date(), currentMonth:0, currentYear:0, selectYear:'', selectMonth:'',
months:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
activities:[],
by_date: {},
editing: -1, } },
mounted: function() {
var self = this
this.currentYear = this.today.getFullYear()
this.currentMonth = this.today.getMonth()
this.selectYear = this.currentYear
this.selectMonth = this.currentMonth
fetch('dir_api.php?a=get/sessions', { method: 'GET' }).then(function (response) {
if (response.ok) {
response.json().then( function(r2) {
self.activities = r2
_.each( self.activities, function(x) {
var dd = new Date(x.starttime);
var [m,d,y] = [dd.getMonth(), dd.getDate(), dd.getFullYear()] // months start at 0....
var d_string = d + "-" + m + "-" + y
if (self.by_date[d_string]) { self.by_date[d_string].push(x) }
else { self.by_date[d_string] = [x, ] } } )
self.$forceUpdate()
} )
} else { return Promise.reject(response) }
}).then(function (data) {
}).catch(function (err) { console.warn('Something went wrong.', err); });
},
methods: {
thisDay: function(i,j) {
var dayOfMonth = ((7*(i-1))+j)-this.firstDay()
return dayOfMonth
},
eventsThisDay: function(i,j) {
var dayOfMonth = ((7*(i-1))+j)-this.firstDay()
var d_string = dayOfMonth + "-" + this.selectMonth + "-" + this.selectYear
var day_text = ''
if (this.by_date[d_string]) {
evts = _.filter( this.by_date[d_string], function(x) { console.log(x); return x.typeId!="101" } )
console.log(evts)
return evts
}
return []
},
cleanTime: function(e) {
var dd = new Date(e.starttime);
var [h,m] = [dd.getHours(), dd.getMinutes()]
var ampm = 'am'
if (h > 12) { h -= 12; ampm = 'pm' }
if (m == 0) { m = '' }
else { m = ':' + m }
return h + m + ampm
},
daysInMonth: function() {
return 32 - new Date(this.selectYear, this.selectMonth, 32).getDate()
},
firstDay: function() {
return (new Date(this.selectYear, this.selectMonth)).getDay()
},
next: function() {
this.selectYear = (this.selectYear === 11) ? this.selectYear + 1 : this.selectYear;
this.selectMonth = (this.selectMonth + 1) % 12;
},
previous: function() {
this.selectYear = (this.selectYear === 0) ? this.selectYear - 1 : this.selectYear;
this.selectMonth = (this.selectMonth === 0) ? 11 : this.selectMonth - 1;
},
},
computed: {
},
watch: {
},
template: `<div class="calendar">
<h2>{{months[selectMonth] + " " + selectYear}}
<div class="btn_container">
<div class="btn_float">
<button class="pure-button" v-on:click="previous">Previous</button>
<button class="pure-button" v-on:click="next">Next</button>
</div>
</div>
</h2>
<table>
<thead>
<tr>
<th>Sun</th>
<th>Mon</th>
<th>Tue</th>
<th>Wed</th>
<th>Thu</th>
<th>Fri</th>
<th>Sat</th>
</tr>
</thead>
<tbody id="calendar-body">
<tr v-for="i in 6" v-if="(((7*(i-1)))-firstDay() < daysInMonth()+1)">
<td v-for="j in 7">
<span v-if="( ((7*(i-1))+j)-firstDay() > 0) && (((7*(i-1))+j)-firstDay() < daysInMonth()+1)">
<div class="do_month">{{ thisDay(i,j) }}</div>
<div class="cal_evt" v-for="ev in eventsThisDay(i,j)">{{cleanTime(ev)}} {{ ev.title }}</div>
</span>
</td>
</tr>
</tbody>
</table>
<!--<label for="month">Jump To: </label>
<select class="pure-input-1-12" name="month" id="month" v-model="selectMonth">
<option v-for="m in 12" :value="m-1">{{months[m-1]}}</option>
</select>
<label for="year"></label>
<select class="pure-input-1-12" name="year" id="year" v-model="selectYear">
<option v-for="i in 5" :value="2018+i">{{2018+i}}</option>
</select>-->
</div>` })
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// AJAX POST UPDATES TO API
//
function post_update(table,cols,vals,id=0) {
action = "nothing"
if (table=="personnel") { action = "update" }
if (table=="personnel_ext") { action = "update_xt" }
if (table=="webpages") { action = "update_web" }
var idstr = ""
if (id) { idstr = "&id=" + id }
console.log("a="+action+"&cols="+cols+"&vals="+vals+idstr)
fetch('dir_api.php', {
method: 'POST',
headers: new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' }),
body: "a="+action+"&cols="+cols+"&vals="+vals+idstr,
}).then(function (response) {
// The API call was successful!
if (response.ok) {
response.json().then( function(r2) {
// display success alert
alert_message('Saved.')
} )
} else { return Promise.reject(response) }
}).then(function (data) {
}).catch(function (err) { alert_message("Couldn't save!",pink); console.warn('Something went wrong.', err); });
}
var evt = {
clear_tables: function() {
var self = this
_.each( this.tables, function(x) { self[x] = [] } )
this.data = {}
this.target_ids = {} },
send_update: function() {
var self = this
//console.log("Sending update... (not really)")
_.each( this.tables, function(x) {
if (self[x].length) {
var cols = ""
var vals = ""
_.each(self[x], function(y) {
if (cols.length) { cols += "," }
if (vals.length) { vals += "," }
cols += y
if (typeof self.data[y] == "string") {
re = /,/g
vals += encodeURIComponent(self.data[y].replace(re,'[CMA]') ) }
else { vals += self.data[y] }
})
//console.log("table: " + x + " Columns: " + cols + ".. Vals: " + vals)
var edit_other = 0
if (self.target_ids[x]) { edit_other = self.target_ids[x] }
post_update(x, cols, vals, edit_other)
}
} ) },
info: "what am I?" ,
data: {},
target_ids: {},
tables: ['personnel','personnel_ext','webpages','welcomepages','conf_sessions','conf_hosts',
'pers_departments','pers_committees','pers_titles'],
}
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// INITIALIZE THE APP
//
evt.clear_tables()
MicroEvent.mixin(evt);
var app = new Vue({
el: '#dir_editor',
data: { events: evt,
msg: 'hello', active: false,
user: {'last_name':'', 'first_name':'', 'department':'', 'extension':'', 'phone_number':'', 'email':'',
'staff_type':'', 'room':'', 'status':'', 'user_id':'', 'password':'', 'time_created':'', 'time_updated':'',
'id':'', 'web_on':'', use_dir_photo:0, general_photo_release:0,
officehours:'', title:'', picture:'', education:'', bio:'', courses:'', personal_page:'', changed:'' },
filter: [],
roles_menu: [],
depts_menu: [],
titles_menu: [],
committees_menu: [],
menus_fetched: false,
},
watch: { },
methods: {
fetch_menus: function() {
if (! this.menus_fetched) {
var self = this;
fetch('dir_api.php?a=menus', { method: 'GET' }).then(function (response) {
// The API call was successful!
if (response.ok) {
response.json().then( function(r2) {
self.depts_menu = r2.departments;
self.roles_menu = r2.roles;
self.titles_menu = r2.titles;
self.committees_menu = r2.committees;
self.menus_fetched = true;
} )
} else { return Promise.reject(response) }
}).then(function (data) {
}).catch(function (err) { console.warn('Something went wrong.', err); });
}
},
},
computed: { },
mounted: function() {
var self = this;
fetch('dir_api.php', { method: 'GET' }).then(function (response) {
// The API call was successful!
if (response.ok) {
response.json().then( function(r2) {
self.user = r2;
if (self.user.use_dir_photo == "0") { self.user.use_dir_photo = false }
if (self.user.general_photo_release == "0") { self.user.general_photo_release = false }
// pause half a second for the children to get populated before registering update events...
setTimeout(function() {
self.active = true;
// fancier text editors...
//pell.init( { element: document.getElementById('bio2'), onChange: function(h) { console.log(h) } } )
}, 1600);
} )
} else { return Promise.reject(response) }
}).then(function (data) {
}).catch(function (err) { console.warn('Something went wrong.', err); });
}
})
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// SIMPLE EVENTS
//
var update_fxn = _.debounce( function() {
alert_message('saving...','lightgreen')
evt.send_update(); evt.clear_tables(); }, 1300 )
evt.bind('changed', function(dat) {
if (app.active) {
var column = dat[0]
var table = dat[1]
var value = dat[2]
var target = dat[3]
console.log(dat)
this.data[column] = value
if (!this[table].includes(column) ) {this[table].push(column)}
if (target) { this.target_ids[table] = target }
update_fxn() }
});
//
//
// MISC
//
//
//
// <img :src="'//www.gavilan.edu/staff/' + s.dir_photo_path" width="25" height="auto" />
// v-lazy-container="{ selector: 'img' }"
//

878
js/dir_app202111022.js Normal file
View File

@ -0,0 +1,878 @@
function init_file_dropzone(parameter_name) {
Dropzone.options.myGreatDropzone = { // camelized version of the `id`
paramName: parameter_name, // The name that will be used to transfer the file
maxFilesize: 6 }; // MB
}
// init_file_dropzone("staffpicupload")
function parsesqltime(mysqldate) { // 2021-01-29 09:00:00
if (! mysqldate) { return 0 }
var field = mysqldate.match(/^(\d\d\d\d)\-(\d+)\-(\d+)\s(\d+)\:(\d+)\:(\d+)$/)
var mydate = new Date(field[1], field[2] - 1 , field[3], field[4], field[5], field[6])
return mydate }
function dj(mysqldate) { return dayjs(parsesqltime(mysqldate)) }
Object.defineProperty(Vue.prototype, '$dj', { value: dj });
Object.defineProperty(Vue.prototype, '$parsesqltime', { value: parsesqltime });
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// VISUAL EFFECTS
//
function fade_message(theselector='#alert') {
var a_dom = document.querySelector(theselector);
TinyAnimate.animateCSS(a_dom, 'opacity', '', 1.0, 0.0, 750, 'easeInOutQuart', function() { }); }
function alert_message(msg,color='yellow') {
var a = $('#alert')
a.text(msg)
a.css('background-color',color)
var a_dom = document.querySelector('#alert');
TinyAnimate.animateCSS(a_dom, 'opacity', '', 0.0, 1.0, 500, 'easeInOutQuart', function() {
setTimeout( fade_message, 2500 ) }); }
function fadein_message(theclass='success') {
//var a = $('#'+theclass)
//a.css('visibility','visible')
var a_dom = document.querySelector('.'+theclass);
TinyAnimate.animateCSS(a_dom, 'opacity', '', 0.0, 1.0, 500, 'easeInOutQuart', function() {
setTimeout( function() { fade_message('.'+theclass) }, 2500 ) }); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// FORM COMPONENTS
//
// TODO these should know if they're modifying the current user or someone else.
// A single text style question
const TQuestion = Vue.component('field', {
props: [ 'table', 'qid', 'question', 'answer', 'placeholder', 'targetid', ],
data: function () {
return { "a":this.answer } },
watch: {
"answer": function(val,Oldval) { this.a = val },
"a": function (val, oldVal) {
this.$root.events.trigger('changed',[this.qid,this.table, val, this.targetid]) }, },
template: `<div class="pure-control-group"><label v-if="this.question" :for="this.qid" class="question">{{ question }}</label>
<input :id="this.qid" type="text" class="form-control" v-model="a" :placeholder="placeholder" /></div>`,
})
// A single INLINE text style question
const TIQuestion = Vue.component('ifield', {
props: [ 'table', 'qid', 'question', 'answer', 'placeholder', 'myclass', 'targetid', ],
data: function () {
return { "a":this.answer } },
watch: {
"answer": function(val,Oldval) { this.a = val },
"a": function (val, oldVal) {
this.$root.events.trigger('changed',[this.qid,this.table, val, this.targetid]) }, },
template: `<input :id="this.qid" type="text" v-model="a" :placeholder="placeholder" :class="this.myclass" />`,
})
// A single checkbox
const Checkbox = Vue.component('checkbox', {
props: [ 'table', 'qid', 'question', 'answer', 'targetid', ],
data: function () {
return { "a":this.answer } },
watch: {
"answer": function(val,Oldval) { this.a = val },
"a": function (val, oldVal) {
var newVal = 0
if (val==true) { newVal = 1 }
this.$root.events.trigger('changed',[this.qid,this.table, newVal, this.targetid]) }, },
template: `<div class="pure-controls">
<label :for="this.qid" class="question pure-checkbox">
<input :id="this.qid" type="checkbox" class="form-control" v-model="a" />
{{ question }}</label></div>`
})
// A single long format text question
const TAQuestion = Vue.component('tfield', {
props: [ 'table', 'qid', 'question', 'answer', 'targetid', ],
data: function () {
return { "a": this.answer } },
watch: {
"a": function (val, oldVal) {
this.$root.events.trigger('changed',[this.qid,this.table, val, this.targetid]) },
"answer": function (val, oldVal) { this.a = val },
},
template: `<div class="pure-control-group"><label :for="this.qid" class="question">{{ question }} </label>
<textarea :id="this.qid" v-model="a"></textarea></div>` })
// Select menu
const SelMenu = Vue.component('selectmenu', {
props: [ 'table', 'qid', 'question', 'answer', 'menu', 'labelfield', 'targetid', ],
data: function () {
return { "a": this.answer } },
watch: {
"a": function (val, oldVal) {
this.$root.events.trigger('changed',[this.qid,this.table, val, this.targetid]) },
"answer": function (val, oldVal) { this.a = val },
},
template: `<select :id="this.qid" v-model="a" class="pure-input-1-12">
<option v-for="o in this.$root[menu]" :value="o.id">{{o[labelfield]}}</option>
</select>` })
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// ONE LINE OF THE STAFF DIR EDITOR listing
//
const StaffLine = Vue.component('staff_line', {
props: [ 's', 'i', 'dup_class', ],
//data: function() { return { } },
methods: {
nope: function() { return 1; },
odd: function(i) { if (i % 2 ==0) { return "even" } return "odd" },
bio: function() { return "bio.php?p=" + this.s.id },
gtitle: function() { if (this.s.gtitle) {return _.findWhere(this.$root.titles_menu, {id:this.s.gtitle}).name}; return "" },
gdept1: function() { if (this.s.dept1) {return _.findWhere(this.$root.depts_menu, {id:this.s.dept1}).name}; return "" },
gdept2: function() { if (this.s.dept2) {return _.findWhere(this.$root.depts_menu, {id:this.s.dept2}).name}; return "-" },
grole: function() { if (this.s.role) {return _.findWhere(this.$root.roles_menu, {id:this.s.role}).descr}; return "" },
swapedit: function() { console.log("edit " + this.s.first_name + " " + this.s.last_name)
this.$emit('swapout', this.s.id) }
},
template: `<div>
<div :class="odd(i) + ' pure-g'">
<div class="pure-u-1-4"><pre>
status: {{ s.status }}
permissions: {{ grole() }}
pers id: {{ s.id }}
ext id: {{ s.ext_id }}
bio page: {{ s.web_on }}
Photo - use: {{s.use_dir_photo}} release: {{s.general_photo_release}}
path: {{s.dir_photo_path}}
# Sections: {{s.num_taught}}
{{ s.sections }} </pre>
</div>
<div class="pure-u-1-4"><pre>
staff: {{ s.staff_type }}
conf_id: {{ s.conf_id }}
G00{{s.conf_goo}}
espanol: {{s.espanol}}
</pre>
</div>
<div class="pure-u-1-4"><pre>
{{s.first_name}} {{s.last_name}}
{{gtitle()}}
{{gdept1()}}
{{gdept2()}}
(old dept: {{s.department}} ) </pre>
</div>
<div class="pure-u-1-4"><pre>
email: {{s.email}}
room: {{s.room}}
phone: {{s.phone_number}}
Zoom: {{s.zoom}}
Preferred contact: {{s.preferred_contact}}
</pre><div class="xxpure-u-1-24 clicky" v-on:click="swapedit"><span class="pure-button button-inlist">edit</span></div>
</div>
</div>
</div>`
});
/*
*
* status: {{ s.status }} staff: {{ s.staff_type }}
* permissions: {{ s.role }} {{s.first_name}} {{s.last_name}} {{gdept1()}} # Sections: {{s.num_taught}}
* ext id: {{ s.ext_id }} {{ s.conf_id }} {{gtitle()}} {{s.room}}
* bio page: {{ s.web_on }} {{s.espanol}} {{s.goo}} {{s.phone}}
* Photo - use: {{s.use_dir_photo}} release: {{s.general_photo_release}} {{s.email}} {{s.preferred_contact}}
* {{s.zoom}} {{s.dir_photo_path}}
* [ status stafftype ] fname lname dept1 num_courses --> need_welcome pg
* [ no pext? perms ] title room dept2 num_flx_activities --> [ ? badges ? tickets ? ]
* [ no conf? ] goo phone log last updated num_hosted acts
* [ web on espanol ] email prefcontact dir last updated num_log_entries
* [ photo on release ] zoom photo path committees?
*/
//
//
// STAFF DIR LISTING
//
// ONE LINE - BUT EDITING! // todo active / inactive switch
//
const StaffLineEdit = Vue.component('staff_line_edit', {
props: [ 's', 'i' ],
//data: function() { return { } },
methods: {
nope: function() { return 1; },
odd: function(i) { if (i % 2 ==0) { return "even" } return "odd" },
bio: function() { return "bio.php?p=" + this.s.id },
done: function() { this.$emit('done_edit') },
gtitle: function() { if (this.s.gtitle) {return _.findWhere(this.$root.titles_menu, {id:this.s.gtitle}).name}; return "" },
gdept1: function() { if (this.s.dept1) {return _.findWhere(this.$root.depts_menu, {id:this.s.dept1}).name}; return "" },
gdept2: function() { if (this.s.dept2) {return _.findWhere(this.$root.depts_menu, {id:this.s.dept2}).name}; return "-" },
grole: function() { if (this.s.role) {return _.findWhere(this.$root.roles_menu, {id:this.s.role}).descr}; return "" },
}, //v-lazy-container="{ selector: 'img' }"
template: `<form class="pure-form">
<div :class="odd(i) + ' list-editor pure-g'">
<div class="pure-u-1-4">
<checkbox table="personnel" qid="status" question="Published" :answer="s.status" :targetid="s.id"></checkbox>
permissions: <selectmenu table="personnel_ext" qid="role" :answer="s.role" menu="roles_menu" :targetid="s.ext_id" labelfield="descr"></selectmenu><br />
pers id: {{ s.id }}<br />
ext id: {{ s.ext_id }}<br />
<checkbox table="personnel" qid="web_on" question="Bio Page On" :answer="s.web_on" :targetid="s.id"></checkbox>
<checkbox table="personnel_ext" qid="use_dir_photo" question="Use Photo" :answer="s.use_dir_photo" :targetid="s.ext_id"></checkbox>
<checkbox table="personnel_ext" qid="general_photo_release" question="Release Photo" :answer="s.general_photo_release" :targetid="s.ext_id"></checkbox>
Dir photo <ifield myclass="double" table="personnel_ext" qid="dir_photo_path" :answer="s.dir_photo_path" :targetid="s.ext_id" placeholder="Dir Photo Path"></ifield><br />
# Sections: {{s.num_taught}}<br />
{{ s.sections }}
</div>
<div class="pure-u-1-4">
Staff Type <ifield myclass="double" table="personnel" qid="staff_type" :answer="s.staff_type" :targetid="s.id" placeholder="Staff Type"></ifield><br />
conf_id: {{ s.conf_id }}<br />
<!-- GOO <ifield myclass="double" table="conf_users" qid="goo" :answer="s.conf_goo" :targetid="s.conf_id" placeholder="GOO"></ifield><br />-->
GOO {{ s.conf_goo }} <br />
<checkbox table="personnel_ext" qid="espanol" question="Speak Spanish" :answer="s.espanol" :targetid="s.ext_id"></checkbox>
</div>
<div class="pure-u-1-4">
<ifield myclass="double" table="personnel" qid="first_name" :answer="s.first_name" :targetid="s.id" placeholder="First Name"></ifield><br />
<ifield myclass="double" table="personnel" qid="last_name" :answer="s.last_name" :targetid="s.id" placeholder="Last Name"></ifield><br />
<selectmenu table="personnel_ext" qid="gtitle" :answer="s.gtitle" menu="titles_menu" :targetid="s.ext_id" labelfield="name"></selectmenu><br />
<selectmenu table="personnel_ext" qid="dept1" :answer="s.dept1" menu="depts_menu" :targetid="s.ext_id" labelfield="name"></selectmenu> <br />
<selectmenu table="personnel_ext" qid="dept2" :answer="s.dept2" menu="depts_menu" :targetid="s.ext_id" labelfield="name"></selectmenu><br />
(old dept: {{s.department}} )
</div>
<div class="pure-u-1-4">
<ifield table="personnel" qid="email" :answer="s.email" :targetid="s.id" placeholder="Email"></ifield><br />
<ifield table="personnel" qid="room" :answer="s.room" :targetid="s.id" placeholder="Room"></ifield><br />
<ifield table="personnel" qid="phone_number" :answer="s.phone_number" :targetid="s.id" placeholder="Phone Number"></ifield><br />
<ifield table="personnel_ext" qid="zoom" :answer="s.zoom" :targetid="s.ext_id" placeholder="Zoom Room"></ifield><br />
<ifield table="personnel_ext" qid="preferred_contact" :answer="s.preferred_contact" :targetid="s.ext_id" placeholder="Preferred contact"></ifield>
<div class="xxpure-u-1-24 clicky" v-on:click="done"><span class="pure-button button-inlist-action">done</span>
</div>
</div>
</div>
</form>
`
});
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// STAFF DIR LISTING MAIN CONTAINER
//
const DirList = Vue.component('dirlist', {
data: function () {
return { "personnel":[], sortby:'last_name', search:'', reversed: false, id_list:[], id_dups:[],
components: {n:StaffLine, e: StaffLineEdit }, editing: -1, } },
mounted: function() {
var self = this;
this.$root.fetch_menus();
fetch('dir_api.php?a=list/staffsemester', { method: 'GET' }).then(function (response) {
if (response.ok) {
response.json().then( function(r2) {
self.personnel = r2;
_.each( self.personnel, function(x) {
if (x.sections==null) { x.num_taught=0 }
if (x.dir_photo_path==null) { x.dir_photo_path='images_sm/nobody.jpg' }
if (x.use_dir_photo == "0") { x.use_dir_photo = false } else { x.use_dir_photo = true }
if (x.espanol == "0" || !x.espanol) { x.espanol = false } else { x.espanol = true }
if (x.general_photo_release == "0") { x.general_photo_release = false
} else { x.general_photo_release = true }
if (self.id_list.includes(x.id)) { self.id_dups.push(x.id) }
else { self.id_list.push(x.id) }
x.searchable = ''
if (x.first_name) { x.searchable += ' ' + x.first_name.toLowerCase() }
if (x.last_name) { x.searchable += ' ' + x.last_name.toLowerCase() }
if (x.dept1name) { x.searchable += ' ' + x.dept1name.toLowerCase() }
if (x.titlename) { x.searchable += ' ' + x.titlename.toLowerCase() }
if (x.status == "1" || x.status == null) { x.status = "1"
} else { x.status = false; x.searchable += ' inactive' }
} ) } ) } else { return Promise.reject(response) }
}).then(function (data) { }).catch(function (err) { console.warn('Something went wrong.', err); });
},
methods: {
setsort: function(ss) {
if (this.sortby == ss) { this.reversed = ! this.reversed }
else {
this.reversed = false
this.sortby = ss
}
},
swapme: function(x) {
this.editing = x
},
done_edit: function(id) {
this.editing = -1
},
am_editing: function(id) {
if (id == this.editing) { return StaffLineEdit }
return StaffLine
},
is_dup_id_class: function(id) { return this.id_dups.includes(id) ? " dup_line" : "" },
},
computed: {
filtered: function() {
var ff = this.personnel
var self = this
if (this.search) {
var ss = self.search.toLowerCase()
ff = ff.filter(function(x) { return x.searchable.includes(ss) }) }
ff = _.sortBy(ff, function(x) {
if (x[self.sortby]) {
var s = x[self.sortby];
return s.trim().toLowerCase() }
return 'zzzzzzzzzz' })
if (this.reversed) {
ff.reverse()
}
return ff
}
},
watch: {
},
template: `<div class="">
<div class="pure-g pure-form">
<div class="pure-u-1-24"></div>
<div class="pure-u-3-4"><b>Filter: </b><input type="text" v-model="search" name="dirfilter" class="double" /></div>
</div>
<br />
<div class="pure-g pure-form">
<div class="pure-u-1-24">&nbsp;</div>
</div>
<div class="pure-g pure-form">
<div v-on:click="setsort('num_taught')" class="pure-u-1-24 clicky"><b>C</b></div>
<div class="pure-u-1-4 clicky">
<b v-on:click="setsort('last_name')">Name</b><br />
<b v-on:click="setsort('gtitle')">Title</b>
</div>
<div class="pure-u-1-6 clicky">
<b v-on:click="setsort('department')">Dept</b><br />
<b v-on:click="setsort('dept1')">Dept1</b>
</div>
<div v-on:click="setsort('email')" class="pure-u-1-6 clicky"><b>Email</b></div>
<div class="pure-u-1-6"><b>Phone</b></div>
<div v-on:click="setsort('room')" class="pure-u-1-6 clicky"><b>Room</b></div>
</div>
<!-- <staff_line_edit :s="this.$root.user" :i="0" :key="'staff_000'"></staff_line_edit> -->
<component :is="am_editing(p.id)" v-on:swapout="swapme" v-on:done_edit="done_edit" v-for="p,i in filtered" :s="p" :i="i" :dup_class="is_dup_id_class(p.id)" :key="'staff_'+p.id + '_' + i"></component>
</div>` })
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// ACTIVITIES LIST MAIN CONTAINER
//
const ActivityList = Vue.component('activitylist', {
props: [ 'itineraryview', ],
data: function () {
return { activities:[], mysessions:[], search:'', sortby:'starttime', reversed:false,
expanded: 1,
editing: -1, active:-1, } },
mounted: function() {
this.$root.fetch_menus();
this.fetch_myevents()
},
methods: {
month_year: function(d) { console.log(d); var b = this.$root.$dj(d).format('MMM D YYYY'); console.log(b); return b },
setsort: function(ss) {
if (this.sortby == ss) { this.reversed = ! this.reversed }
else { this.reversed = false; this.sortby = ss } },
swapme: function(x) { this.editing = x },
done_edit: function(id) { this.editing = -1 },
am_editing: function(id) { return 0 },
fetch_myevents: function() {
var self = this;
basic_get('dir_api.php?a=get/mysessions',
function(r2) { self.mysessions = _.sortBy(r2,function(x) { return x.starttime || 0} ); self.$forceUpdate(); self.active += 1; console.log(self.active) } )
basic_get('dir_api.php?a=get/sessions',
function(r2) {
self.activities = _.sortBy(r2,function(x) { return x.starttime } ); self.$forceUpdate()
self.active += 1; console.log(self.active)
_.each( self.activities, function(x) {
x.searchable = x.title.toLowerCase() + ' ' + x.desc.toLowerCase() } ) } )
},
filtered: function(ff) { if (this.active<1) { return [] }
var self = this
if (this.search) {
var ss = self.search.toLowerCase()
ff = ff.filter(function(x) { return x.searchable.includes(ss) }) }
ff = _.sortBy(ff, function(x) { console.log(x);
if (x[self.sortby]) { var s = x[self.sortby]; return s.trim().toLowerCase() }
return '' })
if (this.reversed) { ff.reverse() }
console.log(ff)
return ff },
},
computed: {
activities_filtered: function() { var a = this.filtered(this.activities); console.log(a); return a; },
mysessions_filtered: function() { return this.filtered(this.mysessions) },
activities_g_filtered: function() { if (this.active<1) { return {} }
var self=this; return _.groupBy(self.activities_filtered, function(x) { return self.month_year(x.starttime) } ); },
mysessions_g_filtered: function() { if (this.active<1) { return {} }
var self=this; return _.groupBy(self.mysessions_filtered, function(x) { return self.month_year(x.starttime) } ); },
},
watch: {
},
template: `<div class="">
<div class="pure-g pure-form">
<div class="pure-u-1-24"></div>
<div class="pure-u-3-4"><b>Search: </b><input type="text" v-model="search" name="actfilter" class="double" /></div>
</div>
<div v-if="itineraryview && active>0" v-for="items,mmyy in mysessions_g_filtered">
<b>{{mmyy}}</b>
<div v-for="a in items" class="pure-g pure-form">
<div class="pure-u-1-24"> </div>
<div class="pure-u-3-24">{{ $root.$dj(a.starttime).format('h:mma') }} </div>
<div class="pure-u-5-6">{{a.title}} </div>
</div>
</div>
<div v-if="!itineraryview && active>0" v-for="items,mmyy in activities_g_filtered">
<b>{{mmyy}}</b>
<div v-for="a in items">
<div class="pure-g pure-form">
<div class="pure-u-1-24"> </div>
<div class="pure-u-3-24">{{ $root.$dj(a.starttime).format('h:mma') }} </div>
<div class="pure-u-5-6">{{a.type}} - {{a.title}} </div>
</div>
<div v-if="expanded" class="pure-g pure-form">
<div class="pure-u-1-24"> </div>
<div class="pure-u-3-24"> </div>
<div class="pure-u-5-6">{{a.desc}} </div>
</div>
</div>
</div>
</div>` })
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// WELCOME LETTER main component
//
const WelcomeLetter = Vue.component('welcomeletter', {
props: [ 'mysem','mycrn', 'teacher_ext_id', ],
data: function () {
return { courses_by_semester:[], wl_sem:'', wl_crn:'', section_wl:{}, sortby:'code', reversed:false, active:-1, } },
watch: {
"teacher_ext_id": function (val, oldVal) { console.log('tch ext id changed'); this.fetch_sections() },
},
mounted: function() {
var self = this
if (this.mysem && this.mycrn) { this.fetch_wletters(this.mysem, this.mycrn) }
else { this.$root.do_after_load( self.fetch_sections) }
},
methods: {
swap_section: function(section_obj) { this.fetch_wletters(section_obj.sem,section_obj.crn) },
show_list: function() { this.section_wl = {} },
fetch_wletters: function(ss,cc) {
var self = this;
fetch('dir_api.php?a=get/section/' + ss + '/' + cc,
{ method: 'GET' }).then(function (response) {
// The API call was successful!
if (response.ok) {
response.json().then( function(r2) {
self.section_wl = r2;
} )
} else { return Promise.reject(response) }
}).then(function (data) {
}).catch(function (err) { console.warn('Something went wrong.', err); });
},
fetch_sections: function() {
var self = this;
basic_get('dir_api.php?a=get/sections/' + this.$root.user.ext_id,
function(r2) { self.courses_by_semester = _.groupBy(r2,function(x) { return x.sem || 0} ); self.$forceUpdate(); self.active += 1; console.log(self.active) } )
},
},
template: `<div class="">
<div v-if="section_wl.id" class="pure-g pure-form">
<div class="pure-u-24-24">
<div class="clicky" v-on:click="show_list()">back to list of sections</div>
<div class="">
Course:
</div>
<div class="">
Description:
</div>
<div class="">
Delivery Format:
</div>
<div class="">
Schedule:
</div>
<div class="">
Length:
</div>
<form class="pure-form pure-form-aligned">
<tfield table="welcome_letters" qid="introduction" question="Introduction" :answer="this.section_wl.introduction" :targetid="this.section_wl.wl_id"></tfield>
<tfield table="welcome_letters" qid="what_expect" question="What to Expect" :answer="this.section_wl.what_expect" :targetid="this.section_wl.wl_id"></tfield>
<tfield table="welcome_letters" qid="textbook" question="Textbook Information" :answer="this.section_wl.textbook" :targetid="this.section_wl.wl_id"></tfield>
<tfield table="welcome_letters" qid="assessments" question="Tests and Assessments" :answer="this.section_wl.assessments" :targetid="this.section_wl.wl_id"></tfield>
<tfield table="welcome_letters" qid="other_info" question="Other Useful Information" :answer="this.section_wl.other_info" :targetid="this.section_wl.wl_id"></tfield>
<tfield table="welcome_letters" qid="additional_resources" question="Additional Resources" :answer="this.section_wl.additional_resources" :targetid="this.section_wl.wl_id"></tfield>
</form>
</div>
</div>
<div v-else class="pure-g pure-form">
<div v-for="sect_list,sm in courses_by_semester" class="pure-u-24-24">
<b> {{sm}}</b><br />
<div v-for="crs in sect_list" class="clicky" v-on:click="swap_section(crs)">
&nbsp; &nbsp; &nbsp; {{crs.code}} - {{crs.crn}} - {{crs.name}}
</div>
</div>
</div>
</div>` })
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// VERY SIMPLE CALENDAR
//
const MyCal = Vue.component('mycal', {
data: function () {
return { today:new Date(), currentMonth:0, currentYear:0, selectYear:'', selectMonth:'',
months:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
activities:[],
by_date: {},
editing: -1, } },
mounted: function() {
var self = this
this.currentYear = this.today.getFullYear()
this.currentMonth = this.today.getMonth()
this.selectYear = this.currentYear
this.selectMonth = this.currentMonth
basic_get('dir_api.php?a=get/sessions',
function(r2) { self.activities = _.map(r2, function(x) {
var dd = new Date(x.starttime);
var [m,d,y] = [dd.getMonth(), dd.getDate(), dd.getFullYear()] // months start at 0....
var d_string = d + "-" + m + "-" + y
if (self.by_date[d_string]) { self.by_date[d_string].push(x) }
else { self.by_date[d_string] = [x, ] } } )
self.$forceUpdate() } )
},
methods: {
thisDay: function(i,j) {
var dayOfMonth = ((7*(i-1))+j)-this.firstDay()
return dayOfMonth },
eventsThisDay: function(i,j) {
var dayOfMonth = ((7*(i-1))+j)-this.firstDay()
var d_string = dayOfMonth + "-" + this.selectMonth + "-" + this.selectYear
var day_text = ''
if (this.by_date[d_string]) {
evts = _.filter( this.by_date[d_string], function(x) { return x.typeId!="101" } )
return evts } return [] },
cleanTime: function(e) {
var dd = new Date(e.starttime);
var [h,m] = [dd.getHours(), dd.getMinutes()]
var ampm = 'am'
if (h > 12) { h -= 12; ampm = 'pm' }
if (m == 0) { m = '' }
else { m = ':' + m }
return h + m + ampm },
daysInMonth: function() {
return 32 - new Date(this.selectYear, this.selectMonth, 32).getDate() },
firstDay: function() {
return (new Date(this.selectYear, this.selectMonth)).getDay() },
next: function() {
this.selectYear = (this.selectYear === 11) ? this.selectYear + 1 : this.selectYear;
this.selectMonth = (this.selectMonth + 1) % 12; },
previous: function() {
this.selectYear = (this.selectYear === 0) ? this.selectYear - 1 : this.selectYear;
this.selectMonth = (this.selectMonth === 0) ? 11 : this.selectMonth - 1; },
},
computed: {
},
watch: {
},
template:`<div class="calendar">
<h3>{{months[selectMonth] + " " + selectYear}}
<div class="btn_container"><div class="btn_float">
<button class="pure-button" v-on:click="previous">Previous</button>
<button class="pure-button" v-on:click="next">Next</button>
</div></div>
</h3>
<table><thead><tr>
<th>Sun</th><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th>
</tr></thead>
<tbody id="calendar-body">
<tr v-for="i in 6" v-if="(((7*(i-1)))-firstDay() < daysInMonth()+1)">
<td v-for="j in 7">
<span v-if="( ((7*(i-1))+j)-firstDay() > 0) && (((7*(i-1))+j)-firstDay() < daysInMonth()+1)">
<div class="do_month">{{ thisDay(i,j) }}</div>
<div class="cal_evt" v-for="ev in eventsThisDay(i,j)">{{cleanTime(ev)}} {{ ev.title }}</div>
</span>
</td>
</tr>
</tbody></table>
</div>` })
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// AJAX POST UPDATES TO API
//
function post_update(table,cols,vals,id=0) {
action = "nothing"
if (table=="personnel") { action = "update" }
if (table=="personnel_ext") { action = "update_xt" }
if (table=="conf_users") { action = "update_cf" }
if (table=="webpages") { action = "update_web" }
if (table=="welcome_letters") { action = "update/letter" } // or insert?
var idstr = ""
if (id) { idstr = "&id=" + id }
fetch('dir_api.php', {
method: 'POST',
headers: new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' }),
body: "a="+action+"&cols="+cols+"&vals="+vals+idstr,
}).then(function (response) {
if (response.ok) {
response.json().then( function(r2) {
// display success alert
alert_message('Saved.')
} )
} else { return Promise.reject(response) }
}).then(function (data) {
}).catch(function (err) { alert_message("Couldn't save!",pink); console.warn('Something went wrong.', err); });
}
function generic_fail(err,x="Something went wrong with an ajax fetch") {
console.log(x); console.log(err) }
function basic_get( url, after_fxn, fail_fxn=generic_fail ) {
fetch(url, { method: 'GET' }).then(function (response) {
if (response.ok) {response.json().then( function(r2) { after_fxn(r2) } )
} else { return Promise.reject(response) }
}).then(function (data) { }).catch(function (err) { fail_fxn(err) } ) }
var evt = {
clear_tables: function() {
var self = this
_.each( this.tables, function(x) { self[x] = [] } )
this.data = {}
this.target_ids = {} },
send_update: function() {
var self = this
//console.log("Sending update... (not really)")
_.each( this.tables, function(x) {
if (self[x].length) {
var cols = ""
var vals = ""
_.each(self[x], function(y) {
if (cols.length) { cols += "," }
if (vals.length) { vals += "," }
cols += y
if (typeof self.data[y] == "string") {
re = /,/g
vals += encodeURIComponent(self.data[y].replace(re,'[CMA]') ) }
else { vals += self.data[y] }
})
var edit_other = 0
if (self.target_ids[x]) { edit_other = self.target_ids[x] }
post_update(x, cols, vals, edit_other)
}
} ) },
data: {},
target_ids: {},
tables: ['personnel','personnel_ext','webpages','welcome_letters','conf_sessions','conf_hosts',
'pers_departments','pers_committees','pers_titles'],
}
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// INITIALIZE THE APP
//
evt.clear_tables()
MicroEvent.mixin(evt);
// welcome letter ?
/*var doing_welcomeletter = 1
if (typeof editing_crn === 'undefined' || editing_crn === null) {
// variable is undefined or null
doing_welcomeletter = 0
editing_crn = ''
editing_sem = ''
} */
var app = new Vue({
el: '#dir_editor',
data: { events: evt,
msg: 'hello', active: false,
user: {'last_name':'', 'first_name':'', 'department':'', 'extension':'', 'phone_number':'', 'email':'',
'staff_type':'', 'room':'', 'status':'', 'user_id':'', 'password':'', 'time_created':'', 'time_updated':'',
'id':'', ext_id:false, 'web_on':'', use_dir_photo:0, general_photo_release:0, espanol:0, zoom:'', preferred_contact:'',
officehours:'', title:'', picture:'', education:'', bio:'', courses:'', personal_page:'', changed:'' },
filter: [],
roles_menu: [],
depts_menu: [],
titles_menu: [],
waiting_fxns: [],
data_loaded: 0,
committees_menu: [],
menus_fetched: false,
},
watch: {
'data_loaded': function(newVal,oldVal) {
if (newVal > 0) { _.each( this.waiting_fxns, function(fx) { fx() }) }
},
},
methods: {
do_after_load: function(do_fxn) { this.waiting_fxns.push(do_fxn) /*....*/ },
fetch_menus: function() {
if (! this.menus_fetched) {
var self = this;
fetch('dir_api.php?a=menus', { method: 'GET' }).then(function (response) {
// The API call was successful!
if (response.ok) {
response.json().then( function(r2) {
self.depts_menu = r2.departments;
self.roles_menu = r2.roles;
self.titles_menu = r2.titles;
self.committees_menu = r2.committees;
self.menus_fetched = true;
} )
} else { return Promise.reject(response) }
}).then(function (data) {
}).catch(function (err) { console.warn('Something went wrong.', err); });
}
},
my_subscribe_calendar: function() { return "webcal://hhh.gavilan.edu/phowell/map/calendar" + this.user.conf_id + ".ics" },
clip_copy: function(x) {
// see the .htaccess file for the mod_rewrite that makes the ics file work. //
var data = [new ClipboardItem({ "text/plain": new Blob([this.my_subscribe_calendar()], { type: "text/plain" }) })];
navigator.clipboard.write(data).then(function() {
console.log("Copied to clipboard successfully!");
fadein_message()
}, function() {
console.error("Unable to write to clipboard. :-(");
});
},
},
computed: { },
mounted: function() {
var self = this;
this.fetch_menus()
fetch('dir_api.php', { method: 'GET' }).then(function (response) {
// The API call was successful!
if (response.ok) {
response.json().then( function(r2) {
var x = self.user.mysessions
self.user = r2;
self.user.mysessions = x
if (self.user.use_dir_photo == "0") { self.user.use_dir_photo = false }
if (self.user.espanol == "0") { self.user.espanol = false }
if (self.user.general_photo_release == "0") { self.user.general_photo_release = false }
self.data_loaded += 1
// pause half a second for the children to get populated before registering update events...
setTimeout(function() {
self.active = true;
// fancier text editors...
//pell.init( { element: document.getElementById('bio2'), onChange: function(h) { console.log(h) } } )
}, 1600);
} )
} else { return Promise.reject(response) }
}).then(function (data) {
}).catch(function (err) { console.warn('Something went wrong.', err); });
}
})
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// SIMPLE EVENTS
//
var update_fxn = _.debounce( function() {
alert_message('saving...','lightgreen')
evt.send_update(); evt.clear_tables(); }, 1300 )
evt.bind('changed', function(dat) {
if (app.active) {
var column = dat[0]
var table = dat[1]
var value = dat[2]
var target = dat[3]
console.log(dat)
this.data[column] = value
if (!this[table].includes(column) ) {this[table].push(column)}
if (target) { this.target_ids[table] = target }
update_fxn() }
});
//
//
// MISC
//
//
//
// <img :src="'//www.gavilan.edu/staff/' + s.dir_photo_path" width="25" height="auto" />
// v-lazy-container="{ selector: 'img' }"
//

1477
js/dir_app20220118.js Normal file

File diff suppressed because it is too large Load Diff

831
js/intranet_libs.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,6 @@
// pell text editor
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.pell={})}(this,function(t){"use strict";var e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},c="defaultParagraphSeparator",l="formatBlock",a=function(t,e,n){return t.addEventListener(e,n)},s=function(t,e){return t.appendChild(e)},d=function(t){return document.createElement(t)},n=function(t){return document.queryCommandState(t)},f=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return document.execCommand(t,!1,e)},p={bold:{icon:"<b>B</b>",title:"Bold",state:function(){return n("bold")},result:function(){return f("bold")}},italic:{icon:"<i>I</i>",title:"Italic",state:function(){return n("italic")},result:function(){return f("italic")}},underline:{icon:"<u>U</u>",title:"Underline",state:function(){return n("underline")},result:function(){return f("underline")}},strikethrough:{icon:"<strike>S</strike>",title:"Strike-through",state:function(){return n("strikeThrough")},result:function(){return f("strikeThrough")}},heading1:{icon:"<b>H<sub>1</sub></b>",title:"Heading 1",result:function(){return f(l,"<h1>")}},heading2:{icon:"<b>H<sub>2</sub></b>",title:"Heading 2",result:function(){return f(l,"<h2>")}},paragraph:{icon:"&#182;",title:"Paragraph",result:function(){return f(l,"<p>")}},quote:{icon:"&#8220; &#8221;",title:"Quote",result:function(){return f(l,"<blockquote>")}},olist:{icon:"&#35;",title:"Ordered List",result:function(){return f("insertOrderedList")}},ulist:{icon:"&#8226;",title:"Unordered List",result:function(){return f("insertUnorderedList")}},code:{icon:"&lt;/&gt;",title:"Code",result:function(){return f(l,"<pre>")}},line:{icon:"&#8213;",title:"Horizontal Line",result:function(){return f("insertHorizontalRule")}},link:{icon:"&#128279;",title:"Link",result:function(){var t=window.prompt("Enter the link URL");t&&f("createLink",t)}},image:{icon:"&#128247;",title:"Image",result:function(){var t=window.prompt("Enter the image URL");t&&f("insertImage",t)}}},m={actionbar:"pell-actionbar",button:"pell-button",content:"pell-content",selected:"pell-button-selected"},r=function(n){var t=n.actions?n.actions.map(function(t){return"string"==typeof t?p[t]:p[t.name]?e({},p[t.name],t):t}):Object.keys(p).map(function(t){return p[t]}),r=e({},m,n.classes),i=n[c]||"div",o=d("div");o.className=r.actionbar,s(n.element,o);var u=n.element.content=d("div");return u.contentEditable=!0,u.className=r.content,u.oninput=function(t){var e=t.target.firstChild;e&&3===e.nodeType?f(l,"<"+i+">"):"<br>"===u.innerHTML&&(u.innerHTML=""),n.onChange(u.innerHTML)},u.onkeydown=function(t){var e;"Enter"===t.key&&"blockquote"===(e=l,document.queryCommandValue(e))&&setTimeout(function(){return f(l,"<"+i+">")},0)},s(n.element,u),t.forEach(function(t){var e=d("button");if(e.className=r.button,e.innerHTML=t.icon,e.title=t.title,e.setAttribute("type","button"),e.onclick=function(){return t.result()&&u.focus()},t.state){var n=function(){return e.classList[t.state()?"add":"remove"](r.selected)};a(u,"keyup",n),a(u,"mouseup",n),a(e,"click",n)}s(o,e)}),n.styleWithCSS&&f("styleWithCSS"),f(c,i),n.element},i={exec:f,init:r};t.exec=f,t.init=r,t.default=i,Object.defineProperty(t,"__esModule",{value:!0})});

11909
js/vue27max.js Normal file

File diff suppressed because it is too large Load Diff

78
list.php Normal file
View File

@ -0,0 +1,78 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$MY_TITLE = "Personnel Directory Index";
$MY_CRUMB = "Personnel Directory";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12">
</div>
<div class="pure-u-20-24 content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<a href="/">
<img border="0" class="headerimg" src="graf/bird_logo.png" alt="Gavilan College Intranet" />
</a>
<ul>
<li><a href="dir.php">Edit Directory Info</a></li>
<li style="list-style:none;">&nbsp;</li>
<li><a href="bio.php">Edit Bio Page</a></li>
<li style="list-style:none;">&nbsp;</li>
<!--<li><a href="/pio/events.php"><span>Events Manager</span></a></li>
<li><a href="/pio/events_multi.php"><span>Events (Multiple)</span></a></li>
<li><a href="https://intranet1.gavilan.edu/pio/listevents.php" target="_blank"><span>View All Events</span></a></li>
-->
</ul>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
Does something need changing? Please email:
<ul><li>Your dept chair</li>
<li>Your dean or division assistant</li>
<li>HR</li>
</ul>
In that order.
<div id="dir_editor" class="listing">
<dirlist></dirlist>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

20
nav.php Normal file
View File

@ -0,0 +1,20 @@
<a href="/">
<img border="0" class="headerimg" src="graf/bird_logo.png" alt="Gavilan College Intranet" />
</a>
<ul id="nav">
<li><a href="index.php">My Itinerary</a></li>
<li><a href="act.php">All Sessions</a></li>
<!--<li><a href="act.php">All Training / Events</a></li>
<li style="list-style:none;">&nbsp;</li>
<li><a href="itn.php">My Events</a></li>
<li><a href="cal.php">Calendar View</a></li>
<li><a href="ed_act.php">Edit Activity</a></li> -->
<li style="list-style:none;">&nbsp;</li>
<!--<li><a href="dir.php">Edit Staff Directory</a></li>
<li><a href="bio.php">Edit Bio Page</a></li>
<li><a href="welcome.php">Edit Course Welcome Pages</a></li> -->
<li style="list-style:none;">&nbsp;</li>
</ul>

82
old/bio.php Normal file
View File

@ -0,0 +1,82 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$MY_TITLE = "Staff Bio Page Editor";
$MY_CRUMB = "<a href='index.php'>Personnel Directory</a> &gt; Staff Bio Page";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12">
</div>
<div class="pure-u-20-24 content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<form class="pure-form pure-form-aligned">
<checkbox table="personnel" qid="web_on"
question="Activate Bio Web Page Link" :answer="this.user.web_on"></checkbox>
<tfield table="webpages" qid="bio" question="Brief biography" :answer="this.user.bio"></tfield>
<tfield table="webpages" qid="education" question="Education summary" :answer="this.user.education"></tfield>
<field table="webpages" qid="title" question="Title" :answer="this.user.title"></field>
<tfield table="webpages" qid="officehours" question="Office hours" :answer="this.user.officehours"></tfield>
<field table="webpages" qid="personal_page" question="Personal web site" :answer="this.user.personal_page"></field>
<br />
<div class="pure-controls">
<img class="staffpic" :src="this.user.picture" />
</div>
</form>
<!-- <div class="formpush">
<p>Upload a new picture (only small files)</p>
<form action="dir_api_tester.php"
class="dropzone"
id="my-awesome-dropzone"></form>
</div>
<div id="bio2"></div> -->
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

125
old/dir.php Normal file
View File

@ -0,0 +1,125 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = "Personnel Directory Editor";
$MY_CRUMB = "Personnel Directory";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12">
</div>
<div class="pure-u-20-24 content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require '../nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<form class="pure-form pure-form-aligned">
<field table="personnel" qid="first_name" question="First name" :answer="this.user.first_name"></field>
<field table="personnel" qid="last_name" question="Last name" :answer="this.user.last_name"></field>
<div class="pure-control-group"><label class="question">Email</label>
<span class="lighter">{{ user.email }}</span></div>
<div class="pure-control-group"><label class="question">G Number</label>
<span class="lighter">G00{{ user.conf_goo }}</span></div>
<!-- <field table="personnel" qid="department" question="Department" :answer="this.user.department"></field> -->
<field table="personnel" qid="phone_number" question="Phone Number" :answer="this.user.phone_number"></field>
<field table="personnel_ext" qid="zoom" question="Zoom link" :answer="this.user.zoom"></field>
<field table="personnel" qid="room" question="Room" :answer="this.user.room"></field>
<div class="pure-control-group">
<label for="dept1" class="question">Department</label>
<selectmenu table="personnel_ext" qid="dept1" :answer="this.user.dept1" menu="depts_menu" :targetid="this.user.ext_id" labelfield="name"></selectmenu>
</div>
<div class="pure-control-group">
<label for="dept2" class="question">Optional Additional Department</label>
<selectmenu table="personnel_ext" qid="dept2" :answer="this.user.dept2" menu="depts_menu" :targetid="this.user.ext_id" labelfield="name"></selectmenu>
</div>
<div class="pure-control-group">
<label for="gtitle" class="question">Job Title</label>
<selectmenu table="personnel_ext" qid="gtitle" :answer="this.user.gtitle" menu="titles_menu" :targetid="this.user.ext_id" labelfield="name"></selectmenu>
</div>
<checkbox table="personnel_ext" qid="espanol" question="I speak spanish" :answer="this.user.espanol"></checkbox>
<checkbox table="personnel_ext" qid="use_dir_photo" question="Publish my photo on staff directory" :answer="this.user.use_dir_photo"></checkbox>
<checkbox table="personnel_ext" qid="general_photo_release" question="I allow Gavilan College to use my directory photo in promotions and publicity." :answer="this.user.general_photo_release"></checkbox>
<div class="pure-controls">
<img class="staffpic" :src="'https://www.gavilan.edu/staff/' + this.user.dir_pic_path" />
</div>
<!-- #### NO PIC UPLOADS FOR NOW
<div class="formpush">
<p>Upload a new picture (only small files)</p>
<form action="dir_api_tester.php"
class="dropzone"
id="my-awesome-dropzone"></form>
</div>
-->
<!-- <div id="bio2"></div> <div class="pure-u-1-4"></div> -->
</form>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

822
old/dir_api.20211021php Normal file
View File

@ -0,0 +1,822 @@
<?php
$DEBUG = 0;
function p($s) { echo "<p>{$s}</p>\n"; }
function p2($val){ echo '<pre>'; print_r($val); echo "</pre>\n"; }
function d_err($s) { global $DEBUG; if ($DEBUG) { p($s); } }
include('underscore.php');
////////////////////
////////////////////
//
// PHP SESSIONS .... needed?
//
/*
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Allow-Methods: get,post");
header("Access-Control-Allow-Headers: Content-Type, Accept");
session_start();
function logout() { session_destroy(); }
*/
////////////////////
////////////////////
//
// DATABASE
//
// Yes, there's two different databases.
//
// $c = gavi_db
// $c2 = PeterDB
//
// Why? Just to keep you on your toes.
//
// The $j argument is true for a json result, or false for a raw db object result.
//
$DBServer = 'localhost'; $DBUser = 'www';
$DBPass = '@$df'; $DBName = 'gavi_db';
$c = new mysqli($DBServer, $DBUser, $DBPass, $DBName);
if ($c->connect_error) { die('Database connection failed: ' . $c->connect_error ); }
if (!mysqli_select_db($c, $DBName)) { die("Uh oh, couldn't select database $DBName"); }
$c2 = new mysqli($DBServer, "phowell", 'p^howell', 'PeterDB');
if ($c2->connect_error) { die('Database connection failed: ' . $c2->connect_error ); }
if (!mysqli_select_db($c2, 'PeterDB')) { die("Uh oh, couldn't select database 'PeterDB'"); }
// Generic string cleaner
function ok($str) { global $c; return mysqli_real_escape_string($c, strip_tags($str, '<p><br><ul><ol><li><b><i><strong><em>')); }
// 1. lookups, like a username
function single_row_select($qry, $j=1, $c) {
$r = mysqli_query($c, $qry); d_err($qry);
$e = mysqli_error($c); if($e) { d_err("sql error: " . $e ); }
$a = mysqli_fetch_assoc($r);
$e = mysqli_error($c); if($e) { d_err("sql error: " . $e ); }
if (! $j) { return $a; } return json_encode($a); }
// 1a. inserts
function single_row_insert($qry, $j=1, $c) {
$r = mysqli_query($c, $qry); d_err($qry);
$e = mysqli_error($c); if($e) { d_err("sql error: " . $e ); }
$a = mysqli_fetch_assoc($c);
$e = mysqli_error($c); if($e) { d_err("sql error: " . $e ); }
if (! $j) { return $a; } return json_encode($a); }
// 2. grid or fancier joins, like get all sessions, rosters, todos, etc
function multi_row_select($qry, $j=1, $db) {
$rows = array();
$result = mysqli_query($db, $qry);
while($r = mysqli_fetch_assoc($result)) { $rows[] = $r; }
if (! $j) { return $rows; } return json_encode( $rows); }
// 3. Check if an entry exists
function does_exist($qry, $full_record=0, $db) { global $c, $c2;
$r = mysqli_query($db, $qry);
$a = mysqli_num_rows($r);
$row = mysqli_fetch_array($r, MYSQLI_NUM);
$id = $row[0]; // getting the id of that which exists... assuming first column has it.
d_err("does exist: {$a}");
$e = mysqli_error($db); if($e) { d_err("sql error: " . $e); }
if ($a && $full_record) { return $row; } if ($a) { return $id; } return 0; }
////////////////////
////////////////////
//
// SSO
//
// Set GLOBAL VARS corresponding to current logged in user.
// They may only edit their own dir info.
//
$server = $_SERVER['SERVER_NAME'];
if ( preg_match('/intranet1/', $server )) {
require 'mAuth.php';
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = strtolower($attributes['http://wso2.org/claims/emailaddress'][0]);
/*$USER_TYPE = "FACULTY"; //$attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = "G00102586"; //$attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = "phowell@gavilan.edu"; //$attributes['http://wso2.org/claims/emailaddress'][0];
$status = "<b>ID:</b>{$USER_GOO}<br />";
$status .= "<b>Email:</b>{$USER_EMAIL}<br />";
$status .= "<b>Employee type:</b>{$USER_TYPE}<br />";
d_err($status); */
} else {
echo json_encode( array("result"=>"not on intranet1") );
//exit();
$USER = 0;
$USER_NAME = 0;
$USER_PERS_ID = 0;
$USER_CONF_U_ID = 0;
$USER_PERS_EXT_ID = 0;
}
// Current academic year
$AY = single_row_select("SELECT * FROM conf_academicyears WHERE label='2021-2022';",0, $c2);
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// Fetching a person's records
//
// 1. use their email to lookup PERSONNEL
// - basic directory info
//
// 2. use their email to lookup CONF_USERS
// - flex app, workshop signups
//
// 3. use conf_users.id to lookup in gavi_personnel_ext.c_users
// - goo, depts, job title, image active
//
// 4. use personnel.id to lookup [webpages, welcomepages, etc]
function user_record() { global $USER, $USER_EMAIL, $USER_NAME, $USER_PERS_ID, $USER_CONF_U_ID, $USER_PERS_EXT_ID, $c, $c2;
$q1 = "SELECT last_name, first_name, department, extension, phone_number, LOWER(email) AS email, room, user_id, time_updated, id, web_on FROM personnel WHERE email='" . $USER_EMAIL . "'";
//p2($q1);
$usr_dir = single_row_select($q1, 0, $c);
//p2($usr_dir);
$q2 = "SELECT id AS id_c_users, goo, LOWER(email) AS email_c_users, name, active FROM conf_users WHERE LOWER(email)='" . $USER_EMAIL . "'";
//p2($q2);
$usr_conf = single_row_select($q2, 0, $c2);
//p2($usr_conf);
$mega = __::extend( (object) $usr_dir, (object) $usr_conf );
$q3 = 'SELECT id AS ext_id, personnel AS personnel_id, role, goo_short, c_users AS c_users_id_ext, ilearn_id, sched_alias, dept1, dept2, gtitle, active, use_dir_photo, general_photo_release, etc FROM gavi_personnel_ext WHERE c_users=' . $mega->id_c_users;
//p2($q3);
$usr_ext = single_row_select($q3,0,$c2);
//p2($usr_ext);
$mega = __::extend( (object) $mega, (object) $usr_ext );
$q4 = 'SELECT person, officehours, title, picture, education, bio, courses, personal_page, changed FROM webpages WHERE person=' . $mega->id; // personnel=1');
//p2($q3);
$usr_web = single_row_select($q4,0,$c);
//p2($usr_ext);
$mega = __::extend( (object) $mega, (object) $usr_web );
$USER = $mega;
}
if ($USER_EMAIL) { user_record(); }
// //
// //
// // LOG ENTRIES
// //
// //
// Enter or get browser log entry
function insert_or_get_browser($b) {
global $c2;
$BROWSER = ok($b);
$existing = does_exist( "SELECT id FROM www_browsers WHERE string='$BROWSER'", 0, $c2);
if ($existing) {
return $existing;
} else {
$q = "INSERT INTO www_browsers (string) VALUES ('$BROWSER')";
single_row_select($q,0,$c2);
return does_exist( "SELECT id FROM www_browsers WHERE string='$BROWSER'",0,$c2);
}
return 0; }
// Log everything!
function log_it($action,$extra='') {
global $USER, $c2;
if (! $USER) {
$USER = array( 'name'=>'unknown', 'id'=>-1 ); }
$user_browser = $_SERVER['HTTP_USER_AGENT'];
$user_ip = $_SERVER['REMOTE_ADDR'];
$BROWSER = insert_or_get_browser($user_browser);
$ACTION = ok($action);
$EXTRA = ok($extra);
//$id = ok($_POST['id']);
$qupdate = "INSERT INTO gavi_logs SET action='{$action}', personnel_id='{$USER->id}', name='{$USER->name}', extra='{$EXTRA}', browser=$BROWSER, ip='$user_ip'";
single_row_select($qupdate,0,$c2);
return array("result"=>"success","action"=>"logged","query"=>$qupdate,"err"=>mysqli_error($c2));
}
function unescape_commas($s) { return preg_replace('/\[CMA\]/', ',', $s); }
function name_to_lc($fn,$ln) {
$fn = str_replace( array( '-', ' '), '', strtolower($fn) );
$ln = str_replace( array( '-', ' '), '', strtolower($ln) );
return $fn . "_" . $ln;
}
function name_to_file($fn,$ln) {
$fn = str_replace( array( '-', ' '), '', strtolower($fn) );
$ln = str_replace( array( '-', ' '), '', strtolower($ln) );
return $fn . "_" . $ln . ".jpg";
}
function check_dir_photo($fn,$ln) { global $USER;
$filename = name_to_file( $fn,$ln );
$path = '/gavilan.edu/staff/images_sm/' . $filename;
$dir_pic_exists = 0;
$dir_pic_path = 'images_sm/nobody.jpg';
if (file_exists($path)) {
$dir_pic_exists = 1;
$dir_pic_path = 'images_sm/' . $filename; }
$USER->dir_pic_exists = $dir_pic_exists;
$USER->dir_pic_path = $dir_pic_path;
return $dir_pic_exists;
}
check_dir_photo($USER->first_name, $USER->last_name);
//
//
//
////////////////////
////////////////////
//require __DIR__ . '/vendor/autoload.php';
// Sample URL
//
// https://www.gavilan.edu/staff/dir_api.php?a=update&cols=name,msg&vals=peter,hello
//
// https://intranet1.gavilan.edu/dir/dir_api.php?a=update&cols=name,msg&vals=peter,hello
/*
NEXT STEPS:
- figure out permissions system
- which means knowing dept / hierarchy
- which means cross referencing PERSONNEL and EXT and CONF_USERS.....
## Permissions summary
0. There is a list of table+column combos that users are allowed to edit.
0.5 An activity "belongs" to the user who owns it (or created it).
1. Simple cases:
- current user is updating their own (allowable) record. Allow.
2. Superuser:
- current user is executive, hr, it, or root. (7,2,8,3) Allow.
3. User is "Dept Editor" (4) and
-is updating a record belonging to someone in their dept. Allow.
4. Harder: Updating events
5. Updating attendance, approvals, or other restricted tables. Only FPLC (1) or superusers.
*/
function check_permission( $acting_user, $target_user, $table ) {
// TODO
return true;
}
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// Everyone. Basic dir. Include status==0 which is unpublished.
function staff_dir() { global $c;
return multi_row_select('SELECT first_name,last_name,department,status, room,phone_number,email,web_on,id FROM personnel',1, $c);
// WHERE status IS null OR status=1
}
// Everyone. Basic dir
function staff_dir_ext() { global $c;
//return multi_row_select('SELECT p.first_name,p.last_name,p.department,p.status, p.room,phone_number,p.email,p.web_on, p.id, e.id AS ext_id, e.role, e.goo_short, e.c_users AS c_users_id_ext, e.ilearn_id, e.sched_alias, e.dept1, e.dept2, e.gtitle, e.active, e.use_dir_photo, e.general_photo_release, e.dir_photo_path, e.etc FROM gavi_db.personnel p LEFT JOIN PeterDB.gavi_personnel_ext e ON p.id=e.personnel ORDER BY p.last_name LIMIT 5000',1, $c);
return multi_row_select('SELECT p.first_name,p.last_name,p.department,p.status, p.room,phone_number,p.email,p.web_on, p.id, e.id AS ext_id, e.role, e.goo_short, e.c_users AS c_users_id_ext, e.ilearn_id, e.sched_alias, e.dept1, e.dept2, e.gtitle, e.active, e.use_dir_photo, e.general_photo_release, e.dir_photo_path, e.etc, c.id AS conf_id, c.goo AS conf_goo, c.name AS conf_name FROM gavi_db.personnel p LEFT JOIN PeterDB.gavi_personnel_ext e ON p.id=e.personnel LEFT JOIN PeterDB.conf_users c ON LOWER(p.email)=LOWER(c.email) ORDER BY p.last_name LIMIT 5000',1, $c);
// WHERE p.status IS null OR p.status=1
}
if (isset($_REQUEST['a']) && $_REQUEST['a']=='list') {
echo staff_dir_ext(); exit(); }
// TODO what about people who don't have all three rows?
//
//
//
//
//
//
//
// Helper tables
function sub_menus() { global $c2;
$ddd = multi_row_select('SELECT * FROM gavi_departments ORDER BY name',0, $c2);
$ttt = multi_row_select('SELECT * FROM gavi_titles ORDER BY name',0, $c2);
$rrr = multi_row_select("SELECT * FROM gavi_roles ORDER BY 'descr'",0, $c2);
$ccc = multi_row_select('SELECT * FROM gavi_committees ORDER BY name',0, $c2);
return json_encode( array( 'departments'=>$ddd, 'titles'=>$ttt, 'roles'=>$rrr, 'committees'=>$ccc ) );
exit();
}
if (isset($_REQUEST['a']) && $_REQUEST['a']=='menus') {
echo sub_menus(); exit(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// GET LIST OF ALL SESSIONS / WORKSHOPS / EVENTS
//
function get_sessions() {
global $c2, $AY;
echo json_encode( multi_row_select("SELECT c.id,c.title,c.desc,c.length,c.starttime,c.track,c.location,c.gets_survey,c.category,c.parent,c.recording,c.instructions,c.image_url,c.is_flex_approved,c.cal_uid,sst.type,sst.id AS typeId, GROUP_CONCAT(ctg.tag) AS tags FROM conf_sessions c 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.starttime BETWEEN CAST('{$AY['begin']}' AS DATE) AND CAST('{$AY['end']}' AS DATETIME) GROUP BY c.id ORDER BY c.track, c.starttime;",0, $c2)); exit(); }
if (isset($_GET['a']) && $_GET['a'] == 'get/sessions') { get_sessions(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// LIST THE CURRENT USER'S SIGNED UP, (OR HOSTING,) SESSIONS / WORKSHOPS / EVENTS
//
function get_user_sessions() {
global $c2, $AY, $USER;
$my_sessions = multi_row_select("SELECT c.id,c.title,c.desc,c.length,c.starttime,c.track,c.location,c.gets_survey,c.category,c.parent,c.recording,c.instructions,c.image_url,c.is_flex_approved,sst.type,sst.id AS typeId, GROUP_CONCAT(ctg.tag) AS tags FROM conf_sessions c JOIN conf_signups as sup on c.id=sup.session JOIN conf_hosts as h ON h.session=c.id 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 (h.host='{$USER->id_c_users}' OR sup.user='{$USER->id_c_users}') AND c.starttime BETWEEN CAST('{$AY['begin']}' AS DATE) AND CAST('{$AY['end']}' AS DATETIME) GROUP BY c.id ORDER BY c.track, c.starttime;",0,$c2);
echo json_encode($my_sessions);
exit(); }
if (isset($_GET['a']) && $_GET['a'] == 'get/mysessions') { get_user_sessions(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// SIGNUP for (possibly overlapping time) session ...
//
function signup() {
global $c2, $AY, $USER;
preg_match('/signup\/(\d+)$/', $_GET['a'], $matches);
$ses = $matches[1];
$ts = date("Y-m-d H:i:s");
$logaction = log_it("Signed up for session: {$ses}");
$existing = does_exist(
"SELECT i.id FROM conf_signups AS i JOIN conf_sessions AS s ON i.session=s.id WHERE s.id={$ses} AND i.user={$USER->id_c_users}",0,$c2);
if ($existing) {
$qupdate = "UPDATE conf_signups SET session={$ses}, timestamp='{$ts}' WHERE session={$ses} AND user={$USER->id_c_users}";
single_row_select($qupdate,1,$c2);
echo json_encode( array("result"=>"success","action"=>"updated","logaction"=>$logaction, "query"=>$qupdate,"err"=>mysqli_error($c2)));
} else {
$q = "INSERT INTO conf_signups (session,user,timestamp) VALUES ({$ses},{$USER->id_c_users},'{$ts}')";
single_row_select($q,1,$c2);
echo json_encode( array("result"=>"success","action"=>"inserted","logaction"=>$logaction, "ses"=>$_SESSION,"query"=>$q,"err"=>mysqli_error($c2)));
} exit(); }
if (isset($_GET['a']) && preg_match('/signup\/(\d+)$/', $_GET['a'], $matches)) { signup(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// CANCEL a signup
//
function signdown() {
global $c2, $AY, $USER;
preg_match('/signdown\/(\d+)$/', $_GET['a'], $matches);
$ses = $matches[1];
$q = "DELETE FROM conf_signups WHERE session={$ses} AND user={$USER->id_c_users}";
single_row_select($q,1,$c2);
$logaction = log_it("Canceled signup for session: $ses");
echo json_encode( array("result"=>"success","action"=>"deleted","logaction"=>$logaction, "query"=>$q,"err"=>mysqli_error($c2)));
exit(); }
if (isset($_GET['a']) && preg_match('/signdown\/(\d+)$/', $_GET['a'], $matches)) { signdown(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// NEW SESSION
//
function new_session() {
global $c2, $AY, $USER;
$title = ok($_POST['title']); $starttime = ok($_POST['starttime']);
$length = ok($_POST['length']); if ($length=='') { $length=1; }
$track = ok($_POST['track']); $gets_survey = ok($_POST['gets_survey']);
$is_flex_approved = ok($_POST['is_flex_approved']); $category = ok($_POST['title']);
if ($category=='') { $category=0; }
$author = ok($_POST['author']); if ($author=='') { $author=1; } // $USER->id_c_users; }
$is_custom = ok($_POST['is_custom']); $parent = ok($_POST['parent']);
$desc = ok($_POST['desc']); $location = ok($_POST['location']);
$recording = ok($_POST['recording']); $instructions = ok($_POST['instructions']);
$type = ok($_POST['type']); if ($type=='') { $type=19; }
$cal_uid = ok($_POST['cal_uid']);
$q = "INSERT INTO conf_sessions (`title`,`starttime`,`length`,`track`,`gets_survey`,`is_flex_approved`,`category`,`author`,`is_custom`,`parent`,`desc`,`location`,`recording`,`instructions`,`type`,`cal_uid`) VALUES ('{$title}', '{$starttime}', '{$length}', '{$track}', '{$gets_survey}', '{$is_flex_approved}', '{$category}', '{$author}', '{$is_custom}', '{$parent}', '{$desc}', '{$location}', '{$recording}', '{$instructions}', '{$type}', '{$cal_uid}');";
$ins = single_row_insert($q,0,$c2);
$logaction = log_it("created new session: {$title}");
echo json_encode( array("result"=>"success","action"=>"inserted new session","insert"=>$ins, "query"=>$q,"logaction"=>$logaction,"err"=>mysqli_error($c2)));
exit(); }
if (isset($_REQUEST['a']) && $_REQUEST['a']=='set/newsession') { new_session(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// Editing of session info
//
function set_sessioninfo() {
global $c, $c2, $AY, $USER;
$table = 'conf_sessions';
if (isset($_POST['id'])) {
$ID = ok($_REQUEST['id']);
if (! check_permission( $USER->id, $ID, $table)) {
echo json_encode( array("result"=>"fail", "err"=>"dont have permission to edit this") );
exit();
} else {
$logaction = log_it("edited session id: {$ID}");
$WHERECLAUSE = " WHERE id={$ID}";
$date = date('Y-m-d H:i:s');
$cols = explode(',', $_REQUEST['cols']); $vals = explode(',', $_REQUEST['vals']);
$vals = __::map($vals, unescape_commas);
$cv = __::zip($cols,$vals);
$q = __::reduce($cv, function($memo, $a) { return $memo . ok($a[0]) . "='" . ok($a[1]) . "', "; }, "UPDATE {$table} SET ");
$q = substr($q, 0, -2);
$q .= $WHERECLAUSE;
single_row_select($q,0,$c1);
echo json_encode( array("rawvalstr"=>$_REQUEST['vals'], "result"=>"success","action"=>"updated","logaction"=>$logaction, "query"=>$q,"err"=>mysqli_error($c2)));
}
} else {
echo json_encode( array("result"=>"fail", "err"=>"no activity id specified") ); }
exit();
}
/*$title = ok($_POST['title']);
$desc = ok($_POST['desc']);
$location = ok($_POST['location']);
$recording = ok($_POST['recording']);
$instructions = ok($_POST['instructions']);
$id = ok($_POST['id']);
$qupdate = "UPDATE conf_sessions SET title='$title', `desc`='$desc', location='$location', recording='$recording', instructions='$instructions' WHERE id=$id";
single_row_select($qupdate,0,$c2);
$logaction = log_it("edited session id: {$id}");
echo json_encode( array("result"=>"success","action"=>"updated","logaction"=>$logaction,"query"=>$qupdate,"err"=>mysqli_error($c2)));
//print_r($_POST);
exit();}
*/
//if (isset($_POST['a']) && $_POST['a']=='update/activity') { set_sessioninfo(); }
if (isset($_REQUEST['a']) && $_REQUEST['a']=='update/activity') { set_sessioninfo(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// update a name, lname, dept, phone, extension, email, type, room, status, user_id, or web_on
function update_dir() {
global $USER, $c, $c2;
$WHERECLAUSE = " WHERE id={$USER->id}";
if (isset($_POST['id'])) { // editing another person's data
if (! check_permission( $USER->id, $_POST['id'], 'personnel')) {
echo json_encode( array("result"=>"fail", "err"=>"dont have permission to edit this") );
exit();
} else {
$logaction = log_it("updating personnel record of personnel id {$_POST['id']}");
$WHERECLAUSE = " WHERE id={$_POST['id']}";
}
} else {
$logaction = log_it("updating personnel record");
}
// date modified is now
$date = date('Y-m-d H:i:s');
$cols = explode(',', $_REQUEST['cols']); $vals = explode(',', $_REQUEST['vals']);
$vals = __::map($vals, unescape_commas);
$cv = __::zip($cols,$vals);
$q = __::reduce($cv, function($memo, $a) { return $memo . ok($a[0]) . "='" . ok($a[1]) . "', "; }, "UPDATE personnel SET ");
//$q = substr($q, 0, -2);
$q .= "time_updated='" . $date . "'";
$q .= $WHERECLAUSE;
if ($USER->id) {
single_row_select($q,0,$c);
echo json_encode( array("rawvalstr"=>$_REQUEST['vals'], "result"=>"success","action"=>"updated","logaction"=>$logaction, "query"=>$q,"err"=>mysqli_error($c)));
}
else {
$logaction2 = log_it("failed to update personnel record");
echo json_encode( array("result"=>"fail", "err"=>"dont have an id for user") );
}
exit();
}
//if (isset($_POST['a']) && $_POST['a']=='update') { update_dir(); }
if (isset($_REQUEST['a']) && $_REQUEST['a']=='update') { update_dir(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// update goo, dept1/dept2, title, active, use_dir_photo
function update_dir_ext() {
global $USER, $c, $c2;
$WHERECLAUSE = " WHERE id={$USER->ext_id}";
if (isset($_POST['id'])) { // editing another person's data
if (! check_permission( $USER->id, $_POST['id'], 'personnel')) {
echo json_encode( array("result"=>"fail", "err"=>"dont have permission to edit this") );
exit();
} else {
$logaction = log_it("updating personnel_ext record of personnel id {$_POST['id']}");
$WHERECLAUSE = " WHERE id={$_POST['id']}";
}
} else {
$logaction = log_it("updating personnel_ext record");
}
// date modified is now
$date = date('Y-m-d H:i:s');
$cols = explode(',', $_REQUEST['cols']); $vals = explode(',', $_REQUEST['vals']);
$vals = __::map($vals, unescape_commas);
$cv = __::zip($cols,$vals);
$q = __::reduce($cv, function($memo, $a) { return $memo . ok($a[0]) . "='" . ok($a[1]) . "', "; }, "UPDATE gavi_personnel_ext SET ");
$q = substr($q, 0, -2);
$q .= $WHERECLAUSE;
if ($USER->ext_id) {
single_row_select($q,0,$c2);
echo json_encode( array("result"=>"success","action"=>"updated","logaction"=>$logaction, "query"=>$q,"err"=>mysqli_error($c2)));
}
else {
$logaction2 = log_it("failed to update gavi_personnel_ext record. dont have id for user.",var_dump($USER) );
echo json_encode( array("result"=>"fail", "err"=>"dont have an id for user") );
}
exit();
}
//if (isset($_POST['a']) && $_POST['a']=='update_xt') { update_dir_ext(); }
if (isset($_REQUEST['a']) && $_REQUEST['a']=='update_xt') { update_dir_ext(); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
//
// update person, officehours, title, picture, education, bio, courses, personal_page, changed
function update_webpage() {
global $USER_PERS_ID, $USER, $c, $c2;
$WHERECLAUSE = " WHERE person={$USER->id}";
if (isset($_POST['id'])) { // editing another person's data
if (! check_permission( $USER->id, $_POST['id'], 'personnel')) {
echo json_encode( array("result"=>"fail", "err"=>"dont have permission to edit this") );
exit();
} else {
$logaction = log_it("updating bio webpage record of personnel id {$_POST['id']}");
$WHERECLAUSE = " WHERE person={$_POST['id']}";
}
} else {
$logaction = log_it("updating bio webpage record");
}
$date = date('Y-m-d H:i:s');
$cols = explode(',', $_REQUEST['cols']); $vals = explode(',', $_REQUEST['vals']);
$vals = __::map($vals, unescape_commas);
$cv = __::zip($cols,$vals);
$q = __::reduce($cv, function($memo, $a) { return $memo . ok($a[0]) . "='" . ok($a[1]) . "', "; }, "UPDATE webpages SET ");
$q .= "changed='" . $date . "'";
$q .= $WHERECLAUSE;
if ($USER->id) {
single_row_select($q,0,$c);
echo json_encode( array("rawvalstr"=>$_REQUEST['vals'], "result"=>"success","action"=>"updated","logaction"=>$logaction, "query"=>$q,"err"=>mysqli_error($c)));
}
else {
$logaction2 = log_it("failed to update bio webpage record");
echo json_encode( array("result"=>"fail", "err"=>"dont have an id for user") );
}
exit();
}
//if (isset($_POST['a']) && $_POST['a']=='update_web') { update_webpage(); }
if (isset($_REQUEST['a']) && $_REQUEST['a']=='update_web') { update_webpage(); }
function handle_pic_upload() { global $USER;
$uploaddir = '/gavilan.edu/staff/uploads/';
$date = date('Ymd_Hi');
$uploadfile = $uploaddir . name_to_lc($USER->first_name,$USER->last_name) . "_" . $date . "_" . basename($_FILES['file']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
}
//if (isset($_POST['a']) && $_POST['a']=='update_web') { update_webpage(); }
//if (isset($_REQUEST['file'])) { handle_pic_upload(); }
if (isset($_FILES['file'])) { handle_pic_upload(); }
function get_a_user($user_email) { global $c, $c2;
$q1 = "SELECT last_name, first_name, department, extension, phone_number, email, room, user_id, time_updated, id, web_on FROM personnel WHERE email='" . $user_email . "'";
//p2($q1);
$usr_dir = single_row_select($q1, 0, $c);
//p2($usr_dir);
$q2 = "SELECT id AS id_c_users, goo, email AS email_c_users, name, active FROM conf_users WHERE email='" . $user_email . "'";
//p2($q2);
$usr_conf = single_row_select($q2, 0, $c2);
//p2($usr_conf);
$mega = __::extend( (object) $usr_dir, (object) $usr_conf );
$q3 = 'SELECT id AS ext_id, personnel AS personnel_id, goo_short, c_users AS c_users_id_ext, ilearn_id, sched_alias, dept1, dept2, title, active, use_dir_photo, etc FROM gavi_personnel_ext WHERE personnel=' . $mega->id;
//p2($q3);
$usr_ext = single_row_select($q3,0,$c2);
//p2($usr_ext);
$mega = __::extend( (object) $mega, (object) $usr_ext );
$q4 = 'SELECT person, officehours, title, picture, education, bio, courses, personal_page, changed FROM webpages WHERE person=' . $mega->id; // personnel=1');
//p2($q3);
$usr_web = single_row_select($q4,0,$c);
//p2($usr_ext);
$mega = __::extend( (object) $mega, (object) $usr_web );
if (!isset($mega->use_dir_photo)) {
$mega->pic_exists = check_dir_photo($mega->first_name, $mega->last_name);
if ($mega->pic_exists) {
$filename = "images_sm/" . name_to_file( $mega->first_name, $mega->last_name );
$mega->bbqueryfix = "UPDATE gavi_personnel_ext SET use_dir_photo=1, dir_photo_path='{$filename}' WHERE id='{$mega->ext_id}'";
} else {
$mega->bbqueryfix = "UPDATE gavi_personnel_ext SET use_dir_photo=0 WHERE id='{$mega->ext_id}'";
}
}
if (! isset($mega->ext_id)) {
$mega->aaqueryfix = "INSERT INTO gavi_personnel_ext (personnel) VALUES('{$mega->id}')"; }
elseif ($mega->id && ! $mega->personnel_id) {
$mega->aaqueryfix = "UPDATE gavi_personnel_ext SET personnel='{$mega->id}' WHERE id='{$mega->ext_id}'"; }
return $mega;
}
function insert_c2($q) {
global $c2;
$result = single_row_insert($q,0,$c2);
return $result; }
function merge_tables() { global $c;
$all_personnel = multi_row_select('SELECT first_name,last_name,department,room,phone_number,email,web_on,id FROM personnel WHERE status IS null OR status=1',0, $c);
$emails = __::pluck($all_personnel, 'email');
//echo json_encode($emails);
//exit();
//$emails = array_slice($emails, 0, 10);
$full = __::map( $emails, get_a_user );
//echo json_encode($full);
//$results = __::map( __::pluck($full,'aaqueryfix'), insert_c2);
//$results = __::pluck($full,'bbqueryfix');
//$results = __::map( $results, insert_c2);
echo json_encode( $full );
exit();
}
if (isset($_REQUEST['merge'])) { merge_tables(); }
//echo json_encode($_FILES);
//echo json_encode($_REQUEST);
// If no arguments were given:
if ($USER_EMAIL) {
// log it as an access
$logaction = log_it("accessed personnel record editor");
$USER->logresult = $logaction;
// Default case is current user data to be embedded in editor page
echo json_encode($USER);
} else {
echo json_encode( array("result"=>"not logged in") );
exit();
}
?>

1235
old/dir_api20211102.php Normal file

File diff suppressed because it is too large Load Diff

94
old/index20211021.php Normal file
View File

@ -0,0 +1,94 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
require 'mAuth.php';
$MY_TITLE = "Personnel Directory Editor";
$MY_CRUMB = "Personnel Directory";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12">
</div>
<div class="pure-u-20-24 content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<a href="/">
<img border="0" class="headerimg" src="graf/bird_logo.png" alt="Gavilan College Intranet" />
</a>
<ul>
<li><a href="#">Edit Directory Info</a></li>
<li style="list-style:none;">&nbsp;</li>
<li><a href="bio.php">Edit Bio Page</a></li>
<li style="list-style:none;">&nbsp;</li>
<!--<li><a href="/pio/events.php"><span>Events Manager</span></a></li>
<li><a href="/pio/events_multi.php"><span>Events (Multiple)</span></a></li>
<li><a href="https://intranet1.gavilan.edu/pio/listevents.php" target="_blank"><span>View All Events</span></a></li>
-->
</ul>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<form class="pure-form pure-form-aligned">
<field table="personnel" qid="first_name" question="First name" :answer="this.user.first_name"></field>
<field table="personnel" qid="last_name" question="Last name" :answer="this.user.last_name"></field>
<field table="personnel" qid="department" question="Department" :answer="this.user.department"></field>
<field table="personnel" qid="phone_number" question="Phone Number" :answer="this.user.phone_number"></field>
<field table="personnel" qid="room" question="Room" :answer="this.user.room"></field>
<checkbox table="personnel_ext" qid="use_dir_photo" question="Publish my photo on staff directory" :answer="this.user.use_dir_photo"></checkbox>
<checkbox table="personnel_ext" qid="general_photo_release" question="I allow Gavilan College to use my directory photo in promotions and publicity." :answer="this.user.general_photo_release"></checkbox>
<div class="pure-controls">
<img class="staffpic" :src="'//www.gavilan.edu/staff/' + this.user.dir_pic_path" />
</div>
<!-- #### NO PIC UPLOADS FOR NOW
<div class="formpush">
<p>Upload a new picture (only small files)</p>
<form action="dir_api_tester.php"
class="dropzone"
id="my-awesome-dropzone"></form>
</div>
-->
<!-- <div id="bio2"></div> -->
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

78
old/list.php Normal file
View File

@ -0,0 +1,78 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$MY_TITLE = "Personnel Directory Index";
$MY_CRUMB = "Personnel Directory";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12">
</div>
<div class="pure-u-20-24 content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<a href="/">
<img border="0" class="headerimg" src="graf/bird_logo.png" alt="Gavilan College Intranet" />
</a>
<ul>
<li><a href="dir.php">Edit Directory Info</a></li>
<li style="list-style:none;">&nbsp;</li>
<li><a href="bio.php">Edit Bio Page</a></li>
<li style="list-style:none;">&nbsp;</li>
<!--<li><a href="/pio/events.php"><span>Events Manager</span></a></li>
<li><a href="/pio/events_multi.php"><span>Events (Multiple)</span></a></li>
<li><a href="https://intranet1.gavilan.edu/pio/listevents.php" target="_blank"><span>View All Events</span></a></li>
-->
</ul>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
Does something need changing? Please email:
<ul><li>Your dept chair</li>
<li>Your dean or division assistant</li>
<li>HR</li>
</ul>
In that order.
<div id="dir_editor" class="listing">
<dirlist></dirlist>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

295
old/test.php Normal file
View File

@ -0,0 +1,295 @@
<style>
/*************************
* GRID SCHEDULE LAYOUT
*************************/
@media screen and (min-width:700px) {
.schedule {
display: grid;
grid-gap: 1em;
grid-template-rows:
[tracks] auto
[time-0800] 0.025fr
[time-0805] 0.025fr
[time-0810] 0.025fr
[time-0815] 0.025fr
[time-0820] 0.025fr
[time-0825] 0.025fr
[time-0830] 0.025fr
[time-0835] 0.025fr
[time-0840] 0.025fr
[time-0845] 0.025fr
[time-0850] 0.025fr
[time-0855] 0.025fr
[time-0900] 0.025fr
[time-0905] 0.025fr
[time-0910] 0.025fr
[time-0915] 0.025fr
[time-0920] 0.025fr
[time-0925] 0.025fr
[time-0930] 0.025fr
[time-0935] 0.025fr
[time-0940] 0.025fr
[time-0945] 0.025fr
[time-0950] 0.025fr
[time-0955] 0.025fr
[time-1000] 0.025fr
[time-1005] 0.025fr
[time-1010] 0.025fr
[time-1015] 0.025fr
[time-1020] 0.025fr
[time-1025] 0.025fr
[time-1030] 0.025fr
[time-1035] 0.025fr
[time-1040] 0.025fr
[time-1045] 0.025fr
[time-1050] 0.025fr
[time-1055] 0.025fr
[time-1100] 0.025fr
[time-1105] 0.025fr
[time-1110] 0.025fr
[time-1115] 0.025fr
[time-1120] 0.025fr
[time-1125] 0.025fr
[time-1130] 0.025fr
[time-1135] 0.025fr
[time-1140] 0.025fr
[time-1145] 0.025fr
[time-1150] 0.025fr
[time-1155] 0.025fr
[time-1200] 0.025fr
[time-1205] 0.025fr
[time-1210] 0.025fr
[time-1215] 0.025fr
[time-1220] 0.025fr
[time-1225] 0.025fr
[time-1230] 0.025fr
[time-1235] 0.025fr
[time-1240] 0.025fr
[time-1245] 0.025fr
[time-1250] 0.025fr
[time-1255] 0.025fr
[time-1300] 0.025fr
[time-1305] 0.025fr
[time-1310] 0.025fr
[time-1315] 0.025fr
[time-1320] 0.025fr
[time-1325] 0.025fr
[time-1330] 0.025fr
[time-1335] 0.025fr
[time-1340] 0.025fr
[time-1345] 0.025fr
[time-1350] 0.025fr
[time-1355] 0.025fr
[time-1400] 0.025fr
[time-1405] 0.025fr
[time-1410] 0.025fr
[time-1415] 0.025fr
[time-1420] 0.025fr
[time-1425] 0.025fr
[time-1430] 0.025fr
[time-1435] 0.025fr
[time-1440] 0.025fr
[time-1445] 0.025fr
[time-1450] 0.025fr
[time-1455] 0.025fr
[time-1500] 0.025fr
[time-1505] 0.025fr
[time-1510] 0.025fr
[time-1515] 0.025fr
[time-1520] 0.025fr
[time-1525] 0.025fr
[time-1530] 0.025fr
[time-1535] 0.025fr
[time-1540] 0.025fr
[time-1545] 0.025fr
[time-1550] 0.025fr
[time-1555] 0.025fr
[time-1600] 0.025fr
[time-1605] 0.025fr
[time-1610] 0.025fr
[time-1615] 0.025fr
[time-1620] 0.025fr
[time-1625] 0.025fr
[time-1630] 0.025fr
[time-1635] 0.025fr
[time-1640] 0.025fr
[time-1645] 0.025fr
[time-1650] 0.025fr
[time-1655] 0.025fr
[time-1700] 0.025fr
[time-1705] 0.025fr
[time-1710] 0.025fr
[time-1715] 0.025fr
[time-1720] 0.025fr
[time-1725] 0.025fr
[time-1730] 0.025fr
[time-1735] 0.025fr
[time-1740] 0.025fr
[time-1745] 0.025fr
[time-1750] 0.025fr
[time-1755] 0.025fr;
/* Note 1:
Use 24hr time for gridline names for simplicity
Note 2: Use "auto" instead of "1fr" for a more compact schedule where height of a slot is not proportional to the session length.
Implementing a "compact" shortcode attribute might make sense for this!
Try 0.5fr for more compact equal rows. I don't quite understand how that works :)
*/
grid-template-columns:
[times] 4em
[track-1-start] 1fr
[track-1-end track-2-start] 1fr
[track-2-end track-3-start] 1fr
[track-3-end track-4-start] 1fr
[track-4-end];
}
}
.time-slot { grid-column: times; }
.track-slot { display: none; }
/* hidden on small screens and browsers without grid support */
@supports(display:grid ) { @media screen and(min-width:700px) {
.track-slot { display: block; padding: 10px 5px 5px; position: sticky; top: 0; z-index: 1000; background-color: rgba(255,255,255,.9); } } }
/* Small-screen & fallback styles */
.session { margin-bottom: 1em; }
@supports(display:grid ) { @media screen and(min-width: 700px) { .session { margin: 0; } } }
/* VISUAL STYLES * Design-y stuff ot particularly important to the demo */
body { padding: 50px; max-width: 1100px; margin: 0 auto; line-height: 1.5; }
.session { padding: .5em; border-radius: 2px; font-size: 14px; }
/* box-shadow: rgba(255,255,255,.6) 1px 1px 0, rgba(0,0,0,.3) 4px 4px 0; */
.session-title, .session-time, .session-track, .session-presenter { display: block; }
.session-title, .time-slot { margin: 0; font-size: 1em; }
.session-title a { color: #fff; text-decoration-style: dotted; &:hover { font-style: italic; }
&:focus { outline: 2px dotted rgba(255,255,255,.8); }
}
.track-slot, .time-slot { font-weight: bold; font-size:.75em; }
.track-1 { background-color: #1259B2; color: #fff; }
.track-2 { background-color: #687f00; color: #fff; }
.track-3 { background-color: #544D69; color: #fff; }
.track-4 { background-color: #c35500; color: #fff; }
.track-all { display: flex; justify-content: center; align-items: center; background: #ccc; color: #000; box-shadow: none; }
.text { max-width: 750px; font-size: 18px; margin: 0 auto 50px; }
.meta { color: #555; font-style: italic; }
.meta a { color: #555; }
hr { margin: 40px 0; }
</style>
<div class="text">
<h1>Conference Schedule with CSS Grid</h1>
<p>Demo for article <a href="https://css-tricks.com/building-a-conference-schedule-with-css-grid/">"Building a Conference Schedule with CSS Grid"</a> on CSS Tricks.<p>
<p><i><small>By <a href="https://MRWweb.com">Mark Root-Wiley</a>.</small></i></p>
<hr>
</div>
<h2 id="schedule-heading">Conference Schedule</h2>
<div class="schedule" aria-labelledby="schedule-heading">
<span class="track-slot" aria-hidden="true" style="grid-column: track-1; grid-row: tracks;">Track 1</span>
<span class="track-slot" aria-hidden="true" style="grid-column: track-2; grid-row: tracks;">Track 2</span>
<span class="track-slot" aria-hidden="true" style="grid-column: track-3; grid-row: tracks;">Track 3</span>
<span class="track-slot" aria-hidden="true" style="grid-column: track-4; grid-row: tracks;">Track 4</span>
<h2 class="time-slot" style="grid-row: time-0800;">8:00am</h2>
<div class="session session-1 track-1" style="grid-column: track-1; grid-row: time-0800 / time-0900;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 9:00</span>
<span class="session-track">Track: 1</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-2 track-2" style="grid-column: track-2; grid-row: time-0800 / time-0830;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 8:30</span>
<span class="session-track">Track: 2</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-3 track-3" style="grid-column: track-3; grid-row: time-0800 / time-0830;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 8:30</span>
<span class="session-track">Track: 3</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-4 track-4" style="grid-column: track-4; grid-row: time-0800 / time-1000;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 10:00</span>
<span class="session-track">Track: 2</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-0830;">8:30am</h2>
<div class="session session-5 track-3" style="grid-column: track-3; grid-row: time-0830 / time-1000;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:30 - 10:00</span>
<span class="session-track">Track: 1</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-0900;">9:00am</h2>
<div class="session session-6 track-1" style="grid-column: track-1-start / track-2-end; grid-row: time-0900 / time-1000;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">9:00 - 10:00</span>
<span class="session-track">Track: 1 & 2</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-1000;">10:00am</h2>
<div class="session session-7 track-all" style="grid-column: track-1-start / track-4-end; grid-row: time-1000 / time-1030;">
<h3 class="session-title">Take a break!</h3>
</div>
<h2 class="time-slot" style="grid-row: time-1030;">10:30am</h2>
<div class="session session-8 track-1" style="grid-column: track-1; grid-row: time-1030 / time-1130;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">10:30 - 11:30</span>
<span class="session-track">Track: 1</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-9 track-2" style="grid-column: track-2-start / track-3-end; grid-row: time-1030 / time-1100;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">10:30 - 11:00</span>
<span class="session-track">Track: 2 & 3</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-10 track-4" style="grid-column: track-4; grid-row: time-1030 / time-1100;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">10:30 - 11:00</span>
<span class="session-track">Track: 4</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-1100;">11:00am</h2>
<div class="session session-11 track-2" style="grid-column: track-2; grid-row: time-1100 / time-1200;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">11:00 - 12:00</span>
<span class="session-track">Track: 2</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-11 track-3" style="grid-column: track-3; grid-row: time-1100 / time-1200;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">11:00 - 12:00</span>
<span class="session-track">Track: 3</span>
<span class="session-presenter">Presenter</span>
</div>
</div>

321
old/test2.php Normal file
View File

@ -0,0 +1,321 @@
<style>
@media screen and (min-width:700px) {
.schedule {
display: grid;
grid-gap: 1em;
grid-template-rows:
[tracks] auto
[time-0800] 0.1fr
[time-0805] 0.1fr
[time-0810] 0.1fr
[time-0815] 0.1fr
[time-0820] 0.1fr
[time-0825] 0.1fr
[time-0830] 0.1fr
[time-0835] 0.1fr
[time-0840] 0.1fr
[time-0845] 0.1fr
[time-0850] 0.1fr
[time-0855] 0.1fr
[time-0900] 0.1fr
[time-0905] 0.1fr
[time-0910] 0.1fr
[time-0915] 0.1fr
[time-0920] 0.1fr
[time-0925] 0.1fr
[time-0930] 0.1fr
[time-0935] 0.1fr
[time-0940] 0.1fr
[time-0945] 0.1fr
[time-0950] 0.1fr
[time-0955] 0.1fr
[time-1000] 0.1fr
[time-1005] 0.1fr
[time-1010] 0.1fr
[time-1015] 0.1fr
[time-1020] 0.1fr
[time-1025] 0.1fr
[time-1030] 0.1fr
[time-1035] 0.1fr
[time-1040] 0.1fr
[time-1045] 0.1fr
[time-1050] 0.1fr
[time-1055] 0.1fr
[time-1100] 0.1fr
[time-1105] 0.1fr
[time-1110] 0.1fr
[time-1115] 0.1fr
[time-1120] 0.1fr
[time-1125] 0.1fr
[time-1130] 0.1fr
[time-1135] 0.1fr
[time-1140] 0.1fr
[time-1145] 0.1fr
[time-1150] 0.1fr
[time-1155] 0.1fr
[time-1200] 0.1fr;
/* Note 1:
Use 24hr time for gridline names for simplicity
Note 2: Use "auto" instead of "1fr" for a more compact schedule where height of a slot is not proportional to the session length. Implementing a "compact" shortcode attribute might make sense for this!
Try 0.5fr for more compact equal rows. I don't quite understand how that works :)
*/
grid-template-columns:
[times] 4em
[track-1-start] 1fr
[track-1-end track-2-start] 1fr
[track-2-end track-3-start] 1fr
[track-3-end track-4-start] 1fr
[track-4-end];
}
}
.time-slot {
grid-column: times;
}
.track-slot {
display: none; /* hidden on small screens and browsers without grid support */
}
@supports( display:grid ) {
@media screen and (min-width:700px) {
.track-slot {
display: block;
padding: 10px 5px 5px;
position: sticky;
top: 0;
z-index: 1000;
background-color: rgba(255,255,255,.9);
}
}
}
/* Small-screen & fallback styles */
.session {
margin-bottom: 1em;
}
@supports( display:grid ) {
@media screen and (min-width: 700px) {
.session {
margin: 0;
}
}
}
/*************************
* VISUAL STYLES
* Design-y stuff ot particularly important to the demo
*************************/
body {
padding: 50px;
max-width: 1100px;
margin: 0 auto;
line-height: 1.5;
}
.session {
padding: .5em;
border-radius: 2px;
font-size: 14px;
box-shadow:
rgba(255,255,255,.6) 1px 1px 0,
rgba(0,0,0,.3) 4px 4px 0;
}
.session-title,
.session-time,
.session-track,
.session-presenter {
display: block;
}
.session-title,
.time-slot {
margin: 0;
font-size: 1em;
}
.session-title a {
color: #fff;
text-decoration-style: dotted;
&:hover {
font-style: italic;
}
&:focus {
outline: 2px dotted rgba(255,255,255,.8);
}
}
.track-slot,
.time-slot {
font-weight: bold;
font-size:.75em;
}
.track-1 {
background-color: #1259B2;
color: #fff;
}
.track-2 {
background-color: #687f00;
color: #fff;
}
.track-3 {
background-color: #544D69;
color: #fff;
}
.track-4 {
background-color: #c35500;
color: #fff;
}
.track-all {
display: flex;
justify-content: center;
align-items: center;
background: #ccc;
color: #000;
box-shadow: none;
}
.text {
max-width: 750px;
font-size: 18px;
margin: 0 auto 50px;
}
.meta {
color: #555;
font-style: italic;
}
.meta a {
color: #555;
}
hr {
margin: 40px 0;
}
</style>
<div class="text">
<h1>Conference Schedule with CSS Grid</h1>
<p>Demo for article <a href="https://css-tricks.com/building-a-conference-schedule-with-css-grid/">"Building a Conference Schedule with CSS Grid"</a> on CSS Tricks.<p>
<p><i><small>By <a href="https://MRWweb.com">Mark Root-Wiley</a>.</small></i></p>
<hr>
</div>
<h2 id="schedule-heading">Conference Schedule</h2>
<div class="schedule" aria-labelledby="schedule-heading">
<span class="track-slot" aria-hidden="true" style="grid-column: track-1; grid-row: tracks;">Track 1</span>
<span class="track-slot" aria-hidden="true" style="grid-column: track-2; grid-row: tracks;">Track 2</span>
<span class="track-slot" aria-hidden="true" style="grid-column: track-3; grid-row: tracks;">Track 3</span>
<span class="track-slot" aria-hidden="true" style="grid-column: track-4; grid-row: tracks;">Track 4</span>
<h2 class="time-slot" style="grid-row: time-0800;">8:00am</h2>
<div class="session session-1 track-1" style="grid-column: track-1; grid-row: time-0800 / time-0900;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 9:00</span>
<span class="session-track">Track: 1</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-2 track-2" style="grid-column: track-2; grid-row: time-0800 / time-0830;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 8:30</span>
<span class="session-track">Track: 2</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-3 track-3" style="grid-column: track-3; grid-row: time-0800 / time-0830;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 8:30</span>
<span class="session-track">Track: 3</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-4 track-4" style="grid-column: track-4; grid-row: time-0800 / time-1000;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 10:00</span>
<span class="session-track">Track: 2</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-0830;">8:30am</h2>
<div class="session session-5 track-3" style="grid-column: track-3; grid-row: time-0830 / time-1000;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:30 - 10:00</span>
<span class="session-track">Track: 1</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-0900;">9:00am</h2>
<div class="session session-6 track-1" style="grid-column: track-1-start / track-2-end; grid-row: time-0900 / time-1000;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">9:00 - 10:00</span>
<span class="session-track">Track: 1 & 2</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-1000;">10:00am</h2>
<div class="session session-7 track-all" style="grid-column: track-1-start / track-4-end; grid-row: time-1000 / time-1030;">
<h3 class="session-title">Take a break!</h3>
</div>
<h2 class="time-slot" style="grid-row: time-1030;">10:30am</h2>
<div class="session session-8 track-1" style="grid-column: track-1; grid-row: time-1030 / time-1130;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">10:30 - 11:30</span>
<span class="session-track">Track: 1</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-9 track-2" style="grid-column: track-2-start / track-3-end; grid-row: time-1030 / time-1100;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">10:30 - 11:00</span>
<span class="session-track">Track: 2 & 3</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-10 track-4" style="grid-column: track-4; grid-row: time-1030 / time-1100;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">10:30 - 11:00</span>
<span class="session-track">Track: 4</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-1100;">11:00am</h2>
<div class="session session-11 track-2" style="grid-column: track-2; grid-row: time-1100 / time-1200;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">11:00 - 12:00</span>
<span class="session-track">Track: 2</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-11 track-3" style="grid-column: track-3; grid-row: time-1100 / time-1200;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">11:00 - 12:00</span>
<span class="session-track">Track: 3</span>
<span class="session-presenter">Presenter</span>
</div>
</div>

192
old/test_sched.php Normal file
View File

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html>
<head>
<title>Conference Schedule</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style> .event-container { background-color: #ccc; padding: 1em; margin:0.25em; border: 1px solid #aaa; }
</style>
</head>
<body>
<div class="container">
<h1>Conference Schedule</h1>
<div class="row">
<div class="col">
<h2>Track 1</h2>
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
</div>
<div class="col">
<h2>Track 2</h2>
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
</div>
<!-- Add more columns for additional tracks -->
<div class="col">
<h2>Track 3</h2>
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
</div>
</div>
</div>
</body>
</html>

94
old/welcome.php Normal file
View File

@ -0,0 +1,94 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$MY_TITLE = "Welcome Letter Editor";
$MY_CRUMB = "Welcome Letters";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12">
</div>
<div class="pure-u-20-24 content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<welcomeletter :teacher_ext_id="this.$root.user.ext_id" mysem="<?php echo $_REQUEST['sem']; ?>" mycrn="<?php echo $_REQUEST['crn']; ?>"></welcomeletter>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script>
var editing_crn = ""
var editing_sem = ""
/* TODO
list my sections if one wasn't given....
*/
</script>
<script src="js/dir_app.js"/></script>
</html>

82
overview.php Normal file
View File

@ -0,0 +1,82 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
include 'semester.php';
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = "Signups Table";
$MY_CRUMB = "Signups";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="content">
<div class="breadcrumb">
<?php echo $CRUMB_START . $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<overview></overview>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 spacer">
&nbsp;
</div>
<div class="pure-u-1-12"></div>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

73
report.php Normal file
View File

@ -0,0 +1,73 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = "Flex / Activities Report";
$MY_CRUMB = "<a href='index.php'>Personnel Directory</a> &gt; Flex Activities";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
if (isset($_GET['s'])) { $FOCUS = $_GET['s'] ; }
else { $FOCUS = "all"; }
if ($FOCUS=="sp22") { $MY_TITLE = "Spring 22 Flex Days"; }
if ($FOCUS=="sp22") { $MY_TITLE = "Fall 22 Flex Days"; }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<activityreport :which="'<?php echo $FOCUS; ?>'"></activityreport>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 spacer">
&nbsp;
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

32
semester.php Normal file
View File

@ -0,0 +1,32 @@
<?php
$m = "08";
$d = "25";
$y = "2023";
if (isset($_REQUEST['m']) ) { $m = $_REQUEST['m']; }
if (isset($_REQUEST['d']) ) { $d = $_REQUEST['d']; }
if (isset($_REQUEST['y']) ) { $y = $_REQUEST['y']; }
$day = $y . "-" . $m . "-" . $d;
$dateObj = DateTime::createFromFormat('!m', $m);
$monthName = $dateObj->format('F'); // March
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
//if (isset($_GET['s'])) { $FOCUS = "'" . $_GET['s'] . "'"; }
if (isset($_GET['s'])) { $FOCUS = $_GET['s'] ; }
else { $FOCUS = "all"; }
if ($FOCUS=="sp22") { $MY_TITLE = "Spring 22 Flex Days"; }
if ($FOCUS=="fa22") { $MY_TITLE = "Fall 22 Convocation - All Activities"; }
if ($FOCUS=="sp23") { $MY_TITLE = "Spring 23 Flex Days"; }
if ($FOCUS=="fa23") { $MY_TITLE = "Fall 2023 Convocation Day"; }
if ($FOCUS=="sp24") { $MY_TITLE = "Spring 24 Flex Days"; }
if ($FOCUS=="fa24") { $MY_TITLE = "Fall 2024 Convocation Day"; }
$CRUMB_START = "<a href='index.php'>Convocation and Flex Days</a> &gt; ";

74
sessions.php Normal file
View File

@ -0,0 +1,74 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = "Events, Training, & Workshops";
$MY_CRUMB = "<a href='index.php'>Staff</a> &gt; Activities &gt; Editor";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
if (isset($_GET['s'])) { $FOCUS = "'" . $_GET['s'] . "'"; }
else { $FOCUS = "'all'"; }
if ($FOCUS=="'sp22'") { $MY_TITLE = "Spring 22 Flex Days"; }
if ($FOCUS=="'fa22'") { $MY_TITLE = "Fall 22 Convocation - All Activities"; }
if ($FOCUS=="'sp23'") { $MY_TITLE = "Spring 23 Flex Days"; }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="js/vue27max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<activityeditorlist></activityeditorlist>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 spacer">
&nbsp;
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

81
settings.php Normal file
View File

@ -0,0 +1,81 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
include 'semester.php';
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = "Settings";
$MY_CRUMB = "Admin";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="content">
<div class="breadcrumb">
<?php echo $CRUMB_START . $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<h3>Settings</h3>
<settings></settings>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 spacer">
&nbsp;
</div>
<div class="pure-u-1-12"></div>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

165
static.php Normal file
View File

@ -0,0 +1,165 @@
<div class="activitylist">
<div>
<div class="pure-g">
<div class="day_title pure-u-1-1">Aug 24 2023 Optional Day</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Ethnic Studies: Window into African-American Studies</strong><br /> 9:00am / online<br /> Zoom Link: <a href="https://gavilan-edu.zoom.us/j/89887870942">https://gavilan-edu.zoom.us/j/89887870942</a><br /><br />
<div>This session is an expansion of our Ethnic Studies curriculum. African American History is one of two Gavilan College crosslisted classes approved by the CSU to meet the Area F Ethnic Studies graduation requirement.&nbsp;</div>
<div>All are invited to become Ethnic Studies students in Max Speare's African American History Zoom classroom. Max is an associate faculty member of History at Saddleback College whose research engages with the relationship between race, death, and slavery in early New York City. His teaching centers the histories of African Americans, Indigenous peoples, and women in American history and ethnic studies.</div>
</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Mental Health First Aid</strong><br /> 9:00am / inperson<br /> Location: BU 120<br /><br />
<div>Student Health Services is proud to announce our first in-house Mental Health First Aid (MHFA) training. This course is open to all Gavilan employees and student workers. This is blended course format, which consists of 2-hours self-paced online learning prior to the 5 hour in-person training taught by Jessica Weiler and Ryan Shook, MHFA certified instructors.</div>
<div><strong><a href="https://forms.office.com/pages/responsepage.aspx?id=wwnWSlaRiUuUlgwGAK6wu561rswSfl1Ak-wk8wIkjEBUQzFGOENYRTlYSVFVUzBUWVdRRFNNQ1JaVi4u">Use this link to pre-register</a></strong>. Please register by August 22nd. Space is limited!</div>
<div>What is Mental Health First Aid and what does it teach?</div>
<div>
<ul>
<li>Mental Health First Aid is a three-year certification.</li>
<li>MHFA is a skills-based training that teaches people how to identify, understand and respond to the signs and symptoms of a mental health or substance use challenge.</li>
<li>Similar to physical First Aid and CPR, MHFA helps you assist someone experiencing a mental health or substance use crisis is resolved.</li>
<li>Mental Health First Aiders learn a 5-step Action Plan to recognize warning signs of a mental health or substance use challenge, provide help in a crisis and non-crisis situations and understand where to turn for additional assistance.</li>
</ul>
</div>
</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Security: Reporters and video rights &amp; responsibilities</strong><br /> 1:00pm / online<br /></div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Benefits</strong><br /> 2:10pm / online<br /> Zoom Link: <a href="https://gavilan-edu.zoom.us/j/85231706472">https://gavilan-edu.zoom.us/j/85231706472</a><br /><br />
<div>Join Human Resources Analyst, Michaela Gonzalez, to learn about the health benefits offered to employees. This workshop will cover the following health benefits:&nbsp;Medical, dental, vision, life insurance, voluntary insurance plans, employee assistance program, and other benefit enhancements.</div>
<div>In addition, we will review changes in medical benefit rates, which go into effect October 1, 2023 for the start of our new medical plan year.</div>
</div>
</div>
</div>
</div>
<div>
<div class="pure-g">
<div class="day_title pure-u-1-1">Aug 25 2023 Fall 2023 Convocation Day</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Fall 2023 Convocation Day</strong><br /> 9:00am / hybrid<br /> Location: Gavilan Theater<br /><br />
<div>Join us for the morning session and kick off the Fall 2023 semester.</div>
</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>GCFA Lunch</strong><br /> 11:50am / inperson<br /><br /> For all faculty - not just GCFA members</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Open House: El Centro</strong><br /> 1:00pm / inperson<br /> Location: LIB 139<br /><br />
<div>Familiarize yourself with student resources and services that are key to student success such as food, housing, laptop loan, study space, transportation, and more! Note: El Centro sits up to 20 people. We will be staying open until 3:00. El Centro is located in Library 139. The door faces the CDC building.</div>
</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Bridging the Gap Between ESL Noncredit Students to Gavilan College</strong><br /> 1:00pm / online<br /> Zoom Link: <a href="https://gavilan-edu.zoom.us/j/6162432432">https://gavilan-edu.zoom.us/j/6162432432</a><br /><br />
<div>Gavilan College has one of the most robust Noncredit programming from our neighboring community colleges. Our students are learning English for personal growth, better job opportunities, or continuing their education. But what is keeping them from transferring to our credit classes and program? Hear about our student experiences and learn what you can do best to support our students.</div>
</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Marketing Branding/Graphic Standards</strong><br /> 1:00pm / online<br /><br />
<div>In this very interactive session, you will learn about college branding and graphic standards that lead to the college&rsquo;s success with campaigns. You will learn about the 3 key components of a successful brand and graphics. This session is taught with a cognitive digital lens and what about a brand and graphics attracts audiences to take actions.</div>
</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Discovery Counseling Center: Trauma-Informed Care</strong><br /> 1:00pm / online<br /> Zoom Link: <a href="https://gavilan-edu.zoom.us/j/6925203873">https://gavilan-edu.zoom.us/j/6925203873</a><br /><br />
<div>A trauma-informed care approach equips educators and support staff with strategies, skills and tools to better engage those with complex trauma. This workshop will focus on understanding how trauma impacts individuals and how to create a trauma-sensitive learning environment with the goal of equity and inclusion. It is our hope for faculty and staff to be provided with information and support to continue to develop their lens of tools and resources that enable them to foster and maintain effective student relationships and compassion through education.&nbsp;</div>
</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Decolonizing Pedagogy Book Group/Club</strong><br /> 1:00pm / hybrid<br /> Location: SS 205<br /><br />
<div>Decolonizing Education Reading Group Kick-Off:&nbsp;Join us for session one of a two-part reading and discussion group forming at convocation this fall.</div>
<div>We'll be introducing Linda Tuhiwai Smith&rsquo;s outstanding book <em>Decolonizing Methodologies: Research and Indigenous Peoples</em>.</div>
<div>Please join us if you want to:</div>
<div>
<ul>
<li>learn more about the power and importance of education and its impacts from an indigenous and decolonizing perspective</li>
<li>enjoy meaningful discussion about true histories and how they shape our ideas about learning</li>
<li>connect and relate to other people here at Gavilan College in ways that promote healing</li>
</ul>
</div>
</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Film Showcase - Highlights and Discussion</strong><br /> 1:00pm / hybrid<br /> Location: SS 214<br /> Zoom Link: <a href="https://gavilan-edu.zoom.us/j/87383508314?pwd=dHd4aU1Gck55U1IvVXVybmtNTTZodz09">https://gavilan-edu.zoom.us/j/87383508314?pwd=dHd4aU1Gck55U1IvVXVybmtNTTZodz09</a><br /><br /> Show highlights of the film showcase and discuss how we can cover support our work and cover Gav Events.</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>What Does it Mean to be an HSI?</strong><br /> 2:10pm / hybrid<br /> Location: SS 205<br /><br /> How do we help foster a sense of belonging and care among our underrepresented students&ndash;both in STEM and across the disciplines? How do we reach out to students who might flourish in STEM to take STEM classes? How do we help first-generation, low-income students be successful in STEM? Come and hear answers to these questions and more from a panel of STEM alumni.</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Introduction to the Hyflex Classroom</strong><br /> 2:10pm / hybrid<br /> Location: TLC (2nd floor Library)<br /> Zoom Link: <a href="https://gavilan-edu.zoom.us/my/sabrinalawrence">https://gavilan-edu.zoom.us/my/sabrinalawrence</a><br /><br /> Interested in teaching a hyflex course? Come to this session to learn about the benefits and challenges about conducting a successful course in this environment. You can access this session either through Zoom or in-person at the TLC.</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Discovery Counseling Center: DSPS/AEC Emphasis</strong><br /> 2:10pm / online<br /> Zoom Link: <a href="https://gavilan-edu.zoom.us/j/6925203873">https://gavilan-edu.zoom.us/j/6925203873</a><br /><br />
<div>Dis/ability. How can we commit to promoting access and quality mental health care for students? This workshop will focus on providing information about working with students with dis/abilities in order to reduce treatment barriers and increase accessibility. It will also provide basic information of mental health conditions that often coincide with disability diagnoses and offer information and tools to support your teaching and the student&rsquo;s learning.&nbsp;</div>
</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Meeting student leaders: making Pottery in Community</strong><br /> 2:10pm / inperson<br /> Location: ART 101<br /><br />
<div>Have you ever wanted to make your own ceramic cup or bowl? We would like to simultaneously introduce you Gavilan's student leaders, while building your own clay creations. Max Rain will give a 15-20 minute demonstration on pinch pot and slab construction techniques, and then for the remainder of the hour you will be able to enjoy conversation with incredible students while creating your own cup, mug, or bowl. There will also be short demos on various ways to texture your vessel, and how to make a functional handle. You can choose between 6 different glaze colors, and your creations will be fired, glazed, and available for you to pick up in September. Connect with students and your own creativity in a great way to end the day!</div>
</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Affinity Groups</strong><br /> 2:10pm / online<br /> Zoom Link: <a href="https://gavilan-edu.zoom.us/j/89887870942">https://gavilan-edu.zoom.us/j/89887870942</a><br /><br /> Join an affinity group and connect with your Gavilan Community. Imagine a Gavilan College where diverse groups of staff and faculty gather to support each other, create events, and contribute to campus equity and inclusion efforts. Please join Lucy Alvarez and Christina Salvin if you are interested in being a part of what the high-tech world calls Employee Resource Groups (ERGs) and some community colleges call Affinity Groups&ndash;i.e. Latinx, Asian American, African American, LGBTQ+, Women, Neuro-Diverse, Military. Let&rsquo;s get our groups going!</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Higher Aspirations</strong><br /> 3:20pm / online<br /><br /> Did you know that Gavilan College has a program to support students impacted by the criminal justice system? Join this session to learn more about Gavilan's Higher Aspirations program, direct services available, partnering agencies, and how you can become an ally!</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Office and Outlook</strong><br /> 3:20pm / online<br /> Zoom Link: <a href="https://zoom.us/my/phowell">https://zoom.us/my/phowell</a><br /><br /> Get up to speed with the useful new features of MS Office. An overview of the cloud, staying organized, sharing docs, viewing revisions, using onedrive, email tips, and more.</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>How We Think About Our Students</strong><br /> 3:20pm / inperson<br /><br /> Let's talk about how we perceive our students, what informs those perceptions, and how those perceptions impact how we make sense of their performance in class. What do we assume about them? What emotions do they bring up within us? These questions, along with concepts such as deficit thinking, assets-based thinking, and attribution theory will serve as the structure to what promises to be a meaningful conversation.</div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>Followup Q&amp;A with Keynote Speaker</strong><br /> 3:20pm / hybrid<br /> Location: SS 205<br /></div>
</div>
</div>
<div class="activitylist">
<div class="pure-g pure-form">
<div class="pure-u-19-24"><strong>ANYONE DOWN FOR SOME SPORTS FUN?</strong><br /> 3:20pm / inperson<br /> Location: Gym<br /><br /> Come learn about the intricacies and uniqueness of being a student-athlete at the community college level. Hear directly from our student-athlete and the staff who support their vision. Our panel will enlighten you on the day-to-day life of a student-athlete at Gavilan College. Bring your questions! Then, cool down with some hoops, volleyball, and corn hole and other fun. Lucky winners will take home some Gav Swag. Meet us in the GYM. GO RAMS!</div>
</div>
</div>
</div>
</div>

76
survey.php Normal file
View File

@ -0,0 +1,76 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$server = $_SERVER['SERVER_NAME'];
if ( $server == 'intranet1.gavilan.edu') {
require 'mAuth.php';
// set a session cookie so our api requests don't get mucked up ...
session_start();
$USER_TYPE = $attributes['http://wso2.org/claims/Roles'][0];
$USER_GOO = $attributes['http://wso2.org/claims/uid'][0];
$USER_EMAIL = $attributes['http://wso2.org/claims/emailaddress'][0];
$_SESSION['USER_TYPE'] = $USER_TYPE;
$_SESSION['USER_GOO'] = $USER_GOO;
$_SESSION['USER_EMAIL'] = $USER_EMAIL;
}
$MY_TITLE = "Survey";
$MY_CRUMB = "<a href='index.php'>Personnel Directory</a> &gt; Flex Activities";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
if (isset($_GET['s'])) { $FOCUS = $_GET['s'] ; }
else { $FOCUS = "all"; }
if ($FOCUS=="sp22") { $MY_TITLE = "Spring 22 Flex Days"; }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12">
</div>
<div class="pure-u-20-24 content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<asksurvey :id="'<?php echo $FOCUS; ?>'"></asksurvey>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 spacer">
&nbsp;
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script src="js/dir_app.js"/></script>
</html>

295
test.php Normal file
View File

@ -0,0 +1,295 @@
<style>
/*************************
* GRID SCHEDULE LAYOUT
*************************/
@media screen and (min-width:700px) {
.schedule {
display: grid;
grid-gap: 1em;
grid-template-rows:
[tracks] auto
[time-0800] 0.025fr
[time-0805] 0.025fr
[time-0810] 0.025fr
[time-0815] 0.025fr
[time-0820] 0.025fr
[time-0825] 0.025fr
[time-0830] 0.025fr
[time-0835] 0.025fr
[time-0840] 0.025fr
[time-0845] 0.025fr
[time-0850] 0.025fr
[time-0855] 0.025fr
[time-0900] 0.025fr
[time-0905] 0.025fr
[time-0910] 0.025fr
[time-0915] 0.025fr
[time-0920] 0.025fr
[time-0925] 0.025fr
[time-0930] 0.025fr
[time-0935] 0.025fr
[time-0940] 0.025fr
[time-0945] 0.025fr
[time-0950] 0.025fr
[time-0955] 0.025fr
[time-1000] 0.025fr
[time-1005] 0.025fr
[time-1010] 0.025fr
[time-1015] 0.025fr
[time-1020] 0.025fr
[time-1025] 0.025fr
[time-1030] 0.025fr
[time-1035] 0.025fr
[time-1040] 0.025fr
[time-1045] 0.025fr
[time-1050] 0.025fr
[time-1055] 0.025fr
[time-1100] 0.025fr
[time-1105] 0.025fr
[time-1110] 0.025fr
[time-1115] 0.025fr
[time-1120] 0.025fr
[time-1125] 0.025fr
[time-1130] 0.025fr
[time-1135] 0.025fr
[time-1140] 0.025fr
[time-1145] 0.025fr
[time-1150] 0.025fr
[time-1155] 0.025fr
[time-1200] 0.025fr
[time-1205] 0.025fr
[time-1210] 0.025fr
[time-1215] 0.025fr
[time-1220] 0.025fr
[time-1225] 0.025fr
[time-1230] 0.025fr
[time-1235] 0.025fr
[time-1240] 0.025fr
[time-1245] 0.025fr
[time-1250] 0.025fr
[time-1255] 0.025fr
[time-1300] 0.025fr
[time-1305] 0.025fr
[time-1310] 0.025fr
[time-1315] 0.025fr
[time-1320] 0.025fr
[time-1325] 0.025fr
[time-1330] 0.025fr
[time-1335] 0.025fr
[time-1340] 0.025fr
[time-1345] 0.025fr
[time-1350] 0.025fr
[time-1355] 0.025fr
[time-1400] 0.025fr
[time-1405] 0.025fr
[time-1410] 0.025fr
[time-1415] 0.025fr
[time-1420] 0.025fr
[time-1425] 0.025fr
[time-1430] 0.025fr
[time-1435] 0.025fr
[time-1440] 0.025fr
[time-1445] 0.025fr
[time-1450] 0.025fr
[time-1455] 0.025fr
[time-1500] 0.025fr
[time-1505] 0.025fr
[time-1510] 0.025fr
[time-1515] 0.025fr
[time-1520] 0.025fr
[time-1525] 0.025fr
[time-1530] 0.025fr
[time-1535] 0.025fr
[time-1540] 0.025fr
[time-1545] 0.025fr
[time-1550] 0.025fr
[time-1555] 0.025fr
[time-1600] 0.025fr
[time-1605] 0.025fr
[time-1610] 0.025fr
[time-1615] 0.025fr
[time-1620] 0.025fr
[time-1625] 0.025fr
[time-1630] 0.025fr
[time-1635] 0.025fr
[time-1640] 0.025fr
[time-1645] 0.025fr
[time-1650] 0.025fr
[time-1655] 0.025fr
[time-1700] 0.025fr
[time-1705] 0.025fr
[time-1710] 0.025fr
[time-1715] 0.025fr
[time-1720] 0.025fr
[time-1725] 0.025fr
[time-1730] 0.025fr
[time-1735] 0.025fr
[time-1740] 0.025fr
[time-1745] 0.025fr
[time-1750] 0.025fr
[time-1755] 0.025fr;
/* Note 1:
Use 24hr time for gridline names for simplicity
Note 2: Use "auto" instead of "1fr" for a more compact schedule where height of a slot is not proportional to the session length.
Implementing a "compact" shortcode attribute might make sense for this!
Try 0.5fr for more compact equal rows. I don't quite understand how that works :)
*/
grid-template-columns:
[times] 4em
[track-1-start] 1fr
[track-1-end track-2-start] 1fr
[track-2-end track-3-start] 1fr
[track-3-end track-4-start] 1fr
[track-4-end];
}
}
.time-slot { grid-column: times; }
.track-slot { display: none; }
/* hidden on small screens and browsers without grid support */
@supports(display:grid ) { @media screen and(min-width:700px) {
.track-slot { display: block; padding: 10px 5px 5px; position: sticky; top: 0; z-index: 1000; background-color: rgba(255,255,255,.9); } } }
/* Small-screen & fallback styles */
.session { margin-bottom: 1em; }
@supports(display:grid ) { @media screen and(min-width: 700px) { .session { margin: 0; } } }
/* VISUAL STYLES * Design-y stuff ot particularly important to the demo */
body { padding: 50px; max-width: 1100px; margin: 0 auto; line-height: 1.5; }
.session { padding: .5em; border-radius: 2px; font-size: 14px; }
/* box-shadow: rgba(255,255,255,.6) 1px 1px 0, rgba(0,0,0,.3) 4px 4px 0; */
.session-title, .session-time, .session-track, .session-presenter { display: block; }
.session-title, .time-slot { margin: 0; font-size: 1em; }
.session-title a { color: #fff; text-decoration-style: dotted; &:hover { font-style: italic; }
&:focus { outline: 2px dotted rgba(255,255,255,.8); }
}
.track-slot, .time-slot { font-weight: bold; font-size:.75em; }
.track-1 { background-color: #1259B2; color: #fff; }
.track-2 { background-color: #687f00; color: #fff; }
.track-3 { background-color: #544D69; color: #fff; }
.track-4 { background-color: #c35500; color: #fff; }
.track-all { display: flex; justify-content: center; align-items: center; background: #ccc; color: #000; box-shadow: none; }
.text { max-width: 750px; font-size: 18px; margin: 0 auto 50px; }
.meta { color: #555; font-style: italic; }
.meta a { color: #555; }
hr { margin: 40px 0; }
</style>
<div class="text">
<h1>Conference Schedule with CSS Grid</h1>
<p>Demo for article <a href="https://css-tricks.com/building-a-conference-schedule-with-css-grid/">"Building a Conference Schedule with CSS Grid"</a> on CSS Tricks.<p>
<p><i><small>By <a href="https://MRWweb.com">Mark Root-Wiley</a>.</small></i></p>
<hr>
</div>
<h2 id="schedule-heading">Conference Schedule</h2>
<div class="schedule" aria-labelledby="schedule-heading">
<span class="track-slot" aria-hidden="true" style="grid-column: track-1; grid-row: tracks;">Track 1</span>
<span class="track-slot" aria-hidden="true" style="grid-column: track-2; grid-row: tracks;">Track 2</span>
<span class="track-slot" aria-hidden="true" style="grid-column: track-3; grid-row: tracks;">Track 3</span>
<span class="track-slot" aria-hidden="true" style="grid-column: track-4; grid-row: tracks;">Track 4</span>
<h2 class="time-slot" style="grid-row: time-0800;">8:00am</h2>
<div class="session session-1 track-1" style="grid-column: track-1; grid-row: time-0800 / time-0900;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 9:00</span>
<span class="session-track">Track: 1</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-2 track-2" style="grid-column: track-2; grid-row: time-0800 / time-0830;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 8:30</span>
<span class="session-track">Track: 2</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-3 track-3" style="grid-column: track-3; grid-row: time-0800 / time-0830;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 8:30</span>
<span class="session-track">Track: 3</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-4 track-4" style="grid-column: track-4; grid-row: time-0800 / time-1000;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 10:00</span>
<span class="session-track">Track: 2</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-0830;">8:30am</h2>
<div class="session session-5 track-3" style="grid-column: track-3; grid-row: time-0830 / time-1000;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:30 - 10:00</span>
<span class="session-track">Track: 1</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-0900;">9:00am</h2>
<div class="session session-6 track-1" style="grid-column: track-1-start / track-2-end; grid-row: time-0900 / time-1000;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">9:00 - 10:00</span>
<span class="session-track">Track: 1 & 2</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-1000;">10:00am</h2>
<div class="session session-7 track-all" style="grid-column: track-1-start / track-4-end; grid-row: time-1000 / time-1030;">
<h3 class="session-title">Take a break!</h3>
</div>
<h2 class="time-slot" style="grid-row: time-1030;">10:30am</h2>
<div class="session session-8 track-1" style="grid-column: track-1; grid-row: time-1030 / time-1130;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">10:30 - 11:30</span>
<span class="session-track">Track: 1</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-9 track-2" style="grid-column: track-2-start / track-3-end; grid-row: time-1030 / time-1100;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">10:30 - 11:00</span>
<span class="session-track">Track: 2 & 3</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-10 track-4" style="grid-column: track-4; grid-row: time-1030 / time-1100;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">10:30 - 11:00</span>
<span class="session-track">Track: 4</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-1100;">11:00am</h2>
<div class="session session-11 track-2" style="grid-column: track-2; grid-row: time-1100 / time-1200;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">11:00 - 12:00</span>
<span class="session-track">Track: 2</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-11 track-3" style="grid-column: track-3; grid-row: time-1100 / time-1200;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">11:00 - 12:00</span>
<span class="session-track">Track: 3</span>
<span class="session-presenter">Presenter</span>
</div>
</div>

321
test2.php Normal file
View File

@ -0,0 +1,321 @@
<style>
@media screen and (min-width:700px) {
.schedule {
display: grid;
grid-gap: 1em;
grid-template-rows:
[tracks] auto
[time-0800] 0.1fr
[time-0805] 0.1fr
[time-0810] 0.1fr
[time-0815] 0.1fr
[time-0820] 0.1fr
[time-0825] 0.1fr
[time-0830] 0.1fr
[time-0835] 0.1fr
[time-0840] 0.1fr
[time-0845] 0.1fr
[time-0850] 0.1fr
[time-0855] 0.1fr
[time-0900] 0.1fr
[time-0905] 0.1fr
[time-0910] 0.1fr
[time-0915] 0.1fr
[time-0920] 0.1fr
[time-0925] 0.1fr
[time-0930] 0.1fr
[time-0935] 0.1fr
[time-0940] 0.1fr
[time-0945] 0.1fr
[time-0950] 0.1fr
[time-0955] 0.1fr
[time-1000] 0.1fr
[time-1005] 0.1fr
[time-1010] 0.1fr
[time-1015] 0.1fr
[time-1020] 0.1fr
[time-1025] 0.1fr
[time-1030] 0.1fr
[time-1035] 0.1fr
[time-1040] 0.1fr
[time-1045] 0.1fr
[time-1050] 0.1fr
[time-1055] 0.1fr
[time-1100] 0.1fr
[time-1105] 0.1fr
[time-1110] 0.1fr
[time-1115] 0.1fr
[time-1120] 0.1fr
[time-1125] 0.1fr
[time-1130] 0.1fr
[time-1135] 0.1fr
[time-1140] 0.1fr
[time-1145] 0.1fr
[time-1150] 0.1fr
[time-1155] 0.1fr
[time-1200] 0.1fr;
/* Note 1:
Use 24hr time for gridline names for simplicity
Note 2: Use "auto" instead of "1fr" for a more compact schedule where height of a slot is not proportional to the session length. Implementing a "compact" shortcode attribute might make sense for this!
Try 0.5fr for more compact equal rows. I don't quite understand how that works :)
*/
grid-template-columns:
[times] 4em
[track-1-start] 1fr
[track-1-end track-2-start] 1fr
[track-2-end track-3-start] 1fr
[track-3-end track-4-start] 1fr
[track-4-end];
}
}
.time-slot {
grid-column: times;
}
.track-slot {
display: none; /* hidden on small screens and browsers without grid support */
}
@supports( display:grid ) {
@media screen and (min-width:700px) {
.track-slot {
display: block;
padding: 10px 5px 5px;
position: sticky;
top: 0;
z-index: 1000;
background-color: rgba(255,255,255,.9);
}
}
}
/* Small-screen & fallback styles */
.session {
margin-bottom: 1em;
}
@supports( display:grid ) {
@media screen and (min-width: 700px) {
.session {
margin: 0;
}
}
}
/*************************
* VISUAL STYLES
* Design-y stuff ot particularly important to the demo
*************************/
body {
padding: 50px;
max-width: 1100px;
margin: 0 auto;
line-height: 1.5;
}
.session {
padding: .5em;
border-radius: 2px;
font-size: 14px;
box-shadow:
rgba(255,255,255,.6) 1px 1px 0,
rgba(0,0,0,.3) 4px 4px 0;
}
.session-title,
.session-time,
.session-track,
.session-presenter {
display: block;
}
.session-title,
.time-slot {
margin: 0;
font-size: 1em;
}
.session-title a {
color: #fff;
text-decoration-style: dotted;
&:hover {
font-style: italic;
}
&:focus {
outline: 2px dotted rgba(255,255,255,.8);
}
}
.track-slot,
.time-slot {
font-weight: bold;
font-size:.75em;
}
.track-1 {
background-color: #1259B2;
color: #fff;
}
.track-2 {
background-color: #687f00;
color: #fff;
}
.track-3 {
background-color: #544D69;
color: #fff;
}
.track-4 {
background-color: #c35500;
color: #fff;
}
.track-all {
display: flex;
justify-content: center;
align-items: center;
background: #ccc;
color: #000;
box-shadow: none;
}
.text {
max-width: 750px;
font-size: 18px;
margin: 0 auto 50px;
}
.meta {
color: #555;
font-style: italic;
}
.meta a {
color: #555;
}
hr {
margin: 40px 0;
}
</style>
<div class="text">
<h1>Conference Schedule with CSS Grid</h1>
<p>Demo for article <a href="https://css-tricks.com/building-a-conference-schedule-with-css-grid/">"Building a Conference Schedule with CSS Grid"</a> on CSS Tricks.<p>
<p><i><small>By <a href="https://MRWweb.com">Mark Root-Wiley</a>.</small></i></p>
<hr>
</div>
<h2 id="schedule-heading">Conference Schedule</h2>
<div class="schedule" aria-labelledby="schedule-heading">
<span class="track-slot" aria-hidden="true" style="grid-column: track-1; grid-row: tracks;">Track 1</span>
<span class="track-slot" aria-hidden="true" style="grid-column: track-2; grid-row: tracks;">Track 2</span>
<span class="track-slot" aria-hidden="true" style="grid-column: track-3; grid-row: tracks;">Track 3</span>
<span class="track-slot" aria-hidden="true" style="grid-column: track-4; grid-row: tracks;">Track 4</span>
<h2 class="time-slot" style="grid-row: time-0800;">8:00am</h2>
<div class="session session-1 track-1" style="grid-column: track-1; grid-row: time-0800 / time-0900;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 9:00</span>
<span class="session-track">Track: 1</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-2 track-2" style="grid-column: track-2; grid-row: time-0800 / time-0830;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 8:30</span>
<span class="session-track">Track: 2</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-3 track-3" style="grid-column: track-3; grid-row: time-0800 / time-0830;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 8:30</span>
<span class="session-track">Track: 3</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-4 track-4" style="grid-column: track-4; grid-row: time-0800 / time-1000;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:00 - 10:00</span>
<span class="session-track">Track: 2</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-0830;">8:30am</h2>
<div class="session session-5 track-3" style="grid-column: track-3; grid-row: time-0830 / time-1000;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">8:30 - 10:00</span>
<span class="session-track">Track: 1</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-0900;">9:00am</h2>
<div class="session session-6 track-1" style="grid-column: track-1-start / track-2-end; grid-row: time-0900 / time-1000;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">9:00 - 10:00</span>
<span class="session-track">Track: 1 & 2</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-1000;">10:00am</h2>
<div class="session session-7 track-all" style="grid-column: track-1-start / track-4-end; grid-row: time-1000 / time-1030;">
<h3 class="session-title">Take a break!</h3>
</div>
<h2 class="time-slot" style="grid-row: time-1030;">10:30am</h2>
<div class="session session-8 track-1" style="grid-column: track-1; grid-row: time-1030 / time-1130;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">10:30 - 11:30</span>
<span class="session-track">Track: 1</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-9 track-2" style="grid-column: track-2-start / track-3-end; grid-row: time-1030 / time-1100;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">10:30 - 11:00</span>
<span class="session-track">Track: 2 & 3</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-10 track-4" style="grid-column: track-4; grid-row: time-1030 / time-1100;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">10:30 - 11:00</span>
<span class="session-track">Track: 4</span>
<span class="session-presenter">Presenter</span>
</div>
<h2 class="time-slot" style="grid-row: time-1100;">11:00am</h2>
<div class="session session-11 track-2" style="grid-column: track-2; grid-row: time-1100 / time-1200;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">11:00 - 12:00</span>
<span class="session-track">Track: 2</span>
<span class="session-presenter">Presenter</span>
</div>
<div class="session session-11 track-3" style="grid-column: track-3; grid-row: time-1100 / time-1200;">
<h3 class="session-title"><a href="#">Talk Title</a></h3>
<span class="session-time">11:00 - 12:00</span>
<span class="session-track">Track: 3</span>
<span class="session-presenter">Presenter</span>
</div>
</div>

192
test_sched.php Normal file
View File

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html>
<head>
<title>Conference Schedule</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style> .event-container { background-color: #ccc; padding: 1em; margin:0.25em; border: 1px solid #aaa; }
</style>
</head>
<body>
<div class="container">
<h1>Conference Schedule</h1>
<div class="row">
<div class="col">
<h2>Track 1</h2>
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
</div>
<div class="col">
<h2>Track 2</h2>
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
</div>
<!-- Add more columns for additional tracks -->
<div class="col">
<h2>Track 3</h2>
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
<div class="event-container">
<div class="time-slot">12:00 PM</div>
<div class="event">Event Title 1</div>
<div class="event-description">Description of Event 1</div>
</div>
<div class="event-container">
<div class="time-slot">1:10 PM</div>
<div class="event">Event Title 2</div>
<div class="event-description">Description of Event 2</div>
</div>
<!-- Add more time slots and events as needed -->
</div>
</div>
</div>
</body>
</html>

1120
underscore.php Normal file

File diff suppressed because it is too large Load Diff

94
welcome.php Normal file
View File

@ -0,0 +1,94 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="utf-8" />
<?php
$MY_TITLE = "Welcome Letter Editor";
$MY_CRUMB = "Welcome Letters";
$MY_PATH = $_SERVER['PHP_SELF'];
$MOD_DATE = '(?)';
if (file_exists(__FILE__)) { $MOD_DATE = date ("F d Y H:i:s.", filemtime(__FILE__)); }
?>
<!--<script src="/_files/js/vendor/vue2.6.min.js"></script>-->
<script src="js/intranet_libs.js"/></script>
<script src="//www.gavilan.edu/_files/js/vendor/vue2.6.max.js"/></script>
<head>
<link rel="stylesheet" type="text/css" href="css/intranet2021.css" />
<title>Gavilan Intranet -&gt; <?php echo $MY_TITLE; ?></title>
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12">
</div>
<div class="pure-u-20-24 content">
<div class="breadcrumb">
<a href="/">Gavilan Intranet</a> &gt; <?php echo $MY_CRUMB; ?>
</div>
<div class="pure-g layout-with-nav">
<div class=" pure-u-1-6 navigation">
<?php require 'nav.php'; ?>
</div>
<div class=" pure-u-19-24 main-content">
<h1 class="main_header"><?php echo $MY_TITLE; ?></h1>
<div id="dir_editor">
<welcomeletter :teacher_ext_id="this.$root.user.ext_id" mysem="<?php echo $_REQUEST['sem']; ?>" mycrn="<?php echo $_REQUEST['crn']; ?>"></welcomeletter>
</div>
</div>
</div>
<div class="pure-u-1-12">
</div>
</div>
<br clear="all"/>
</div>
<div class="pure-g">
<div class="pure-u-1-12"></div>
<div class="pure-u-20-24 footer">
Please send comments or questions to
<a href="mailto:webmaster@gavilan.edu">webmaster@gavilan.edu</a><br/>
Address of this page is
<a href="https://intranet1.gavilan.edu<?php echo $MY_PATH; ?>">https://intranet1.gavilan.edu<?php echo $MY_PATH; ?></a><br/>
Last updated on <?php echo $MOD_DATE; ?>
</div>
<div class="pure-u-1-12"></div>
</div>
<div id="alert">Alert message</div>
</body>
<script src="js/intranet_libs_bottom.js"/></script>
<script>
var editing_crn = ""
var editing_sem = ""
/* TODO
list my sections if one wasn't given....
*/
</script>
<script src="js/dir_app.js"/></script>
</html>