Summary of items "; while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $report .= ""; } $report .= "
ID Name Actions
$row[0]$row[1]
"; break; case "options"; // start a table //($table,$id,$appID,$type,$field) while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $report .= ""; } break; } } return $report; } function listRecordsVersionFromLinks($table,$type,$status,$appID,$format,$limit) { $table_attribute = "$table" . "_attribute"; if ($type != null && $type != "*") { $queryType = "AND t.type = '$type'"; } else { $queryType = null; } // if appID is not null, then use it in query, otherwise, no if ($appID != null && $appID != "*") { $queryAppID = "AND app_id = '$appID'"; } else { $queryAppID = null; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); if ($status != null) { $query = " SELECT t.id FROM $table t, $table_attribute ta WHERE t.status = '1' $queryType $queryAppID AND t.id = ta.id AND ta.type='Status' AND ta.content = '$status' ORDER BY t.create_date DESC LIMIT $limit "; } else { $query = " SELECT t.id FROM $table t WHERE t.status = '1' $queryType $queryAppID ORDER BY t.create_date DESC LIMIT $limit "; } $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { switch ($format) { case "summary": // start a table $report = "

Summary of items

"; while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { // targets $thisTable_content = $table . "_content"; $thisTable_attribute = $table . "_attribute"; // content $thisSource = getRecordDetails($thisTable_content,$row[0],$appID,"Source","content"); $thisSourceAuthor = getRecordDetails($thisTable_content,$row[0],$appID,"Source Author","content"); $thisWebsiteKey = getRecordDetails($thisTable_attribute,$row[0],$appID,"Website Key","value"); $thisSourceHeadline = getRecordDetails($thisTable_content,$row[0],$appID,"Source Headline","content"); $thisURL = getRecordDetails($thisTable_content,$row[0],$appID,"Source URL Link","content"); // presentation if ($thisSourceAuthor != null) {$thisSourceAuthor = $thisSourceAuthor . ", ";} $report .= ""; } $report .= "
ID Website Key Story Actions
$row[0]$thisWebsiteKey$thisSourceHeadline
$thisSourceAuthor $thisSource
Edit | Delete
"; break; case "options"; // start a table //($table,$id,$appID,$type,$field) while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $thisName = getRecordDetails($table,$row[0],$appID,"website","name"); $report .= ""; } break; } } return $report; } function generatePageComment($theme) { // get all URL LINKS and show a report $comment = " THIS COMMENT IS PROUDLY SPONSORED BY THE SPRING 2020 COHORT _____ ______ __ _ ______ _ _ | | \ \ / | | \ \ \ | | / | | \ | | | | | | | | | | | | \_\_| | | | | | | | | | |_|_/_/ \_|__|_/ ____|_| \_|__|_/ \_|__|_| ______ ______ ______ _ ______ _______ _ _ ______ | | | | | | | | / / | | | | | | | | | |---- | |---- | |---- | | _ .---' | | | |--| | | |---- |_| |_|____ |_|____ |_|__|_| /_/___ |_| |_| |_| |_|____ ______ ______ ______ _ _ _____ _ ______ _____ ______ | | | | \ \ | | | | | | | | | | | | | | | | \ \ | | | | | |---- | | | | | | | |--| | | | | | _ | |__| | | | | | | |__| | |_|____ |_| |_| |_|____ |_| |_| _|_|_ |_|__|_| |_| |_| |_|_/_/ |_| |_| ______ ______ ______ _ _ ______ _______ __ _ ______ ______ | | | | | | | \ | | | | | | | | | | \ \ | | | | | \ | | | |__| | | |__| | | | | |--| | | |---- | | \_\_| | | |__|_/ | |---- |_| |_| |_| \_\ |_|____ |_| |_| |_|____ |_| ____|_| |_| |_|____ ______ |_| | | __|_| |_| _ "; return $comment; } function listLinks() { } function listRecordsOLD($table,$type,$appID,$format) { // if appID is not null, then use it in query, otherwise, no if ($appID != null && $appID != "*") { $queryAppID = "AND app_id = '$appID'"; } else { $queryAppID = null; } if ($format == options) { $sortOrder="ORDER BY name ASC"; } else { $sortOrder="ORDER BY id ASC"; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $query = " SELECT id, create_date, name FROM $table WHERE type = '$type' $queryAppID $sortOrder "; $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { switch ($format) { case "summary": // CUSTOMIZE SUMMARY HEADER BY TYPE switch ($type) { case "Artifact": $report = "

