\n"; echo "\n"; echo "Calum's Dive Log\n"; echo "\n"; echo "\n"; ?> \n"; echo "\n"; echo "\n"; $i = 1; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $years = array(); $tot_time_sec = 0; $big_ar = array(); while ($data = fgetcsv ($divefile, 1000, ",")) { $big_ar[$data[1]] = $data; } for ($i=1;$i<=count($big_ar);$i++) { $data = $big_ar[$i]; if (!in_array(substr($data[2],6,4),$years)) { $years[count($years)] = substr($data[2],6,4); } if ($year == substr($data[2],6,4)) { $tot_time_sec = $tot_time_sec + $data[6]; echo "\n"; # Dive Number echo ""; # Date echo ""; # Site echo ""; # Max Depth echo "\n"; # Dive Time echo "\n"; echo "\n"; echo "\n"; } else { $tot_time_sec = $tot_time_sec + $data[6]; } # $i++; } echo "
Dive#DateSiteMax DepthDive TimeCumulative
".$i."."; $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 ""; echo $data[19].", ".$data[18]; echo ""; echo $data[8]."m"; echo ""; $test = floor($data[6] / 60); $test1 = $test * 60; echo $test." : ".substr("00".($data[6] - $test1),strlen($data[6] - $test1),2); 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[".$years[$i]."] "; } echo "

"; } $deepest = 0; $longest = 0; $cumulative = 0; function do_dive($diveno) { $divefile = fopen("cas.csv","r"); $big_ar = array(); while ($data = fgetcsv ($divefile, 1000, ",")) { $big_ar[$data[1]] = $data; } for ($i=1;$i<=count($big_ar);$i++) { $data = $big_ar[$i]; if ($data[8] > $deepest) { $deepest = $data[8]; } if ($data[6] > $longest) { $longest = $data[6]; } $cumulative = $cumulative + $data[6]; if ($data[1] == $diveno) { break; } } echo "\n"; echo "\n"; echo "Dive# ".$diveno." - ".$data[19].", ".$data[18]."\n"; echo "\n"; echo "\n"; echo "\n"; echo "

Dive #".$diveno." - ".$data[19].", ".$data[18]."

\n"; echo "

\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
"; if ($diveno != 1) { echo " <<< Previous"; } else { echo " "; } echo " Summary"; if ($diveno != count($big_ar)) { echo "Next >>>"; } else { echo " "; } 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 " \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 " \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 " \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 " \n"; echo " \n"; echo " \n"; $test = floor($longest / 60); $test1 = $test * 60; echo " \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 " \n"; echo " \n"; echo " \n"; $hrs = floor($data[7] / 3600); $the_rest = $data[7] - ($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 " \n"; $test = floor($data[6] / 60); $test1 = $test * 60; 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 " \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 " \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 " \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 " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
Dive #DateTime   
".$diveno."".$data[2]."".$data[3]."   
      

Depth

  
MaxAvg    
".$data[8]."m".$data[9]."m 

To Date

   DeepestLongestCumulative Time
Surface IntervalDive Time ".$deepest."m".$test.":".substr("00".($longest - $test1),strlen($longest - $test1),2)."".$hrs.":".$mins.":".$secs."
".$hrs.":".$mins.":".$secs."".$test.":".substr("00".($data[6] - $test1),strlen($data[6] - $test1),2)."    
      
   

Temperature

EnvironmentVisibilityWeatherAirDepthSurface (End)
".$data[38]."".$data[21]."".$data[20]."".$data[22]."C".$data[23]."C".$data[24]."C
      
BuddyDive MasterDive CentreBoat  
".$data[25]."".$data[26]."".$data[39]."".$data[27]."   
\n"; echo "

Profile

\n"; echo "

"; if (file_exists("../gallery/galleries/".$diveno)) { echo "

Photo Gallery

\n"; } if (file_exists("html/".$diveno.".htm")) { echo "

Write up available...

\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; # } # } } ?>