Example #1
0
 function __construct()
 {
     $dbName = isInPath("_test") || isset($_REQUEST["test"]) ? "accounts_test" : "accounts";
     if (isset($GLOBALS["DBS"][$dbName])) {
         parent::__construct($GLOBALS["DBS"][$dbName]["name"], $GLOBALS["DBS"][$dbName]["host"], $GLOBALS["DBS"][$dbName]["user"], $GLOBALS["DBS"][$dbName]["pass"], FALSE);
     }
     $this->dbprefix = isset($GLOBALS["DBS"][$dbName]["dbprefix"]) ? $GLOBALS["DBS"][$dbName]["dbprefix"] : "";
 }
Example #2
0
 function __construct()
 {
     $dbName = "preprintsmeta";
     if (isset($GLOBALS["DBS"][$dbName])) {
         parent::__construct($GLOBALS["DBS"][$dbName]["name"], $GLOBALS["DBS"][$dbName]["host"], $GLOBALS["DBS"][$dbName]["user"], $GLOBALS["DBS"][$dbName]["pass"], FALSE);
     }
     $this->dbprefix = isset($GLOBALS["DBS"][$dbName]["dbprefix"]) ? $GLOBALS["DBS"][$dbName]["dbprefix"] : "";
 }
Example #3
0
 function __construct()
 {
     $dbName = isInPath("/" . PATH_NEWSTEST . "/") || isInPath("/" . PATH_NEWSEDITTEST . "/") || isset($_REQUEST["test"]) ? "newstest" : "news";
     //TODO:
     if (isset($GLOBALS["DBS"][$dbName])) {
         parent::__construct($GLOBALS["DBS"][$dbName]["name"], $GLOBALS["DBS"][$dbName]["host"], $GLOBALS["DBS"][$dbName]["user"], $GLOBALS["DBS"][$dbName]["pass"], FALSE);
     }
     $this->dbprefix = isset($GLOBALS["DBS"][$dbName]["dbprefix"]) ? $GLOBALS["DBS"][$dbName]["dbprefix"] : "";
     // cf. NEWS_DB_PREFIX
 }
Example #4
0
 function __construct()
 {
     if (isset($GLOBALS["DBS"]["vm"])) {
         parent::__construct($GLOBALS["DBS"]["vm"]["name"], $GLOBALS["DBS"]["vm"]["host"], $GLOBALS["DBS"]["vm"]["user"], $GLOBALS["DBS"]["vm"]["pass"], FALSE);
     }
     $this->dbprefix = isset($GLOBALS["DBS"]["vm"]["dbprefix"]) ? $GLOBALS["DBS"]["vm"]["dbprefix"] : "";
 }
Example #5
0
 function __construct()
 {
     $dbName = "events";
     if (isset($GLOBALS["DBS"][$dbName])) {
         parent::__construct($GLOBALS["DBS"][$dbName]["name"], $GLOBALS["DBS"][$dbName]["host"], $GLOBALS["DBS"][$dbName]["user"], $GLOBALS["DBS"][$dbName]["pass"], FALSE);
     }
 }
Example #6
0
 static function OutputTestDbSearch()
 {
     $application = "vm";
     // "vm", "test", "cms", "preprints" // lowercase!
     $stdout = "";
     if (!class_exists("fromdb", FALSE)) {
         require_once PATH_CLASSES . "/fromdb.php";
     }
     if (isset($GLOBALS["DBS"][$application])) {
         $dbClass = new fromdb($GLOBALS["DBS"][$application]["name"], $GLOBALS["DBS"][$application]["host"], $GLOBALS["DBS"][$application]["user"], $GLOBALS["DBS"][$application]["pass"], FALSE);
     } else {
         return "***ERROR***";
     }
     // --------------------
     // -- Test total output form one table at a time:
     //$table = "abs_apartments";
     //$table = "abs_events";
     //$table = "abs_expenses";
     //$table = "abs_leases";
     //$table = "abs_offices";
     //$table = "abs_payment";
     //$table = "abs_visits";
     //$table = "jam_applicants";
     //$table = "jam_documents";
     //$table = "jam_posfields";
     //$table = "jam_positions";
     //$table = "jam_recommendations";
     //$table = "jam_reviews";
     //$table = "jam_rf";
     //$table = "lic_event";
     //$table = "lic_host";
     //$table = "lic_server";
     //$table = "lic_soft";
     //$table = "lic_user";
     //$table = "wiw_trips";
     //$table = "zzz_avatars";
     //$table = "zzz_bugs";
     //$table = "zzz_countries";
     //$table = "zzz_flavors";
     //$table = "zzz_huts";
     $table = "zzz_list_members";
     //$table = "zzz_lists";
     //$table = "zzz_logs";
     //$table = "zzz_master";
     //$table = "zzz_templates";
     //$table = "zzz_unit_members";
     //$table = "zzz_units";
     $sql = "SELECT " . "  * " . "FROM " . "  " . $table . " " . "WHERE " . "  (lm_lid = '40213') " . "";
     // --------------------
     // -- Test a special case:
     /*
     	$sql =
     	  "SELECT " .
     	  "  lm_lid, " .
           "  lm_key," .
           "  lm_value " .
     	  "FROM " .
           "  zzz_list_members " .
     	  "WHERE " .
           "  (lm_lid = '40213') " .
           "  AND (lm_id <> '41135') " .
           "";
     */
     // --------------------
     $res = $dbClass->query($sql, FALSE);
     $eventlist = array();
     if ($dbClass->num_rows($res)) {
         $stdout .= "<h2>" . $table . "</h2>\r\n";
         while ($record = $dbClass->next_record_assoc($res)) {
             ksort($record);
             $stdout .= "<br><br><hr>\r\n";
             foreach ($record as $idx => $value) {
                 $stdout .= "<br>[" . $idx . "] = <strong>" . $value . "</strong>\r\n";
             }
         }
         // end while
     }
     // --------------------
     return $stdout;
 }
