function deleteBroker($handler, $brokerId)
{
    $brokerInfo = getBasicBrokerInfo($handler, $brokerId);
    $trucks = mysql_query("SELECT * FROM truck WHERE brokerId = {$brokerId}", $handler);
    while ($truck = mysql_fetch_assoc($trucks)) {
        deleteTruck($handler, $truck['truckId']);
    }
    $drivers = mysql_query("SELECT * FROM driver WHERE brokerId = {$brokerId}", $handler);
    while ($driver = mysql_fetch_assoc($drivers)) {
        deleteDriver($handler, $driver['driverId']);
    }
    deleteAddress($handler, $brokerInfo['addressId']);
    mysql_query("DELETE FROM broker WHERE brokerId = '{$brokerId}'", $handler);
    return $brokerId;
}
Esempio n. 2
0
if ($_GET['startDate'] == '') {
    $fromDate = '0000-00-00';
} else {
    $fromDate = to_YMD(mysql_real_escape_string($_GET['startDate']));
}
if ($_GET['endDate'] == '') {
    $toDate = date("Y-m-d");
} else {
    $toDate = to_YMD(mysql_real_escape_string($_GET['endDate']));
}
$nextInvoiceId = 0;
$queryStatus = "SHOW TABLE STATUS LIKE 'report'";
$status = mysql_query($queryStatus, $conexion);
$stat = mysql_fetch_assoc($status);
$nextInvoice = $stat['Auto_increment'];
$brokerInfo = getBasicBrokerInfo($conexion, $broker);
$termDays = $brokerInfo['termValue'];
$percentage = $brokerInfo['brokerPercentage'];
if (isset($_GET['driverId']) && $_GET['driverId'] != '' && $_GET['driverId'] != 0) {
    $driver = $_GET['driverId'];
    $isDriver = true;
    $driverInfo = getBasicDriverInfo($conexion, $driver);
    $termDays = $driverInfo['termValue'];
    $percentage = $driverInfo['driverPercentage'];
}
?>

<table class="topt" align="center" >
<tr>
	<td width="30%" align="left" >
		<table class="invinfo" width='100%'>