Skip to main content

Uncategorised

Carbon Storage (2)

function loadEventSurveyData() { //if(document.getElementById("ddEvents").value == ""){ // document.getElementById("ddEvents").selectedIndex = "0"; //} console.log("SurveyID: "+ document.getElementById("sid").value); console.log("Selected Event ID: "+ document.getElementById("ddEvents").value); location.href= document.getElementById("frmSurveyData").action + '?eid='+document.getElementById("ddEvents").value+'&sid='+document.getElementById("sid").value; //document.getElementById("frmSurveyData").submit(); } function sortTable(n, st) { var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0; table = document.getElementById("myTable"); switching = true; //Set the sorting direction to ascending: dir = "asc"; /*Make a loop that will continue until no switching has been done:*/ while (switching) { //start by saying: no switching is done: switching = false; rows = table.rows; /*Loop through all table rows (except the first, which contains table headers):*/ for (i = 1; i (rows.length - 1); i++) { //start by saying there should be no switching: shouldSwitch = false; /*Get the two elements you want to compare, one from current row and one from the next:*/ x = rows[i].getElementsByTagName("TD")[n].children[0]; y = rows[i + 1].getElementsByTagName("TD")[n].children[0]; /*check if the two rows should switch place, based on the direction, asc or desc:*/ //console.log("Sort values x: " + x + " y: " + y); //console.log("Sort values x: " + x.innerHTML + " y: " + y.innerHTML); if(st == 1){ x = Number((x.innerHTML).replace(":", "")); y = Number((y.innerHTML).replace(":", "")); }else{ x = x.innerHTML.toLowerCase(); y = y.innerHTML.toLowerCase(); } //console.log("x: "+x+" y: "+y); if (dir == "asc") { if (x > y) { //if so, mark as a switch and break the loop: shouldSwitch= true; break; } } else if (dir == "desc") { if (x < y) { //if so, mark as a switch and break the loop: houldSwitch = true; break; } } } if (shouldSwitch) { /*If a switch has been marked, make the switch and mark that a switch has been done:*/ rows[i].parentNode.insertBefore(rows[i + 1], rows[i]); switching = true; //Each time a switch is done, increase this count by 1: switchcount ++; } else { /*If no switching has been done AND the direction is "asc", set the direction to "desc" and run the while loop again.*/ if (switchcount == 0 && dir == "asc") { dir = "desc"; switching = true; } } } } id.'|'.$user->name);*/ $uid = $user->id; $tfid = $app->getUserStateFromRequest("tf_id", "tf_id", 0 ); //print_r('TF_IID :: ' . $tfid); $postData = $app->input->post; //$getData = $app->input->get; ///get event id $eventid = $postData->get('ddEvents', '', 'string'); if(strlen($eventid ?? '') == 0){ $eventid = $app->input->get('eid', ''); } //echo 'ddEvents-selected value : ' . $eventid; //get surveyId $surveyid = $app->input->get('sid', 0); if(strlen($surveyid ?? '') == 0){ $surveyid = $postData->get('sid', '0', 'int'); } //echo 'SID : ' . $surveyid; if($tfid == 0){ $app->redirect(JRoute::_("https://tinyforest.earthwatch.org.uk/tiny-forest-admin-screen")); } echo '
'; //Event dates dropdown - START $baseUrl = 'https://tinyforest.earthwatch.org.uk/event-management/'; $formAction = ""; switch ($surveyid) { case 10: //echo "Carbon Capture"; $formAction = $baseUrl . 'carbon-capture'; break; case 20: //echo "Thermal Comfort"; $formAction = $baseUrl . 'thermal-comfort'; break; case 30: //echo "Flood Management A"; $formAction = $baseUrl . 'flood-management-infiltration-rate-and-moisture'; break; case 40: //echo "Flood Management B"; $formAction = $baseUrl . 'flood-management-compaction-colour-and-texture'; break; case 50: //echo "Butterfly Time Count"; $formAction = $baseUrl . 'butterflies-timed-count'; break; case 60: //echo "Butterfly Species List"; $formAction = $baseUrl . 'butterflies-species-list'; break; case 70: //echo "Soil Dwellers"; $formAction = $baseUrl . 'soil-dwellers'; break; case 80: //echo "Pollinators"; $formAction = $baseUrl . 'pollinator-timed-count'; break; //default: //Survey Id == 0 //$app->redirect(JRoute::_("https://tinyforest.earthwatch.org.uk/tiny-forest-admin-screen")); } //get survey record Id which needs to be marked as deleted $delSurveyid = $app->input->get('delid', 0); if(strlen($delSurveyid ?? '') == 0){ $delSurveyid = $postData->get('delid', '0', 'int'); } if($delSurveyid > 0){ $sql = 'call bitnami_joomla.ew_tf_survey_status_update('.$db->quote($delSurveyid).');'; //print_r('Q1 : ' . $sql); $query = $db->getQuery(true); $db->setQuery($sql); $row = $db->loadObject(); $retVal = $row->result; $msg='Successfuly updated survey status'; $baseSurveyResultUrl = $formAction; $app->enqueueMessage($msg); $app->redirect(JRoute::_($formAction.'?sid='.$surveyid.'&eid='.$app->input->get('eid', ''))); } //echo 'form action: ' . $formAction; //RETRIEVE - Survey Data - START $query = $db->getQuery(true); $sql = "call bitnami_joomla.ew_tf_event_get(". $db->quote($tfid) . ", 3)"; $db->setQuery($sql); //print_r('qyery : ' .$sql); $rows = $db->loadObjectList(); if(empty($rows) == false){ echo '
'; echo ''; // KS: Added 2 x opening div and P tag below echo '
'; echo '
'; echo '

Select event survey date from the list below.

'; echo ''; // KS: added closing div below echo '
'; $is_qry_prm = '?eid='.$is_eid.'&sid='.$surveyid; // KS: Added opening div and p tag below echo '
'; echo '

Alternatively, to see the independent survey data click the button below.

'; echo 'Independent Survey Data'; // KS: Added closing div below echo '
'; // KS: Added closing div below echo '
'; echo '
'; if(strlen($eventid ?? '') == 0){ //trigger ddEventDates on change function //echo ''; $eventid = $latestEventId; //echo 'event id: ' . $latestEventId; } //row empty check -END } else { echo '
No events created yet.
'; } //Event dates dropdown - END // KS: Added HR tag echo '
'; //Survey Data Display - START $baseSurveyUrl = 'https://tinyforest.earthwatch.org.uk/event-surveys/'; $surveyUrl = ""; switch ($surveyid) { case 10: //echo "Carbon Capture"; $surveyUrl = $baseSurveyUrl . 'carbon-capture-update'; break; case 20: //echo "Thermal Comfort"; $surveyUrl = $baseSurveyUrl . 'thermal-comfort-update'; break; case 30: //echo "Flood Management A"; $surveyUrl = $baseSurveyUrl . 'flood-managment-a-update'; break; case 40: //echo "Flood Management B"; $surveyUrl = $baseSurveyUrl . 'flood-managment-b-update'; break; case 50: //echo "Butterfly Time Count"; $surveyUrl = $baseSurveyUrl . 'butterflies-timed-count-update'; break; case 60: //echo "Butterfly Species List"; $surveyUrl = $baseSurveyUrl . 'butterflies-free-count-update'; break; case 70: //echo "Soil Dwellers"; $surveyUrl = $baseSurveyUrl . 'soil-dwellers-update'; break; case 80: //echo "Pollinators"; $surveyUrl = $baseSurveyUrl . 'pollinators-update'; break; //default: //Survey Id == 0 //$app->redirect(JRoute::_("https://tinyforest.earthwatch.org.uk/tiny-forest-admin-screen")); } if(strlen($eventid ?? '') > 0 && $surveyid > 0){ //RETRIEVE - Survey Data - START $query = $db->getQuery(true); $sql = "call bitnami_joomla.ew_survey_data_get(". $db->quote($eventid) . ", " . $db->quote($surveyid) .")"; $db->setQuery($sql); //print_r('qyery : ' .$sql); $rows = $db->loadObjectList(); $surveyCount = count($rows); if(empty($rows) == false){ // KS: Added class surv-resp-cnt to div echo '
Survey response count : ' . $surveyCount . '
'; echo ''; echo ''; echo ''; #echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; foreach($rows as $itemrow) { $usersurveyid = $itemrow->id; $editSurveyUrl = $surveyUrl . '?edid=' . $usersurveyid; $delSurveyUrl = $formAction . '?sid=' . $surveyid . '&delid=' . $usersurveyid . '&eid=' . $app->input->get('eid', ''); $fullName = $itemrow->full_name; $eventDate = $itemrow->event_date; #$eventType = $itemrow->event_type; $stemText = "["; //Stem 1 if(strlen($itemrow->ddh_1 ?? '')>0){ $stemText = $stemText . $itemrow->ddh_1 . ', '; if(strlen($itemrow->dbh_1 ?? '') > 0) { $stemText = $stemText . $itemrow->dbh_1 . ']'; } else { $stemText = $stemText . ']'; } } //Stem 2 if(strlen($itemrow->ddh_2 ?? '')>0){ $stemText = $stemText . ' [' .$itemrow->ddh_2 . ', '; if(strlen($itemrow->dbh_2 ?? '') > 0) { $stemText = $stemText . $itemrow->dbh_2 . ']'; } else { $stemText = $stemText . ']'; } } //Stem 3 if(strlen($itemrow->ddh_3 ?? '')>0){ $stemText = $stemText . ' [' .$itemrow->ddh_3 . ', '; if(strlen($itemrow->dbh_3 ?? '') > 0) { $stemText = $stemText . $itemrow->dbh_3 . ']'; } else { $stemText = $stemText . ']'; } } //Stem 4 if(strlen($itemrow->ddh_4 ?? '')>0){ $stemText = $stemText . ' [' .$itemrow->ddh_4 . ', '; if(strlen($itemrow->dbh_4 ?? '') > 0) { $stemText = $stemText . $itemrow->dbh_4 . ']'; } else { $stemText = $stemText . ']'; } } //Stem 5 if(strlen($itemrow->ddh_5 ?? '')>0){ $stemText = $stemText . ' [' .$itemrow->ddh_5 . ', '; if(strlen($itemrow->ddh_5 ?? '') > 0) { $stemText = $stemText . $itemrow->ddh_5 . ']'; } else { $stemText = $stemText . ']'; } } //remove if there is nothing other than '[' if($stemText == "["){ $stemText = ""; } $treeHeight = $itemrow->Tree_height_cm; $talltree = $itemrow->tree_too_tall; if($talltree == 1){ $treeHeight = "too tall to measure"; } $stemCount = $itemrow->no_of_stems; $tagSpecies = $itemrow->species_name; $isTreeDead = $itemrow->is_tree_dead; $recommendedSpecies = $itemrow->recommended_species; $eventSurveyDate = $itemrow->event_date; $submittedOn = $itemrow->submitted_on; echo ''; #echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if($isTreeDead == 'Yes'){ echo ''; }else{ echo ''; } if($itemrow->status == 1){ echo ''; }else{ echo ''; } echo ''; } //RETRIEVE - tag records - END echo ''; echo '
Full nameSpecies Name:Tag IdDead Tree?Recommmended SpeciesTree Height in cmNo. of StemsStems [dbh , ddh] in mmEvent/Survey DateSubmitted onEditStatus
' . $fullName . '
' . $tagSpecies . '
' . $isTreeDead . '
' . $recommendedSpecies . '
' . $treeHeight . '
' . $stemCount . '
' . $stemText . '
' . $eventSurveyDate . '
' . $submittedOn . '
EDITDeleteRestore
'; //row empty check -END } else { echo '
No survey data submitted yet
'; } }else{ //redirect user to the home page echo ''; } echo '
'; //Survey Data Display - END ?>

Read more …Carbon Storage (2)

  • Hits: 31

Test Product FWW

Read more …Test Product FWW

  • Hits: 171

Survey Submission Page


Warning: include(/var/www/html/joomla/ew_files/ew_system/modules/surveys/public_survey_submission_page.php): Failed to open stream: No such file or directory in /var/www/html/joomla/tmp/regularlabs/custom_php/1550205_32e99152337b36727318ea6881571149 on line 11

Warning: include(): Failed opening '/var/www/html/joomla/ew_files/ew_system/modules/surveys/public_survey_submission_page.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/joomla/tmp/regularlabs/custom_php/1550205_32e99152337b36727318ea6881571149 on line 11

Read more …Survey Submission Page

  • Hits: 316

More Articles …