Summary of items

"; break; case "Location": $report = "

Summary of locations

ID Website Title Actions
"; break; case "URL Link": $report = "

Summary of items

ID Website Location Actions
"; break; default: } while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $thisTable_content = $table . "_content"; $thisTable_attribute = $table . "_attribute"; $thisWebsiteID = getRecordDetails($thisTable_content,$row[0],$appID,"Main Content","app_id"); $thisSource = getRecordDetails($thisTable_content,$row[0],$appID,"Source","content"); $thisSourceAuthor = getRecordDetails($thisTable_content,$row[0],$appID,"Source Author","content"); $thisSourceHeadline = getRecordDetails($thisTable_content,$row[0],$appID,"Source Headline","content"); $thisURL = getRecordDetails($thisTable_content,$row[0],$appID,"Source URL Link","content"); $thisTitle = getRecordDetails($thisTable_content,$row[0],$appID,"Title","content"); $thisMainContent = getRecordDetails($thisTable_content,$row[0],$appID,"Main Content","content"); // CUSTOMIZE SUMMARY OUTPUT BY TYPE switch ($type) { case "Artifact": $report .= ""; break; case "Location": $report .= ""; break; case "URL Link": $report .= ""; break; default: } } $report .= "
ID Source Author Headline (with Link) Actions
$row[0] $row[1]$thisWebsiteID$thisTitle
$row[0] $row[1]$thisWebsiteID$thisTitle
$row[0]$thisSource$thisSourceAuthor$thisSourceHeadlineEdit | Delete
"; break; case "options"; // start a table //($table,$id,$appID,$type,$field) while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $thisName = getRecordDetails($table,$row[0],$appID,"website","name"); $report .= ""; } break; } } return $report; } function listCourseworkSubmissions($assignmentID) { $query = " SELECT value,relate_value FROM activity_content WHERE id = '$assignmentID' AND type = 'Activity Log' AND name = 'Coursework Link' AND relate_key = 'person' AND relate_value IS NOT NULL ORDER BY create_date DESC "; $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { // start a table $report=""; } return $report; } function listSurveyResponses($activityID) { $query = " SELECT content FROM activity_content WHERE id = '$activityID' AND type = 'Activity Log' AND name = 'Survey Response' ORDER BY create_date DESC "; $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { // start a table $report=""; } return $report; } function listSurveyResponsesHOM($activityID,$value) { $query = " SELECT content, update_author, create_date FROM activity_content WHERE id = '$activityID' AND type = 'Activity Log' AND name = 'Survey Response' AND value = '$value' ORDER BY create_date DESC "; $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { // start a table $report=""; } return $report; } function listCourseworkSubmissionReport($assignmentID) { $query = " SELECT value, relate_value, create_date FROM activity_content WHERE id = '$assignmentID' AND type = 'Activity Log' AND name = 'Coursework Link' AND relate_key = 'person' AND relate_value IS NOT NULL ORDER BY create_date ASC "; $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { // start a table $report="
name
url submitted
date submitted
assessments
base
additional
total
actions
"; while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $i = $i+1; $iteration = $i % 2; if($iteration == 0) { // EVEN $b = "background-color: #efefef"; } else { // ODD $b = "background-color: #eaeaea"; } $thisLink = $row[0]; $thisPersonID = $row[1]; $submitDate = $row[2]; $thisPersonName = getRecordDetails("person_content",$row[1],$appID,"Name","content"); $report .= "
$thisPersonName
$thisLink
$submitDate
count
lookup
count
math
Assess
"; } $report.="
"; } return $report; } function listPerson() { $query = " SELECT id FROM person "; $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { // start a table while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $thisPersonID = $row[0]; $thisPersonName = getRecordDetails("person_content",$row[0],$appID,"Name","content"); $report .= ""; } } return $report; } function listAssignments($userID) { $table = "activity"; $query = " SELECT id, create_date FROM $table WHERE type = 'Assignment' ORDER BY create_date DESC "; $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { // start a summary table $i = 0; $report = "
#
^
assignment
assigned
status
actions
"; while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $i = $i+1; $iteration = $i % 2; if($iteration == 0) { // EVEN $b = "background-color: #efefef"; } else { // ODD $b = "background-color: #eaeaea"; } $thisID = $row[0]; $thisTable_content = $table . "_content"; $thisTable_attribute = $table . "_attribute"; $rawDate = $row[1]; date_default_timezone_set("America/Los_Angeles"); $thisDate = date("l, F n, Y H:i a", strtotime($rawDate)); $thisAssignmentTitle = getRecordDetails($thisTable_content,$row[0],$appID,"Title","content"); $checkCourseworkSubmission = checkActivityLog($personID,"Coursework Link",$row[0]); $thisACategory = getRecordDetails($thisTable_attribute,$row[0],$appID,"Category","content"); $personID = $userID; switch($checkCourseworkSubmission) { case "YES": // THERE IS A SUBMISSION ALREADY. REPORT IT. // 200327 AND OFFER DELETE $thisLink = getRecordDetailsTypeNameRelate($thisTable_content,$thisID,$appID,"Activity Log","Coursework Link","value","person",$personID); $status = "Submitted"; break; default: // THERE IS NO COURSEWORK. LET THEM SUBMIT. $status = "Awaiting submission"; } //$summaryCoursework = listCourseworkSubmissions($row[0]); $report .= "
$row[0]
$thisACategory
$thisAssignmentTitle
$thisDate
$status
review
"; } $report .= "
"; } return $report; } function displayLatestNewsHeadline() { // if type is not null, then use it in query, otherwise, no $query = " SELECT id, create_date FROM artifact WHERE type = 'News Article' ORDER BY create_date DESC LIMIT 1 "; $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { // start a table while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $table = "artifact"; $thisTable_content = $table . "_content"; $thisTable_attribute = $table . "_attribute"; $thisCTitle = getRecordDetails($thisTable_content,$row[0],$appID,"Title","content"); $report .= " $thisCTitle "; } } return $report; } function displayNewsFeed($statusID,$searchContent,$authorID,$categoryID,$dateStart,$itemLimit) { // if type is not null, then use it in query, otherwise, no $query = " SELECT id, create_date FROM artifact WHERE type = 'News Article' ORDER BY create_date DESC LIMIT $itemLimit "; $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { // start a table while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $table = "artifact"; $thisTable_content = $table . "_content"; $thisTable_attribute = $table . "_attribute"; $thisType = getRecordMeta($table,$row[0],"type"); // 200610 for unknown reason, this formatting insttruction is not formatting the create date captured in $row[1]; everything says tuesday june 6 $rawDate = $row[1]; date_default_timezone_set("America/Los_Angeles"); $thisDate = date("l, F n, Y H:i a", strtotime($rawDate)); $thisCAction = getRecordDetails($thisTable_content,$row[0],$appID,"Action","content"); $thisCName = getRecordDetails($thisTable_content,$row[0],$appID,"Name","content"); $thisCTitle = getRecordDetails($thisTable_content,$row[0],$appID,"Title","content"); $thisContent = getRecordDetails($thisTable_content,$row[0],$appID,"Main Content","content"); $thisCSourceHeadline = getRecordDetails($thisTable_content,$row[0],$appID,"Source Headline","content"); $thisALocation = getRecordDetails($thisTable_attribute,$row[0],$appID,"Location","content"); $thisACategory = getRecordDetails($thisTable_attribute,$row[0],$appID,"Category","content"); $thisAStatus = getRecordDetails($thisTable_attribute,$row[0],$appID,"Status","content"); $thisAVehicle = getRecordDetails($thisTable_attribute,$row[0],$appID,"Vehicle","content"); $report .= "

