예제 #1
0
 function init()
 {
     parent::init('tbl_users');
     $this->objConfig = $this->getObject('config', 'config');
     $this->objUser = $this->getObject('user', 'security');
     $this->objLanguage = $this->getObject('language', 'language');
 }
예제 #2
0
 /**
  *
  * Intialiser for the userblock model
  * 
  * @access public
  * @return VOID
  *
  */
 public function init()
 {
     // Guess the module we are in so we can load its data connection
     $objGuess = $this->getObject('bestguess', 'utilities');
     $curMod = $objGuess->identifyModule();
     $blockTable = "tbl_" . $curMod . "_userblocks";
     parent::init($blockTable);
     $this->objUser = $this->getObject('user', 'security');
 }
예제 #3
0
 /**
  * Chisimba init function
  *
  */
 public function init()
 {
     try {
         parent::init('tbl_modules');
         $this->objConfig = $this->getObject('altconfig', 'config');
         $this->objModFile = $this->getObject('modulefile', 'modulecatalogue');
         $this->objLanguage = $this->getObject('language', 'language');
     } catch (Exception $e) {
         echo customException::cleanUp($e->getMessage());
         exit(0);
     }
 }
 protected static function init()
 {
     require "dbinfo.php";
     //database login information
     $tableName = "cds";
     //specify the table name to access
     $table1 = array();
     if (!($db = mysqli_connect($hn, $un, $pw, $dn))) {
         die("<font color='red'>Failed to connect to MySQL. </font><br/><br/>");
     }
     //$sql = 'SELECT titel, interpret, jahr FROM cds';  //add your select statement for the database in dbinfo.php
     $sql = 'SELECT * FROM ' . $tableName;
     //sql statement here gets all the columns
     if (!($result = mysqli_query($db, $sql))) {
         die("<font color='red'> Error with query to database.</font><br/><br/>");
     }
     mysqli_close($db);
     foreach ($result as $row) {
         array_push($table1, new table1($row));
         //this will assign each row in the table as an array to the column in $table1
     }
     self::$table1 = $table1;
 }
<?php

require "../classes/dbtable.php";
header("Content-type:  application/jason");
$table1 = dbtable::getTable();
echo ")]}',\n";
//prevent HiJacking of data
echo json_encode($table1);
예제 #6
0
 /**
  *
  * Intialiser for the login database connector
  * @access public
  * @return VOID
  *
  */
 public function init()
 {
     //Set the parent table
     parent::init('tbl_login_nonce');
     $this->clearNonces();
 }
예제 #7
0
 /**
  * Method to construct the class.
  */
 public function init()
 {
     parent::init('tbl_menu_category');
     $this->table = 'tbl_menu_category';
 }
 /**
  * Method to reset the working table to 'tbl_context'
  *
  * @return NULL
  * @access public
  */
 public function resetTable()
 {
     parent::init('tbl_context_nodes');
 }
 function init()
 {
     parent::init('tbl_langs_avail');
 }
 function init()
 {
     parent::init('tbl_useractivity');
     $this->objUser = $this->getObject('user', 'security');
 }
예제 #11
0
 /**
  *
  * Intialiser for the ckeditor2 database connector
  * @access public
  * @return VOID
  *
  */
 public function init()
 {
     //Set the parent table to our demo table
     parent::init('tbl_ckeditor2_text');
 }
