Exemple #1
0
function rosterProp($member, $prop)
{
    global $SEMESTER;
    $html = '';
    switch ($prop) {
        case "Contact":
            $html .= "<a href='tel:" . $member["phone"] . "'>" . $member["phone"] . "</a><br><a href='mailto:" . $member['email'] . "'>" . $member["email"] . "</a>";
            break;
        case "Location":
            $html .= $member["location"];
            break;
        case "Balance":
            $balance = balance($member['email']);
            if ($balance < 0) {
                $html .= "<span class='moneycell' style='color: red'>{$balance}</span>";
            } else {
                $html .= "<span class='moneycell'>{$balance}</span>";
            }
            break;
        case "Dues":
            $result = mysql_fetch_array(mysql_query("select sum(`amount`) as `balance` from `transaction` where `memberID` = '" . $member['email'] . "' and `type` = 'dues' and `semester` = '{$SEMESTER}'"));
            $balance = $result['balance'];
            if ($balance == '') {
                $balance = 0;
            }
            if ($balance >= 0) {
                $html .= "<span class='duescell' style='color: green'>{$balance}</span>";
            } else {
                $html .= "<span class='duescell' style='color: red'>{$balance}</span>";
            }
            break;
        default:
            $html .= "???";
            break;
    }
    return $html;
}
    if (!preg_match("/^[0-9A-Z]*\$/", $first)) {
        $errors[] = 'Wrong Vehicle Number format.';
    }
}
?>


