Exemplo n.º 1
0
<?php

App::Uses('CakeRequest', 'Network');
App::uses('Controller', 'Controller');
App::uses('File', 'Utility');
App::uses('View', 'View');
class CakePdf
{
    /**
     * Layout for the View
     *
     * @var string
     */
    protected $_layout = 'default';
    /**
     * Template for the view
     *
     * @var string
     */
    protected $_template = null;
    /**
     * View for render
     *
     * @var string
     */
    protected $_viewRender = 'View';
    /**
     * Vars to sent to render
     *
     * @var array
     */
<?php

App::Uses('AppController', 'Controller');
class UpdatehoursController extends AppController
{
    public function save_studtopic()
    {
        $this->autoRender = false;
        $this->loadModel("Students_topic");
        if ($this->Students_topic->save($this->request->data)) {
            $message = array('text' => __('Saved'), 'type' => 'succed');
        } else {
            $message = array('text' => __('Error'), 'type' => 'error');
        }
        $this->set(array('message' => $message, '_serialize' => array('message')));
    }
    /*//get  value from Student_topics
    public function getspendhoursvalue(){
    
    $this->autoRender = false;
    $value = $this->request->data('selectedtopics');
    $this->loadModel("Students_topic");
    $topi = $this->Students_topic->findAllByTopicstitle($value);
    $data = array(
          'Data' => $topi,
          'error' => 'okey'
    
      );
    
    return json_encode($data);
    
Exemplo n.º 3
0
/**
 * Application model for Cake.
 *
 * This file is application-wide model file. You can put all
 * application-wide model-related methods here.
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.Model
 * @since         CakePHP(tm) v 0.2.9
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */
App::Uses('AppModel', 'Model');
class User extends AppModel
{
    public $name = 'User';
    var $primaryKey = "userID";
    public $hasMany = array('Follow' => array('className' => 'Follow', 'foreignKey' => 'userID'), 'Following' => array('className' => 'Follow', 'foreignKey' => 'followingID'), 'Post' => array('className' => 'Post', 'foreignKey' => 'userID'), 'Like' => array('className' => 'Like', 'foreignKey' => 'userID'));
    //model validations
    public $validate = array('username' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => 'Please Enter the  Username')), 'password' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => 'Please Enter the  Password'), 'minLength' => array('rule' => array('minLength', 5), 'message' => 'Password must be atleast 5 characters long !!')), 'user_type_id' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => 'Please Select the User Type')), 'userDescription' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => 'Please Enter the  description')), 'email' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => 'Please Enter the valid Email')), 'phone' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => 'Please Enter the  Phone Number')), 'userAvatar' => array('rule1' => array('rule' => array('extension', array('jpeg', 'jpg', 'png', 'gif')), 'allowEmpty' => true, 'message' => 'Please select a valid user image', 'on' => 'create'), 'rule2' => array('rule' => array('extension', array('jpeg', 'jpg', 'png', 'gif')), 'message' => 'Please select a valid user image', 'on' => 'update')), 'user_csv_file' => array('rule' => array('extension', array('csv')), 'required' => false, 'allowEmpty' => false, 'message' => 'Please select a valid csv file'));
}
<?php

