/** * * POOR FUND BILLING PRINT REPORT * */ function GetRowsFromSpecial($mnth, $yrs, $type, $ca, $cb, $action) { global $db; //$db->debug=TRUE; $dt = $yrs . '-' . $mnth . '%'; $cc = '0'; $toto = 0; $nipo = FALSE; $this->sql = "SELECT encounter_nr,date,fullname,remain,paid,billno FROM care_tz_billing_special WHERE date like '{$dt}' AND type = '{$type}' ORDER BY encounter_nr DESC"; $this->result = $db->Execute($this->sql); echo ' </td> </tr> <tr valign=top> <td colspan="5">' . '<table width="' . '' . ''; $action == 'prnt' ? print '95%' : (print '60%'); echo '' . '' . '"border="0" align="left" cellpadding="5" cellspacing="1" class="tablebg"> <tr class="searchtxthead" id="rowhead" valign="middle"> <td width="10%" height="25" nowrap>S/No</td> <td width="10%" nowrap>Attendant Date </td> <td width="20%" nowrap>Name</td> <td width="50%" nowrap>No. of Procedures done </td> <td width="10%" align="center" nowrap>Not paid</td> </tr>'; while ($this->row = $this->result->FetchRow()) { $nipo = TRUE; $billno = $this->row[5]; $getpid_obj = new dental(); $myid = $getpid_obj->GetPidFromEncounter($this->row[0]); echo '<tr class="'; if ($cc == '0') { echo $ca; $cc = '1'; } else { echo $cb; $cc = '0'; } echo '" valign="top">'; echo '<td nowrap>' . $myid . '</td>'; // echo '<td nowrap>' . $this->row[1] . '</td>'; echo '<td nowrap>' . nl2br($this->row[2]) . '</td>'; echo '<td nowrap>'; $this->totorows = $db->Execute("SELECT nr FROM care_tz_billing_archive_elem WHERE nr = '{$billno}'"); $this->tt = $this->totorows->FetchRow(); $ennoz = $this->row[0]; if ($this->tt[0] > 0) { $this->rr = $db->Execute("SELECT description, price, amount FROM care_tz_billing_archive_elem WHERE nr = '{$billno}'"); echo '<table width="100%" border="0" align="right" cellpadding="4" cellspacing="1">'; $counttoto = 0; while ($this->mm = $this->rr->FetchRow()) { echo '<tr valign="top" style="font:normal 12px Tahoma, monospace; color:black; ">'; echo '<td align="left" style="border-bottom:1px dotted #F2F2F2; " nowrap> ' . $this->mm[0] . ' </td>'; echo '<td align="right" style="border-bottom:1px dotted #F2F2F2; "> ' . $this->mm[1] * $this->mm[2] . '.00 </td>'; $counttoto += intval($this->mm[1] * $this->mm[2]); echo '</tr>'; } echo ' <tr style="font:normal 12px Tahoma, monospace; color:black; "> <td width="70%" align="right" valign="middle"><strong>Grand Total:</strong></td> <td width="30%" align="right" valign="middle" bgcolor="#FFFFFF" style="border-bottom:1px solid #F2F2F2; border-top:1px solid #F2F2F2;">' . '<strong>' . $counttoto . '.00' . '</strong>' . '</td> </tr>'; echo ' <tr style="font:normal 12px Tahoma, monospace; color:black; "> <td width="70%" align="right" valign="middle"><strong>Total Paid:</strong></td> <td width="30%" align="right" valign="middle" bgcolor="#FFFFFF" style="border-bottom:1px solid #F2F2F2; border-top:1px solid #F2F2F2;">' . '<strong>' . $this->row[4] . '.00' . '</strong>' . '</td> </tr> </table>'; $showme = 'yes'; } else { echo 'no description found'; // ??????????????????????????????????????????????????? $showme = 'no'; } echo '</td>'; echo '<td align="right" valign="bottom">' . '<div style="width:100%;padding-bottom:3px; border-bottom:1px solid #F2F2F2; font-weight:bold;">' . ''; $showme == 'yes' ? print $this->row[3] : (print '0'); $showme == 'no' ? $toto = $toto : ($toto += $this->row[3]); echo '.00</div></td>' . '' . ''; echo '</tr>'; $showme = 'yes'; } if (intval($toto) != 0) { echo '<tr class="'; if ($cc == '0') { echo $ca; } else { echo $cb; } echo '" style="text-align:right;font:bold 12px Tahoma,Monospace;">'; echo '<td colspan="4">Total: </td>'; echo '<td>' . $toto . '.00</td>'; echo '</tr></table>'; } else { echo '<tr class="'; if ($cc == '0') { echo $ca; } else { echo $cb; } echo '">'; echo '<td colspan="5" align="center">No Record Found</td>'; echo '</tr></table>'; } }
require_once $root_path . 'include/inc_date_format_functions.php'; include_once $root_path . 'include/care_api_classes/class_mini_dental.php'; $histry = new dental(); $pName = new dental(); $histry->viewtype = $view == 'cons' ? 4 : 0; #print ($pName->viewtype.'<hr />'); $fileno_obj = new dental(); /** * Patient Encounter */ $encounter_nr = $_GET['encounter']; /** * Patient ID */ $pid = $_GET['pid']; !$pid ? $pid = $pName->GetPidFromEncounter($encounter_nr) : ($pid = $pid); /** * colors for the report */ $printThiS = FALSE; $c1 = '#FFFFF'; $c2 = '#F4F8F3'; /** * Number of Records to display */ $records = '15'; /** * Double-Check for File No. */ !$_GET['filenr'] ? $fileno = $fileno_obj->GetFileNoFromPID($pid) : ($fileno = $_GET['filenr']); ?>