예제 #1
0
            echo "<td>USD " . number_format($ln_bck_lndr_amt, 2) . "</td>";
            echo '</tr>';
            echo '<tr>';
            echo "<td>{$desc17}</td>";
            echo "<td>USD " . number_format($ln_bid_lndr_amt, 2) . "</td>";
            echo '</tr>';
            echo '<tr>';
            echo "<td>{$desc3}</td>";
            echo "<td>USD " . number_format($ln_snt_lndr_amt, 2) . "</td>";
            echo '</tr>';
            echo '<tr>';
            echo "<td>{$desc7}</td>";
            echo "<td>USD\t" . number_format($ln_bck_amt, 2);
            foreach ($bCountries as $bcont) {
                if ($bcont['ln_bck_amt_total'] != 0) {
                    echo "<br/>" . $bcont['Currency'] . " " . number_format(round_local($bcont['ln_bck_amt_total']), 0) . " (" . $bcont['name'] . ")";
                }
            }
            echo "</td>";
            echo '</tr>';
            /*echo'<tr>';
            			echo"<td>$desc18</td>";
            			echo"<td> USD ".number_format($feeByAnonymous, 2)."</td>";
            		echo '</tr>';
            		*/
            ?>
		</tbody>
				</table>
<!--			</div>
-->
	<br/>
예제 #2
0
											<tr>
												<td colspan="2"><br/><strong><?php 
        echo $lang['loanstatn']['repay_due'] . " " . date("M d, Y", time());
        ?>
:</strong>&nbsp&nbsp<?php 
        echo $tmpcurr . " " . number_format($schedule['due'], 0, '', ',');
        ?>
</td>
											</tr>
											<tr>
												<td colspan="2"><strong><?php 
        echo $lang['loanstatn']['totrepay_due'] . " " . date("M d, Y", time());
        ?>
:</strong>&nbsp&nbsp<?php 
        if ($show_localcurrency) {
            echo $tmpcurr . " " . number_format(round_local($schedule['amtPaidTillShow']), 0, '.', ',');
        } else {
            echo $tmpcurr . " " . number_format($schedule['amtPaidTillShow'], 0, '', ',');
        }
        ?>
												</td>
											</tr>
										<?php 
        if ($brw2['active'] == LOAN_ACTIVE && $session->userlevel == LENDER_LEVEL && $database->isLenderInThisLoan($ld, $session->userid)) {
            $totalForgivenLenders = $database->totalForgivenLendersThisLoan($ld);
            if ($totalForgivenLenders > 0) {
                if ($totalForgivenLenders == 1) {
                    $strText1 = convertNumber2word($totalForgivenLenders) . " lender has forgiven this loan.";
                } else {
                    $strText1 = convertNumber2word($totalForgivenLenders) . " lenders have forgiven this loan.";
                }
예제 #3
0
								<td><strong><?php 
                echo $lang['loanstatn']['repay_due'] . " " . date("M d, Y ", time());
                ?>
:</strong></td>
								<td><?php 
                echo number_format(round_local($schedule['due']), 0, '.', ',') . " " . $tmpcurr;
                ?>
</td>
							</tr>
							<tr>
								<td><strong><?php 
                echo $lang['loanstatn']['totrepay_due'] . " " . date("M d, Y ", time());
                ?>
:</strong></td>
								<td><?php 
                echo number_format(round_local($schedule['amtPaidTillShow']), 0, '.', ',') . "</b> " . $tmpcurr;
                ?>
</td>
							</tr>-->
						</tbody>
					</table>
					<?php 
                echo $schedule['schedule'];
                ?>
				</div><!-- /bid-table -->
			</div><!-- /row -->			
<?php 
            }
        } else {
            echo "No Transaction Yet";
        }
예제 #4
0
 function getAuthLoanAmount($userid, $loanid = 0, $native = true)
 {
     global $db;
     if ($loanid == 0) {
         $q = "SELECT reqdamt FROM loanapplic WHERE borrowerid={$userid} AND adminDelete = 0 ORDER BY loanid DESC ";
     } else {
         $q = "SELECT reqdamt FROM loanapplic WHERE borrowerid={$userid} AND adminDelete = 0 AND loanid = {$loanid}";
     }
     $result = $db->getOne($q);
     if (empty($result)) {
         return 0;
     }
     if ($native) {
         $rate = $this->getAuthorisedRate($userid, $loanid);
         // changed dby Mohit
         $amt = round_local($result * $rate);
         return $amt;
     } else {
         return $result;
     }
 }