App::Uses('DrexCartInstaller', 'DrexCart.DrexCartLib');
class DrexCartInstallController extends DrexCartAppController
{
    var $uses = array('DrexCart.DrexCartConfig');
    public function index()
    {
    }
    public function runStep1($run = 0)
    {
        if ($run) {
            $installer = new DrexCartInstaller();
            if ($installer->runStep1()) {
                $this->set('ran', true);
            }
        }
    }
    public function runStep2($run = 0)
    {
        $installer = new DrexCartInstaller();
        if (!empty($this->request->data)) {
            //print_r($this->request->data);
            if (isset($this->request->data['DrexCartConfig']['sitename'])) {
                $installer->runStep2($this->request->data['DrexCartConfig']['sitename']);
            }
        }
        try {
            $sitename = $this->DrexCartConfig->getValue('sitename');
            $this->request->data['DrexCartConfig']['sitename'] = $sitename;
        } catch (Exception $e) {
Exemplo n.º 5
0
App::Uses('GetSettledBatchListRequestType', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetSettledBatchListResponse', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetSettledBatchListResponseType', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetBatchStatistics', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetBatchStatisticsRequestType', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetBatchStatisticsResponse', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetBatchStatisticsResponseType', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetTransactionList', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetTransactionListRequestType', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetTransactionListResponse', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetTransactionListResponseType', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('TransactionSummaryType', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetUnsettledTransactionList', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetUnsettledTransactionListRequestType', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetUnsettledTransactionListResponse', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
App::Uses('GetUnsettledTransactionListResponseType', 'DrexCart.DrexCartLib/PaymentGateways/Authorize');
//App::Uses('SoapClientWrapper', 'apiClasses/structure');
/**
 * 
 * @package apiClasses.apiObjects.service
 */
class ServiceCustom extends SoapClient
{
    /**
     * 
     * @var array $classmap The defined classes
     * @access private
     */
    private static $classmap = array('IsAlive' => '\\IsAlive', 'IsAliveResponse' => '\\IsAliveResponse', 'ANetApiResponseType' => '\\ANetApiResponseType', 'MessagesTypeMessage' => '\\MessagesTypeMessage', 'AuthenticateTest' => '\\AuthenticateTest', 'MerchantAuthenticationType' => '\\MerchantAuthenticationType', 'AuthenticateTestResponse' => '\\AuthenticateTestResponse', 'ARBCreateSubscription' => '\\ARBCreateSubscription', 'ARBSubscriptionType' => '\\ARBSubscriptionType', 'PaymentScheduleType' => '\\PaymentScheduleType', 'PaymentScheduleTypeInterval' => '\\PaymentScheduleTypeInterval', 'PaymentType' => '\\PaymentType', 'BankAccountType' => '\\BankAccountType', 'BankAccountBaseType' => '\\BankAccountBaseType', 'CreditCardType' => '\\CreditCardType', 'CreditCardSimpleType' => '\\CreditCardSimpleType', 'OrderType' => '\\OrderType', 'CustomerType' => '\\CustomerType', 'DriversLicenseType' => '\\DriversLicenseType', 'DriversLicenseBaseType' => '\\DriversLicenseBaseType', 'NameAndAddressType' => '\\NameAndAddressType', 'ARBCreateSubscriptionResponse' => '\\ARBCreateSubscriptionResponse', 'ARBCreateSubscriptionResponseType' => '\\ARBCreateSubscriptionResponseType', 'ARBUpdateSubscription' => '\\ARBUpdateSubscription', 'ARBUpdateSubscriptionResponse' => '\\ARBUpdateSubscriptionResponse', 'ARBUpdateSubscriptionResponseType' => '\\ARBUpdateSubscriptionResponseType', 'ARBCancelSubscription' => '\\ARBCancelSubscription', 'ARBCancelSubscriptionResponse' => '\\ARBCancelSubscriptionResponse', 'ARBCancelSubscriptionResponseType' => '\\ARBCancelSubscriptionResponseType', 'ARBGetSubscriptionStatus' => '\\ARBGetSubscriptionStatus', 'ARBGetSubscriptionStatusResponse' => '\\ARBGetSubscriptionStatusResponse', 'ARBGetSubscriptionStatusResponseType' => '\\ARBGetSubscriptionStatusResponseType', 'ARBGetSubscriptionList' => '\\ARBGetSubscriptionList', 'ARBGetSubscriptionListRequestType' => '\\ARBGetSubscriptionListRequestType', 'ARBGetSubscriptionListSorting' => '\\ARBGetSubscriptionListSorting', 'Paging' => '\\Paging', 'ARBGetSubscriptionListResponse' => '\\ARBGetSubscriptionListResponse', 'ARBGetSubscriptionListResponseType' => '\\ARBGetSubscriptionListResponseType', 'SubscriptionDetail' => '\\SubscriptionDetail', 'CreateCustomerProfile' => '\\CreateCustomerProfile', 'CustomerProfileType' => '\\CustomerProfileType', 'CustomerProfileBaseType' => '\\CustomerProfileBaseType', 'CustomerPaymentProfileType' => '\\CustomerPaymentProfileType', 'CustomerPaymentProfileBaseType' => '\\CustomerPaymentProfileBaseType', 'CustomerAddressType' => '\\CustomerAddressType', 'CreateCustomerProfileResponse' => '\\CreateCustomerProfileResponse', 'CreateCustomerProfileResponseType' => '\\CreateCustomerProfileResponseType', 'CreateCustomerProfileFromTransaction' => '\\CreateCustomerProfileFromTransaction', 'CreateCustomerProfileFromTransactionResponse' => '\\CreateCustomerProfileFromTransactionResponse', 'CreateCustomerPaymentProfile' => '\\CreateCustomerPaymentProfile', 'CreateCustomerPaymentProfileResponse' => '\\CreateCustomerPaymentProfileResponse', 'CreateCustomerPaymentProfileResponseType' => '\\CreateCustomerPaymentProfileResponseType', 'CreateCustomerShippingAddress' => '\\CreateCustomerShippingAddress', 'CreateCustomerShippingAddressResponse' => '\\CreateCustomerShippingAddressResponse', 'CreateCustomerShippingAddressResponseType' => '\\CreateCustomerShippingAddressResponseType', 'GetCustomerProfile' => '\\GetCustomerProfile', 'GetCustomerProfileResponse' => '\\GetCustomerProfileResponse', 'GetCustomerProfileResponseType' => '\\GetCustomerProfileResponseType', 'CustomerProfileMaskedType' => '\\CustomerProfileMaskedType', 'CustomerProfileExType' => '\\CustomerProfileExType', 'CustomerPaymentProfileMaskedType' => '\\CustomerPaymentProfileMaskedType', 'PaymentMaskedType' => '\\PaymentMaskedType', 'BankAccountMaskedType' => '\\BankAccountMaskedType', 'CreditCardMaskedType' => '\\CreditCardMaskedType', 'TokenMaskedType' => '\\TokenMaskedType', 'DriversLicenseMaskedType' => '\\DriversLicenseMaskedType', 'CustomerAddressExType' => '\\CustomerAddressExType', 'GetCustomerPaymentProfile' => '\\GetCustomerPaymentProfile', 'GetCustomerPaymentProfileResponse' => '\\GetCustomerPaymentProfileResponse', 'GetCustomerPaymentProfileResponseType' => '\\GetCustomerPaymentProfileResponseType', 'GetCustomerShippingAddress' => '\\GetCustomerShippingAddress', 'GetCustomerShippingAddressResponse' => '\\GetCustomerShippingAddressResponse', 'GetCustomerShippingAddressResponseType' => '\\GetCustomerShippingAddressResponseType', 'UpdateCustomerProfile' => '\\UpdateCustomerProfile', 'UpdateCustomerProfileResponse' => '\\UpdateCustomerProfileResponse', 'UpdateCustomerProfileResponseType' => '\\UpdateCustomerProfileResponseType', 'UpdateCustomerPaymentProfile' => '\\UpdateCustomerPaymentProfile', 'CustomerPaymentProfileExType' => '\\CustomerPaymentProfileExType', 'UpdateCustomerPaymentProfileResponse' => '\\UpdateCustomerPaymentProfileResponse', 'UpdateCustomerPaymentProfileResponseType' => '\\UpdateCustomerPaymentProfileResponseType', 'UpdateCustomerShippingAddress' => '\\UpdateCustomerShippingAddress', 'UpdateCustomerShippingAddressResponse' => '\\UpdateCustomerShippingAddressResponse', 'UpdateCustomerShippingAddressResponseType' => '\\UpdateCustomerShippingAddressResponseType', 'DeleteCustomerProfile' => '\\DeleteCustomerProfile', 'DeleteCustomerProfileResponse' => '\\DeleteCustomerProfileResponse', 'DeleteCustomerProfileResponseType' => '\\DeleteCustomerProfileResponseType', 'DeleteCustomerPaymentProfile' => '\\DeleteCustomerPaymentProfile', 'DeleteCustomerPaymentProfileResponse' => '\\DeleteCustomerPaymentProfileResponse', 'DeleteCustomerPaymentProfileResponseType' => '\\DeleteCustomerPaymentProfileResponseType', 'DeleteCustomerShippingAddress' => '\\DeleteCustomerShippingAddress', 'DeleteCustomerShippingAddressResponse' => '\\DeleteCustomerShippingAddressResponse', 'DeleteCustomerShippingAddressResponseType' => '\\DeleteCustomerShippingAddressResponseType', 'CreateCustomerProfileTransaction' => '\\CreateCustomerProfileTransaction', 'ProfileTransactionType' => '\\ProfileTransactionType', 'ProfileTransVoidType' => '\\ProfileTransVoidType', 'ProfileTransAuthOnlyType' => '\\ProfileTransAuthOnlyType', 'ProfileTransOrderType' => '\\ProfileTransOrderType', 'ProfileTransAmountType' => '\\ProfileTransAmountType', 'ExtendedAmountType' => '\\ExtendedAmountType', 'LineItemType' => '\\LineItemType', 'ProfileTransPriorAuthCaptureType' => '\\ProfileTransPriorAuthCaptureType', 'ProfileTransRefundType' => '\\ProfileTransRefundType', 'OrderExType' => '\\OrderExType', 'ProfileTransAuthCaptureType' => '\\ProfileTransAuthCaptureType', 'ProfileTransCaptureOnlyType' => '\\ProfileTransCaptureOnlyType', 'CreateCustomerProfileTransactionResponse' => '\\CreateCustomerProfileTransactionResponse', 'CreateCustomerProfileTransactionResponseType' => '\\CreateCustomerProfileTransactionResponseType', 'ValidateCustomerPaymentProfile' => '\\ValidateCustomerPaymentProfile', 'ValidateCustomerPaymentProfileResponse' => '\\ValidateCustomerPaymentProfileResponse', 'ValidateCustomerPaymentProfileResponseType' => '\\ValidateCustomerPaymentProfileResponseType', 'GetCustomerProfileIds' => '\\GetCustomerProfileIds', 'GetCustomerProfileIdsResponse' => '\\GetCustomerProfileIdsResponse', 'GetCustomerProfileIdsResponseType' => '\\GetCustomerProfileIdsResponseType', 'GetHostedProfilePage' => '\\GetHostedProfilePage', 'SettingType' => '\\SettingType', 'GetHostedProfilePageResponse' => '\\GetHostedProfilePageResponse', 'GetHostedProfilePageResponseType' => '\\GetHostedProfilePageResponseType', 'UpdateSplitTenderGroup' => '\\UpdateSplitTenderGroup', 'UpdateSplitTenderGroupResponse' => '\\UpdateSplitTenderGroupResponse', 'UpdateSplitTenderGroupResponseType' => '\\UpdateSplitTenderGroupResponseType', 'GetTransactionDetails' => '\\GetTransactionDetails', 'GetTransactionDetailsResponse' => '\\GetTransactionDetailsResponse', 'GetTransactionDetailsResponseType' => '\\GetTransactionDetailsResponseType', 'TransactionDetailsType' => '\\TransactionDetailsType', 'FDSFilterType' => '\\FDSFilterType', 'BatchDetailsType' => '\\BatchDetailsType', 'BatchStatisticType' => '\\BatchStatisticType', 'CustomerDataType' => '\\CustomerDataType', 'subscriptionPaymentType' => '\\subscriptionPaymentType', 'returnedItem' => '\\returnedItem', 'solutionInfo' => '\\solutionInfo', 'GetSettledBatchList' => '\\GetSettledBatchList', 'GetSettledBatchListRequestType' => '\\GetSettledBatchListRequestType', 'GetSettledBatchListResponse' => '\\GetSettledBatchListResponse', 'GetSettledBatchListResponseType' => '\\GetSettledBatchListResponseType', 'GetBatchStatistics' => '\\GetBatchStatistics', 'GetBatchStatisticsRequestType' => '\\GetBatchStatisticsRequestType', 'GetBatchStatisticsResponse' => '\\GetBatchStatisticsResponse', 'GetBatchStatisticsResponseType' => '\\GetBatchStatisticsResponseType', 'GetTransactionList' => '\\GetTransactionList', 'GetTransactionListRequestType' => '\\GetTransactionListRequestType', 'GetTransactionListResponse' => '\\GetTransactionListResponse', 'GetTransactionListResponseType' => '\\GetTransactionListResponseType', 'TransactionSummaryType' => '\\TransactionSummaryType', 'GetUnsettledTransactionList' => '\\GetUnsettledTransactionList', 'GetUnsettledTransactionListRequestType' => '\\GetUnsettledTransactionListRequestType', 'GetUnsettledTransactionListResponse' => '\\GetUnsettledTransactionListResponse', 'GetUnsettledTransactionListResponseType' => '\\GetUnsettledTransactionListResponseType');
    /**
     * 
Exemplo n.º 6
0
<?php

App::Uses('AdminCrudBehavior', 'Panel.Model/Behavior');
App::uses('Model', 'Model');
class User extends Model
{
    public $name = 'User';
    public $validate = array('name' => array('rule' => 'notempty', 'required' => true, 'allowEmpty' => false));
}
class AdminCrudBehaviorTest extends CakeTestCase
{
    public $fixtures = array('plugin.panel.user');
    public function startTest($method)
    {
        parent::startTest($method);
        $this->AdminCrud = new AdminCrudBehavior();
        $this->User = ClassRegistry::init('User');
        $fixture = new UserFixture();
        $this->record = array('User' => $fixture->records[0]);
    }
    public function endTest($method)
    {
        parent::endTest($method);
        unset($this->AdminCrud);
        unset($this->User);
        ClassRegistry::flush();
    }
    public function testAdminAdd()
    {
        $data = $this->record;
        unset($data['User']['id']);
Exemplo n.º 7
0
<?php

App::uses('ClassRegistry', 'Utility');
App::uses('Aro', 'Model');
App::uses('Aco', 'Model');
App::Uses('Permission', 'Model');
App::uses('Role', 'Model');
App::uses('User', 'Model');
App::uses('DbAcl', 'Controller/Component/Acl');
class AppSchema extends CakeSchema
{
    public function before($event = array())
    {
        return true;
    }
    public function after($event = array())
    {
        static $createdTables = 0;
        // tracks number of created tables
        // determines how many tables are in this schema class
        $totalTables = 0;
        $refclass = new ReflectionClass($this);
        foreach ($refclass->getProperties() as $property) {
            if ($property->class === $refclass->name) {
                ++$totalTables;
            }
        }
        // when called from the console schema utility, the connection parameter is
        // a string, but when it's called from the web installer it's an object
        if (is_string($this->connection)) {
            $dataSourceName = $this->connection;