Example #7
0
 function __construct($db = "", $host = "", $user = "", $pwd = "", $debug = FALSE)
 {
     // ----------------------
     // Initiate GPC variables
     // ----------------------
     // -- $GLOBALS["variant"]
     //     @calledby people::OutputPeople()
     //     @calledby people::outputPeopleList()
     //     @calledby people::outputConveniencyLinks()
     functions::gpc_declare_input("variant", "all");
     // -- $GLOBALS["g"]
     //    Group by
     //    @calledby
     functions::gpc_declare_input("g", false);
     //TODO: this seems not to be implemented yet...
     switch ($GLOBALS["g"]) {
         case "e":
             $toplevelid = "employeeType";
             break;
         case "g":
             $toplevelid = "groupid";
             break;
         default:
             $toplevelid = "employeeType";
     }
     // end switch
     // -- $GLOBALS["sort_by"]
     //TODO: this seems not to be implemented yet...
     functions::gpc_declare_input("sort_by", "sn");
     // -- $GLOBALS["u"]
     //    @calledby people::getPeopleData()
     if (!isset($_REQUEST["labelusers"])) {
         functions::gpc_declare_input("u", false);
     }
     // ----------------------
     // DB connect parameters
     // ----------------------
     if (!empty($db) && !empty($host)) {
         parent::__construct($db, $host, $user, $pwd, $debug);
     }
 }
Example #8
0
 function __construct()
 {
     // ----------------------
     // Initiate GPC variables
     // ----------------------
     // ...
     // ----------------------
     // DB connect parameters
     // ----------------------
     if (isset($GLOBALS["DBS"]["search"])) {
         parent::__construct($GLOBALS["DBS"]["search"]["name"], $GLOBALS["DBS"]["search"]["host"], $GLOBALS["DBS"]["search"]["user"], $GLOBALS["DBS"]["search"]["pass"], FALSE);
         $this->dbprefix = isset($GLOBALS["DBS"]["search"]["dbprefix"]) ? $GLOBALS["DBS"]["search"]["dbprefix"] : "";
         $this->table = $GLOBALS["DBS"]["search"]["table"];
         $this->tablevars = $GLOBALS["DBS"]["search"]["tablevars"];
         $this->tablestat = $GLOBALS["DBS"]["search"]["tablestat"];
         $this->tabletemp = $GLOBALS["DBS"]["search"]["tabletemp"];
     }
 }
Example #9
0
 public static function AdbMypearLists()
 {
     $stdout = "";
     $records = array();
     if (!class_exists("fromdb", FALSE)) {
         require_once PATH_CLASSES . "/fromdb.php";
     }
     $db = new fromdb($GLOBALS["DBS"]["vm"]["name"], $GLOBALS["DBS"]["vm"]["host"], $GLOBALS["DBS"]["vm"]["user"], $GLOBALS["DBS"]["vm"]["pass"]);
     // --------------
     $tables = array("zzz_units" => "u", "zzz_lists" => "l");
     foreach ($tables as $table => $prefix) {
         $sql = "SELECT  * FROM " . $table;
         $result = $db->query($sql);
         if ($db->num_rows($result) > 0) {
             while ($rec = $db->next_record_assoc($result)) {
                 if (isset($rec[$prefix . "_name"]) && isset($rec[$prefix . "_class"])) {
                     $records[$table . " --&gt; " . $rec[$prefix . "_name"] . " [" . $rec[$prefix . "_class"] . "]"][] = array("id" => $rec[$prefix . "_id"], "parent" => $rec[$prefix . "_parent"]);
                 }
             }
         }
         // end while
     }
     //TODO: temporary output:
     debug::rr(array_keys($records));
     debug::rr($records);
     return $stdout;
 }
Example #10
0
 function __construct($stopOnError = FALSE)
 {
     $application = "rooms";
     if (isset($GLOBALS["DBS"][$application])) {
         parent::__construct($GLOBALS["DBS"][$application]["name"], $GLOBALS["DBS"][$application]["host"], $GLOBALS["DBS"][$application]["user"], $GLOBALS["DBS"][$application]["pass"], FALSE);
     }
     /* -- REINSTATE WHEN WE HAVE TRUE ACCESS TO MRBS-- */
     /*
         $application = "mrbs";
         if (isset($GLOBALS["DBS"]["mrbs"])) {
           parent::__construct(
             $GLOBALS["DBS"]["mrbs"]["name"],
             $GLOBALS["DBS"]["mrbs"]["host"],
             $GLOBALS["DBS"]["mrbs"]["user"],
             $GLOBALS["DBS"]["mrbs"]["pass"],
             FALSE);
         }
     
         $this->dbprefix = isset($GLOBALS["DBS"]["mbrs"]["dbprefix"]) ? $GLOBALS["DBS"]["mbrs"]["dbprefix"] : "";
     
         $this->connect($stopOnError);
     
         //$this->dbtable = $GLOBALS["DBS"]["mrbs"]["table"];
     */
 }
Example #11
0
 function __construct($db, $host, $user = "", $pwd = "", $debug = FALSE)
 {
     parent::__construct($db, $host, $user, $pwd, $debug);
 }
Example #12
0
 function __construct()
 {
     if (isset($GLOBALS["DBS"]["positions"])) {
         parent::__construct($GLOBALS["DBS"]["positions"]["name"], $GLOBALS["DBS"]["positions"]["host"], $GLOBALS["DBS"]["positions"]["user"], $GLOBALS["DBS"]["positions"]["pass"], FALSE);
     }
 }