<?php

include "../../myDatabase2.php";
$month = $_GET['month'];
$days = $_GET['days'];
$year = $_GET['year'];
$month1 = $_GET['month1'];
$days1 = $_GET['days1'];
$year1 = $_GET['year1'];
$dateSource = $_GET['dateSource'];
$ro = new database2();
$date = $year . "-" . $month . "-" . $days;
$date1 = $year1 . "-" . $month1 . "-" . $days1;
echo "<font size=2>Source <br> <b>{$dateSource}</b> <Br> Date Range <Br><b>" . $ro->reformatDate($date) . " to " . $ro->reformatDate($date1) . "</b><center><br><br></font>";
$ro->companyPaymentReport($date, $date1, $dateSource);
echo "<br><font class='informationLabel'>Company:</font>&nbsp;" . $ro->getRegistrationDetails_company() . " <a href='http://" . $ro->getMyUrl() . "/COCONUT/patientProfile/Payments/companyPayment_selection.php?registrationNo={$registrationNo}&username={$username}&companyName=" . $ro->getRegistrationDetails_company() . "&columnToGet=company' style='text-decoration:none;'><font color='red' size=2>[Payment]</font></a>";
if ($ro->selectNow("registrationDetails", "company1", "registrationNo", $registrationNo) != "") {
    echo "<br><font class='informationLabel'>Company1:</font>&nbsp;" . $ro->selectNow("registrationDetails", "company1", "registrationNo", $registrationNo) . "<a href='http://" . $ro->getMyUrl() . "/COCONUT/patientProfile/Payments/companyPayment_selection.php?registrationNo={$registrationNo}&username={$username}&companyName=" . $ro->selectNow("registrationDetails", "company1", "registrationNo", $registrationNo) . "&columnToGet=company1' style='text-decoration:none;'><font color='red' size=2>[Payment]</font></a>";
} else {
}
if ($ro->selectNow("registrationDetails", "company2", "registrationNo", $registrationNo) != "") {
    echo "<br><font class='informationLabel'>Company2:</font>&nbsp;" . $ro->selectNow("registrationDetails", "company2", "registrationNo", $registrationNo) . "<a href='http://" . $ro->getMyUrl() . "/COCONUT/patientProfile/Payments/companyPayment_selection.php?registrationNo={$registrationNo}&username={$username}&companyName=" . $ro->selectNow("registrationDetails", "company2", "registrationNo", $registrationNo) . "&columnToGet=company2' style='text-decoration:none;'><font color='red' size=2>[Payment]</font></a>";
} else {
}
echo "<br><font class='informationLabel'>Mother's Name:</font>&nbsp;" . $ro->selectNow("patientRecord", "mothersName", "patientNo", $ro->getRegistrationDetails_patientNo());
echo "<br><font class='informationLabel'>Father's Name:</font>&nbsp;" . $ro->selectNow("patientRecord", "fathersName", "patientNo", $ro->getRegistrationDetails_patientNo());
echo "<br><font class='informationLabel'>Spouse Name:</font>&nbsp;" . $ro->selectNow("patientRecord", "spouseName", "patientNo", $ro->getRegistrationDetails_patientNo());
echo "<br><font class='informationLabel'>Informant:</font>&nbsp;" . $ro->selectNow("registrationDetails", "informant", "registrationNo", $ro->getRegistrationDetails_registrationNo());
echo "<br><font class='informationLabel'>Relationship:</font>&nbsp;" . $ro->selectNow("registrationDetails", "relationship", "registrationNo", $ro->getRegistrationDetails_registrationNo());
echo "<br><font class='informationLabel'>Time Registered:</font>&nbsp;" . $ro->getRegistrationDetails_timeRegistered();
echo "<br><font class='informationLabel'>Date Registered:</font>&nbsp;" . $ro->reformatDate($ro->getRegistrationDetails_dateRegistered());
echo "<br><font class='informationLabel'>Registered From:</font>&nbsp;" . $ro->selectNow("registrationDetails", "registeredFrom", "registrationNo", $registrationNo);
echo "<br><font class='informationLabel'>Case Type:</font>&nbsp;<a href='#' style='text-decoration:none; color:black;'>" . $ro->getRegistrationDetails_caseType() . "</a>";
echo "<br><font class='informationLabel'>Diet</font>&nbsp;" . $ro->selectNow("dietList", "dietName", "dietNo", $ro->selectNow("registrationDetails", "diet", "registrationNo", $registrationNo));
//selectNow($table,$cols,$identifier,$identifierData)
echo "<br><font class='informationLabel'>Room:</font>&nbsp;" . $room[0];
echo "<br><font class='informationLabel'>Address:</font>&nbsp;" . $ro->getPatientRecord_address();
echo "<br><font class='informationLabel'>Registered By:</font>&nbsp;" . $ro->getRegistrationDetails_registeredBy();
if ($ro->selectNow("nbs", "motherRegistrationNo", "motherRegistrationNo", $registrationNo) != "") {
    echo "<br>" . $ro->coconutImages_return("mother.jpeg");
    $ro->getBabies($registrationNo);
    echo "<br><a href='/COCONUT/patientProfile/nbs/searchBaby.php?registrationNo={$registrationNo}&username={$username}' style='text-decoration:none;'><font class='informationLabel' color=red>[+1 Baby]</font></a>&nbsp;";
} else {
    if ($ro->selectNow("nbs", "motherRegistrationNo", "babyRegistrationNo", $registrationNo) != "") {
        echo "<br> " . $ro->coconutImages_return("mother.jpeg") . "  - <font color=blue>" . $ro->selectNow("patientRecord", "lastName", "patientNo", $ro->selectNow("registrationDetails", "patientNo", "registrationNo", $ro->selectNow("nbs", "motherRegistrationNo", "babyRegistrationNo", $registrationNo))) . ", " . $ro->selectNow("patientRecord", "firstName", "patientNo", $ro->selectNow("registrationDetails", "patientNo", "registrationNo", $ro->selectNow("nbs", "motherRegistrationNo", "babyRegistrationNo", $registrationNo))) . "</font>&nbsp;";
    } else {