예제 #12
0
 /**
  * Init function for class
  */
 public function init()
 {
     parent::init('tbl_users');
 }
 /**
  * alter an existing table
  *
  * @param  string  $name    name of the table that is intended to be changed.
  * @param  array   $changes associative array that contains the details of each type
  *                          of change that is intended to be performed. The types of
  *                          changes that are currently supported are defined as follows:
  *
  *                          name
  *
  *                          New name for the table.
  *
  *                          add
  *
  *                          Associative array with the names of fields to be added as
  *                          indexes of the array. The value of each entry of the array
  *                          should be set to another associative array with the properties
  *                          of the fields to be added. The properties of the fields should
  *                          be the same as defined by the Metabase parser.
  *
  *
  *                          remove
  *
  *                          Associative array with the names of fields to be removed as indexes
  *                          of the array. Currently the values assigned to each entry are ignored.
  *                          An empty array should be used for future compatibility.
  *
  *                          rename
  *
  *                          Associative array with the names of fields to be renamed as indexes
  *                          of the array. The value of each entry of the array should be set to
  *                          another associative array with the entry named name with the new
  *                          field name and the entry named Declaration that is expected to contain
  *                          the portion of the field declaration already in DBMS specific SQL code
  *                          as it is used in the CREATE TABLE statement.
  *
  *                          change
  *
  *                          Associative array with the names of the fields to be changed as indexes
  *                          of the array. Keep in mind that if it is intended to change either the
  *                          name of a field and any other properties, the change array entries
  *                          should have the new names of the fields as array indexes.
  *
  *                          The value of each entry of the array should be set to another associative
  *                          array with the properties of the fields to that are meant to be changed as
  *                          array entries. These entries should be assigned to the new values of the
  *                          respective properties. The properties of the fields should be the same
  *                          as defined by the Metabase parser.
  *
  *                          Example
  *                          array(
  *                          'name' => 'userlist',
  *                          'add' => array(
  *                          'quota' => array(
  *                          'type' => 'integer',
  *                          'unsigned' => 1
  *                          )
  *                          ),
  *                          'remove' => array(
  *                          'file_limit' => array(),
  *                          'time_limit' => array()
  *                          ),
  *                          'change' => array(
  *                          'name' => array(
  *                          'length' => '20',
  *                          'definition' => array(
  *                          'type' => 'text',
  *                          'length' => 20,
  *                          ),
  *                          )
  *                          ),
  *                          'rename' => array(
  *                          'sex' => array(
  *                          'name' => 'gender',
  *                          'definition' => array(
  *                          'type' => 'text',
  *                          'length' => 1,
  *                          'default' => 'M',
  *                          ),
  *                          )
  *                          )
  *                          )
  *
  * @param  boolean $check   indicates whether the function should just check if the DBMS driver
  *                          can perform the requested table alterations if the value is TRUE or
  *                          actually perform them otherwise.
  * @access public
  *
  * @return mixed   MDB2_OK on success, a MDB2 error on failure
  */
 function alterTable($name, $changes, $check)
 {
     /**
      * check if there is already field with same name
      * If true, simply return
      */
     /*
     $fields = $this->listTableFields($name);
     
     foreach ($changes as $change) {
         if ($this->returnIfExistingKey($change, $fields, $changes)) {
             return TRUE;
         }
     }
     */
     // If the change is an insert - insert the data, otherwise alter the table
     if (isset($changes['insert'])) {
         // insert data through db table
         if ($check) {
             return TRUE;
         } else {
             dbtable::init($name, $this->_db);
             $fields = $changes['insert'];
             $ret_ = dbtable::insert($fields, $name);
             return $ret_ !== FALSE ? TRUE : FALSE;
         }
     } else {
         $ret = $this->_db->mgAlterTable($name, $changes, $check);
     }
     //log_debug('alterTable::$ret=='.var_export($ret, TRUE));
     if (PEAR::isError($ret)) {
         //log_debug('alterTable::PEAR::isError($ret)::$ret=='.var_export($ret, TRUE).';$ret->getMessage()=='.$ret->getMessage());
         return $ret->getMessage();
     } else {
         // var_dump($ret);
         //log_debug('alterTable::else::$ret=='.var_export($ret, TRUE));
         return $ret;
     }
 }
예제 #14
0
 public function init($dataTable)
 {
     parent::init($dataTable);
     $this->userLoginHistory = $this->getObject('userLoginHistory', 'security');
     $this->loggedInUsers = $this->getObject('loggedInUsers', 'security');
 }
예제 #15
0
 function init()
 {
     parent::init('tbl_useractivity');
 }