<?php 
if (empty($errors) === true) {
    $vehicle_number = $first;
    $vehicle_exists = vehicle_exists($vehicle_number);
    if ($vehicle_exists === false) {
        $errors[] = 'Vehicle Number ' . $vehicle_number . ' registered. Bill Manually!!!';
    } else {
        stolen_alert($vehicle_number, $user_data);
        $balance = balance($vehicle_number, $user_data);
        if ($balance === false) {
            $errors[] = 'Vehicle Number' . $vehicle_number . 'balance is low. Bill Manually!!!';
            $data1 = array();
            $data1 = mysql_fetch_assoc(mysql_query("SELECT * FROM `vehicle` WHERE `vehicle_number` = '{$vehicle_number}'"));
            $vehicle_owner_id = $data1['vehicle_owner_id'];
            $data2 = array();
            $data2 = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `user_id` = '{$vehicle_owner_id}'"));
            $email = $data2['email'];
            $body = "Your Current Balance is " . $data2['balance'] . " which is low. Recharge Urgently.";
            $sub = "Toll Booth Transaction";
            $bool = sendMail($email, $body, $sub);
        } else {
            $errors[] = 'Vehicle Number ' . $vehicle_number . ' billed successfully!';
            $data1 = array();
            tb_owner_detail($vehicle_number, $user_data);
Exemple #3
0
function rosterProp($member, $prop)
{
    global $SEMESTER, $CHOIR;
    if (!$CHOIR) {
        die("No choir selected");
    }
    $html = '';
    switch ($prop) {
        case "Section":
            $section = mysql_fetch_array(mysql_query("select `sectionType`.`name` from `sectionType`, `activeSemester` where `sectionType`.`id` = `activeSemester`.`section` and `activeSemester`.`choir` = '{$CHOIR}' and `activeSemester`.`semester` = '{$SEMESTER}' and `activeSemester`.`member` = '" . $member["email"] . "'"));
            $html .= $section['name'];
            break;
        case "Contact":
            $html .= "<a href='tel:" . $member["phone"] . "'>" . $member["phone"] . "</a><br><a href='mailto:" . $member['email'] . "'>" . $member["email"] . "</a>";
            break;
        case "Location":
            $html .= $member["location"];
            break;
        case "Car":
            if ($member["passengers"] == 0) {
                $html .= "No";
            } else {
                $html .= $member["passengers"] . " passengers";
            }
            break;
        case "Enrollment":
            $enr = enrollment($member["email"]);
            if ($enr == "class") {
                $html .= "<span style=\"color: blue\">class</span>";
            } else {
                if ($enr == "club") {
                    $html .= "club";
                } else {
                    $html .= "<span style=\"color: gray\">inactive</span>";
                }
            }
            break;
        case "Balance":
            $balance = balance($member['email']);
            if ($balance < 0) {
                $html .= "<span class='moneycell' style='color: red'>{$balance}</span>";
            } else {
                $html .= "<span class='moneycell'>{$balance}</span>";
            }
            break;
        case "Dues":
            $result = mysql_fetch_array(mysql_query("select sum(`amount`) as `balance` from `transaction` where `memberID` = '" . $member['email'] . "' and `type` = 'dues' and `semester` = '{$SEMESTER}'"));
            $balance = $result['balance'];
            if ($balance == '') {
                $balance = 0;
            }
            if ($balance >= 0) {
                $html .= "<span class='duescell' style='color: green'>{$balance}</span>";
            } else {
                $html .= "<span class='duescell' style='color: red'>{$balance}</span>";
            }
            break;
        case "Gigs":
            $gigcount = attendance($member["email"], 3);
            $result = mysql_fetch_array(mysql_query("select `gigreq` from `semester` where `semester` = '{$SEMESTER}'"));
            $gigreq = $result['gigreq'];
            if ($gigcount >= $gigreq) {
                $html .= "<span class='gigscell' style='color: green'>";
            } else {
                $html .= "<span class='gigscell' style='color: red'>";
            }
            $html .= "{$gigcount}</span>";
            break;
        case "Score":
            if (enrollment($member["email"]) == 'inactive') {
                $grade = "--";
            } else {
                $grade = attendance($member["email"], 0);
            }
            $html .= "<span class='gradecell'";
            if (enrollment($member["email"]) == "class" && $grade < 80) {
                $html .= " style=\"color: red\"";
            }
            $html .= ">{$grade}</span>";
            break;
        case "Tie":
            $html .= "<span class='tiecell' ";
            $result = mysql_fetch_array(mysql_query("select sum(`amount`) as `amount` from `transaction` where `memberID` = '" . $member['email'] . "' and `type` = 'deposit'"));
            $tieamount = $result['amount'];
            if ($tieamount == '') {
                $tieamount = 0;
            }
            if ($tieamount >= fee("tie")) {
                $html .= "style='color: green'";
            } else {
                $html .= "style='color: red'";
            }
            $html .= ">";
            $query = mysql_query("select `tie` from `tieBorrow` where `member` = '" . $member['email'] . "' and `dateIn` is null");
            if (mysql_num_rows($query) != 0) {
                $result = mysql_fetch_array($query);
                $html .= $result['tie'];
            } else {
                $html .= "•";
            }
            $html .= "</span>";
            break;
        default:
            $html .= "???";
            break;
    }
    return $html;
}
<?php

require "settings.php";
if (isset($_REQUEST["key"])) {
    switch ($_REQUEST["key"]) {
        case "select":
            $OUTPUT = select();
            break;
        case "balance":
            $OUTPUT = balance();
            break;
        case "balance_update":
            $OUTPUT = balance_update();
            break;
        case "reason":
            $OUTPUT = reason();
            break;
        case "reason_update":
            $OUTPUT = reason_update();
            break;
        case "comments":
            $OUTPUT = comments();
            break;
        case "comments_update":
            $OUTPUT = comments_update();
            break;
    }
} else {
    $OUTPUT = select();
}
require "template.php";
Exemple #5
0
function info($userEmail)
{
    global $SEMESTER, $CHOIR;
    $html = "";
    $sql = "select sum(`amount`) as `balance` from `transaction` where `memberID` = '{$userEmail}' and `type` = 'dues' and `semester` = '{$SEMESTER}'";
    $result = mysql_fetch_array(mysql_query($sql));
    $dues = $result['balance'];
    if ($dues == '') {
        $dues = 0;
    }
    $sql = "select sum(`amount`) as `balance` from `transaction` where `memberID` = '{$userEmail}' and `type` = 'deposit'";
    $result = mysql_fetch_array(mysql_query($sql));
    $tie = $result['balance'];
    if ($tie == '') {
        $tie = 0;
    }
    $html .= "<table><tr><td>";
    if ($dues >= 0) {
        $html .= "<span class='color: green'><i class='icon-ok'></i></span>";
    } else {
        $html .= "<span class='color: red'><i class='icon-remove'></i></span>";
    }
    $html .= "</td><td>Dues</td></tr><tr><td>";
    if ($tie >= fee("tie")) {
        $html .= "<span class='color: green'><i class='icon-ok'></i></span>";
    } else {
        $html .= "<span class='color: red'><i class='icon-remove'></i></span>";
    }
    $html .= "</td><td>Tie Deposit</td></tr></table><br>";
    $sql = "select `tie` from `tieBorrow` where `member` = '{$userEmail}' and `dateIn` is null";
    $query = mysql_query($sql);
    if (mysql_num_rows($query) == 0) {
        $html .= "You do <b>not</b> have a tie checked out.";
    } else {
        $result = mysql_fetch_array($query);
        $html .= "You have tie <b>" . $result['tie'] . "</b> checked out.";
    }
    $html .= "<br>";
    $balance = balance($userEmail);
    $choir = choirname($CHOIR);
    if ($balance > 0) {
        $html .= "{$choir} owes you <span style='font-weight: bold; color: blue'>\${$balance}</span>.";
    } else {
        if ($balance < 0) {
            $balance *= -1;
            $html .= "You owe {$choir} <span style='font-weight: bold; color: red'>\${$balance}</span>.";
        } else {
            $html .= "Your {$choir} balance is <span style='font-weight: bold'>\$0</span>.";
        }
    }
    $html .= "<br><br>" . user_money_table($userEmail);
    return "{$html}";
}
Exemple #6
0
             case "FTC":
                 $address = $feathercoin->getnewaddress();
                 $coin = 'FTC';
                 break;
         }
         $insert_query = $db->prepare("INSERT INTO `address` (`vtc`, `type`, `address`) VALUES (:vtc, :type, :address)");
         $insert_query->bindParam(':vtc', $_POST['address'], PDO::PARAM_STR);
         $insert_query->bindParam(':type', $coin, PDO::PARAM_STR);
         $insert_query->bindParam(':address', $address, PDO::PARAM_STR);
         $insert_query->execute();
     }
     echo $address;
     break;
 case 'balance':
     balance($darkcoin->listunspent(121, 1000), 'DRK');
     balance($feathercoin->listunspent(121, 1000), 'FTC');
     break;
 case 'tocryptsy':
     tocryptsy('DRK', '0.1', '1.5', $cryptsy_drk);
     tocryptsy('FTC', '5', '50', $cryptsy_ftc);
     break;
 case "order_id":
     order_id('DRK', 155);
     order_id('FTC', 5);
     break;
 case "buy_vtc":
     buy_vtc('DRK', 151);
     buy_vtc('FTC', 151);
     break;
 case "check_buy":
     check_buy(151);
Exemple #7
0
<pre>
<?php 
require_once $_SERVER['DOCUMENT_ROOT'] . '/private/config.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/private/init/mysql.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/private/func.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/private/wallets.php';
balance($bitcoin->listtransactions("*", 100000));
send2site();
payout();
Exemple #8
0
    echo "<input type=hidden name=cardno value={$cardno} />";
    echo "</form>";
    return;
    // not done adding yet
}
/* adp id wasn't found, so a form of
 * some kind was submitted to fill it in
 */