$thisCTitle

Posted by Eugene Ahn | $row[1] PT
$thisContent
"; } } return $report; } function listRecords($table,$type,$status,$category,$searchKey,$appID,$limit) { // if type is not null, then use it in query, otherwise, no $table_attribute = "$table" . "_attribute"; $table_content = "$table" . "_content"; if ($type != null && $type != "*") { $queryType = "AND t.type = '$type'"; } else { $queryType = null; } // if appID is not null, then use it in query, otherwise, no if ($appID != null && $appID != "*") { $queryAppID = "AND t.app_id = '$appID'"; } else { $queryAppID = null; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); if ($status != null) { $query = " SELECT t.id FROM $table t, $table_attribute ta WHERE t.status = '1' $queryType $queryAppID AND t.id = ta.id AND ta.type='Status' AND ta.content = '$status' ORDER BY t.id DESC LIMIT $limit "; } elseif ($category != null) { $query = " SELECT t.id FROM $table t, $table_attribute ta WHERE t.status = '1' $queryType $queryAppID AND t.id = ta.id AND ta.type='Category' AND ta.content = '$category' ORDER BY t.create_date DESC LIMIT $limit "; } elseif ($searchKey != null) { // search performs a content search $query = " SELECT DISTINCT t.id FROM $table t, $table_content tc WHERE (tc.name LIKE '%$searchKey%' OR tc.description LIKE '%$searchKey%' OR tc.content LIKE '%$searchKey%' OR tc.value LIKE '%$searchKey%') and tc.status = '1' AND tc.id = t.id and t.status = '1' $queryType $queryAppID ORDER BY t.create_date DESC LIMIT $limit "; } else { $query = " SELECT t.id FROM $table t WHERE t.status = '1' $queryType $queryAppID ORDER BY t.create_date DESC LIMIT $limit "; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { // start a table $report = "

