API15:JFactory/getUser
Contents |
Description
Get an user object
Syntax
& getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
function &getUser($id = null) { jimport('joomla.user.user'); if(is_null($id)) { $session =& JFactory::getSession(); $instance =& $session->get('user'); if (!is_a($instance, 'JUser')) { $instance =& JUser::getInstance(); } } else { $instance =& JUser::getInstance($id); } return $instance; }
[Edit See Also] SeeAlso:JFactory/getUser
Examples
<CodeExamplesForm />
Example
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
Example
<?php /* This program is for adding in Jumi module It will show the cooperative account of login user which store in CSV file on the server */ defined('_JEXEC') OR die("Restricted access"); // Prevent direct Access to the program $user =& JFactory::getUser(); // get user if ($user->guest) { echo "<h3>Please log in to see your report ! </h3>"; // Show this message if user not yet log in } else { // If user log in $id = strtoupper($user->username); // Get user and store in $id $fd = fopen ("http://btc-intranet.ap.bayer.cnb/coop/COOPBAL.csv", "r"); // Open CSV file $found=0; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); // Get one record if(strtoupper($buffer[1]) == $id){ $found = 1; // if $id = login name then set flag $found break; // exit loop } } fclose ($fd); if($found){ // Display account detail 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{ // if check to end of file but not found echo "<h3>No Account for you, Please let us know if you are member of the Cooperation fund </h3>"; } } ?>
Get an user object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static getUser($id=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getUser($id = null) { jimport('joomla.user.user'); if (is_null($id)) { $instance = JFactory::getSession()->get('user'); if (!$instance INSTANCEOF JUser) { $instance = &JUser::getInstance(); } } else { $instance = &JUser::getInstance($id); } return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
{{Expansion depth limit exceeded}}Example
Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
Get an user object
Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
<! removed transcluded page call, red link never existed >
<span class="error">Expansion depth limit exceeded Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | null | $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. |
<span class="error">Expansion depth limit exceeded object
<span class="error">Expansion depth limit exceeded libraries/joomla/factory.php <span class="error">Expansion depth limit exceeded Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
<span class="error">Expansion depth limit exceeded Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
Invalid tag extension name: <span class="error">expansion depth limit exceeded</span> <! removed transcluded page call, red link never existed >
<span class="error">Expansion depth limit exceeded <CodeExamplesForm /> Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
