//$i_total = get_isset($i_total); $i_supplier = get_isset($i_supplier); $i_branch_id = get_isset($i_branch_id); $i_code = get_isset($i_code); $data = " purchase_date = '{$i_date}',\n\t\t\t\t\tstock_id = '{$i_stock_id}', \n\t\t\t\t\tpurchase_qty = '{$i_qty}',\n\t\t\t\t\tpurchase_price = '{$i_harga}',\n\t\t\t\t\tpurchase_total = '0',\n\t\t\t\t\tsupplier_id = '{$i_supplier}',\n\t\t\t\t\tbranch_id = '{$i_branch_id}',\n\t\t\t\t\tpurchase_code = '{$i_code}'\n\n\t\t\t\t\t"; update($data, $id); header('Location: purchase.php?page=list&did=2'); break; case 'delete': $id = get_isset($_GET['id']); delete($id); header('Location: purchase.php?page=list&did=3'); break; case 'payment': $id = get_isset($_GET['id']); payment($id); header('Location: purchase.php?page=list&did=4'); break; case 'add_menu': $item_id = get_isset($_GET['item_id']); $data = "'',\n\t\t\t\t\t'0',\n\t\t\t\t\t'{$item_id}',\n\t\t\t\t\t'0', \n\t\t\t\t\t'0',\n\t\t\t\t\t'" . $_SESSION['user_id'] . "'\n\t\t\t\t\t\n\t\t\t"; create_config("purchase_details", $data); header("Location: purchase.php?page=form"); break; case 'edit_price': $id = get_isset($_GET['id']); $qty = get_isset($_GET['qty']); $price = get_isset($_GET['price']); $data = "purchase_detail_qty = '{$qty}',\n\t\t\t\tpurchase_detail_price = '{$price}'\n\t\t\t\t\n\t\t"; update_config("purchase_details", $data, "purchase_detail_id", $id); break;
<?php require_once "../include/core.php"; $options = getopt("", array("db-prefix:", "id:")); if (isset($options['db-prefix'])) { define('DB_TABLE_PREFIX', $options['db-prefix']); echo "DB prefix: " . $options['db-prefix']; } require_once realpath(__DIR__ . "/../include/core.php"); if (isset($options['id'])) { $id = $options['id']; } else { $id = false; } payment(1, $id);
if (isset($options['db-prefix'])) { define('DB_TABLE_PREFIX', $options['db-prefix']); echo "DB prefix: " . $options['db-prefix']; } require_once realpath(__DIR__ . "/../include/core.php"); $currentDay = intval(date('j')); // Create withdrawal date $withdrawalDay = configgetvalue('system', 'cash', NULL, 'withdrawalDay'); $withdrawalDate = new DateTime('first day of this month midnight'); $withdrawalDate->modify(intval($withdrawalDay) - 1 . ' days'); // Create notifications start date $notificationsOffset = configgetvalue('system', 'cash', NULL, 'notificationsOffset'); $notificationsStartDate = clone $withdrawalDate; $notificationsStartDate->modify(-$notificationsOffset . ' days'); // Crete notifications end date $notificationsDuration = configgetvalue('system', 'cash', NULL, 'notificationsDuration'); $notificationsEndDate = clone $notificationsStartDate; $notificationsEndDate->modify($notificationsDuration . ' days'); // Show notifications if (configgetvalue('system', 'cash', NULL, 'showNotifications') && intval($notificationsStartDate->format('j')) === $currentDay) { echo "Show notifications..."; payment(1); } else { if (intval($notificationsEndDate->format('j')) === $currentDay) { echo "Hide notifications..."; payment(2); } } echo "Withdrawal..."; payment(0);
case 'reservations': showRes($link); break; case 'rooms': checkRooms($link); break; case 'checkIN': checkIN($link, $_POST['guestID']); console($link, $_POST['guestID']); break; case 'checkOUT': checkOUT($link, $_POST['guestID']); console($link, $_POST['guestID']); break; case 'payment': payment($link, $_POST['guestID']); console($link, $_POST['guestID']); break; case 'console': console($link, $_POST['guestID']); break; default: break; } /** * List guests registered accounts * * @param $link */ function showGuests($link) {
}); $afterEditRenderers = array('user' => function ($id, $newFields, $oldFields) { // Router migration if (isset($newFields['router'])) { if (intval($oldFields['router'])) { controllerRouterQueue($oldFields['router'], "delete", $id); } controllerRouterQueue($newFields['router'], "update", $id); } else { if (isset($newFields['login']) || isset($newFields['password']) || isset($newFields['disabled']) || isset($newFields['iplist'])) { controllerRouterQueue($oldFields['router'], "update", $id); } } $currentOrder = getCurrentTariff($id); if (!$currentOrder || $currentOrder['temp'] === 1) { payment(0, $id); } }, 'tariff' => function ($id, $newFields) { if (isset($newFields['upspeed']) || isset($newFields['downspeed']) || isset($newFields['nightupspeed']) || isset($newFields['nightdownspeed']) || isset($newFields['downburstlimit']) || isset($newFields['downburstthreshold']) || isset($newFields['downbursttime']) || isset($newFields['upburstlimit']) || isset($newFields['upburstthreshold']) || isset($newFields['upbursttime'])) { $usersTable = new table('user'); $users = $usersTable->load("WHERE tariff={$id}"); foreach ($users as $row) { controllerRouterQueue($row['router'], "update", $row['id']); } } }, 'order' => function ($id, $newFields, $oldFields) { $usersTable = new table('user'); $row = $usersTable->loadById($oldFields['user']); controllerRouterQueue($row['router'], "update", $oldFields['user']); return $newFields; });
private function post_credits() { if ($this->get_request_method() != 'POST') { $this->response($this->get_request_method(), 406); } //Recebe um Json como argumento para o parâmetro 'json'. $json = $this->_request['json']; //Converte o Json em um array, os indices do array são iguais às chaves do Json. Ex.: {"id":1,"outroValor": "string"}. $vector = json_decode($json, TRUE); // variaveis $id_user = $vector['IdUser']; $id_credit_card = $vector['IdCreditCard']; $csc = $vector['CSC']; $value = $vector['Value']; $sql = select_credit_card($id_user, $id_credit_card); $response = array(); if ($query = mysqli_query($this->db, $sql)) { if (mysqli_num_rows($query) > 0) { // pega o unico registro da consulta e armazena em $row $row = mysqli_fetch_array($query, MYSQLI_ASSOC); $pay = payment($row['name'], $row['flag'], $row['num'], $row['validate_month'], $row['validate_year'], $csc); if ($pay) { $sql_insert_payment = insert_payment($id_user, $id_credit_card, $value, 1); //inserindo na tabela payment if ($query_insert_payment = mysqli_query($this->db, $sql_insert_payment)) { // atualizando o saldo do user $sql_update_saldo = update_user_saldo($id_user, $value); if ($query_update_saldo = mysqli_query($this->db, $sql_update_saldo)) { $response['Sucess'] = 'Sucesso'; } else { $response['Error'] = mysqli_error($this->db); } } else { $response['Error'] = mysqli_error($this->db); } } } else { $response['Error'] = 'Cartão de crédito não cadastrado'; } } else { $response['Error'] = mysqli_error($this->db); } $this->response(json_encode($response), 200); }
<?php require_once "../include/core.php"; payment(2);
$gAmount = $_POST["gAmount"]; $principal = $tuition - $discount - $deposit; $a = payment($apr, $periods, $principal); if (isset($_POST["discount"])) { $monthly = ($a * $periods - $gPeriods * $gAmount) / ($periods - $gPeriods); $total = $a * $periods + $deposit; } else { $monthly = payment($apr, $periods, $principal); $total = $open * $periods + $deposit; } if (isset($_POST["gPeriods"])) { //$a = payment($apr,$periods,$principal); $monthly = ($a * $periods - $gPeriods * $gAmount) / ($periods - $gPeriods); $total = $a * $periods + $deposit; } else { $monthly = payment($apr, $periods, $principal); $total = $monthly * $periods + $deposit; } if ($discount != 0 && $apr == 0) { $total = $tuition - $discount; } elseif ($discount == 0 && $apr == 0) { $total = $tuition; } else { $total = $a * $periods + $deposit; } ?> <div class="container"> <div class="row"> <div class="col-xs-12 col-md-3 col-md-offset-9"> <p><?php echo "Prepared: " . $currentDate;