Summary of items

"; while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $thisTable_content = $table . "_content"; $thisTable_attribute = $table . "_attribute"; $thisType = getRecordMeta($table,$row[0],"type"); $thisDate = getRecordMeta($table,$row[0],"create_date"); $thisCAction = getRecordDetails($thisTable_content,$row[0],$appID,"Action","content"); $thisCName = getRecordDetails($thisTable_content,$row[0],$appID,"Name","content"); $thisCTitle = getRecordDetails($thisTable_content,$row[0],$appID,"Title","content"); $thisCSourceHeadline = getRecordDetails($thisTable_content,$row[0],$appID,"Source Headline","content"); $thisALocation = getRecordDetails($thisTable_attribute,$row[0],$appID,"Location","content"); $thisACategory = getRecordDetails($thisTable_attribute,$row[0],$appID,"Category","content"); $thisAStatus = getRecordDetails($thisTable_attribute,$row[0],$appID,"Status","content"); $thisAVehicle = getRecordDetails($thisTable_attribute,$row[0],$appID,"Vehicle","content"); $report .= ""; } $report .= "
type
$row[0]$thisDate$thisType$thisAStatus$thisCAction$thisCName $thisCTitle $thisCSourceHeadline$thisALocation $thisACategory $thisAVehicleManage
"; } return $report; } function listRequests($table,$type,$status,$category,$searchKey,$roleID,$limit) { // if type is not null, then use it in query, otherwise, no $table_attribute = "$table" . "_attribute"; $table_content = "$table" . "_content"; if ($type != null && $type != "*") { $queryType = "AND t.type = '$type'"; } else { $queryType = null; } // if appID is not null, then use it in query, otherwise, no if ($appID != null && $appID != "*") { $queryAppID = "AND t.app_id = '$appID'"; } else { $queryAppID = null; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); if ($status != null) { $query = " SELECT t.id FROM $table t, $table_attribute ta WHERE t.status = '1' $queryType $queryAppID AND t.id = ta.id AND ta.type='Status' AND ta.content = '$status' ORDER BY t.id DESC LIMIT $limit "; } elseif ($category != null) { $query = " SELECT t.id FROM $table t, $table_attribute ta WHERE t.status = '1' $queryType $queryAppID AND t.id = ta.id AND ta.type='Category' AND ta.content = '$category' ORDER BY t.create_date DESC LIMIT $limit "; } elseif ($searchKey != null) { // search performs a content search $query = " SELECT DISTINCT t.id FROM $table t, $table_content tc WHERE (tc.name LIKE '%$searchKey%' OR tc.description LIKE '%$searchKey%' OR tc.content LIKE '%$searchKey%' OR tc.value LIKE '%$searchKey%') and tc.status = '1' AND tc.id = t.id and t.status = '1' $queryType $queryAppID ORDER BY t.create_date DESC LIMIT $limit "; } else { // base query $query = " SELECT t.id FROM $table t, $table_attribute ta WHERE ta.relate_value = '$roleID' AND ta.relate_key = 'user' AND ta.type = 'Role' AND ta.content = 'Owner' AND ta.id = t.id AND t.type = 'Request' $queryType $queryAppID ORDER BY t.create_date DESC LIMIT $limit "; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { // start a table $report = "

