Actions

CodeExample

Difference between revisions of "4cc41287689c8"

From Joomla! Documentation

(CodeExample provided by Jeeradate)
 
Line 23: Line 23:
 
if($found){
 
if($found){
 
echo "<h3> Report of ".$buffer[4]." For the month".$buffer[5]. "</h3><br/>";
 
echo "<h3> Report of ".$buffer[4]." For the month".$buffer[5]. "</h3><br/>";
echo "<h4>รายงานเงินฝาก สมาชิกหมายเลข ".$buffer[3]."</h4>";
+
echo "<h4> Deposit Account of member no ".$buffer[3]."</h4>";
 
echo "<table>";
 
echo "<table>";
echo "<tr><td>ทุนสะสมยกมา :</td><td align=\"right\">".$buffer[6]."</td><td> บาท </td></tr>";
+
echo "<tr><td>Last month :</td><td align=\"right\">".$buffer[6]."</td><td> Baht </td></tr>";
echo "<tr><td>ทุนเพิ่มเดือนนี้ :</td><td align=\"right\">".$buffer[7]."</td><td> บาท </td></tr>";
+
echo "<tr><td>This month :</td><td align=\"right\">".$buffer[7]."</td><td> Baht </td></tr>";
echo "<tr><td>ทุนสะสมยกไป :</td><td align=\"right\">".$buffer[8]."</td><td> บาท </td></tr>";
+
echo "<tr><td>Next month :</td><td align=\"right\">".$buffer[8]."</td><td> Baht </td></tr>";
 
echo "</table>";
 
echo "</table>";
 
if(!($buffer[9]=="") || !($buffer[13])){
 
if(!($buffer[9]=="") || !($buffer[13])){
echo "<h4>รายงานเงินกู้</h4>";
+
echo "<h4>Loan account</h4>";
 
echo "<table>";
 
echo "<table>";
echo "<tr><td>เงินกู้ยกมา :</td><td align=\"right\"> ".$buffer[9]."</td><td> บาท </td></tr>";
+
echo "<tr><td>Last month :</td><td align=\"right\"> ".$buffer[9]."</td><td> Baht </td></tr>";
echo "<tr><td>ยอดชำระเดือนนี้ :</td><td align=\"right\"> ".$buffer[10]."</td><td> บาท </td></tr>";
+
echo "<tr><td>Pay this month :</td><td align=\"right\"> ".$buffer[10]."</td><td> Baht </td></tr>";
echo "<tr><td>ชำระเงินต้น :</td><td align=\"right\"> ".$buffer[11]."</td><td> บาท </td></tr>";
+
echo "<tr><td>Actual Payment :</td><td align=\"right\"> ".$buffer[11]."</td><td> Baht </td></tr>";
echo "<tr><td>ชำระดอกเบี้ย :</td><td align=\"right\"> ".$buffer[12]."</td><td> บาท </td></tr>";
+
echo "<tr><td>Interest :</td><td align=\"right\"> ".$buffer[12]."</td><td> Baht </td></tr>";
echo "<tr><td>เงินกู้คงเหลือ :</td><td align=\"right\"> ".$buffer[13]."</td><td> บาท </td></tr>";
+
echo "<tr><td>Next Month begin :</td><td align=\"right\"> ".$buffer[13]."</td><td> Baht </td></tr>";
 
echo "</table>";
 
echo "</table>";
 
}
 
}
                 echo "<br/>หากมีข้อผิดพลาดโปรดติดต่อเจ้าหน้าที่โดยด่วนนะครับ <br/>";
+
                 echo "<br/>Please check your account <br/>";
 
}else{
 
}else{
echo "<h3>ไม่มีรายงาน สำหรับคุณครับ หากคุณเป็นสมาชิกกองทุนโปรดติดต่อเจ้าหน้าที่ </h3>";     
+
echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>";     
 
}
 
}
 
}
 
}

Revision as of 06:10, 24 October 2010

Example

<?php
defined('_JEXEC') OR die("Restricted access");
$user =& JFactory::getUser();
if ($user->guest) {
    echo "<h3>Please log in to see your report ! </h3>";
} else {
        $id = strtoupper($user->username);
        $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r");
    $found=0; 
        while (!feof ($fd)) {
        $buffer = fgetcsv($fd, 4096); 
                if(strtoupper($buffer[1]) == $id){
                        $found = 1;
                        break;
        }
        }
        fclose ($fd);
        if($found){
                echo "<h3> Report of ".$buffer[4]." For the month".$buffer[5]. "</h3><br/>";    
                echo "<h4> Deposit Account of member no ".$buffer[3]."</h4>";
                echo "<table>";
                echo "<tr><td>Last month :</td><td align=\"right\">".$buffer[6]."</td><td> Baht </td></tr>";
                echo "<tr><td>This month :</td><td align=\"right\">".$buffer[7]."</td><td> Baht </td></tr>";
                echo "<tr><td>Next month :</td><td align=\"right\">".$buffer[8]."</td><td> Baht </td></tr>";
                echo "</table>";
                if(!($buffer[9]=="") || !($buffer[13])){
                        echo "<h4>Loan account</h4>";
                        echo "<table>";
                        echo "<tr><td>Last month :</td><td align=\"right\"> ".$buffer[9]."</td><td> Baht </td></tr>";
                        echo "<tr><td>Pay this month :</td><td align=\"right\"> ".$buffer[10]."</td><td> Baht </td></tr>";
                        echo "<tr><td>Actual Payment :</td><td align=\"right\"> ".$buffer[11]."</td><td> Baht </td></tr>";
                        echo "<tr><td>Interest :</td><td align=\"right\"> ".$buffer[12]."</td><td> Baht </td></tr>";
                        echo "<tr><td>Next Month begin :</td><td align=\"right\"> ".$buffer[13]."</td><td> Baht </td></tr>";
                        echo "</table>";
                }
                echo "<br/>Please check your account <br/>";
        }else{
                echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>";    
        }
}
?>


Jeeradate 06:03, 24 October 2010 (CDT) Edit comment