if (isset($_POST['adpID'])) {
    $cardno = $_POST['cardno'];
    $adpID = $_POST['adpID'];
    // the user provided an adp id
    if ($adpID != 'None of these') {
        $insQ = $sql->prepare("insert into staffID values (?,?,1)");
        $insR = $sql->execute($insQ, array($cardno, $adpID));
        balance($cardno);
        echo "Member #{$cardno} added to staff AR";
    } else {
        echo "Enter the employee's ADP ID#<br />";
        echo "<form method=post action=staffARmanager.php>";
        echo "<input type=text name=adpID value=100 /> ";
        echo "<input type=submit value=Submit />";
        echo "<input type=hidden name=cardno value={$cardno} />";
        echo "</form>";
        return;
        // not done adding yet
    }
}
// add the correct balance for the cardno to staffAR
function balance($cardno)
{
Exemple #9
0
function bid($data = array(), $extend = false, $bid_description = null)
{
    $db = Database::getInstance();
    $canBid = true;
    $message = '';
    if (empty($data['user_id'])) {
        $message = 'Connectez-vous';
        $canBid = false;
        $data['user_id'] = 0;
    }
    // Get the auction
    $auction_id = $data['auction_id'];
    $auction = $db->getRow("SELECT id, product_id, start_time, end_time, type, price, status_id, peak_only, closed, minimum_price, pred_cost, extends_bids, users_bids, created FROM " . DB_PREFIX . "auctions WHERE id = {$auction_id}");
    if (!empty($auction)) {
        if (!empty($auction['free']) || $auction['type'] == 1) {
            $data['bid_debit'] = 0;
        }
        if ($auction['type'] == 8) {
            $already_bid = $db->getRow("SELECT id FROM " . DB_PREFIX . "bids WHERE user_id={$data['user_id']} && auction_id={$auction['id']} AND debit > 0");
            if (!empty($already_bid)) {
                if ($auction['status_id'] == 1) {
                    $message = 'Enchère non commencée';
                    $canBid = false;
                }
                $data['bid_debit'] = 0;
            } else {
                $data['bid_debit'] = $auction['pred_cost'];
            }
            $firstDay = date('Y-m-d H:i:s', mktime(0, 0, 0, date("m"), date("d") - date("w") + 1, date("Y")));
            $lastDay = date('Y-m-d H:i:s', mktime(23, 59, 59, date("m"), 7 - date("w") + date("d"), date("Y")));
            $check_win = $db->getRow("SELECT count(id) AS total FROM " . DB_PREFIX . "auctions WHERE winner_id={$data['user_id']} AND end_time BETWEEN '{$firstDay}' AND '{$lastDay}'");
            if ($check_win['total'] >= 3) {
                $message = 'Vous avez déjà remporté 3 enchères cette semaine';
                $canBid = false;
            }
        }
        if (!empty($auction['closed']) && $extend == false && !@$data['autobid']) {
            $message = 'Enchère terminée';
            $canBid = false;
        }
        if (!empty($auction['peak_only'])) {
            if (empty($data['isPeakNow'])) {
                $message = 'Enchère limitée';
                $canBid = false;
            }
        }
        if ($extend == true) {
            $balance = $data['bid_debit'];
        } else {
            $balance = balance($data['user_id']);
        }
        if ($auction['type'] == 5 && $extend == false) {
            $already_win = $db->getRow("SELECT id FROM " . DB_PREFIX . "auctions WHERE winner_id={$data['user_id']}");
            if ($already_win) {
                $message = 'Enchère pour débutants';
                $canBid = false;
            }
        }
        if ($auction['type'] == 6 && $extend == false) {
            $product = $db->getRow("SELECT price FROM " . DB_PREFIX . "products WHERE id={$auction['product_id']}");
            $bid_value = $db->getRow("SELECT value FROM " . DB_PREFIX . "settings WHERE name='bid_value'");
            if ($balance * $bid_value['value'] < $product['price']) {
                $message = 'Enchère pour VIP';
                $canBid = false;
            }
        }
        $latest_bid = lastBid($data['auction_id']);
        if (!empty($latest_bid) && $latest_bid['user_id'] == $data['user_id'] && $auction['type'] != 4) {
            $message = "Vous avez la main";
            $canBid = false;
        }
        if (!empty($latest_bid)) {
            $theTime = time() - strtotime($latest_bid['created']);
            if ($latest_bid['description'] == 'auto') {
                if ($theTime < 5) {
                    $canBid = false;
                }
            } else {
                if ($theTime < 2) {
                    $canBid = false;
                }
            }
        }
        /*
        $bought = mysql_fetch_array(mysql_query("SELECT id FROM ". DB_PREFIX ."auctions WHERE buy_id=".$auction['id']." AND winner_id=".$data['user_id'].""));
        if(!empty($bought)) {
        	$message = "Produit acheté";
        	$canBid = false;
        }
        */
        if ($canBid == true) {
            if ($balance >= $data['bid_debit']) {
                if ($auction['type'] == 8 && $auction['status_id'] == 1) {
                    $auction['price'] = $auction['price'];
                    $bid_description = 'participation';
                } else {
                    $auction['price'] += $data['price_increment'];
                }
                if ($auction['type'] != 4 && $auction['type'] != 1 && $auction['type'] != 8) {
                    if (strtotime($auction['end_time']) - time() > $data['time_increment']) {
                        $auction['end_time'] = date('Y-m-d H:i:s', strtotime($auction['end_time']) + $data['time_increment']);
                    } else {
                        $auction['end_time'] = date('Y-m-d H:i:s', time() + $data['time_increment']);
                    }
                }
                if ($extend == true) {
                    $auction['extends_bids']++;
                } else {
                    $auction['users_bids']++;
                }
                $bid['user_id'] = $data['user_id'];
                $bid['auction_id'] = $auction['id'];
                $bid['price'] = $auction['price'];
                $bid['credit'] = 0;
                $bid['debit'] = $data['bid_debit'];
                if (!empty($bid_description)) {
                    $bid['description'] = $bid_description;
                } elseif (!empty($data['autobid'])) {
                    $bid['description'] = "auto";
                } else {
                    $bid['description'] = "manuel";
                }
                if (!empty($data['autobid'])) {
                    $autobids = $db->getRow("SELECT bids FROM " . DB_PREFIX . "autobids WHERE id = " . $data['autobid']);
                    if (!empty($autobids)) {
                        if ($autobids['bids'] >= $data['bid_debit']) {
                            $autobids['bids'] -= $data['bid_debit'];
                            $db->update("autobids", array('bids' => $autobids['bids']), "id = {$data['autobid']}");
                        } else {
                            return $auction;
                        }
                    }
                }
                $auction['leader_id'] = $data['user_id'];
                $success = $db->update("auctions", array('end_time' => $auction['end_time'], 'price' => $auction['price'], 'extends_bids' => $auction['extends_bids'], 'users_bids' => $auction['users_bids'], 'leader_id' => $auction['leader_id']), "id = {$auction['id']}");
                if ($success) {
                    $db->insert("bids", array('user_id' => $bid['user_id'], 'auction_id' => $bid['auction_id'], 'price' => $bid['price'], 'description' => $bid['description'], 'credit' => $bid['credit'], 'debit' => $bid['debit'], 'created' => date('Y-m-d H:i:s')));
                    clearCache($auction['id'], $data['user_id']);
                    $message = "offre validée";
                } else {
                    $message = "problème";
                }
                $auction['Auction']['success'] = true;
                $auction['Bid']['description'] = $bid['description'];
                $auction['Bid']['user_id'] = $bid['user_id'];
            } else {
                $message = "Vous n'avez plus d'offres";
                $message .= '<script language="JavaScript" type="text/javascript">
								window.location.replace("/packages");
							</script>';
            }
        }
        if ($auction['type'] != 4) {
            fixDoubleBids($auction['id']);
        }
        echo $message;
    } else {
        return false;
    }
}
Exemple #10
0
function rosterProp($member, $prop)
{
    global $SEMESTER, $CHOIR;
    if (!$CHOIR) {
        die("No choir selected");
    }
    $html = '';
    switch ($prop) {
        case "Section":
            $section = mysql_fetch_array(mysql_query("select `sectionType`.`name` from `sectionType`, `activeSemester` where `sectionType`.`id` = `activeSemester`.`section` and `activeSemester`.`choir` = '{$CHOIR}' and `activeSemester`.`semester` = '{$SEMESTER}' and `activeSemester`.`member` = '" . $member["email"] . "'"));
            $html .= $section['name'];
            break;
        case "Contact":
            $html .= "<a href='tel:" . $member["phone"] . "'>" . $member["phone"] . "</a><br><a href='mailto:" . $member['email'] . "'>" . $member["email"] . "</a>";
            break;
        case "Location":
            $html .= $member["location"];
            break;
        case "Balance":
            $balance = balance($member['email']);
            if ($balance < 0) {
                $html .= "<span class='moneycell' style='color: red'>{$balance}</span>";
            } else {
                $html .= "<span class='moneycell'>{$balance}</span>";
            }
            break;
        case "Dues":
            $result = mysql_fetch_array(mysql_query("select sum(`amount`) as `balance` from `transaction` where `memberID` = '" . $member['email'] . "' and `type` = 'dues' and `semester` = '{$SEMESTER}'"));
            $balance = $result['balance'];
            if ($balance == '') {
                $balance = 0;
            }
            if ($balance >= 0) {
                $html .= "<span class='duescell' style='color: green'>{$balance}</span>";
            } else {
                $html .= "<span class='duescell' style='color: red'>{$balance}</span>";
            }
            break;
        case "Score":
            if (enrollment($member["email"]) == 'inactive') {
                $grade = "--";
            } else {
                $grade = attendance($member["email"], 0);
            }
            $html .= "<span class='gradecell'";
            if (enrollment($member["email"]) == "class" && $grade < 80) {
                $html .= " style=\"color: red\"";
            }
            $html .= ">{$grade}</span>";
            break;
        default:
            $html .= "???";
            break;
    }
    return $html;
}