2014-11-16 18:06:09 -08:00
< ? php
include 'functions.php' ;
function lowBalance (){
2014-11-16 23:34:19 -08:00
//$result = queryMysql("SELECT username, acctype, balance from account WHERE balance <= 200");
$result = queryMysql ( " Call getLowBalance " );
2014-11-16 18:06:09 -08:00
$num = $result -> num_rows ;
for ( $j = 0 ; $j < $num ; $j ++ ){
$row = $result -> fetch_array ( MYSQLI_ASSOC );
2014-11-16 23:34:19 -08:00
echo " <tr><td> " . $row [ 'username' ] . " </td><td> " . $row [ 'acctype' ] . " </td><td> $ " . number_format ( $row [ 'balance' ], 2 , '.' , ',' ) . " </td></tr> " ;
}
}
function offerCC (){
$result = queryMysql ( " SELECT username, balance from account WHERE balance > 10000 " );
$num = $result -> num_rows ;
for ( $j = 0 ; $j < $num ; $j ++ ){
$row = $result -> fetch_array ( MYSQLI_ASSOC );
echo " <tr><td> " . $row [ 'username' ] . " </td><td> $ " . number_format ( $row [ 'balance' ], 2 , '.' , ',' ) . " </td></tr> " ;
}
}
function increaseCCLimit (){
2014-11-21 14:12:55 -08:00
//$result = queryMysql("SELECT account.username, account.balance, creditcard.maxlimit, account.acctype from account,creditcard WHERE (account.acctype = 'checking' and "
// . "account.balance > 2 * creditcard.maxlimit and account.username = creditcard.username)");
$result = queryMysql ( " SELECT account.username, account.balance, creditcard.maxlimit, account.acctype from account,creditcard WHERE ( "
2014-11-16 23:34:19 -08:00
. " account.balance > 2 * creditcard.maxlimit and account.username = creditcard.username) " );
2014-11-21 14:12:55 -08:00
2014-11-16 23:34:19 -08:00
$num = $result -> num_rows ;
for ( $j = 0 ; $j < $num ; $j ++ ){
$row = $result -> fetch_array ( MYSQLI_ASSOC );
echo " <tr><td> " . $row [ 'username' ] . " </td><td> $ " . number_format ( $row [ 'maxlimit' ], 2 , '.' , ',' ) .
2014-11-21 14:12:55 -08:00
" </td><td> $ " . number_format ( $row [ 'balance' ], 2 , '.' , ',' ) . " </td><td> " . $row [ 'acctype' ] . " </td></tr> " ;
2014-11-16 18:06:09 -08:00
}
}
?>