Ejemplo n.º 1
0
 protected function getZendSearch()
 {
     if (is_null($this->_search)) {
         $this->importZendNamespace();
         Prado::using('Zend.Search.Lucene');
         $this->_search = new Zend_Search_Lucene($this->_data);
     }
     return $this->_search;
 }
Ejemplo n.º 2
0
 /**
  * Create and configure the data mapper using sqlmap configuration file.
  * Or if cache is enabled and manager already cached load from cache.
  * If cache is enabled, the data mapper instance is cached.
  *
  * @return TSqlMapManager SqlMap manager instance
  * @since 3.1.7
  */
 public function getSqlMapManager()
 {
     Prado::using('System.Data.SqlMap.TSqlMapManager');
     if (($manager = $this->loadCachedSqlMapManager()) === null) {
         $manager = new TSqlMapManager($this->getDbConnection());
         if (strlen($file = $this->getConfigFile()) > 0) {
             $manager->configureXml($file);
             $this->cacheSqlMapManager($manager);
         }
     } elseif ($this->getConnectionID() !== '') {
         $manager->setDbConnection($this->getDbConnection());
     }
     return $manager;
 }
Ejemplo n.º 3
0
 /**
  * Obtain database specific TDbMetaData class using the driver name of the database connection.
  * @param TDbConnection database connection.
  * @return TDbMetaData database specific TDbMetaData.
  */
 public static function getInstance($conn)
 {
     $conn->setActive(true);
     //must be connected before retrieving driver name
     $driver = $conn->getDriverName();
     switch (strtolower($driver)) {
         case 'pgsql':
             Prado::using('System.Data.Common.Pgsql.TPgsqlMetaData');
             return new TPgsqlMetaData($conn);
         case 'mysqli':
         case 'mysql':
             Prado::using('System.Data.Common.Mysql.TMysqlMetaData');
             return new TMysqlMetaData($conn);
         case 'sqlite':
             //sqlite 3
         //sqlite 3
         case 'sqlite2':
             //sqlite 2
             Prado::using('System.Data.Common.Sqlite.TSqliteMetaData');
             return new TSqliteMetaData($conn);
         case 'mssql':
             // Mssql driver on windows hosts
         // Mssql driver on windows hosts
         case 'sqlsrv':
             // sqlsrv driver on windows hosts
         // sqlsrv driver on windows hosts
         case 'dblib':
             // dblib drivers on linux (and maybe others os) hosts
             Prado::using('System.Data.Common.Mssql.TMssqlMetaData');
             return new TMssqlMetaData($conn);
         case 'oci':
             Prado::using('System.Data.Common.Oracle.TOracleMetaData');
             return new TOracleMetaData($conn);
             //			case 'ibm':
             //				Prado::using('System.Data.Common.IbmDb2.TIbmDb2MetaData');
             //				return new TIbmDb2MetaData($conn);
         //			case 'ibm':
         //				Prado::using('System.Data.Common.IbmDb2.TIbmDb2MetaData');
         //				return new TIbmDb2MetaData($conn);
         default:
             throw new TDbException('ar_invalid_database_driver', $driver);
     }
 }
Ejemplo n.º 4
0
 public function addStandalone($function, $id, $param = NULL)
 {
     $db = $this->Application->getModule('horuxDb')->DbConnection;
     $db->Active = true;
     $sql = "SELECT type FROM hr_device GROUP BY type";
     $cmd = $db->createCommand($sql);
     $data = $cmd->query();
     $data = $data->readAll();
     foreach ($data as $d) {
         $type = $d['type'];
         try {
             Prado::using('horux.pages.hardware.device.' . $type . '.' . $type . '_standalone');
             $class = $type . '_standalone';
             if (class_exists($class)) {
                 $sa = new $class();
                 $sa->addStandalone($function, $id, $param);
             }
         } catch (Exception $e) {
             //! do noting
         }
     }
 }