예제 #5
0
 function generateScheduleTable($ud, $ld, $displyall = 0, $disburseRate = 0)
 {
     global $database;
     $path = getEditablePath('loanstatn.php');
     include FULL_PATH . "editables/" . $path;
     $schedule = $database->getSchedulefromDB($ud, $ld);
     $actualSchedule = $database->getRepaySchedulefromDB($ud, $ld);
     $gracePeriod = $database->gerGracePeriod($ld);
     $UserCurrency = $database->getUserCurrency($ud);
     if (!empty($disburseRate)) {
         $CurrencyRate = $disburseRate;
     } else {
         $CurrencyRate = $database->getCurrentRate($ud);
     }
     $rtnArray = array();
     if (empty($schedule)) {
         $rtnArray['schedule'] = '';
         $rtnArray['due'] = 0;
         $rtnArray['amtPaidTillShow'] = 0;
     } else {
         if ($displyall) {
             $tmpcurr = $UserCurrency;
         } else {
             $tmpcurr = 'USD';
         }
         $text = "<table width = 100% class='zebra-striped'>\r\n\t\t\t<tr>\r\n\t\t\t\t<th>" . $lang['loanstatn']['date'] . "</th>\r\n\t\t\t\t<th>" . $lang['loanstatn']['due_amount'] . "</th>\r\n\t\t\t\t<th>" . $lang['loanstatn']['datepaid'] . "</th>\r\n\t\t\t\t<th>" . $lang['loanstatn']['paid_amount'] . " <a style='cursor:pointer' class='tt'><img src='library/tooltips/help.png' style='border-style:none;' /><span class='tooltip'><span class='top'></span><span class='middle'>" . $lang['loanstatn']['paidAmt_tooltip'] . "</span><span class='bottom'></span></span></a></th>\r\n\t\t\t</tr>";
         $printSchedule = array();
         $paidBalance = 0;
         $totalDueAmt = 0;
         $totalDueAmtUsd = 0;
         $totalPaidAmt = 0;
         $totalPaidAmtUsd = 0;
         $amtDueTill = 0;
         $amtPaidTill = 0;
         $amtDueTillUsd = 0;
         for ($i = 0, $j = 0; $i < count($schedule); $i++) {
             $totalDueAmt += $schedule[$i]['amount'];
             $printSchedule[$i]['dueAmt'] = $schedule[$i]['amount'];
             $printSchedule[$i]['dueDate'] = $schedule[$i]['duedate'];
             if ($schedule[$i]['duedate'] < time()) {
                 $amtDueTill += $schedule[$i]['amount'];
             }
             $inst = 0;
             $inst = $schedule[$i]['amount'];
             while ($paidBalance > 0) {
                 if ($inst > 0) {
                     if ($inst <= $paidBalance) {
                         $printSchedule[$i]['sub'][][$actualSchedule[$j - 1]['paiddate']] = $inst;
                         $paidBalance = number_format($paidBalance - $inst, 6, '.', '');
                         $inst = 0;
                         break;
                     } else {
                         $printSchedule[$i]['sub'][][$actualSchedule[$j - 1]['paiddate']] = $paidBalance;
                         $inst = number_format($inst - $paidBalance, 6, '.', '');
                         $paidBalance = 0;
                     }
                 } else {
                     break;
                 }
             }
             if ($paidBalance == 0) {
                 for ($k = 0; $j < count($actualSchedule); $j++) {
                     if ($inst > 0) {
                         if ($inst <= $actualSchedule[$j]['paidamt']) {
                             $printSchedule[$i]['sub'][][$actualSchedule[$j]['paiddate']] = $inst;
                             /*Pranjal Change 26 Jan When there are 2 small payments on the same date the schedule does not show correct data Example loain id 206*/
                             //$printSchedule[$i]['sub'][$actualSchedule[$j]['paiddate']]+=$inst;
                             $paidBalance = number_format($actualSchedule[$j]['paidamt'] - $inst, 6, '.', '');
                             $j++;
                             break;
                         } else {
                             $printSchedule[$i]['sub'][][$actualSchedule[$j]['paiddate']] = $actualSchedule[$j]['paidamt'];
                             $inst = number_format($inst - $actualSchedule[$j]['paidamt'], 6, '.', '');
                         }
                     } else {
                         break;
                     }
                 }
             }
             if ($i == count($schedule) - 1 && $paidBalance > 0) {
                 if (isset($printSchedule[$i]['sub'])) {
                     $pos = count($printSchedule[$i]['sub']) - 1;
                     $printSchedule[$i]['sub'][$pos][$actualSchedule[count($actualSchedule) - 1]['paiddate']] += $paidBalance;
                 } else {
                     $printSchedule[$i]['sub'][0][$actualSchedule[count($actualSchedule) - 1]['paiddate']] = $paidBalance;
                 }
             }
         }
         $totalDueAmtUsd += convertToDollar($totalDueAmt, $CurrencyRate);
         $amtDueTillUsd += convertToDollar($amtDueTill, $CurrencyRate);
         for ($i = 0; $i < count($printSchedule); $i++) {
             if ($i < $gracePeriod) {
                 continue;
             }
             $text = $text . "<tr> ";
             $text = $text . "<td style='text-align:left; width:20%'>" . date('M d, Y', $printSchedule[$i]['dueDate']) . "</td>";
             if ($displyall) {
                 $text = $text . "<td style='text-align:left; width:20%'>" . number_format(round_local($printSchedule[$i]['dueAmt']), 0, '.', ',') . "</td>";
             } else {
                 $text = $text . "<td style='text-align:left; width:20%'>" . number_format(convertToDollar($printSchedule[$i]['dueAmt'], $CurrencyRate), 2, '.', ',') . "</td>";
             }
             if (isset($printSchedule[$i]['sub'])) {
                 $j = 0;
                 foreach ($printSchedule[$i]['sub'] as $sub) {
                     foreach ($sub as $key => $value) {
                         $totalPaidAmt += $value;
                         if ($key < time()) {
                             $amtPaidTill += $value;
                         }
                         if ($j > 0) {
                             $text = $text . "<tr> ";
                             $text = $text . "<td style='text-align:left; width:20%'>&nbsp;</td>";
                             $text = $text . "<td style='text-align:left; width:20%'>&nbsp;</td>";
                         }
                         $text = $text . "<td style='text-align:left; width:20%'>" . date('M d, Y', $key) . "</td>";
                         if ($displyall) {
                             $amtPaidShow = number_format(round_local($value), 0, '.', ',');
                             $text = $text . "<td style='text-align:left; width:20%'>" . $amtPaidShow . "</td>";
                         } else {
                             $amtPaidShow = convertToDollar($value, $CurrencyRate);
                         }
                         if (count($printSchedule[$i]['sub']) > 1) {
                             if ($j % 2 == 0) {
                                 $amtPaidShow = round_up($amtPaidShow, 2);
                             } else {
                                 $amtPaidShow = round_down($amtPaidShow, 2);
                             }
                         }
                         if (!$displyall) {
                             $text = $text . "<td style='text-align:left; width:20%'>" . number_format($amtPaidShow, 2, '.', ',') . "</td>";
                         }
                         $text = $text . " </tr>";
                         if ($j > 0) {
                             $text = $text . "</tr> ";
                         }
                         $j++;
                     }
                 }
             } else {
                 $text = $text . "<td style='text-align:left; width:20%'>&nbsp;</td>";
                 $text = $text . "<td style='text-align:left; width:20%'>&nbsp;</td>";
                 $text = $text . " </tr>";
             }
         }
         $totalPaidAmtUsd = convertToDollar($totalPaidAmt, $CurrencyRate);
         $amtPaidTillUsd = convertToDollar($amtPaidTill, $CurrencyRate);
         $text = $text . "<tfoot>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t<th>" . $lang['loanstatn']['tot_amount'] . "</th>";
         if ($displyall) {
             $text = $text . "<th>" . number_format(round_local($totalDueAmt), 0, '.', ',') . "</th>";
         } else {
             $text = $text . "<th>" . number_format($totalDueAmtUsd, 2, '.', ',') . "</th>";
         }
         $text = $text . "<th>" . $lang['loanstatn']['tot_paid_amount'] . "</th>";
         if ($displyall) {
             $text = $text . "<th>" . number_format($totalPaidAmt, 0, '.', ',') . "</th>";
             // round_local($totalPaidAmt)
         } else {
             $text = $text . "<th>" . number_format($totalPaidAmtUsd, 2, '.', ',') . "</th>";
         }
         $text = $text . "</tr></tfoot>";
         $text = $text . "</table>";
         $rtnArray['schedule'] = $text;
         if ($displyall) {
             $due = $amtDueTill - $amtPaidTill;
             $amtPaidTillShow = $amtPaidTill;
             $amtRemaining = $totalDueAmt - $totalPaidAmt;
         } else {
             $due = $amtDueTillUsd - $amtPaidTillUsd;
             $amtPaidTillShow = $amtPaidTillUsd;
             $amtRemaining = $totalDueAmtUsd - $totalPaidAmtUsd;
         }
         if ($due < 0) {
             $due = 0;
         }
         if ($amtRemaining < 0) {
             $amtRemaining = 0;
         }
         $rtnArray['amtPaidTillShow'] = $amtPaidTillShow;
         $rtnArray['amtRemaining'] = $amtRemaining;
         $rtnArray['due'] = $due;
     }
     return $rtnArray;
 }
