Initial transfer of larger repo from git. IF full history and branches are needed must go to github at https://github.com/DulcisL/CCUCoding.git

This commit is contained in:
dolcel committed 2026-10-20 23:59:02 +00:00
commit c09ce40be0
4048 files changed
+603256

No files matched your search

@@ -0,0 +1,35 @@
body
{
font: normal 16px Helvetica, Arial, sans-serif;
margin: 15px;
}
h1{text-align: center;}
nav span, nav a
{
margin: 5px;
font-size: 20px;
margin-right: 10px;
margin-left: 10px;
}
label{font-weight: bold;}
select, textarea {margin: 5px;}
footer
{
text-align: center;
font-size: 10px;
}
.hidden{display: none;}
#label_yes, #label_no{font-weight: normal;}
#color
{
padding: 1px 3px;
text-align: right;
float: right;
}
@@ -0,0 +1,5 @@
:root
{
--light-teal: #ABEADB;
--dark-teal: #003D2B;
}
@@ -0,0 +1,12 @@
<footer>
<hr>
<p>Copyright &copy; Lucas Wedge, Alim Aminev, Jamal Wilson,
Serkan Yildirim, Lakota Dolce @ Coastal Computing</p>
<p>This project is for academic purposes only.</p>
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI"
crossorigin="anonymous"></script>
<script type="text/Javascript" src="modeChange.js"></script>
</body>
</html>
@@ -0,0 +1,56 @@
<?php
// allows me to see all the errors so they can be fixed
// will be turned off in a prouction environment
error_reporting(E_ALL);
ini_set('display_errors', "1");
$currentFile = basename($_SERVER['SCRIPT_FILENAME']);
$currentDate = date('Y-m-d');
$extensionLoc = strpos($currentFile, ".");
$pageName = substr($currentFile, 0, $extensionLoc);
// session_start();
// header('Content-Type: application/json');
// echo json_encode(['mode' => $_SESSION['mode']]);
?>
<!DOCTYPE html lang="en-us">
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="Lucas Wedge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB"
crossorigin="anonymous">
<link id="base" rel="stylesheet" href="base.css">
<?php
if(isset($_SESSION['mode']))
{
if($_SESSION['mode'] == 'light')
{
echo '<link id="mode" rel="stylesheet" href="lightMode.css">';
}
else
{
echo '<link id="mode" rel="stylesheet" href="darkMode.css">';
}
}
else
{
$_SESSION['mode'] = 'light';
echo '<link id="mode" rel="stylesheet" href="lightMode.css">';
}
?>
<title><?php echo ucfirst($pageName), PHP_EOL; ?></title>
</head>
<body>
<header>
<h1>CCU Commuting</h1>
<nav>
<span><?php echo ($currentFile == "parking.php") ? 'Parking' : '<a href="parking.php">Parking</a>'; ?></span>
<span><?php echo ($currentFile == "stats.php") ? '<span>Stats</span>' : '<a href="stats.php">Stats</a>'; ?></span>
<button type="button" class="rounded" id="color">Change Color Mode</button>
</nav>
<hr>
</header>
@@ -0,0 +1,6 @@
@import url("colorVariables.css");
body
{
background-color: var(--dark-teal);
color: var(--light-teal);
}
@@ -0,0 +1,69 @@
<select name="lot" id="lot">
<option>Select a parking lot</option>
<option value="a">A Parking (Wall Building)</option>
<option value="aa">AA Parking (HTC Center)</option>
<option value="b" class="fac_staff">B Parking (Penny Hall)</option>
<option value="bb">BB Parking (Woods Residence Halls)</option>
<option value="bbb">BBB Parking (Burroughs & Chapin Center)</option>
<option value="c" class="fac_staff">C Parking (Penny Hall)</option>
<option value="cc">CC Parking (road in front of Hicks Dining Hall)</option>
<option value="ccc">CCC Parking (Burroughs & Chapin Center)</option>
<option value="d" class="fac_staff">D Parking (Smith Building)</option>
<option value="dd">DD Parking (behind Hicks Dining Hall)</option>
<option value="ddd">DDD Parking (Coastal Science Center)</option>
<option value="e">E Parking(LJSU/Spadoni Park)</option>
<option value="ee">EE Parking (Woods Residence Halls)</option>
<option value="fff">FFF Parking (Intermural Fields)</option>
<option value="gg">GG Parking (across the way from LJSU)</option>
<option value="ggg">GGG Parking (Atlantic Hall)</option>
<option value="h">H Parking ()</option>
<option value="hh" class="fac_staff">HH Parking (across road from Douglas and Swain)</option>
<option value="hhh">HHH Parking (Soccer Stadium)</option>
<option value="i">I Parking ()</option>
<option value="ii">II Parking (Horry County Scholars Academy)</option>
<option value="j">J Parking (by Atheneum Hall and Indigo Hall)</option>
<option value="jjj">JJJ Parking</option>
<option value="kk">KK Parking</option>
<option value="ll">LL Parking</option>
<option value="m">M Parking (Williams-Brice)</option>
<option value="mm">MM Parking (Baxley Hall)</option>
<option value="nn">NN Parking (Gardens Residence Halls)</option>
<option value="o">O Parking (Hampton and Laurel Hall)</option>
<option value="oo">OO Parking</option>
<option value="p">P Parking (Edwards Building)</option>
<option value="q">Q Parking (Edwards Building)</option>
<option value="qq">QQ Parking (Brooks Stadium, Boni Belle Hitting Facility)</option>
<option value="r">R Parking (Brittain Hall)</option>
<option value="rr">RR Parking (University Place)</option>
<option value="s">S Parking (Brittain Hall)</option>
<option value="uu">UU Parking (near Arcadia Hall)</option>
<option value="ww">WW Parking (Sands Hall)</option>
<option value="yy">YY Parking (close to University Place)</option>
</select>
<?php
if ($currentFile == "parking.php")
{
?>
<br><select name="loc" id="loc">
<option>Select a location to visit</option>
<option value="baxley">Baxley Hall (BAXL)</option>
<option value="brittain">Brittain Hall (BRTH)</option>
<option value="little_chant">Chanticleer Hall (little)</option>
<option value="big_chant">Chanticleer Hall (big)</option>
<option value="chauncey">Chauncey's Choice</option>
<option value="decenzo">DeCenzo Hall</option>
<option value="edwards">Edwards Building (EHFA)</option>
<option value="hicks">Hicks Dining Hall</option>
<option value="kearns">Kearns Hall (KRNS)</option>
<option value="kingston">Kingston Hall</option>
<option value="ljsu">Lib Jackson Student Union (LJSU)</option>
<option value="penny">Penny Hall</option>
<option value="prince">Prince Building (PRIN)</option>
<option value="thomp">Thompson Library (TLIB)</option>
<option value="tradition">Tradition Hall</option>
<option value="wall">Wall College of Business</option>
<option value="wheel">Wheelwright Auditorium (WHEL)</option>
</select>
<?php
} // End of the parking.php check
?>
@@ -0,0 +1,6 @@
@import url("colorVariables.css");
body
{
background-color: var(--light-teal);
color: var(--dark-teal);
}
@@ -0,0 +1,9 @@
let modeButton = document.getElementById("color");
modeButton.addEventListener("click", changeMode);
function changeMode()
{
let colorCSS = document.getElementById("mode");
if(colorCSS.href == "lightMode.css"){colorCSS.href = "darkMode.css";}
else{colorCSS.href = "lightMode.css";}
}
@@ -0,0 +1,54 @@
<?php include "commheader.php"; ?>
<main>
<section>
<h2>Parking Statuses</h2>
<p>
Below you can see an interactive map showing the status of each
CCU parking lot.<br>Bus routes are included as well.
</p>
</section>
<section>
<h2>Select A Parking Lot</h2>
<p>
Use the dropdown menu to see a specific parking lot's data.<br>
To see a map of campus, click here:
<a href="https://www.coastal.edu/map/" target="_blank">Campus Map</a>
</p>
<!-- All info sections are hidden initially and become visible
when the user selects one. -->
<?php include "dropdown.php"; ?>
<section class="hidden">
<h3>A Parking Lot</h3>
<ul>
<li>Location: circle in from of the Wall College of Business</li>
<li>Closest Shuttle Stop: (Brittain Hall)</li>
</ul>
<ul>
</section>
<section class="hidden">
<h3>AA Parking Lot</h3>
<ul>
<li>Location: Outside the HTC Center</li>
<li>Closest Shuttle Stop: (Brittain Hall)</li>
<li>Parking Type: Limited Time**</li>
</ul>
</section>
<section class="hidden">
<h3>B Parking Lot</h3>
<ul>
<li>Location: Outside Penny Hall (formerly Academic Office 2)</li>
<li>Closest Shuttle Stop: (Brittain Hall)</li>
<li>Parking Type: </li>
</ul>
</section>
<section class="hidden">
<h3>BB Parking Lot</h3>
<ul>
<li>Location:</li>
<li>Closest Shuttle Stop:</li>
<li>Parking Type:</li>
</ul>
</section>
</section>
</main>
<?php include "commfooter.php"; ?>
@@ -0,0 +1,79 @@
<?php
include "commheader.php";
$showForm = TRUE;
$errors = [];
if($_SERVER['REQUEST_METHOD'] == "POST")
{
print_r($_POST);
$firstName = trim($_POST['firstName']);
$lastName = trim($_POST['lastName']);
$email = trim($_POST['email']);
$date = $_POST['date'];
$time = $_POST['time'];
$lot = $_POST['lot'];
$percent = $_POST['percent'];
$explain = trim($_POST['explain']);
$showForm = FALSE;
}
if($showForm){
?>
<main>
<section>
<h2>Submit Statistics</h2>
<p>
Use the form below to submit parking statistics.<br>
This data might be used to continue developing this web app!
</p>
</section>
<section>
<p>Note: The values with an asterisk (*) are required.</p>
<form name="stats" id="stats" target="_blank" method="POST">
<p>
<label>First Name</label>
<input type="text" id="first" name="first" placeholder="Jane">
</p>
<p>
<label>Last Name</label>
<input type="text" id="last" name="last" placeholder="Dough">
</p>
<p>
<label>Email*</label>
<input type="text" id="email" name="email" placeholder="[email protected]">
</p>
<p>
<label>Date*</label>
<input type="date" id="date" name="date"
value=<?php echo $currentDate?>
min="2000-01-01" max=<?php echo $currentDate?>>
</p>
<p>
<label>Time*</label>
<input type="time" id="time" name="time">
</p>
<p>
<label for="">Special Event?*</label><br>
<input name="event" type="radio" id="yes" value="yes">
<label id="label_yes" for="yes">Yes</label><br>
<input name="event" type="radio" id="no" value="no">
<label id="label_no" for="no">No</label>
</p>
<p>
<label>Select A Parking Lot*</label>
<?php include "dropdown.php"; ?>
</p>
<p>
<label for="percent">Percentage Full*</label>
<input type="number" name="percent" id="percent" min="0" max="100">
</p>
<p>
<label>Further Explanation</label><br>
<textarea id="explain" name="explain" rows=10 cols=30>Blah blah blah blah blah...</textarea>
</p>
<p><input type="submit" name="submit" id="submit" value="Submit"></p>
</form>
</section>
</main>
<?php
} // end of if($showForm)
include "commfooter.php";
?>
@@ -0,0 +1,87 @@
//user story 1
const SEMESTER_BASE_MIN = { Fall: 34, Spring: 30, Summer: 24 };
const WEEK_FACTOR = { 1: 1.15, 2: 1.05, 3: 1.00, 4: 1.00, 5: 0.98 };
const DAY_FACTOR = { Mon: 1.15, Tue: 1.10, Wed: 1.10, Thu: 1.08, Fri: 1.05, Sat: 0.80, Sun: 0.75 };
const WEATHER_FACTOR = { clear: 1.00, rain: 1.10, storm: 1.20 };
function todFactor(hhmm) {
const [h, m] = hhmm.split(":").map(Number);
const t = h + m / 60;
if (t >= 6 && t < 9) return 1.25;
if (t >= 9 && t < 15) return 1.00;
if (t >= 15 && t < 18) return 1.30;
if (t >= 18 && t < 21) return 1.05;
return 0.90;
}
function jitterMinutes(key, spread = 3) {
let h = 2166136261;
for (const c of key) h = Math.imul(h ^ c.charCodeAt(0), 16777619);
return ((h >>> 0) % (2 * spread + 1)) - spread;
}
function estimateDriveMinutes({ semester, weekOfMonth, day, departTime, weather = "clear" }) {
const base = SEMESTER_BASE_MIN[semester] ?? 30;
const wf = WEEK_FACTOR[weekOfMonth] ?? 1.0;
const df = DAY_FACTOR[day] ?? 1.0;
const tf = todFactor(departTime);
const wfz = WEATHER_FACTOR[weather] ?? 1.0;
const raw = base * wf * df * tf * wfz;
const noise = jitterMinutes(`${semester}|${weekOfMonth}|${day}|${departTime}|${weather}`, 3);
return Math.max(8, Math.round(raw + noise));
}
for (let w = 1; w <= 5; w++) {
const mins = estimateDriveMinutes({ semester: "Fall", weekOfMonth: w, day: "Mon", departTime: "08:00", weather: "clear" });
console.log(`Fall, week ${w}, Mon 08:00 → ~${mins} min`);
}
//user story 2
function toMinutes(hhmm) {
const [h, m] = hhmm.split(":").map(Number);
return h * 60 + m;
}
function fromMinutes(total) {
const t = ((total % (24 * 60)) + 24 * 60) % (24 * 60);
const h = Math.floor(t / 60), m = t % 60;
return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`;
}
function whenToLeaveForClass({
classStartHHMM,
semester,
weekOfMonth,
day,
weather = "clear",
arriveEarlyMin = 20,
parkingWalkBufferMin = 0,
}) {
const driveMin = estimateDriveMinutes({ semester, weekOfMonth, day, departTime: classStartHHMM, weather });
const leaveAt = toMinutes(classStartHHMM) - arriveEarlyMin - parkingWalkBufferMin - driveMin;
return {
leaveHHMM: fromMinutes(leaveAt),
driveMin,
arriveBufferMin: arriveEarlyMin + parkingWalkBufferMin
};
}
const plan = whenToLeaveForClass({
classStartHHMM: "09:30",
semester: "Fall",
weekOfMonth: 1,
day: "Mon",
weather: "rain",
arriveEarlyMin: 20,
parkingWalkBufferMin: 5
});
console.log(`Drive ≈ ${plan.driveMin} min, arrive buffer = ${plan.arriveBufferMin} min`);
console.log(`Leave home at: ${plan.leaveHHMM}`);