예제 #1
0
파일: test.php 프로젝트: bcGiR/roommates
<?php

require 'dbadapter.php';
include_once 'header.php';
if (createBill("bill", 300, 15, 1)) {
    echo "<p>Bill created</p>";
}
if (createDate("trash", 21, 1)) {
    echo "<p>Date created</p>";
}
if (createPurchase("Dish Soap", 21, "2014-10-06", 1, 1)) {
    echo "<p>Purchase created</p>";
}
if (createRoom(50, 1, 1)) {
    echo "<p>Room created</p>";
}
include_once 'footer.php';
예제 #2
0
     $money = $money['money'];
 } else {
     $money = 0;
 }
 $list = mysql_query("SELECT orderID from purchase_confirm ORDER BY -orderID");
 if ($row = mysql_fetch_array($list)) {
     $max_list = $row[0];
 } else {
     $max_list = 1;
 }
 if (isset($_REQUEST['option'])) {
     if ($_REQUEST['description'] == "" || $_REQUEST['amount'] <= 0) {
         get_page_advanced("purchase", "admin", array('deposit' => $deposit, 'incomplete' => $incomplete, 'pending' => $pending, 'accept' => $accept, 'reject' => $reject, 'balance' => $money, 'max_list' => $max_list, 'error' => "New orders require a description and amount!"));
     } else {
         if ($_REQUEST['transfer_type'] == -1) {
             $id = createPurchase($club_id, $_REQUEST['description'], $_REQUEST['amount'] * $_REQUEST['transfer_type']);
             get_page_advanced("purchase_create", "admin", array('club_id' => $club_id, 'id' => $id));
         } else {
             if ($_REQUEST['transfer_type'] == 0) {
                 $amount = $_REQUEST['amount'];
                 createDeposit($club_id, $_REQUEST['description'], $_REQUEST['amount']);
                 get_page_advanced("purchase", "admin", array('deposit' => $deposit, 'incomplete' => $incomplete, 'pending' => $pending, 'accept' => $accept, 'reject' => $reject, 'balance' => $money, 'max_list' => $max_list, 'success' => "\${$amount} added to your account!"));
             }
         }
     }
 } else {
     if (isset($_REQUEST['edit'])) {
         get_page_advanced("purchase_create", "admin", array('club_id' => $club_id, 'id' => $_REQUEST['edit']));
     } else {
         get_page_advanced("purchase", "admin", array('deposit' => $deposit, 'incomplete' => $incomplete, 'pending' => $pending, 'accept' => $accept, 'reject' => $reject, 'balance' => $money, 'max_list' => $max_list));
     }