Ejemplo n.º 5
0
 /**
  * @param mixed $params the function name and parameters
  * @return mixed the component service response
  * @soapmethod
  */
 public function callServiceComponent($params)
 {
     if (is_array($params)) {
         if (array_key_exists(0, $params)) {
             if (array_key_exists(1, $params)) {
                 if (array_key_exists(2, $params)) {
                     try {
                         Prado::using('horux.pages.components.' . $params[0] . '.webservice.' . $params[1]);
                         $comp = new $params[1]();
                         if (method_exists($comp, $params[2])) {
                             if (array_key_exists(3, $params)) {
                                 return $comp->{$params}[2]($params[3]);
                             } else {
                                 return $comp->{$params}[2]();
                             }
                         } else {
                             return -4;
                         }
                         //Function not exists
                     } catch (Exception $e) {
                         return -5;
                         //class not exists
                     }
                 } else {
                     return -3;
                     //!Missing function
                 }
             } else {
                 return -2;
             }
             //! Missing class
         } else {
             return -1;
             //!Missing component
         }
     } else {
         return false;
     }
 }
Ejemplo n.º 6
0
<?php

//NOTE: This page require UTF-8 aware editors
Prado::using('System.I18N.core.NumberFormatInfo');
/**
 * @package System.I18N.core
 */
