category_name); foreach ($categories_in_payment as $key => $category_in_payment) { $category_id = explode('*', $category_in_payment); if ($category_id[0] == $cat_name->id) { $category_id_for_report[] = $category_id[0]; } } } } $category_id_for_reports = array_unique($category_id_for_report); ?> id, $category_id_for_reports)) { ?>
category ?> category_name; $category_names_and_amountss = explode(',', $category_names_and_amountss); foreach ($category_names_and_amountss as $category_name_and_amountt) { $category_namee = explode('*', $category_name_and_amountt); if (($category->id == $category_namee[0])) { $category_quantity = $category_namee[3]; } } } echo $category_quantity; ?> currency; ?> category_name; $category_names_and_amounts = explode(',', $category_names_and_amounts); foreach ($category_names_and_amounts as $category_name_and_amount) { $category_name = explode('*', $category_name_and_amount); if (($category->id == $category_name[0])) { $amount_per_category[] = $category_name[1]; } } } if (!empty($amount_per_category)) { echo array_sum($amount_per_category); $total_payment_by_category[] = array_sum($amount_per_category); } else { echo '0'; } $amount_per_category = NULL; ?>

currency; ?>
currency; ?> flat_discount; } if ($paid_number > 0) { echo array_sum($discount); } else { echo '0'; } } else { echo '0'; } ?>
currency; ?> 0) { $gross = array_sum($total_payment_by_category) - array_sum($discount) + array_sum($vat); echo $gross; } else { echo '0'; } } else { echo '0'; } ?>
currency; ?> hospital_amount; } if ($paid_number > 0) { $hospital_amount = array_sum($hospital_amount); echo $hospital_amount; } else { echo '0'; } } else { echo '0'; } ?>
currency; ?> doctor_amount; } if ($paid_number > 0) { $gross_doctor_amount = array_sum($doctor_amount); echo $gross_doctor_amount; } else { echo '0'; } } else { echo '0'; } ?>
category ?> currency; ?> category; if (($category->category == $category_name)) { $amount_per_category[] = $expense->amount; } } if (!empty($amount_per_category)) { $total_expense_by_category[] = array_sum($amount_per_category); echo array_sum($amount_per_category); } else { echo '0'; } $amount_per_category = NULL; ?>
currency; ?>
currency; ?> 0) { $gross = $hospital_amount; echo $gross; } } elseif (!empty($payments)) { if (($paid_number > 0)) { $gross = $hospital_amount; echo $gross; } } else { echo '0'; } ?>
currency; ?>
currency; ?> deposited_amount; } if ($paid_number > 0) { $deposited_amount = array_sum($deposited_amount); echo $deposited_amount; } else { echo '0'; } } else { echo '0'; } ?>
currency; ?> deposited_amount; } if ($paid_number > 0) { $deposited_amount = array_sum($deposited_amount); echo $gross_bill - $deposited_amount; } else { echo '0'; } } else { echo '0'; } ?>
currency; ?>