Jump to content

invalid argument on line 61


ronnie88

Recommended Posts

	
<?
include ("header.php");

global $database_tbl_prefix;

$ferry = new Ferry();

$ferries = $ferry->getAll();


echo "<script language=\"javascript\">\n";
echo "function openpopup(\$id){\n";


for ($i = 1; $i <= sizeof($ferries); $i++) {
echo "if (\$id == $i) {";
echo "var popurl=\"ferrydetail.php?id=$i\";\n";
echo "}\n";
}
echo "winpops=window.open(popurl,\"\",\"width=400,height=338,scrollbars,\")\n";
echo "}\n";
echo "</script>\n";


?>
<div class="content2">
<div class="content2-pagetitle">Ferry Activity</div>	
<div class="content-txtbox-noshade">
	<div class="content-title-noshade-size2">List Ferry</div>

	<table>
	<tr>
	<th>Dep. Code</th>	
	<th>Arr. Code</th>
	<th>Aircraft</th>

	<th>Type</th>
	<th>Deadline</th>
	<th>Pilot</th>
	<th></th>
	<th></th>
<?
if ($isadminuser == '1') {
	?>
	<th></th>
	<th></th>
	<th></th>
	<?
}

echo "</tr>\n";

foreach ($ferries as $g) {
$this_pilotname = get_pilotnamefromid($g['bookedby']);

$t = get_datefromutc($g['deadline']);
$deadline = $t;

?>
	<tr>	

	<td><? echo $g['depart_code'] ?></td>

	<td><? echo $g['arrive_code'] ?></td>
	<td><? echo $g['aircraft'] ?></td>

	<td><? echo $g['ferry_type'] ?></td>
	<td><? echo $deadline ?></td>
	<td><? echo $this_pilotname ?></td>
	<td><a href="javascript:openpopup(<? echo $g['id'] ?>)">Details</a></td>
<?
	if ($f['complete'] == '0') {
		if ($g['bookedby'] == '0') { // if this ferry is not taken by another
			echo "<td><a href =\"do_add.php?type=takeferry&id=".$g['id']."\">take</a></td>";
		} else {
			echo "<td></td>";
		}
	} else {
		?>
			<td></td>
		<?
	}

	if ($isadminuser == '1') {
		if ($complete == '1') {
			echo "<td>DONE</td>";
		} else {
			echo "<td></td>";
		}
		?>

		<td><a href="do_delete.php?id=<? echo $g['id'] ?>&table=ferry&form=listferry" onClick="return confirm('Confirm Delete of this item');"><img border="0" src="/vadminicons/item_delete.png" alt="delete"/></a></td>
		<?
	}

	echo "</tr>";
}
?>
</table>
</div>
</div>
<?
include ("footer.php");
?>

 

 

Im getting an invalid argument on line 61 which is:

	foreach ($ferries as $g) {

any ideas thanks very much

Link to comment
https://forums.phpfreaks.com/topic/105803-invalid-argument-on-line-61/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.