Summary of requests

"; while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $thisTable_content = $table . "_content"; $thisTable_attribute = $table . "_attribute"; $thisType = getRecordMeta($table,$row[0],"type"); $thisDate = getRecordMeta($table,$row[0],"create_date"); $thisCAction = getRecordDetails($thisTable_content,$row[0],$appID,"Action","content"); $thisCName = getRecordDetails($thisTable_content,$row[0],$appID,"Name","content"); $thisCTitle = getRecordDetails($thisTable_content,$row[0],$appID,"Title","content"); $thisCSourceHeadline = getRecordDetails($thisTable_content,$row[0],$appID,"Source Headline","content"); $thisALocation = getRecordDetails($thisTable_attribute,$row[0],$appID,"Location","content"); $thisACategory = getRecordDetails($thisTable_attribute,$row[0],$appID,"Category","content"); $thisAStatus = getRecordDetails($thisTable_attribute,$row[0],$appID,"Status","content"); $thisAVehicle = getRecordDetails($thisTable_attribute,$row[0],$appID,"Vehicle","content"); $report .= ""; } $report .= "
id requested status request fresca blarney actions
$row[0]$thisDate$thisAStatus$thisCAction$thisCName $thisCTitle $thisCSourceHeadline$thisALocation $thisACategory $thisAVehicleManage
"; } else { $report="There are no requests to summarize. Yet."; } return $report; } function listRecords2($table,$type,$status,$category,$searchKey,$appID,$limit,$personID) { // if type is not null, then use it in query, otherwise, no $table_attribute = "$table" . "_attribute"; $table_content = "$table" . "_content"; if ($type != null && $type != "*") { $queryType = "AND t.type = '$type'"; } else { $queryType = null; } // if appID is not null, then use it in query, otherwise, no if ($appID != null && $appID != "*") { $queryAppID = "AND t.app_id = '$appID'"; } else { $queryAppID = null; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); if ($status != null) { $query = " SELECT t.id FROM $table t, $table_attribute ta WHERE t.status = '1' $queryType $queryAppID AND t.id = ta.id AND ta.type='Status' AND ta.content = '$status' ORDER BY t.id DESC LIMIT $limit "; } elseif ($category != null) { $query = " SELECT t.id FROM $table t, $table_attribute ta WHERE t.status = '1' $queryType $queryAppID AND t.id = ta.id AND ta.type='Category' AND ta.content = '$category' ORDER BY t.create_date DESC LIMIT $limit "; } elseif ($searchKey != null) { // search performs a content search $query = " SELECT DISTINCT t.id FROM $table t, $table_content tc WHERE (tc.name LIKE '%$searchKey%' OR tc.description LIKE '%$searchKey%' OR tc.content LIKE '%$searchKey%' OR tc.value LIKE '%$searchKey%') and tc.status = '1' AND tc.id = t.id and t.status = '1' $queryType $queryAppID ORDER BY t.create_date DESC LIMIT $limit "; } else { $query = " SELECT t.id FROM $table t WHERE t.status = '1' $queryType $queryAppID ORDER BY t.create_date DESC LIMIT $limit "; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { // start a table $report = ""; while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $thisID = $row[0]; $thisTable_content = $table . "_content"; $thisTable_attribute = $table . "_attribute"; $thisType = getRecordMeta($table,$row[0],"type"); $thisDate = getRecordMeta($table,$row[0],"create_date"); $thisCAction = getRecordDetails($thisTable_content,$row[0],$appID,"Action","content"); $thisCName = getRecordDetails($thisTable_content,$row[0],$appID,"Name","content"); $thisCTitle = getRecordDetails($thisTable_content,$row[0],$appID,"Title","content"); $thisCSourceHeadline = getRecordDetails($thisTable_content,$row[0],$appID,"Source Headline","content"); $thisDescription = getRecordDetails($thisTable_content,$row[0],$appID,"Description","content"); $thisALocation = getRecordDetails($thisTable_attribute,$row[0],$appID,"Location","content"); $thisACategory = getRecordDetails($thisTable_attribute,$row[0],$appID,"Category","content"); $thisAStatus = getRecordDetails($thisTable_attribute,$row[0],$appID,"Status","content"); $thisAVehicle = getRecordDetails($thisTable_attribute,$row[0],$appID,"Vehicle","content"); if ($personID !=null) { $checkCourseworkSubmission = checkActivityLog($personID,"Coursework Link",$row[0]); switch($checkCourseworkSubmission) { case "YES": // THERE IS A SUBMISSION ALREADY. REPORT IT. // 200327 AND OFFER DELETE $thisLink = getRecordDetailsTypeNameRelate($thisTable_content,$thisID,$appID,"Activity Log","Coursework Link","value","person",$personID); $status = "

