checkMySQLError(); $row = mysql_fetch_array($result, MYSQL_ASSOC); if (!$row) { die("No Voucher with this Number found!"); } else { if ($row["VR_TP"] == "CR") { die("Requested Voucher is a Credit-Voucher. Credit-Vouchers can't get deleted. Instead, make a Debit-Voucher and correct the mistake!"); } else { if (mysql_fetch_array($result, MYSQL_ASSOC)) { die("more than one Voucher found! Database-integrity is in Danger! Call your System-maintainer!"); } } } beginPrettyTable("1", "Do you want to Remove this Voucher ?"); printRow(array("AC_Codes", "VR_TP", "Vr_No", "VR_DT", "PARTY", "NARRATION", "AMOUNT"), "", "1,5"); $row["VR_DT"] = conv_to_hrd($row["VR_DT"]); printRow($row, "something"); openForm("removevoucher_confirm_form", $PHP_SELF); makeHiddenField("remove_confirm", 0); makeHiddenField("vr_no", $vr_no); makeSpecialSubmitter("yes, remove it!", "this.form.remove_confirm.value=1", 6); endPrettyTable(); mysql_close($db); } else { ?> <table cellpadding=5 cellspacing=0 border=0 width='100%'> <tr> <td valign=top width='15%'> <?php
function get_today_hrd_string() { return conv_to_hrd(get_today_srd_string()); }
echo get_month_name($ref_date) . " " . get_year($ref_date) . "</div>"; if ($type == "PF") { $loan_table = "PF_LOAN"; } else { if ($type == "CUF") { $loan_table = "CUF_LOAN"; } else { die("Loantype unspecified !"); } } $result = mysql_query("select * from {$loan_table}", $db); checkMySQLError(); beginPrettyTable("4", "{$loan_table}"); printRow(array("Emp_ID3", "Emp. Name", "LoanStart", "LoanEnd", "Loan-Amt", "Instalment", "Tot_Amt", "Due", "Balance")); while ($row = mysql_fetch_array($result)) { $name = $personal_array[$row["EMP_ID3"]]; $rest_inst_no = datediff("m", $ref_date, $row["LOAN_END"]); $rest_amount = $rest_inst_no * $row["INT_RATE"]; if ($rest_inst_no < 0) { continue; } $inst_sum += $rest_inst_no; $rest_amount_sum += $rest_amount; $loan_amount_sum += $row["LOAN_AMT"]; printRow(array($row["EMP_ID3"], $name, conv_to_hrd($row["LOAN_START"]), conv_to_hrd($row["LOAN_END"]), $row["LOAN_AMT"], $row["INT_RATE"], $row["TOT_AMT"], $rest_inst_no, $rest_amount), "fluct"); } printRow(array("", "", "Loan-Amt-Sum: ", $loan_amount_sum), "", "3,2"); printRow(array("", "", "Inst-Sum: ", "", $inst_sum), "", "3,2"); printRow(array("", "", "Balance-Sum: ", "", "", "", "", $rest_amount_sum), "", "3,2"); endPrettyTable(); endDocument();