query("SELECT SUM(total_amount) AS total_amount FROM payments WHERE user_id='$id' AND payment_type=1");
$invoice_sum = $temp_result->fetch_array();
$temp_result = $db->query("SELECT SUM(total_amount) AS total_amount FROM payments WHERE user_id='$id' AND (payment_type=2 OR payment_type=3)");
$payment_sum = $temp_result->fetch_array();
$total_balance = $invoice_sum['total_amount'] - $payment_sum['total_amount'];
?>
Balance:
| Description |
Due / Paid Date |
Status |
Type |
Payments / Credit |
Invoices |
Download |
query("SELECT SUM(amount) AS total_amount FROM payments WHERE user_id='$id' AND payment_type=1");
$invoice_sum_sql = $temp_result->fetch_array();
$invoice_sum = $invoice_sum_sql['total_amount'];
while($payment = $payments->fetch_array() ){
$rowBgColor = '';
if($payment['payment_type'] == 1)
{
if(date('Y-m-d') > $payment['due_date'] && $payment['status'] == 1)
{
$rowBgColor = '#e02222';
}
else
{
$rowBgColor = '#f0ad4e';
}
}
else if($payment['payment_type'] == 2)
{
$rowBgColor = '#5cb85c';
}
else
{
$rowBgColor = '#428bca';
}
?>
|
|
|
|
|
|
Download
|