Status: You have submitted coursework for this assignment via this link: $thisLink.
"; break; default: // THERE IS NO COURSEWORK. LET THEM SUBMIT. $status = "
Submit URL to your assignment coursework:
"; } } else { $status = "You need to log in to submit to this coursework."; } $report .= "

$thisCTitle

Assigned

$thisDate

Status

$status
$thisDescription
"; } $report .= ""; } return $report; } function logActivity($id) { } function checkActivityLog($personID,$activityName,$activityID) { // look for specific activity from user in activity #id // HAS person DONE activity to activity ID // example has elizabeth done URL Link to php app // example has viktoria done vote to week 6 // it is content $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); // this function prepares a report of artifacts with type = Script Dialogue and name=Seattle Road, the same type of artifact being written. $query = " SELECT relate_value FROM activity_content WHERE id = '$activityID' AND relate_value = '$personID' AND relate_key = 'person' AND type = 'Activity Log' AND name = '$activityName' "; $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { // there is a match, so the answer is YES $status = "YES"; } } else { $status = "NO"; } return $status; } function getRecordMeta($table,$id,$field) { // for any record in table with id, return the content of the field $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); // this function prepares a report of artifacts with type = Script Dialogue and name=Seattle Road, the same type of artifact being written. $query = " SELECT $field FROM $table WHERE id = '$id' "; $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $content = $row[0]; } } return $content; } function getRecordNotes($table,$id) { $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $query = " SELECT create_date, content, create_author FROM $table WHERE id = '$id' AND type = 'Note' ORDER BY create_date "; $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { $content = " "; while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { if ($row[2] != 0) { // there is a person record, so get the name $thisPersonName = getRecordDetails("person_content",$row[2],$appID,"Name","content"); } else { $thisPersonName = "System"; } $content .= ""; } // build the select for person $content .= "
DateAuthorNoteAction
$row[0]$thisPersonName$row[1]