class NumberFormatInfoTest extends PHPUnit_Framework_TestCase
{
    function testCurrencyPatterns()
    {
        $numberInfo = NumberFormatInfo::getCurrencyInstance();
        //there should be 2 decimal places.
        $this->assertEquals($numberInfo->DecimalDigits, 2);
        $this->assertEquals($numberInfo->DecimalSeparator, '.');
        $this->assertEquals($numberInfo->GroupSeparator, ',');
        //there should be only 1 grouping of size 3
        $groupsize = array(3, false);
        $this->assertEquals($numberInfo->GroupSizes, $groupsize);
        //the default negative pattern prefix and postfix
        $negPattern = array('-¤', '');
        $this->assertEquals($numberInfo->NegativePattern, $negPattern);
        //the default positive pattern prefix and postfix
        $negPattern = array('¤', '');
        $this->assertEquals($numberInfo->PositivePattern, $negPattern);
        //the default currency symbol
        $this->assertEquals($numberInfo->CurrencySymbol, 'US$');
        $this->assertEquals($numberInfo->getCurrencySymbol('JPY'), '¥');
        $this->assertEquals($numberInfo->NegativeInfinitySymbol, '-∞');
        $this->assertEquals($numberInfo->PositiveInfinitySymbol, '+∞');
        $this->assertEquals($numberInfo->NegativeSign, '-');
Ejemplo n.º 7
0
/**
 * TOracleMetaData class file.
 *
 * @author Marcos Nobre <marconobre[at]gmail[dot]com>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2008 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @version $Id: TOracleMetaData.php 2787 2010-03-17 14:58:30Z rojaro $
 * @package System.Data.Common.Oracle
 */
/**
 * Load the base TDbMetaData class.
 */
Prado::using('System.Data.Common.TDbMetaData');
Prado::using('System.Data.Common.Oracle.TOracleTableInfo');
Prado::using('System.Data.Common.Oracle.TOracleTableColumn');
/**
 * TOracleMetaData loads Oracle database table and column information.
 *
 * @author Marcos Nobre <marconobre[at]gmail[dot]com>
 * @version $Id: TOracleMetaData.php 2787 2010-03-17 14:58:30Z rojaro $
 * @package System.Data.Common.Oracle
 * @since 3.1
 */
class TOracleMetaData extends TDbMetaData
{
    private $_defaultSchema = 'system';
    /**
     * @return string TDbTableInfo class name.
     */
    protected function getTableInfoClass()
Ejemplo n.º 8
0
<?php

/**
 * TScaffoldSearch class file.
 *
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
 * @link https://github.com/pradosoft/prado
 * @copyright Copyright &copy; 2005-2015 The PRADO Group
 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
 * @version $Id$
 * @package System.Data.ActiveRecord.Scaffold
 */
/**
 * Import the scaffold base.
 */
Prado::using('System.Data.ActiveRecord.Scaffold.TScaffoldBase');
/**
 * TScaffoldSearch provide a simple textbox and a button that is used
 * to perform search on a TScaffoldListView with ID given by {@link setListViewID ListViewID}.
 *
 * The {@link getSearchText SearchText} property is a TTextBox and the
 * {@link getSearchButton SearchButton} property is a TButton with label value "Search".
 *
 * Searchable fields of the Active Record can be restricted by specifying
 * a comma delimited string of allowable fields in the
 * {@link setSearchableFields SearchableFields} property. The default is null,
 * meaning that most text type fields are searched (the default searchable fields
 * are database dependent).
 *
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
 * @version $Id$
Ejemplo n.º 9
0
<?php

/**
 * TDbCache class file
 *
 * @author Qiang Xue <*****@*****.**>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2008 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @version $Id: TDbCache.php 2938 2011-06-01 07:46:44Z ctrlaltca@gmail.com $
 * @package System.Caching
 */
Prado::using('System.Data.TDbConnection');
/**
 * TDbCache class
 *
 * TDbCache implements a cache application module by storing cached data in a database.
 *
 * TDbCache relies on {@link http://www.php.net/manual/en/ref.pdo.php PDO} to retrieve
 * data from databases. In order to use TDbCache, you need to enable the PDO extension
 * as well as the corresponding PDO DB driver. For example, to use SQLite database
 * to store cached data, you need both php_pdo and php_pdo_sqlite extensions.
 *
 * By default, TDbCache creates and uses an SQLite database under the application
 * runtime directory. You may change this default setting by specifying the following
 * properties:
 * - {@link setConnectionID ConnectionID} or
 * - {@link setConnectionString ConnectionString}, {@link setUsername Username} and {@link setPassword Pasword}.
 *
 * The cached data is stored in a table in the specified database.
 * By default, the name of the table is called 'pradocache'. If the table does not
Ejemplo n.º 10
0
 protected function validateAttributes($type, $attributes)
 {
     Prado::using($type);
     if (($pos = strrpos($type, '.')) !== false) {
         $className = substr($type, $pos + 1);
     } else {
         $className = $type;
     }
     $class = new ReflectionClass($className);
     if (is_subclass_of($className, 'TControl') || $className === 'TControl') {
         foreach ($attributes as $name => $att) {
             if (($pos = strpos($name, '.')) !== false) {
                 // a subproperty, so the first segment must be readable
                 $subname = substr($name, 0, $pos);
                 if (!$class->hasMethod('get' . $subname)) {
                     throw new TConfigurationException('template_property_unknown', $type, $subname);
                 }
             } else {
                 if (strncasecmp($name, 'on', 2) === 0) {
                     // an event
                     if (!$class->hasMethod($name)) {
                         throw new TConfigurationException('template_event_unknown', $type, $name);
                     } else {
                         if (!is_string($att)) {
                             throw new TConfigurationException('template_eventhandler_invalid', $type, $name);
                         }
                     }
                 } else {
                     // a simple property
                     if (!($class->hasMethod('set' . $name) || $class->hasMethod('setjs' . $name) || $this->isClassBehaviorMethod($class, $name))) {
                         if ($class->hasMethod('get' . $name) || $class->hasMethod('getjs' . $name)) {
                             throw new TConfigurationException('template_property_readonly', $type, $name);
                         } else {
                             throw new TConfigurationException('template_property_unknown', $type, $name);
                         }
                     } else {
                         if (is_array($att) && $att[0] !== self::CONFIG_EXPRESSION) {
                             if (strcasecmp($name, 'id') === 0) {
                                 throw new TConfigurationException('template_controlid_invalid', $type);
                             } else {
                                 if (strcasecmp($name, 'skinid') === 0) {
                                     throw new TConfigurationException('template_controlskinid_invalid', $type);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     } else {
         if (is_subclass_of($className, 'TComponent') || $className === 'TComponent') {
             foreach ($attributes as $name => $att) {
                 if (is_array($att) && $att[0] === self::CONFIG_DATABIND) {
                     throw new TConfigurationException('template_databind_forbidden', $type, $name);
                 }
                 if (($pos = strpos($name, '.')) !== false) {
                     // a subproperty, so the first segment must be readable
                     $subname = substr($name, 0, $pos);
                     if (!$class->hasMethod('get' . $subname)) {
                         throw new TConfigurationException('template_property_unknown', $type, $subname);
                     }
                 } else {
                     if (strncasecmp($name, 'on', 2) === 0) {
                         throw new TConfigurationException('template_event_forbidden', $type, $name);
                     } else {
                         // id is still alowed for TComponent, even if id property doesn't exist
                         if (strcasecmp($name, 'id') !== 0 && !$class->hasMethod('set' . $name)) {
                             if ($class->hasMethod('get' . $name)) {
                                 throw new TConfigurationException('template_property_readonly', $type, $name);
                             } else {
                                 throw new TConfigurationException('template_property_unknown', $type, $name);
                             }
                         }
                     }
                 }
             }
         } else {
             throw new TConfigurationException('template_component_required', $type);
         }
     }
 }
Ejemplo n.º 11
0
<?php

Prado::using('System.Data.ActiveRecord.*');
class Frecuencia extends TActiveRecord
{
    const TABLE = 'frecuencia';
    public $id_frecuencia;
    public $frecuencia;
}
Ejemplo n.º 12
0
<?php

/**
 * TCache and cache dependency classes.
 *
 * @author Qiang Xue <*****@*****.**>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2014 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @package System.Caching
 */
Prado::using('System.Collections.TList');
/**
 * TCache class
 *
 * TCache is the base class for cache classes with different cache storage implementation.
 *
 * TCache implements the interface {@link ICache} with the following methods,
 * - {@link get} : retrieve the value with a key (if any) from cache
 * - {@link set} : store the value with a key into cache
 * - {@link add} : store the value only if cache does not have this key
 * - {@link delete} : delete the value with the specified key from cache
 * - {@link flush} : delete all values from cache
 *
 * Each value is associated with an expiration time. The {@link get} operation
 * ensures that any expired value will not be returned. The expiration time by
 * the number of seconds. A expiration time 0 represents never expire.
 *
 * By definition, cache does not ensure the existence of a value
 * even if it never expires. Cache is not meant to be an persistent storage.
 *
Ejemplo n.º 13
0
<?php

/**
 * TMssqlMetaData class file.
 *
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2014 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @package System.Data.Common.Mssql
 */
/**
 * Load the base TDbMetaData class.
 */
Prado::using('System.Data.Common.TDbMetaData');
Prado::using('System.Data.Common.Mssql.TMssqlTableInfo');
/**
 * TMssqlMetaData loads MSSQL database table and column information.
 *
 * @author Wei Zhuo <weizho[at]gmail[dot]com>
 * @package System.Data.Common.Mssql
 * @since 3.1
 */
class TMssqlMetaData extends TDbMetaData
{
    /**
     * @return string TDbTableInfo class name.
     */
    protected function getTableInfoClass()
    {
        return 'TMssqlTableInfo';
Ejemplo n.º 14
0
<?php

Prado::using('horux.pages.openTime.sql');
class add extends Page
{
    protected $timeArray = array();
    protected $lastId = 0;
    public function onLoad($param)
    {
        parent::onLoad($param);
    }
    public function onApply($sender, $param)
    {
        if ($this->Page->IsValid) {
            if ($this->saveData()) {
                $pBack = array('okMsg' => Prado::localize('The open time was added successfully'), 'id' => $this->lastId);
                $this->Response->redirect($this->Service->constructUrl('openTime.mod', $pBack));
            } else {
                $pBack = array('koMsg' => Prado::localize('The open time was not added'));
            }
        }
    }
    public function onSave($sender, $param)
    {
        if ($this->Page->IsValid) {
            if ($this->saveData()) {
                $pBack = array('okMsg' => Prado::localize('The open time was added successfully'));
            } else {
                $pBack = array('koMsg' => Prado::localize('The open time was not added'));
            }
            $this->Response->redirect($this->Service->constructUrl('openTime.openTimeList', $pBack));
Ejemplo n.º 15
0
<?php

/**
 * @author Daniel Sampedro Bello <*****@*****.**>
 * @link https://github.com/pradosoft/prado
 * @copyright Copyright &copy; 2005-2015 The PRADO Group
 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
 * @version $Id$
 * @since 3.3
 * @package Wsat.pages
 */
Prado::using("System.Wsat.TWsatScaffoldingGenerator");
class TWsatScaffolding extends TPage
{
    public function onInit($param)
    {
        parent::onInit($param);
        $this->startVisual();
    }
    private function startVisual()
    {
        $scf_generator = new TWsatScaffoldingGenerator();
        foreach ($scf_generator->getAllTableNames() as $tableName) {
            $dynChb = new TCheckBox();
            $dynChb->ID = "cb_{$tableName}";
            $dynChb->Text = ucfirst($tableName);
            $dynChb->Checked = true;
            $this->registerObject("cb_{$tableName}", $dynChb);
            $this->tableNames->getControls()->add($dynChb);
            $this->tableNames->getControls()->add("</br>");
        }
Ejemplo n.º 16
0
<?php

/**
 * TDataGridColumn class file
 *
 * @author Qiang Xue <*****@*****.**>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2014 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @package System.Web.UI.WebControls
 */
Prado::using('System.Util.TDataFieldAccessor');
Prado::using('System.Web.UI.WebControls.TDataGrid');
/**
 * TDataGridColumn class
 *
 * TDataGridColumn serves as the base class for the different column types of
 * the {@link TDataGrid} control.
 * TDataGridColumn defines the properties and methods that are common among
 * all datagrid column types. In particular, it initializes header and footer
 * cells according to {@link setHeaderText HeaderText} and {@link getHeaderStyle HeaderStyle}
 * {@link setFooterText FooterText} and {@link getFooterStyle FooterStyle} properties.
 * If {@link setHeaderImageUrl HeaderImageUrl} is specified, the image
 * will be displayed instead in the header cell.
 * The {@link getItemStyle ItemStyle} is applied to cells that belong to
 * non-header and -footer datagrid items.
 *
 * When the datagrid enables sorting, if the {@link setSortExpression SortExpression}
 * is not empty, the header cell will display a button (linkbutton or imagebutton)
 * that will bubble the sort command event to the datagrid.
 *
Ejemplo n.º 17
0
 public function applyConfiguration($config, $withinService = false)
 {
     if ($config->getIsEmpty()) {
         return;
     }
     foreach ($config->getAliases() as $alias => $path) {
         Prado::setPathOfAlias($alias, $path);
     }
     foreach ($config->getUsings() as $using) {
         Prado::using($using);
     }
     if (!$withinService) {
         foreach ($config->getProperties() as $name => $value) {
             $this->setSubProperty($name, $value);
         }
     }
     if (empty($this->_services)) {
         $this->_services = array($this->getPageServiceID() => array('TPageService', array(), null));
     }
     foreach ($config->getParameters() as $id => $parameter) {
         if (is_array($parameter)) {
             $component = Prado::createComponent($parameter[0]);
             foreach ($parameter[1] as $name => $value) {
                 $component->setSubProperty($name, $value);
             }
             $this->_parameters->add($id, $component);
         } else {
             $this->_parameters->add($id, $parameter);
         }
     }
     $modules = array();
     foreach ($config->getModules() as $id => $moduleConfig) {
         if (!is_string($id)) {
             $id = '_module' . count($this->_lazyModules);
         }
         $this->_lazyModules[$id] = $moduleConfig;
         if ($module = $this->internalLoadModule($id)) {
             $modules[] = $module;
         }
     }
     foreach ($modules as $module) {
         $module[0]->init($module[1]);
     }
     foreach ($config->getServices() as $serviceID => $serviceConfig) {
         $this->_services[$serviceID] = $serviceConfig;
     }
     foreach ($config->getExternalConfigurations() as $filePath => $condition) {
         if ($condition !== true) {
             $condition = $this->evaluateExpression($condition);
         }
         if ($condition) {
             if (($path = Prado::getPathOfNamespace($filePath, $this->getConfigurationFileExt())) === null || !is_file($path)) {
                 throw new TConfigurationException('application_includefile_invalid', $filePath);
             }
             $cn = $this->getApplicationConfigurationClass();
             $c = new $cn();
             $c->loadFromFile($path);
             $this->applyConfiguration($c, $withinService);
         }
     }
 }
Ejemplo n.º 18
0
<?php

/**
 * TDataTypeValidator class.
 *
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2014 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @package System.Web.UI.WebControls
 */
/**
 * Using TBaseValidator class
 */
Prado::using('System.Web.UI.WebControls.TBaseValidator');
/**
 * TDataTypeValidator class
 *
 * TDataTypeValidator verifies if the input data is of the type specified
 * by {@link setDataType DataType}.
 * The following data types are supported:
 * - <b>Integer</b> A 32-bit signed integer data type.
 * - <b>Float</b> A double-precision floating point number data type.
 * - <b>Date</b> A date data type.
 * - <b>String</b> A string data type.
 * For <b>Date</b> type, the property {@link setDateFormat DateFormat}
 * will be used to determine how to parse the date string. If it is not
 * provided, the string will be assumed to be in GNU datetime format.
 *
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
 * @package System.Web.UI.WebControls
Ejemplo n.º 19
0
<?php

/**
 * TUrlMapping, TUrlMappingPattern and TUrlMappingPatternSecureConnection class file.
 *
 * @author Wei Zhuo <weizhuo[at]gamil[dot]com>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2008 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @version $Id: TUrlMapping.php 2856 2010-07-14 17:12:38Z rojaro $
 * @package System.Web
 */
Prado::using('System.Web.TUrlManager');
Prado::using('System.Collections.TAttributeCollection');
/**
 * TUrlMapping Class
 *
 * The TUrlMapping module allows PRADO to construct and recognize URLs
 * based on specific patterns.
 *
 * TUrlMapping consists of a list of URL patterns which are used to match
 * against the currently requested URL. The first matching pattern will then
 * be used to decompose the URL into request parameters (accessible through
 * <code>$this->Request['paramname']</code>).
 *
 * The patterns can also be used to construct customized URLs. In this case,
 * the parameters in an applied pattern will be replaced with the corresponding
 * GET variable values.
 *
 * Since it is derived from {@link TUrlManager}, it should be configured globally
 * in the application configuration like the following,
Ejemplo n.º 20
0
<?php

Prado::using('Application.pages.Controls.Samples.LabeledTextBox2.LabeledTextBox');
class Home extends TPage
{
    public function buttonClicked($sender, $param)
    {
        $sender->Text = $this->Input->TextBox->Text;
    }
}
/**
 * TActiveListControlAdapter class file.
 *
 * @author Wei Zhuo <weizhuo[at]gamil[dot]com>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2008 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @version $Id: TActiveListControlAdapter.php 2482 2008-07-30 02:07:13Z knut $
 * @package System.Web.UI.ActiveControls
 */
/**
 * Load active control adapter.
 */
Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
Prado::using('System.Web.UI.WebControls.TListControl');
/**
 * TActiveListControlAdapter class.
 *
 * Adapte the list controls to allows the selections on the client-side to be altered
 * during callback response.
 *
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
 * @version $Id: TActiveListControlAdapter.php 2482 2008-07-30 02:07:13Z knut $
 * @package System.Web.UI.ActiveControls
 * @since 3.1
 */
class TActiveListControlAdapter extends TActiveControlAdapter implements IListControlAdapter
{
    /**
     * @return boolean true if can update client-side attributes.
Ejemplo n.º 22
0
<?php

Prado::using('horux.pages.nonWorkingDay.sql');
class add extends Page
{
    public function onLoad($param)
    {
        parent::onLoad($param);
        if (!$this->isPostBack) {
            $date = getDate();
            if (Prado::getApplication()->getSession()->contains('nonWorkingDayYear')) {
                $this->until->setTimeStamp(mktime(0, 0, 0, 1, 1, $this->Session['nonWorkingDayYear']));
                $this->from->setTimeStamp(mktime(0, 0, 0, 1, 1, $this->Session['nonWorkingDayYear']));
            } else {
                $this->until->setTimeStamp(mktime(0, 0, 0, 1, 1, $date['year']));
                $this->from->setTimeStamp(mktime(0, 0, 0, 1, 1, $date['year']));
            }
        }
    }
    public function onApply($sender, $param)
    {
        if ($this->Page->IsValid) {
            if ($this->saveData()) {
                $id = $this->db->getLastInsertID();
                $pBack = array('okMsg' => Prado::localize('The non working day was added successfully'), 'id' => $id);
                $this->Response->redirect($this->Service->constructUrl('nonWorkingDay.mod', $pBack));
            } else {
                $pBack = array('koMsg' => Prado::localize('The non working day was not added'));
            }
        }
    }
Ejemplo n.º 23
0
<?php

/**
 * TAttributeCollection classes
 *
 * @author Qiang Xue <*****@*****.**>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2014 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @package System.Collections
 */
/**
 * Includes TMap class
 */
Prado::using('System.Collections.TMap');
/**
 * TAttributeCollection class
 *
 * TAttributeCollection implements a collection for storing attribute names and values.
 *
 * Besides all functionalities provided by {@link TMap}, TAttributeCollection
 * allows you to get and set attribute values like getting and setting
 * properties. For example, the following usages are all valid for a
 * TAttributeCollection object:
 * <code>
 * $collection->Text='text';
 * echo $collection->Text;
 * </code>
 * They are equivalent to the following:
 * <code>
 * $collection->add('Text','text');
Ejemplo n.º 24
0
<?php

Prado::using('horux.pages.hardware.device.accessLink_ReaderRS232.sql');
class mod extends Page
{
    public function onLoad($param)
    {
        parent::onLoad($param);
        if (!$this->isPostBack) {
            $userId = $this->Application->getUser()->getUserId();
            $this->blockRecord('hr_device', $this->Request['id'], $userId);
            $param = $this->Application->getParameters();
            $superAdmin = $this->Application->getUser()->getSuperAdmin();
            if ($param['appMode'] == 'demo' && $superAdmin == 0) {
                $this->Save->setEnabled(false);
                $this->Apply->setEnabled(false);
            }
            $this->id->Value = $this->Request['id'];
            $this->setData();
        }
    }
    public function getInterface()
    {
        $command = $this->db->createCommand(SQL::SQL_GET_INTERFACE);
        $data = $command->query();
        return $data;
    }
    protected function setData()
    {
        $cmd = $this->db->createCommand(SQL::SQL_GET_RS232);
        $cmd->bindParameter(":id", $this->id->Value, PDO::PARAM_INT);
Ejemplo n.º 25
0
<?php

Prado::using('horux.pages.hardware.device.accessLink_Interface.sql');
class add extends Page
{
    public function onLoad($param)
    {
        parent::onLoad($param);
        if (!$this->isPostBack) {
            $param = $this->Application->getParameters();
            $superAdmin = $this->Application->getUser()->getSuperAdmin();
            if ($param['appMode'] == 'demo' && $superAdmin == 0) {
                $this->Save->setEnabled(false);
                $this->Apply->setEnabled(false);
            }
        }
    }
    public function onApply($sender, $param)
    {
        if ($this->Page->IsValid) {
            if ($id = $this->saveData()) {
                $pBack = array('okMsg' => Prado::localize('The interface was added successfully'), 'id' => $id);
                $this->Response->redirect($this->Service->constructUrl('hardware.device.accessLink_Interface.mod', $pBack));
            } else {
                $pBack = array('koMsg' => Prado::localize('The interface was not added'));
            }
        }
    }
    public function onSave($sender, $param)
    {
        if ($this->Page->IsValid) {
<?php

/**
 * TSqlMapXmlConfigBuilder, TSqlMapXmlConfiguration, TSqlMapXmlMappingConfiguration classes file.
 *
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2008 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @version $Id: TSqlMapXmlConfiguration.php 2757 2010-01-15 14:47:40Z Christophe.Boulain $
 * @package System.Data.SqlMap.Configuration
 */
Prado::using('System.Data.SqlMap.Configuration.TSqlMapStatement');
/**
 * TSqlMapXmlConfig class file.
 *
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
 * @version $Id: TSqlMapXmlConfiguration.php 2757 2010-01-15 14:47:40Z Christophe.Boulain $
 * @package System.Data.SqlMap.Configuration
 */
abstract class TSqlMapXmlConfigBuilder
{
    /**
     * Create an instance of an object give by the attribute named 'class' in the
     * node and set the properties on the object given by attribute names and values.
     * @param SimpleXmlNode property node
     * @return Object new instance of class with class name given by 'class' attribute value.
     */
    protected function createObjectFromNode($node)
    {
        if (isset($node['class'])) {
Ejemplo n.º 27
0
 /**
  * @param TDbConnection database connection.
  * @return TDbCommandBuilder new command builder
  */
 public function createCommandBuilder($connection)
 {
     Prado::using('System.Data.Common.Mssql.TMssqlCommandBuilder');
     return new TMssqlCommandBuilder($connection, $this);
 }
Ejemplo n.º 28
0
<?php

/**
 * @author Daniel Sampedro Bello <*****@*****.**>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2013 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @version $Id$
 * @since 3.3
 * @package Wsat.pages
 */
Prado::using("System.Wsat.TWsatARGenerator");
class TWsatScaffolding extends TPage
{
}
Ejemplo n.º 29
0
<?php

Prado::using('System.Web.UI.ActiveControls.*');
include_once '../compartidos/clases/conexion.php';
include_once '../compartidos/clases/usadbf.php';
include_once '../compartidos/clases/charset.php';
class descuentos extends TPage
{
    var $dbConexion;
    public function onLoad($param)
    {
        parent::onLoad($param);
        $this->dbConexion = Conexion::getConexion($this->Application, "dbpr");
        Conexion::createConfiguracion();
        if (!$this->IsPostBack) {
            $estatus = Conexion::Retorna_Registro($this->dbConexion, "estatus", array(), " where id_estatus > 0");
            $this->ddlEstatus->DataSource = $estatus;
            $this->ddlEstatus->dataBind();
        }
    }
    public function btnGenerar_Click($sender, $param)
    {
        $this->Generar_desno($this->ddlTipo->SelectedValue == 'PE' ? "J" : "A");
    }
    public function Generar_desno($TipoEmpleado)
    {
        $liberar = "TRUNCATE respMovimientos";
        $comando = $this->dbConexion->createCommand($liberar);
        $comando->execute();
        $consulta = "INSERT INTO respMovimientos (id_contrato,  cargo,   abono,  activo , adeudo,movimientos)  \n\t\t\t\t\tSELECT id_contrato, SUM(cargo), SUM(abono), 1, SUM(Cargo - Abono) AS adeudo ,COUNT(id_contrato) AS movimientos FROM movimientos WHERE  activo = 1 \n\t\t\t\t\tGROUP BY id_contrato HAVING SUM(Cargo - Abono) > 1";
        $comando = $this->dbConexion->createCommand($consulta);
Ejemplo n.º 30
0
<?php

/**
 * TTranslate, I18N translation component.
 *
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2008 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @version $Id: TTranslate.php 2919 2011-05-21 18:14:36Z ctrlaltca@gmail.com $
 * @package System.I18N
 */
/**
 * Get the parent control class.
 */
Prado::using('System.I18N.TI18NControl');
/**
 * TTranslate class.
 *
 * This component performs message/string translation. The translation
 * source is set in the TGlobalization handler. The following example
 * demonstrated a simple message translation.
 * <code>
 * <com:TTranslate Text="Goodbye" />
 * </code>
 *
 * Depending on the culture set on the page, the phrase "Goodbye" will
 * be translated.
 *
 * The {@link getParameters Parameters} property can be use to add name values pairs for
 * substitution. Substrings enclosed with "{" and "}" in the translation message are consider as the