Location: PHPKode > projects > ampCAD > f_callList.inc.php
<?php

// *******************************
// f_callList.inc.php
//
// function callList
// *******************************

// *******************************
// List calls
// *******************************

function callList( $result ) {
	include 'globals.inc.php';
?>
<table align=center cellpadding=0 cellspacing=0 borders=0>
	<tr bgcolor="<?php echo $global_tblHeader;?>">
		<td align=center><b><u>Call ID</u></b></td>
		<td>&nbsp;&nbsp;&nbsp;</td>
		<td align=center><b><u>Date</u></b></td>
		<td>&nbsp;&nbsp;&nbsp;</td>
		<td align=center><b><u>Time</u></b></td>
		<td>&nbsp;&nbsp;&nbsp;</td>
		<td align=center><b><u>Location</u></b></td>
		<td>&nbsp;&nbsp;&nbsp;</td>
		<td align=center><b><u>City</u></b></td>
		<td>&nbsp;&nbsp;&nbsp;</td>
		<td align=center><b><u>Type</u></b></td>
		<td>&nbsp;&nbsp;&nbsp;</td>
		<td align=center><b><u>Channel</u></b></td>
		<td>&nbsp;&nbsp;&nbsp;</td>
	</tr>
<?php
	for( $x = 0; $x < mysql_num_rows( $result ); $x++ ) {
		echo "  <tr bgcolor=";
		if( $x % 2 ) echo "$global_tblColor1>\n";
		else echo "$global_tblColor2>\n";

		$data = mysql_fetch_object( $result );
		echo "		<td><a href=\"index.php?class=inquiry&function=detail&id=$data->callID\">$data->callID</a></td>\n";
		echo "		<td>&nbsp;&nbsp;&nbsp</td>\n";
		echo "		<td>$data->callDate</td>\n";
		echo "		<td>&nbsp;&nbsp;&nbsp</td>\n";
		echo "		<td>$data->callTime</td>\n";
		echo "		<td>&nbsp;&nbsp;&nbsp</td>\n";
		echo "		<td>$data->locationAddress</td>\n";
		echo "		<td>&nbsp;&nbsp;&nbsp</td>\n";
		echo "		<td>$data->locationCity</td>\n";
		echo "		<td>&nbsp;&nbsp;&nbsp</td>\n";
		echo "		<td>$data->callTypeDescription : $data->incidentDescription</td>\n";
		echo "		<td>&nbsp;&nbsp;&nbsp</td>\n";
		echo "		<td>$data->channelDescription</td>\n";
		echo "		<td>&nbsp;&nbsp;&nbsp</td>\n";
		echo "	</tr>\n";
	}

	echo "</table>\n";
}

function showGoogleMap( $result ) {
	include 'globals.inc.php';
	include 'dbaccess.inc.php';
?>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<?php echo $googleMapKey;?>"
      type="text/javascript"></script>
    <script type="text/javascript">

    //<![CDATA[

   var map;
   var marker;
   var point;
   var callIcon;

   function load()
   {
      map = new GMap2(document.getElementById("map"));
      map.addControl(new GSmallMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter( new GLatLng(<?php echo $googleMapLat;?>, <?php echo $googleMapLog; ?>) , 11 );

<?php
	for( $x = 0; $x < mysql_num_rows( $result ); $x++ ) {
		$data = mysql_fetch_object( $result );
		$sql_unit = "select * from tblCallUnits join tblUnit on (tblCallUnits.callUnitsAssigned = tblUnit.unitID) where callUnitsCall = $data->callID";
		$result_unit = mysql_query( $sql_unit, $db );
		if( !$result_unit ) error_process( $db );

		$sql_action = "SELECT * FROM tblCallLog where logCall = $data->callID order by logID desc";
		$result_action = mysql_query( $sql_action, $db );
		if( !$result_action ) error_process( $db );
		$data_action = mysql_fetch_object( $result_action );

		$callInfo = "<table><tr><td align=right>Call:</td><td>$data->callID</td></tr>";
		$callInfo .= "<tr><td align=right>Initiated:</td><td>$data->callDate at $data->callTime</td></tr>";
		$callInfo .= "<tr><td align=right>Type:</td><td>$data->incidentDescription</td></tr>";
		$callInfo .= "<tr><td align=right>Units Assigned:</td><td>";

		for( $y = 0; $y < mysql_num_rows( $result_unit ); $y++ ) {
			$data_unit = mysql_fetch_object( $result_unit );
			$callInfo .=  "$data_unit->unitCallSign ";
		}

		$callInfo .= "</td></tr><td align=right>Last Action:</td><td>$data_action->logMessage</td></tr></table>";

?>
      point = new GLatLng(<?php echo $data->locationLat; ?>, <?php echo $data->locationLong; ?>);

	  callIcon = new GIcon();
	  callIcon.image = "http://labs.google.com/ridefinder/images/mm_20_<?php echo $data->callTypeColor;?>.png";
	  callIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
	  callIcon.iconSize = new GSize(12, 20);
	  callIcon.shadowSize = new GSize(22, 20);
	  callIcon.iconAnchor = new GPoint(6, 20);
	  callIcon.infoWindowAnchor = new GPoint(5, 1);

      marker = new GMarker( point, callIcon );
      marker.bindInfoWindow( "<?php echo $callInfo; ?>" );
      map.addOverlay( marker );
<?php

	}
?>

   }

    //]]>
    </script>
  <body onload="load()" onunload="GUnload()">
  	<hr>
    <center><div id="map" style="width: 500px; height: 500px"></div></center>
<?php
}

?>
Return current item: ampCAD