本文整理汇总了PHP中Payment::getById方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::getById方法的具体用法?PHP Payment::getById怎么用?PHP Payment::getById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Payment
的用法示例。
在下文中一共展示了Payment::getById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: homepage
function homepage()
{
global $connector;
global $result;
if (isset($_SESSION['admin'])) {
header("Location: admin/");
}
if (isset($_SESSION['login'])) {
include_once "classes/Student.php";
include_once "classes/Exam.php";
include_once "classes/Plan.php";
include_once "classes/Payment.php";
include_once "classes/Notice.php";
include_once "classes/Booking.php";
include_once "classes/Document.php";
$student = new Student();
$student->setConnector($connector);
$student = $student->getById($_SESSION['id_student']);
$student->setConnector($connector);
$exam = new Exam();
$plan = new Plan();
$payment = new Payment();
$notice = new Notice();
$booking = new Booking();
$document = new Document();
$exam->setConnector($connector);
$plan->setConnector($connector);
$payment->setConnector($connector);
$notice->setConnector($connector);
$booking->setConnector($connector);
$document->setConnector($connector);
if (isset($_POST['operation'])) {
list($operation, $params) = explode("#", $_POST['operation']);
switch ($operation) {
case 'editChanges':
$student->storeFormValues($_POST);
$student->id = $params;
if (isset($_POST['password']) && $_POST['password'] != '') {
$student->generatePassword($_POST['password']);
}
$error_msg = $student->update();
break;
case 'saveBook':
$error_msg = $booking->saveBooking($student->id, $params);
break;
case 'sendMail':
$error_msg = sendMail();
break;
default:
$error_msg = $operation . "#" . $params;
break;
}
if ($error_msg != "") {
$result["errorMessage"] = $error_msg;
} elseif ($operation != 'edit' && $operation != "nextPage") {
$result["statusMessage"] = "Operazione completata!";
}
}
if ($student) {
$result["edit"] = $student;
$result["edit"]->exam = $exam->getList($student);
$result["edit"]->plan = $plan->getById($student->id_plan);
$result['edit']->payment = $payment->getById($student->id);
$result['edit']->notice = $notice->getList();
$result['edit']->booking = $booking->getListForStudent($student);
$result['edit']->booked = $booking->getBookedList($student->id);
$result['edit']->document = $document->getList();
}
$page = "home.php";
include_once BASE_PATH . "/template.php";
} else {
$page = "login.php";
include_once BASE_PATH . "/template.php";
}
}
示例2:
$p->set_surcharge(0);
$p->set_discount(0);
$p->set_comment('');
$p->set_status(1);
$p->set_date(strtotime('now'));
$payment_id = Payment::save($p);
exit;
}
if (!empty($_GET['switch'])) {
// Update status of old device
$d = Device::getById($device_id);
$d->set_status(0);
Device::save($d);
// Update status of new device
$device_id = (int) $_GET['new_device_id'];
$d = Device::getById($device_id);
$d->set_status(1);
Device::save($d);
$p = Payment::getById($payment_id);
$p->set_device($device_id);
Payment::save($p);
echo $device_id;
exit;
}
$smarty->assign('start', $start);
$smarty->assign('stop', $stop);
$smarty->assign('total', $total);
$smarty->assign('total1', $total1);
$smarty->assign('payment', Payment::getById($payment_id));
$smarty->assign('device', $device);
$smarty->display('payment.tpl');
示例3: showPayment
function showPayment()
{
global $connector;
$student = new Student();
$student->setConnector($connector);
$payment = new Payment();
$payment->setConnector($connector);
if (isset($_POST['operation'])) {
list($operation, $params) = explode("#", $_POST['operation']);
switch ($operation) {
case 'selectStudent':
$result['edit'] = $payment->getById($params);
if (!isset($result['edit']->student_id)) {
$result['edit']->student_id = $params;
}
break;
case 'delete':
$error_msg = $payment->delete($params);
break;
case 'edit':
$result['edit'] = $payment->getById($params);
break;
case 'editChanges':
$payment->storeFormValues($_POST);
$error_msg = $payment->update();
break;
case 'saveChanges':
$payment->storeFormValues($_POST);
$payment->setConnector($connector);
$error_msg = $payment->insert();
break;
default:
$error_msg = "Operazione non valida";
}
if ($error_msg != "") {
$result["errorMessage"] = $error_msg;
} elseif ($operation != 'edit' && $operation != 'selectStudent') {
$result["statusMessage"] = "Operazione completata!";
}
}
$result['students'] = $student->getList("cognome");
$result['payments'] = $payment->getList();
$page = "payment.php";
include_once BASE_PATH . "template.php";
}