상속: extends PageController
예제 #1
0
    }
    $fields = implode($fields, ',');
    $userPayFields = Profile::model()->find(array('select' => $fields, 'condition' => 'user_id = :user', 'params' => array(':user' => $data->profileUser->id)));
    $fields = array();
    if (!empty($userPayFields)) {
        foreach ($userPayFields as $key => $field) {
            if ($field != null) {
                $fields[$key] = $final[$key];
            }
        }
    }
    $model = Company::model()->findByPk(Company::getId());
    if ($model !== null && $model->PaymentCash == '1') {
        $fields['cash'] = 'Наличные';
    }
    return CHtml::dropDownList('paymentType_' . $data->id, $data->details_type, $fields, array('empty' => '', 'disabled' => in_array($data->approve, array(Payment::APPROVED, Payment::REJECTED)) ? true : false, 'ajax' => array('url' => PaymentController::createUrl('getPayNumber'), 'data' => array('payType' => 'js:this.value', 'user' => $data->profileUser->id), 'success' => 'function(html) {
									if (html != "") $("#payDetailNumber_' . $data->id . '").val(html);
									else $("#payDetailNumber_' . $data->id . '").val("");
								}')));
}), array('name' => 'details_number', 'type' => 'raw', 'value' => function ($data) {
    return CHtml::textField("payDetailNumber_{$data->id}", $data->details_number, array('disabled' => in_array($data->approve, array(Payment::APPROVED, Payment::REJECTED)) ? true : false));
}), array('name' => 'approve', 'type' => 'raw', 'value' => function ($data) {
    return approve_buttons($data);
}, 'filter' => array('0' => Yii::t('site', 'New'), '1' => Yii::t('site', 'Confirmed'), '2' => Yii::t('site', 'Rejected'))), array('header' => 'Отменить платеж', 'class' => 'CButtonColumn', 'template' => '{cancel}', 'buttons' => array('cancel' => array('label' => Yii::t('site', 'Cancel'), 'options' => array("class" => "btn btn-primary btn-xs cancel_payment"), 'visible' => 'in_array($data->approve, array(' . Payment::APPROVED . ', ' . Payment::REJECTED . '))', 'click' => 'function(){cancelPayment($(this).attr("href"));return false;}', 'url' => '$data->id'))))));
?>
	Количество: <b><?php 
echo $data['out']['count'];
?>
</b>
	<br>
	Сумма: <b><?php 
예제 #2
0
<?php

/**
 * Created by IntelliJ IDEA.
 * User: Pranav
 * Date: 29-03-2016
 * Time: 20:55
 */
require_once 'PaymentController.php';
$data = json_decode($_GET['data']);
if (!isset($_SESSION['token'])) {
    session_start();
}
$userId = $_SESSION['token'];
$opt = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC);
switch ($data->operation) {
    case 'AllPaymentForProject':
        echo json_encode(PaymentController::getAllPayment($data->data));
        break;
    case 'getPaymentPaidByInvoices':
        PaymentController::getPaymentPaidByInvoices($data->invoiceId);
        break;
}
 /**
  * Ingresa un nuevo participante a la base de datos,
  * Si el correo ya existe regresa un mensaje de error
  */
 public function setParticipante()
 {
     $participante = new participantesModel();
     $datos = $participante->validarCorreo($_POST['correo']);
     if (count($datos) == 1) {
         //validación de que el corre no se duplique.
         $respuesta = array('estatus' => 500, "msg" => "EL CORREO YA EXISTE.", "url" => PATH_SITE . "perfil/");
     } else {
         $result = $participante->setParticipante($_POST['correo'], $_POST['pass']);
         if ($result) {
             $datos = $participante->autentificarUser($_POST['correo'], $_POST['pass']);
             if (count($datos) == 1) {
                 foreach ($datos as $key => $row) {
                     $_SESSION['registro_cief'] = array('id_participante' => $row['id_participante'], 'nombre' => $row['nombre']);
                     $respuesta = array('estatus' => 200, "msg" => "SE GUARDARON CORRECTAMENTE SUS DATOS.", "url" => PATH_SITE . "perfil/");
                     $correo = new PaymentController();
                     $participante->setRegistroNuevo($row['id_participante']);
                     $correo->notificacion($row['id_participante']);
                 }
             } else {
                 $respuesta = array('estatus' => 500, 'msg' => 'ERROR AL OBTENER LOS DATOS DE ACCESO');
             }
         } else {
             $respuesta = array('estatus' => 500, 'msg' => 'ERROR AL GUARDAR LOS DATOS');
         }
     }
     echo json_encode($respuesta);
 }