예제 #6
0
     if (!empty($note)) {
         $editlink = "<a href='javascript:void(0)' onclick='editnotes({$userid})'>edit</a>";
     }
     $navigate_away_ids[] = 'note' . $userid;
     $navigate_away_ids_values[] = '';
     echo "<td><div id ='editdiv{$userid}'>{$note}</div><div id='editlink{$userid}'>{$editlink}</div><br/>\n\t\t\t\t\t\t\t<textarea name='note'  id='note{$userid}' col='6' row='6' style='height: 80px'  ></textarea>\n\t\t\t\t\t\t\t\t\t<input type='hidden' name='borrowerid' id='borrower{$userid}' value='{$userid}'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' name='loanid' id='loan{$userid}' value='{$loanid}'>\n\n\t\t\t\t\t\t\t\t</td>";
     echo "<input name='isedit' type = 'hidden' value='0' id = 'isedit{$userid}'>";
     echo '</tr>';
 } else {
     if ($assignedto == 0) {
         if ($dueamt <= 0 || $dueamtUSD < $repayThresholdAmt && $row['totpaidamt'] > 0) {
             continue;
         }
         $dueamtTot += $dueamt;
         $dueamtToSort = number_format(round_local($dueamt), 2, '.', '');
         $dueamt = number_format(round_local($dueamt), 0, '.', ',');
         $bcity = $row['city'];
         $address = $row['Paddress'];
         echo "<tr id='rowid{$userid}' >";
         echo "<td>Member Name:<br/><br/>{$bname}<br/><br/><br/>Member Telephone:<br/><br/>{$brwrnumbr}</td>";
         echo "<td><span style='display:none'>{$bcity}</span>{$bcity}<br/><br/>{$address}</td>";
         echo "<td><span style='display:none'>{$dueamtToSort}</span>Amount Past Due:<br/><br/> &nbsp;{$currency}&nbsp;{$dueamt}</td>";
         echo "<td><span style='display:none'>{$duedatetosort}</span>Past Due Since:<br/><br/>{$duedate}<br/><br/><br/><a href=index.php?p=37&l={$loanid}&u={$userid}>View Repayment Schedule</a></td>";
         //echo "<td>$brwrnumbr</td>";
         echo "<td><div>Community Leader Name:<br/><br/></div>";
         ?>
                                              <?php 
         $navigate_away_ids[] = 'refname' . $userid;
         $navigate_away_ids_values[] = '';
         ?>
                                              <input type='text' readonly="readonly" style='width: 100px;' id="<?php 
예제 #7
0
						<tfoot>
							<tr>
								<th><?php 
            echo $lang['loanstatn']['tot_amount'];
            ?>
</th>
								<th><?php 
            echo number_format(round_local($amtDue), 0, '.', ',');
            ?>
</th>
								<th><?php 
            echo $lang['loanstatn']['tot_paid_amount'];
            ?>
</th>
								<th><?php 
            echo number_format(round_local($amtPaid), 0, '.', ',');
            ?>
</th>
							</tr>
						</tfoot>
					</table>
					<form method="post" action="updateprocess.php" onsubmit="disablemultiplesubmit();">
			<?php 
            $_SESSION['value_array'] = $form->values;
            $_SESSION['error_array'] = $form->getErrorArray();
            ?>
					<table class="detail">
						<tbody>
							<tr style='display:none'>
								<td>
									<input type='hidden' name='original_period' value='<?php 
예제 #8
0
         $country = "US";
     } elseif ($row['txn_type'] == DONATION && isset($row['txn_sub_type']) && $row['txn_sub_type'] == DONATE_BY_ADMIN) {
         $txnamtinus = number_format($row['amount'], 2);
         $desc = "Expired Lender Account Converted to Donation";
         $country = "US";
     }
 }
 logger('trhistory display txn description end');
 /*Txn description and country stuff end */
 //if($row['userlevel']==LENDER_LEVEL)
 if ($userLevel == LENDER_LEVEL) {
     $txnamtinus = number_format($row['amount'], 2);
     $txnid = "<a href='index.php?p=16&u={$userid}' target='_blank'>" . $row['id'] . "</a>";
 } else {
     if ($userLevel == BORROWER_LEVEL) {
         $txnamt = number_format(round_local($row['amount']), 0);
         $txnamt = $txnamt . " (" . $row['currency'] . ")";
         $txnamtinus = number_format($row['amount'] / $row['conversionrate'], 2);
         $loanid = $row['loanid'];
         $txnid = "<a href='index.php?p=37&l={$loanid}&u={$userid}' target='_blank'>" . $row['id'] . "</a>";
     } else {
         if ($userLevel == null || $userLevel == "") {
             $txnamtinus = number_format($row['amount'], 2);
             $txnid = $row['id'];
         } else {
             $txnid = $row['id'];
         }
     }
 }
 if ($row['txn_type'] == FEE) {
     $loanid = $row['loanid'];
예제 #9
0
									<td><strong><?php 
                echo $lang['loanstatn']['tot_int_and_fee'];
                ?>
:</strong></td>
									<td><?php 
                echo number_format(round_local($totFee), 0, '.', ',') . " " . $tmpcurr . " (" . number_format($totIntr, 0, '.', ',') . "% " . $lang['loanstatn']['intrst_rate_text'] . ' ' . $period . ' ' . $periodText . ")";
                ?>
</td>
								</tr>
								<tr>
									<td><strong><?php 
                echo $lang['loanstatn']['tot_repay_due_orig'];
                ?>
:</strong></td>
									<td><?php 
                echo number_format(round_local($amtTotal), 0, '.', ',') . " " . $tmpcurr;
                ?>
</td>
								</tr>
								<tr><td colspan=2><br/></td></tr>
								<tr>
									<td colspan=2><strong><?php 
                echo $lang['loanstatn']['org_repay_schedule'];
                ?>
:</strong></td>
								</tr>
							</tbody>
						</table>

						<?php 
                echo $schedule['schedule'];
예제 #10
0
							<td><a href="javascript:void(0)">fake name</a></td>
							<td><span style="display:none">24000.00</span>24,000</td>
							<td><span style="display:none">1338124710</span>May 27, 2012</td><td>779595532</td><td>
							<div>Name</div>
							<input type="text" style="width: 100px;"  value="fake" >
							<div>Telephone number</div>
							<input type="text" style="width: 100px;"  value="99999999">	
							</td><td><input style="width: 70px;" name="exdate" type="text" value="07/31/2012"><span style="display:none">1343692800</span></td><td><textarea name="note"  id="note188" col="6" row="6" style="height: 80px">fake row content in textarea</textarea>
							</td><td>
							<span></span>
							</td>
						</tr>
					</tbody>
				</table>
				<strong>Total Amount Overdue <?php 
                echo number_format(round_local($dueamtTot), 0, '.', ',') . " (" . $currency . ")";
                ?>
</strong><br/><br/>

<strong>Recommendation Forms are no longer accepted from the following Community Leaders:</strong><br /><br />

<strong>Kenya:</strong><br /><br />
Elias Konde, tel. 0720588318<br />
Pst. John Opiyo, tel. 0720823379<br /> 
Pst. George Ombati, tel. 0778420402 or 0778640604<br />
Euphraim Kasinga, tel. 0716771316, 0728723251 or 0771885224<br />
Muguu Tupu Foundation, tel. 0705693769<br />
nicholas opondo, 0719772097<br />
Rev. Livingstone Kipkemei, tel. 0723993844<br />
George Kamunge, tel. 0771271963<br />
Pastor Charles Maingi, tel. 0789277834<br />
예제 #11
0
        echo $lang['referral']['commission_amount'];
        ?>
</strong></th>					
					<th><strong><?php 
        echo $lang['referral']['payment_date'];
        ?>
</strong></th>
				</tr>
			</thead>
			<tbody>
		<?php 
        $set = $database->getPaidCommissions($session->userid);
        foreach ($set as $row) {
            $applicant_id = $row['applicant_id'];
            $referrer_id = $row['referrer_id'];
            $paid_amt = number_format(round_local($row['paid_amt']), 0, '.', ',');
            $paid_date = date('d M Y', $row['paid_date']);
            $applicant_name = $database->getNameById($applicant_id);
            $referrer_name = $database->getNameById($referrer_id);
            $currency = $database->getUserCurrency($referrer_id);
            $refurl = getUserProfileUrl($referrer_id);
            $aplcurl = getUserProfileUrl($applicant_id);
            echo "<tr align='center'>";
            echo "<td><a href='{$aplcurl}'>{$applicant_name}</a></td>";
            echo "<td><a href='{$refurl}'>{$referrer_name}</a></td>";
            echo "<td>{$paid_amt} ({$currency})</td>";
            echo "<td>{$paid_date}</td>";
            echo "</tr>";
        }
        if (empty($set)) {
            echo "<tr align='center'><td colspan=5>No Data</td></tr>";