"; } else { $content = "

No Notes. Add a note:

"; } return $content; } function getRecordQuotes($table,$id) { $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $query = " SELECT create_date, content FROM $table WHERE id = '$id' AND type = 'Quote' ORDER BY create_date "; $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { $content = " "; while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $content .= ""; } $content .= "
DateQuoteAction
$row[0]$row[1]Modify | Delete | Artifactize

"; } else { $content = "

No Quotes. Add a quote:

"; } return $content; } function getRecordDetails($table,$id,$appID,$type,$field) { // if appID is not null, then use it in query, otherwise, no if ($appID != null && $appID != "*") { $queryAppID = "AND app_id = '$appID'"; } else { $queryAppID = null; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $query = " SELECT $field FROM $table WHERE id = '$id' AND type = '$type' $queryAppID "; $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $content = $row[0]; } } return $content; } function getRecordDetailsTypeName($table,$id,$appID,$type,$name,$field) { // ADDED 200312 // if appID is not null, then use it in query, otherwise, no if ($appID != null && $appID != "*") { $queryAppID = "AND app_id = '$appID'"; } else { $queryAppID = null; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $query = " SELECT $field FROM $table WHERE id = '$id' AND type = '$type' AND name = '$name' $queryAppID "; $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $content = $row[0]; } } return $content; } function getRecordDetailsTypeNameRelate($table,$id,$appID,$type,$name,$field,$relate_key,$relate_value) { // ADDED 200316 // if appID is not null, then use it in query, otherwise, no if ($appID != null && $appID != "*") { $queryAppID = "AND app_id = '$appID'"; } else { $queryAppID = null; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $query = " SELECT $field FROM $table WHERE id = '$id' AND type = '$type' AND name = '$name' AND relate_key = '$relate_key' AND relate_value = '$relate_value' $queryAppID "; $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); // do the results here if ($result) { while ($row = mysqli_fetch_array($rows,MYSQLI_NUM)) { $content = $row[0]; } } return $content; } function listArtifact($type) { // this function prepares a report of artifacts with type = URL Link, the same type of artifact being written. } function getRealIpAddr() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet { $ip=$_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy { $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip=$_SERVER['REMOTE_ADDR']; } return $ip; } ?>
Student:

$person

Email:

$personEmail

Goal:

$personGoal

"; $header = "MIME-Version: 1.0" . "\r\n"; $header .= "Content-type: text/html; charset=iso-8859-1" . "\r\n"; $header .= "To: <$alertRecipient>" . "\r\n"; $header .= "From: "."\r\n"; mail($alertRecipient,$alertSubject,$alertContent,$header); $confirmationMessage = "OK, let's see what kind of pizza happens."; } else { $confirmationMessageX = "

Submit a request for an account and login to the website.

My Name

My email address

Course

"; $confirmationMessage = "

Participate in an important survey!

My Name

My email address

Favorite pizza topping

"; } $newsFeed = displayNewsFeed("1",null,null,null,null,"5"); ?> Art 645 | Learn the art and craft of web design

Art 645

Learn the art and craft of web design from the Department of Visual And Media Art at Los Angeles City College.

Course instructor: Eugene Ahn, MA. Email: AhnEW@laccd.edu

Participant access

Log in to access coursework

Need help logging in?

If you are having trouble logging in, it's probably because you are not using a valid username. Email the instructor for help confirming your username.