예제 #4
0
 public function getRoute()
 {
     // Retrieve the URI
     if (strlen($this->_basepath) > 1) {
         // Local Server
         $uri = str_replace($this->_basepath, "", $_SERVER['REQUEST_URI']);
     } else {
         // AWS Server
         $uri = substr($_SERVER['REQUEST_URI'], 1);
     }
     // If the user is not logged in, go back to Home.
     if ($uri != 'Login') {
         if (!isset($_SESSION['loggedin'])) {
             $uri = 'Home';
         }
     }
     if (strrpos($uri, '/') !== false) {
         $uri = explode('/', $uri);
         $id = $uri[1];
         $uri = $uri[0] . '-';
     }
     // Calls the appropriate controller based on the URI.
     switch ($uri) {
         case 'Home':
             $home = new HomeController();
             $home->display();
             break;
         case 'Account-Summary':
             $summary = new SummaryController();
             $summary->display();
             break;
         case 'Transaction-History-':
             $_SESSION['accountID'] = $id;
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Transaction-History");
             break;
         case 'Transaction-History':
             $history = new HistoryController();
             $history->display();
             break;
         case 'Account-Details-':
             $_SESSION['detAccountID'] = $id;
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Account-Details");
             break;
         case 'Account-Details':
             $details = new DetailsController();
             $details->display();
             break;
         case 'New-Bill-Payment-':
             $payment = new Paymentamt();
             $payment->setAccountSelected($id);
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "New-Bill-Payment");
             break;
         case 'New-Bill-Payment':
             $payment = new PaymentController();
             $payment->display();
             break;
         case 'Bill-Payment-Amount':
             $paymentamt = new PaymentamtController();
             $paymentamt->display();
             break;
         case 'Bill-Payment-Confirmation':
             $paymentconf = new PaymentconfController();
             $paymentconf->display();
             break;
         case 'Bill-Payment-Acknowledgement':
             $paymentack = new PaymentackController();
             $paymentack->display();
             break;
         case 'Payment-List':
             $paymentlist = new PaymentlistController();
             $paymentlist->display();
             break;
         case 'Bill-Payment-List':
             $_SESSION['billPayment'] = true;
             unset($_SESSION['fundsTransferPayment']);
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payment-List");
             break;
         case 'Funds-Transfer-Payment-List':
             $_SESSION['fundsTransferPayment'] = true;
             unset($_SESSION['billPayment']);
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payment-List");
             break;
         case 'Payee-List':
             $payeelist = new PayeelistController();
             $payeelist->display();
             break;
         case 'Bill-Payee-List':
             $_SESSION['billPayee'] = true;
             unset($_SESSION['fundsTransferPayee']);
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payee-List");
             break;
         case 'Funds-Transfer-Payee-List':
             $_SESSION['fundsTransferPayee'] = true;
             unset($_SESSION['billPayee']);
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payee-List");
             break;
         case 'Biller-Add':
             $billeradd = new BilleraddController();
             $billeradd->display();
             break;
         case 'Biller-Modify-':
             $_SESSION['billerModifyID'] = $id;
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Biller-Modify");
             break;
         case 'Biller-Modify':
             $billermodify = new BillermodifyController();
             $billermodify->display();
             break;
         case 'Biller-Delete-':
             $_SESSION['billerDeleteID'] = $id;
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Biller-Delete");
             break;
         case 'Biller-Delete':
             $billerdelete = new BillerdeleteController();
             $billerdelete->display();
             break;
         case 'New-Funds-Transfer-':
             $transfer = new CheckTransfer();
             $transfer->setAccountSelected($id);
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "New-Funds-Transfer");
             break;
         case 'New-Funds-Transfer':
             $transfer = new TransferController();
             $transfer->display();
             break;
         case 'Check-Transfer':
             $checktransfer = new ChecktransferController();
             $checktransfer->display();
             break;
         case 'Funds-Transfer-Acknowledgement':
             $transferack = new TransferackController();
             $transferack->display();
             break;
         case 'Payee-Add':
             $payeeadd = new PayeeaddController();
             $payeeadd->display();
             break;
         case 'Payee-Modify-':
             $_SESSION['payeeModifyID'] = $id;
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payee-Modify");
             break;
         case 'Payee-Modify':
             $payeemodify = new PayeemodifyController();
             $payeemodify->display();
             break;
         case 'Payee-Delete-':
             $_SESSION['payeeDeleteID'] = $id;
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payee-Delete");
             break;
         case 'Payee-Delete':
             $payeedelete = new PayeedeleteController();
             $payeedelete->display();
             break;
         case 'Login':
             $login = new LoginController();
             $login->login();
             break;
         case 'Logout':
             $logout = new LoginController();
             $logout->logout();
             break;
         default:
             $home = new HomeController();
             $home->display();
             break;
     }
 }
<?php

session_start();
require __DIR__ . '/config.php';
require_once __DIR__ . '/lib/Notary/Notary.php';
require_once __DIR__ . '/lib/Util/Util.php';
require_once __DIR__ . '/src/Controller/PaymentController.php';
use Att\Api\Util\Util;
$controller = new PaymentController();
$controller->handleRequest();
$results = $controller->getResults();
$errors = $controller->getErrors();
?>
<!DOCTYPE html>
<html lang="en"> 
  <head> 
    <title>AT&amp;T Sample Application - Payment</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta id="viewport" name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1">
    <link rel="stylesheet" type="text/css" href="style/common.css">
    <script src="scripts/utils.js"></script>
    <script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-33466541-1']);
        _gaq.push(['_trackPageview']);

        (function () {
             var ga = document.createElement('script');
             ga.type = 'text/javascript';
             ga.async = true;
             ga.src = ('https:' == document.location.protocol ? 'https://ssl'
<?php

/**
 * Created by IntelliJ IDEA.
 * User: LENOVO
 * Date: 03/29/16
 * Time: 11:30 PM
 */
require_once 'PaymentController.php';
$data = json_decode($_GET['data']);
if (!isset($_SESSION['token'])) {
    session_start();
}
$userId = $_SESSION['token'];
$opt = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC);
//echo json_encode($data);
switch ($data->operation) {
    case 'getProjectPayment':
        PaymentController::getAllPayment($data->projectId);
        break;
    case 'saveProjectPayment':
        PaymentController::savePaymentAndDetails($data->data);
        break;
    case 'getPaymentPaidAndTotalAmount':
        PaymentController::getPaymentPaidAndTotalAmount($data->data);
        break;
    case 'getAllPaymentForProject':
        PaymentController::getAllPaymentForProject($data->projectId);
        break;
}