=".date("Y/m/d")." ORDER BY fldDateClose"; $res = mysqli_query($GLOBALS['con'], $qry); $num = mysqli_num_rows($res); if ($num == 0){ mysqli_free_result($res); mysqli_close($GLOBALS['con']); echo "

No Vacancies AvailableClick here to back.

"; exit; }else{ while ($row = mysqli_fetch_assoc($res)){ if ($row['fldRank']=="Master"){ $GLOBALS['Master'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Chief_Officer"){ $GLOBALS['Chief_Officer'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="First_Officer"){ $GLOBALS['First_Officer'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Second_Officer"){ $GLOBALS['Second_Officer'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Third_Officer"){ $GLOBALS['Third_Officer'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Chief_Engineer"){ $GLOBALS['Chief_Engineer'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Second_Engineer"){ $GLOBALS['Second_Engineer'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Third_Engineer"){ $GLOBALS['Third_Engineer'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Fourth_Engineer"){ $GLOBALS['Fourth_Engineer'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Electro_Tech_Officer"){ $GLOBALS['Electro_Tech_Officer'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Bosun"){ $GLOBALS['Bosun'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Able_Body"){ $GLOBALS['Able_Body'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Oiler"){ $GLOBALS['Oiler'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Greaser"){ $GLOBALS['Greaser'][0] += $row['fldPositions']; }elseif ($row['fldRank']=="Cook"){ $GLOBALS['Cook'][0] += $row['fldPositions']; } } } mysqli_free_result($res); } function populateCrews(){ $qry = "SELECT * FROM tblCrews ORDER BY fldDateAV"; $res = mysqli_query($GLOBALS['con'], $qry); $num = mysqli_num_rows($res); if ($num == 0){ echo "

No Vacancies AvailableClick here to back.

"; }else{ while ($row = mysqli_fetch_assoc($res)){ if (isDateInRange($row['fldDateAV'])==true){ if ($row['fldRank']=="Master"){ $GLOBALS['Master'][1] += 1; }elseif ($row['fldRank']=="Chief_Officer"){ $GLOBALS['Chief_Officer'][1] += 1; }elseif ($row['fldRank']=="First_Officer"){ $GLOBALS['First_Officer'][1] += 1; }elseif ($row['fldRank']=="Second_Officer"){ $GLOBALS['Second_Officer'][1] += 1; }elseif ($row['fldRank']=="Third_Officer"){ $$GLOBALS['Third_Officer'][1] += 1; }elseif ($row['fldRank']=="Chief_Engineer"){ $GLOBALS['Chief_Engineer'][1] += 1; }elseif ($row['fldRank']=="Second_Engineer"){ $GLOBALS['Second_Engineer'][1] += 1; }elseif ($row['fldRank']=="Third_Engineer"){ $GLOBALS['Third_Engineer'][1] += 1; }elseif ($row['fldRank']=="Fourth_Engineer"){ $GLOBALS['Fourth_Engineer'][1] += 1; }elseif ($row['fldRank']=="Electro_Tech_Officer"){ $GLOBALS['Electro_Tech_Officer'][1] += 1; }elseif ($row['fldRank']=="Bosun"){ $$GLOBALS['Bosun'][1] += 1; }elseif ($row['fldRank']=="Able_Body"){ $GLOBALS['Able_Body'][1] += 1; }elseif ($row['fldRank']=="Oiler"){ $GLOBALS['Oiler'][1] += 1; }elseif ($row['fldRank']=="Greaser"){ $GLOBALS['Greaser'][1] += 1; }elseif ($row['fldRank']=="Cook"){ $GLOBALS['Cook'][1] += 1; } } } } mysqli_free_result($res); } function populateTable(){ echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; //New row echo ""; echo ""; echo ""; echo ""; echo ""; echo "
RankVacancySeafarer
Master".$GLOBALS['Master'][0]."".$GLOBALS['Master'][1]."
Chief Officer".$GLOBALS['Chief_Officer'][0]."".$GLOBALS['Chief_Officer'][1]."
Second Officer".$GLOBALS['Second_Officer'][0]."".$GLOBALS['Second_Officer'][1]."
Third Officer".$GLOBALS['Third_Officer'][0]."".$GLOBALS['Third_Officer'][1]."
Chief Engineer".$GLOBALS['Chief_Engineer'][0]."".$GLOBALS['Chief_Engineer'][1]."
Second Engineer".$GLOBALS['Second_Engineer'][0]."".$GLOBALS['Second_Engineer'][1]."
Third Engineer".$GLOBALS['Third_Engineer'][0]."".$GLOBALS['Third_Engineer'][1]."
Fourth Engineer".$GLOBALS['Fourth_Engineer'][0]."".$GLOBALS['Fourth_Engineer'][1]."
Electro Tech Officer".$GLOBALS['Electro_Tech_Officer'][0]."".$GLOBALS['Electro_Tech_Officer'][1]."
Bosun".$GLOBALS['Bosun'][0]."".$GLOBALS['Bosun'][1]."
Able Body".$GLOBALS['Able_Body'][0]."".$GLOBALS['Able_Body'][1]."
Oiler".$GLOBALS['Oiler'][0]."".$GLOBALS['Oiler'][1]."
Greaser".$GLOBALS['Greaser'][0]."".$GLOBALS['Greaser'][1]."
Cook".$GLOBALS['Cook'][0]."".$GLOBALS['Cook'][1]."
"; } function isDateInRange($strDate){ $dToday = date_create_from_format('Y/m/d', date('Y/m/d')); $dDate = date_create($strDate); $diff = date_diff($dToday, $dDate);//$dDate-$dToday $intDiff = (int)($diff->format('%R%a')); //echo "

intDiff = ".$intDiff; if ($intDiff < LIMIT_DATE_PAST){ return false; }elseif ($intDiff > LIMIT_DATE_FUTURE){ return false; }else{ return true; } } populateVacancies(); populateCrews(); ?> Maritime Network

Seafarer Network