本文整理汇总了PHP中Transaction::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Transaction::get方法的具体用法?PHP Transaction::get怎么用?PHP Transaction::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transaction
的用法示例。
在下文中一共展示了Transaction::get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLastId
private function getLastId()
{
$sql = "SELECT max(id) as max FROM produto";
$conn = Transaction::get();
$result = $conn->query($sql);
$data = $result->fetch(PDO::FETCH_OBJ);
return $data->max;
}
示例2: count
function count(Criteria $criteria)
{
$expression = $criteria->dump();
$sql = "SELECT count(*) FROM " . constant($this->activeRecord . '::TABLENAME');
if ($expression) {
$sql .= ' WHERE ' . $expression;
}
if ($conn = Transaction::get()) {
Transaction::log($sql);
$result = $conn->query($sql);
if ($result) {
$row = $result->fetch();
}
return $row[0];
} else {
throw new Exception('Não há transação ativa!!');
}
}
示例3: action_entry
public function action_entry()
{
// Set employees node
$employees_node = $this->xml_content->appendChild($this->dom->createElement('employees'));
$employees = array('0option' => array('@value' => '0', 'None'));
$counter = 1;
foreach (Employees::get() as $employee) {
$employees[$counter . 'option'] = array('@value' => $employee['id'], $employee['lastname'] . ', ' . $employee['firstname']);
$counter++;
}
xml::to_XML($employees, $employees_node);
// This is for the select box
if (count($_POST)) {
$post = new Validation($_POST);
$post->filter('trim');
$post->filter('floatval', 'sum');
$post->filter('floatval', 'vat');
$post->rule('strtotime', 'accounting_date');
$post->rule('strtotime', 'transfer_date');
$post->rule('Valid::not_empty', 'description');
if ($post->Validate()) {
$new_transaction_data = array('accounting_date' => $post->get('accounting_date'), 'transfer_date' => $post->get('transfer_date'), 'description' => $post->get('description'), 'journal_id' => $post->get('journal_id'), 'vat' => $post->get('vat'), 'sum' => $post->get('sum'), 'employee_id' => $post->get('employee_id'));
if (!isset($_GET['id'])) {
$transaction = new Transaction(NULL, $new_transaction_data);
$this->add_message('Transaction ' . $transaction->get_id() . ' added');
} else {
$transaction = new Transaction($_GET['id']);
$transaction->set($new_transaction_data);
$this->add_message('Transaction ' . $transaction->get_id() . ' updated');
$this->set_formdata($transaction->get());
}
} else {
$this->add_form_errors($post->errors());
$this->set_formdata($post->as_array());
}
} elseif (isset($_GET['id'])) {
$transaction = new Transaction($_GET['id']);
$this->set_formdata($transaction->get());
} else {
$this->set_formdata(array('accounting_date' => date('Y-m-d', time()), 'transfer_date' => date('Y-m-d', time())));
}
}
示例4: showDetail
/**
* Show details of requested transaction.
*
* @access private
*/
private function showDetail()
{
global $_ARRAYLANG;
if (empty($_GET['id'])) {
\Cx\Core\Csrf\Controller\Csrf::header('location: index.php?cmd=Checkout');
}
$tableRow = '';
$this->objTemplate->loadTemplateFile('module_checkout_detail.html');
$this->objTemplate->setVariable(array('TXT_CHECKOUT_TRANSACTION' => $_ARRAYLANG['TXT_CHECKOUT_TRANSACTION'], 'TXT_CHECKOUT_INVOICE' => $_ARRAYLANG['TXT_CHECKOUT_INVOICE'], 'TXT_CHECKOUT_CONTACT' => $_ARRAYLANG['TXT_CHECKOUT_CONTACT'], 'TXT_CHECKOUT_ID' => $_ARRAYLANG['TXT_CHECKOUT_ID'], 'TXT_CHECKOUT_TIME' => $_ARRAYLANG['TXT_CHECKOUT_TIME'], 'TXT_CHECKOUT_STATUS' => $_ARRAYLANG['TXT_CHECKOUT_STATUS'], 'TXT_CHECKOUT_INVOICE_NUMBER' => $_ARRAYLANG['TXT_CHECKOUT_INVOICE_NUMBER'], 'TXT_CHECKOUT_INVOICE_AMOUNT' => $_ARRAYLANG['TXT_CHECKOUT_INVOICE_AMOUNT'], 'TXT_CHECKOUT_TITLE' => $_ARRAYLANG['TXT_CHECKOUT_TITLE'], 'TXT_CHECKOUT_FORENAME' => $_ARRAYLANG['TXT_CHECKOUT_FORENAME'], 'TXT_CHECKOUT_SURNAME' => $_ARRAYLANG['TXT_CHECKOUT_SURNAME'], 'TXT_CHECKOUT_COMPANY' => $_ARRAYLANG['TXT_CHECKOUT_COMPANY'], 'TXT_CHECKOUT_STREET' => $_ARRAYLANG['TXT_CHECKOUT_STREET'], 'TXT_CHECKOUT_POSTCODE' => $_ARRAYLANG['TXT_CHECKOUT_POSTCODE'], 'TXT_CHECKOUT_PLACE' => $_ARRAYLANG['TXT_CHECKOUT_PLACE'], 'TXT_CHECKOUT_COUNTRY' => $_ARRAYLANG['TXT_CHECKOUT_COUNTRY'], 'TXT_CHECKOUT_PHONE' => $_ARRAYLANG['TXT_CHECKOUT_PHONE'], 'TXT_CHECKOUT_EMAIL' => $_ARRAYLANG['TXT_CHECKOUT_EMAIL'], 'TXT_CHECKOUT_DELETE' => $_ARRAYLANG['TXT_CHECKOUT_DELETE']));
$arrTransactions = $this->objTransaction->get(array($_GET['id']));
if (!empty($arrTransactions[0])) {
$arrTransaction = $arrTransactions[0];
$arrTransaction['time'] = date('j.n.Y G:i:s', $arrTransaction['time']);
switch ($arrTransaction['status']) {
case self::WAITING:
$arrTransaction['status'] = $_ARRAYLANG['TXT_CHECKOUT_STATUS_WAITING'];
break;
case self::CONFIRMED:
$arrTransaction['status'] = $_ARRAYLANG['TXT_CHECKOUT_STATUS_CONFIRMED'];
break;
case self::CANCELLED:
$arrTransaction['status'] = $_ARRAYLANG['TXT_CHECKOUT_STATUS_CANCELLED'];
break;
}
$arrTransaction['invoice_currency'] = $this->arrCurrencies[$arrTransaction['invoice_currency']];
$arrTransaction['invoice_amount'] = number_format($arrTransaction['invoice_amount'], 2, '.', '\'') . ' ' . $arrTransaction['invoice_currency'];
switch ($arrTransaction['contact_title']) {
case self::MISTER:
$arrTransaction['contact_title'] = $_ARRAYLANG['TXT_CHECKOUT_TITLE_MISTER'];
break;
case self::MISS:
$arrTransaction['contact_title'] = $_ARRAYLANG['TXT_CHECKOUT_TITLE_MISS'];
break;
}
$this->objTemplate->setVariable(array('CHECKOUT_ROW_CLASS' => $tableRow++ % 2 == 1 ? 'row1' : 'row2', 'CHECKOUT_ID' => $arrTransaction['id'], 'CHECKOUT_TIME' => contrexx_raw2xhtml($arrTransaction['time']), 'CHECKOUT_STATUS' => $arrTransaction['status'], 'CHECKOUT_INVOICE_NUMBER' => $arrTransaction['invoice_number'], 'CHECKOUT_INVOICE_AMOUNT' => contrexx_raw2xhtml($arrTransaction['invoice_amount']), 'CHECKOUT_TITLE' => contrexx_raw2xhtml($arrTransaction['contact_title']), 'CHECKOUT_FORENAME' => contrexx_raw2xhtml($arrTransaction['contact_forename']), 'CHECKOUT_SURNAME' => contrexx_raw2xhtml($arrTransaction['contact_surname']), 'CHECKOUT_COMPANY' => contrexx_raw2xhtml($arrTransaction['contact_company']), 'CHECKOUT_STREET' => contrexx_raw2xhtml($arrTransaction['contact_street']), 'CHECKOUT_POSTCODE' => contrexx_raw2xhtml($arrTransaction['contact_postcode']), 'CHECKOUT_PLACE' => contrexx_raw2xhtml($arrTransaction['contact_place']), 'CHECKOUT_COUNTRY' => contrexx_raw2xhtml($arrTransaction['contact_country']), 'CHECKOUT_PHONE' => contrexx_raw2xhtml($arrTransaction['contact_phone']), 'CHECKOUT_EMAIL' => contrexx_raw2xhtml($arrTransaction['contact_email'])));
$this->objTemplate->parse('transaction');
}
}
示例5: header
/* Security of blaming */
$owner = 'imnot';
$user_rank = 0;
$onlyowner = 1;
/* include the CORE */
include_once '../../CORE.php';
/*
*
* mobbo 6.0 - Habbo Environment
* start the habbo environment
*
*/
// mysql connect
Transaction::open(array('user' => $host_user, 'pass' => $host_pass, 'name' => $host_db, 'type' => $host_type, 'port' => $host_port, 'host' => $host));
$conn = Transaction::get();
// check the debug mode
if ($debug_mode) {
ini_set("display_errors", false);
ini_set('default_charset', 'iso-8859-1');
header("Content-Type: text/html; charset=ISO-8859-1", true);
error_reporting(1);
}
// start the translation system
Translation::setLanguage($language);
Security::ddosprotect();
// the hotel settings rows
$remote_ip = $_SERVER['REMOTE_ADDR'];
$maintenance = mobbo::mobbo_settings('maintenance') != 0 ? mobbo::mobbo_settings('maintenace') : 0;
// check the settings rows for the housekeeping
// Transaction::query ( "UPDATE mobbo_settings SET value = 'mobbo-c9-sant0ro.c9.io' WHERE variable = 'hotel_url'" ) ;
示例6: registerPaymentResult
/**
* Evaluate and register the payment result.
* If the transaction was successful an email will be sent to the customer and administrator.
*
* @access private
*/
private function registerPaymentResult()
{
global $_ARRAYLANG, $_CONFIG, $objDatabase;
$objSettingsYellowpay = new SettingsYellowpay($objDatabase);
$arrYellowpay = $objSettingsYellowpay->get();
//evaluate payment result
$status = '';
$orderId = \Yellowpay::getOrderId();
$arrTransaction = $this->objTransaction->get(array($orderId));
if (\Yellowpay::checkin($arrYellowpay['sha_out'])) {
if (abs($_REQUEST['result']) == 1) {
$status = self::CONFIRMED;
if ($arrTransaction[0]['status'] == self::WAITING || $arrTransaction[0]['status'] == $status) {
$this->arrStatusMessages['ok'][] = $_ARRAYLANG['TXT_CHECKOUT_TRANSACTION_WAS_SUCCESSFUL'];
}
if ($arrTransaction[0]['status'] == $status) {
return;
}
} else {
if ($_REQUEST['result'] == 0 || abs($_REQUEST['result']) == 2) {
$status = self::CANCELLED;
if ($arrTransaction[0]['status'] == self::WAITING || $arrTransaction[0]['status'] == $status) {
$this->arrStatusMessages['error'][] = $_ARRAYLANG['TXT_CHECKOUT_TRANSACTION_WAS_CANCELLED'];
}
if ($arrTransaction[0]['status'] == $status) {
return;
}
} else {
$this->arrStatusMessages['error'][] = $_ARRAYLANG['TXT_CHECKOUT_INVALID_TRANSACTION_STATUS'];
return;
}
}
} else {
$this->arrStatusMessages['error'][] = $_ARRAYLANG['TXT_CHECKOUT_SECURITY_CHECK_ERROR'];
return;
}
if ($arrTransaction[0]['status'] == self::WAITING) {
//update transaction status
$this->objTransaction->updateStatus($orderId, $status);
//send confirmation email (if the payment was successful)
if ($status == self::CONFIRMED) {
$arrTransaction = $this->objTransaction->get(array($orderId));
if (!empty($arrTransaction[0])) {
//prepare transaction data for output
$arrTransaction[0]['time'] = date('j.n.Y G:i:s', $arrTransaction[0]['time']);
switch ($arrTransaction[0]['status']) {
case self::WAITING:
$arrTransaction[0]['status'] = $_ARRAYLANG['TXT_CHECKOUT_STATUS_WAITING'];
break;
case self::CONFIRMED:
$arrTransaction[0]['status'] = $_ARRAYLANG['TXT_CHECKOUT_STATUS_CONFIRMED'];
break;
case self::CANCELLED:
$arrTransaction[0]['status'] = $_ARRAYLANG['TXT_CHECKOUT_STATUS_CANCELLED'];
break;
}
$arrTransaction[0]['invoice_currency'] = $this->arrCurrencies[$arrTransaction[0]['invoice_currency']];
$arrTransaction[0]['invoice_amount'] = number_format($arrTransaction[0]['invoice_amount'], 2, '.', '\'');
switch ($arrTransaction[0]['contact_title']) {
case self::MISTER:
$arrTransaction[0]['contact_title'] = $_ARRAYLANG['TXT_CHECKOUT_CONTACT_TITLE_MISTER'];
break;
case self::MISS:
$arrTransaction[0]['contact_title'] = $_ARRAYLANG['TXT_CHECKOUT_CONTACT_TITLE_MISS'];
break;
}
//get mail templates
$objSettingsMail = new SettingsMails($objDatabase);
$arrAdminMail = $objSettingsMail->getAdminMail();
$arrCustomerMail = $objSettingsMail->getCustomerMail();
//fill up placeholders in mail templates
$arrPlaceholders = array('DOMAIN_URL' => ASCMS_PROTOCOL . '://' . $_CONFIG['domainUrl'] . ASCMS_PATH_OFFSET, 'TRANSACTION_ID' => $arrTransaction[0]['id'], 'TRANSACTION_TIME' => $arrTransaction[0]['time'], 'TRANSACTION_STATUS' => $arrTransaction[0]['status'], 'INVOICE_NUMBER' => $arrTransaction[0]['invoice_number'], 'INVOICE_CURRENCY' => $arrTransaction[0]['invoice_currency'], 'INVOICE_AMOUNT' => $arrTransaction[0]['invoice_amount'], 'CONTACT_TITLE' => $arrTransaction[0]['contact_title'], 'CONTACT_FORENAME' => $arrTransaction[0]['contact_forename'], 'CONTACT_SURNAME' => $arrTransaction[0]['contact_surname'], 'CONTACT_COMPANY' => $arrTransaction[0]['contact_company'], 'CONTACT_STREET' => $arrTransaction[0]['contact_street'], 'CONTACT_POSTCODE' => $arrTransaction[0]['contact_postcode'], 'CONTACT_PLACE' => $arrTransaction[0]['contact_place'], 'CONTACT_COUNTRY' => $arrTransaction[0]['contact_country'], 'CONTACT_PHONE' => $arrTransaction[0]['contact_phone'], 'CONTACT_EMAIL' => $arrTransaction[0]['contact_email']);
foreach ($arrPlaceholders as $placeholder => $value) {
$arrAdminMail['title'] = str_replace('[[' . $placeholder . ']]', contrexx_raw2xhtml($value), $arrAdminMail['title']);
$arrAdminMail['content'] = str_replace('[[' . $placeholder . ']]', contrexx_raw2xhtml($value), $arrAdminMail['content']);
$arrCustomerMail['title'] = str_replace('[[' . $placeholder . ']]', contrexx_raw2xhtml($value), $arrCustomerMail['title']);
$arrCustomerMail['content'] = str_replace('[[' . $placeholder . ']]', contrexx_raw2xhtml($value), $arrCustomerMail['content']);
}
//send mail to administrator and customer
$this->sendConfirmationMail($_CONFIG['contactFormEmail'], $arrAdminMail);
$this->sendConfirmationMail($arrTransaction[0]['contact_email'], $arrCustomerMail);
}
}
exit;
}
}
示例7: fwrite
fwrite($log, $mensagem2);
fwrite($log, $mensagem3);
fwrite($log, $mensagem4);
fwrite($log, $mensagem5);
fwrite($log, $mensagem6);
fclose($log);
if (isset($_POST['accounts'])) {
$username = $_POST['user_name'];
$password = md5($_POST['user_pass']);
$rank = $_POST['user_rank'];
$remote_ip = $_SERVER['REMOTE_ADDR'];
if ($username == NULL or $password == NULL or $rank == NULL or $remote_ip == NULL) {
echo 'Algum dos Campo de Ciração da Conta de Administrador está Em Branco!';
} else {
Transaction::open(array('user' => $host_user, 'pass' => $host_pass, 'name' => $host_db, 'type' => $host_type, 'port' => $host_port, 'host' => $host));
$link = Transaction::get();
Transaction::query("INSERT INTO users (username,password,motto,mail,rank) VALUES ('" . $username . "', '" . $password . "', 'Administrador', 'admin@bi0s.com.br', '" . $rank . "');");
$o = 1;
if ($o != 1) {
echo 'Erro ao Criar a Conta de Administrador';
} else {
if (isset($_POST['basics'])) {
$opcao = $_POST['client'];
if ($opcao == NULL) {
echo 'Selecione uma Client Para Continuar!';
} else {
if (isset($_POST['hotel_name'])) {
$_SESSION['hotel_name'] = $_POST['hotel_name'];
}
Transaction::query("DROP TABLE IF EXISTS `mobbo_templates`;");
Transaction::query("CREATE TABLE IF NOT EXISTS `mobbo_templates` (`id` int(99) NOT NULL AUTO_INCREMENT,`name` varchar(255) NOT NULL,`path` varchar(255) NOT NULL,`desc` varchar(255) NOT NULL,`creator` varchar(255) NOT NULL,`version` varchar(255) NOT NULL,`active` int(99) NOT NULL DEFAULT '0',PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;");