$diveno = $_REQUEST['diveno']; $year = $_REQUEST['year']; if(!isset($diveno)) { $diveno = 0; } if ($diveno == 0) { if (!isset($year)) { $year = 2002; } all_dives($year); } else { do_dive($diveno); } $dayst[1] = 'st'; $dayst[2] = 'nd'; $dayst[3] = 'rd'; $dayst[4] = 'th'; $dayst[5] = 'th'; $dayst[6] = 'th'; $dayst[7] = 'th'; $dayst[8] = 'th'; $dayst[9] = 'th'; $dayst[10] = 'th'; $dayst[11] = 'th'; $dayst[12] = 'th'; $dayst[13] = 'th'; $dayst[14] = 'th'; $dayst[15] = 'th'; $dayst[16] = 'th'; $dayst[17] = 'th'; $dayst[18] = 'th'; $dayst[19] = 'th'; $dayst[20] = 'th'; $dayst[21] = 'st'; $dayst[22] = 'nd'; $dayst[23] = 'rd'; $dayst[24] = 'th'; $dayst[25] = 'th'; $dayst[26] = 'th'; $dayst[27] = 'th'; $dayst[28] = 'th'; $dayst[29] = 'th'; $dayst[30] = 'th'; $dayst[31] = 'st'; $months[1] = 'January'; $months[2] = 'February'; $months[3] = 'March'; $months[4] = 'April'; $months[5] = 'May'; $months[6] = 'June'; $months[7] = 'July'; $months[8] = 'August'; $months[9] = 'September'; $months[10] = 'October'; $months[11] = 'November'; $months[12] = 'December'; function all_dives($year) { global $dayst, $months; $dayst[1] = 'st'; $dayst[2] = 'nd'; $dayst[3] = 'rd'; $dayst[4] = 'th'; $dayst[5] = 'th'; $dayst[6] = 'th'; $dayst[7] = 'th'; $dayst[8] = 'th'; $dayst[9] = 'th'; $dayst[10] = 'th'; $dayst[11] = 'th'; $dayst[12] = 'th'; $dayst[13] = 'th'; $dayst[14] = 'th'; $dayst[15] = 'th'; $dayst[16] = 'th'; $dayst[17] = 'th'; $dayst[18] = 'th'; $dayst[19] = 'th'; $dayst[20] = 'th'; $dayst[21] = 'st'; $dayst[22] = 'nd'; $dayst[23] = 'rd'; $dayst[24] = 'th'; $dayst[25] = 'th'; $dayst[26] = 'th'; $dayst[27] = 'th'; $dayst[28] = 'th'; $dayst[29] = 'th'; $dayst[30] = 'th'; $dayst[31] = 'st'; $months[1] = 'January'; $months[2] = 'February'; $months[3] = 'March'; $months[4] = 'April'; $months[5] = 'May'; $months[6] = 'June'; $months[7] = 'July'; $months[8] = 'August'; $months[9] = 'September'; $months[10] = 'October'; $months[11] = 'November'; $months[12] = 'December'; $divefile = fopen("cas.csv","r"); echo "\n"; echo "
\n"; echo "Dive# | "; echo "Date | "; echo "Site | "; echo "Max Depth | "; echo "Dive Time | "; echo "Cumulative | "; echo "
".$i.". | "; # Date echo ""; $thedate = substr($data[2],0,2) * 1; $themonth = substr($data[2],3,2) * 1; echo substr($data[2],0,2).$dayst[$thedate]." ".$months[$themonth]." ".substr($data[2],6,4); echo " | "; # Site echo ""; echo $data[19].", ".$data[18]; echo " | "; # Max Depth echo ""; echo $data[8]."m"; echo " | \n"; # Dive Time echo ""; $test = floor($data[6] / 60); $test1 = $test * 60; echo $test." : ".substr("00".($data[6] - $test1),strlen($data[6] - $test1),2); echo " | \n"; echo ""; $hrs = floor($tot_time_sec / 3600); $the_rest = $tot_time_sec - ($hrs * 3600); $mins = substr("00".(floor($the_rest / 60)),strlen(floor($the_rest / 60)),2); $secs = substr("00".($the_rest - ($mins * 60)),strlen(($the_rest - ($mins * 60))),2); echo $hrs." : ".$mins." : ".$secs; echo " | \n"; echo "
\n"; echo "
";
for ($i=0;$i
Dive #".$diveno." - ".$data[19].", ".$data[18]."
\n"; echo "\n"; echo "
"; if ($diveno != 1) { echo " <<< Previous"; } else { echo " "; } echo " | \n"; echo "Summary | \n"; echo ""; if ($diveno != count($big_ar)) { echo "Next >>>"; } else { echo " "; } echo " | \n"; echo "
Dive # | \n"; echo "Date | \n"; echo "Time | \n"; echo "\n"; echo " | \n"; echo " | \n"; echo " | |
".$diveno." | \n"; echo "".$data[2]." | \n"; echo "".$data[3]." | \n"; echo "\n"; echo " | \n"; echo " | \n"; echo " | |
\n"; echo " | \n"; echo " | \n"; echo " | \n"; echo " | \n"; echo " | \n"; echo " | |
Depth | \n";
echo " \n"; echo " | \n"; echo " | ||||
Max | \n"; echo "Avg | \n"; echo "\n"; echo " | \n"; echo " | \n"; echo " | \n"; echo " | |
".$data[8]."m | \n"; echo "".$data[9]."m | \n"; echo "\n"; echo " | To Date | \n";
echo " |||
\n"; echo " | \n"; echo " | \n"; echo " | Deepest | \n"; echo "Longest | \n"; echo "Cumulative Time | \n"; echo "|
Surface Interval | \n"; echo "Dive Time | \n"; echo "\n"; echo " | ".$deepest."m | \n"; $test = floor($longest / 60); $test1 = $test * 60; echo "".$test.":".substr("00".($longest - $test1),strlen($longest - $test1),2)." | \n"; $hrs = floor($cumulative / 3600); $the_rest = $cumulative - ($hrs * 3600); $mins = substr("00".(floor($the_rest / 60)),strlen(floor($the_rest / 60)),2); $secs = substr("00".($the_rest - ($mins * 60)),strlen(($the_rest - ($mins * 60))),2); echo "".$hrs.":".$mins.":".$secs." | \n"; echo "|
".$hrs.":".$mins.":".$secs." | \n"; $test = floor($data[6] / 60); $test1 = $test * 60; echo "".$test.":".substr("00".($data[6] - $test1),strlen($data[6] - $test1),2)." | \n"; echo "\n"; echo " | \n"; echo " | \n"; echo " | \n"; echo " | |
\n"; echo " | \n"; echo " | \n"; echo " | \n"; echo " | \n"; echo " | \n"; echo " | |
\n"; echo " | \n"; echo " | \n"; echo " | Temperature | \n";
echo " |||
Environment | \n"; echo "Visibility | \n"; echo "Weather | \n"; echo "Air | \n"; echo "Depth | \n"; echo "Surface (End) | \n"; echo "|
".$data[38]." | \n"; echo "".$data[21]." | \n"; echo "".$data[20]." | \n"; echo "".$data[22]."C | \n"; echo "".$data[23]."C | \n"; echo "".$data[24]."C | \n"; echo "|
\n"; echo " | \n"; echo " | \n"; echo " | \n"; echo " | \n"; echo " | \n"; echo " | |
Buddy | \n"; echo "Dive Master | \n"; echo "Dive Centre | \n"; echo "Boat | \n"; echo "\n"; echo " | \n"; echo " | |
".$data[25]." | \n"; echo "".$data[26]." | \n"; echo "".$data[39]." | \n"; echo "".$data[27]." | \n"; echo "\n"; echo " | \n"; echo " | \n"; echo " |
Profile
\n"; echo ""; if (file_exists("../gallery/galleries/".$diveno)) { echo "\n"; } if (file_exists("html/".$diveno.".htm")) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; # $proffile = fopen("cas\$PRO.csv","r"); # $profdata = array(); # while ($prof = fgetcsv ($proffile, 1000, ",")) { # if ($prof[0] == $diveno) { # $profdata[count($prof)] = $prof; # } # } } ?>