本文整理汇总了PHP中DataConnector类的典型用法代码示例。如果您正苦于以下问题:PHP DataConnector类的具体用法?PHP DataConnector怎么用?PHP DataConnector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DataConnector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
private function __construct()
{
$this->classloader = Classloader::getInstance();
$this->classloader->initLoadLib();
$this->dataConnector = DataConnector::getInstance();
$this->routingEngine = RoutingEngine::getInstance();
$this->templateEngine = TemplateEngine::getInstance();
}
示例2: SQLite3
<?php
$db = new SQLite3('../../common/testdata.sqlite');
require "../../common/connector/data_connector.php";
require "../../common/connector/db_sqlite3.php";
ConnectorSecurity::$xss = DHX_SECURITY_SAFEHTML;
$conn = new DataConnector($db, "SQLite3");
$conn->render_table("films", "id", "title,year,votes,rating,rank");
示例3: session_start
<?php
session_start();
include_once "check.php";
include_once "defines.php";
include_once "ClassLibrary/Text.php";
include_once "ClassLibrary/DataConnector.php";
include_once "DataAccessObjects/ContractDAO.php";
include_once "DataTransferObjects/ContractDTO.php";
include_once "DataAccessObjects/SubContractDAO.php";
include_once "DataTransferObjects/SubContractDTO.php";
include_once "DataAccessObjects/BusinessPartnerDAO.php";
include_once "DataTransferObjects/BusinessPartnerDTO.php";
$slpCode = $_REQUEST["slpCode"];
// Abre a conexao com o banco de dados
$dataConnector = new DataConnector('both');
$dataConnector->OpenConnection();
if ($dataConnector->mysqlConnection == null || $dataConnector->sqlserverConnection == null) {
echo 'Não foi possível se connectar ao bando de dados!';
exit;
}
// Cria os objetos de mapeamento objeto-relacional
$contractDAO = new ContractDAO($dataConnector->mysqlConnection);
$contractDAO->showErrors = 1;
$subContractDAO = new SubContractDAO($dataConnector->mysqlConnection);
$subContractDAO->showErrors = 1;
// Busca os contratos pertencentes ao vendedor
$contractArray = $contractDAO->RetrieveRecordArray("vendedor=" . $slpCode . " AND id > 0 ORDER BY convert(numero, signed)");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
示例4: DataConnector
// SOFTWARE NAME: Thematic Mapping Engine
// SOFTWARE RELEASE: 1.6
// COPYRIGHT NOTICE: Copyright (C) 2008 Bjorn Sandvik,
// bjorn@thematicmapping.org
// SOFTWARE LICENSE: GNU General Public License version 3 (GPLv3)
// NOTICE: >
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 3 of the GNU General
// Public License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// http://www.gnu.org/licenses/
//
//
// This file shows how maps can be created with the DataConnector
// and ThematicMap classes.
// Can be changed to another data connector class
require_once 'TME_MySQL_DataConnector.php';
// Include engine class
require_once 'TME_Engine.php';
$dataConnector = new DataConnector();
$dataStore = $dataConnector->getDataStore(1230, 2005, 0);
// indicator / year / region
$parameters = array('mapType' => 'prism', 'indicator' => 1230, 'year' => 2005, 'classification' => 'equal');
// Create thematic map object
$map = new ThematicMap($dataStore, $parameters);
$file = $map->getKML();
echo "<p><a href='{$file}'>{$file}</a>";
示例5: DataConnector
<?php
require_once "../../../common/config.php";
$data = new DataConnector($conn, $dbtype);
$data->add_section("config", '
<columns stack="true">
<column id="package" header="Name" width="200"></column>
<column id="section" header="Section" width="120"></column>
<column id="size" header="Size" width="80"></column>
<column id="architecture" header="PC" width="60"></column>
</columns>
<height>100</height>
<autowidth>true</autowidth>
');
$data->render_table("packages_plain", "id", "package, size, architecture, section");
示例6: session_start
<?php
session_start();
require_once "../codebase/connector/scheduler_connector.php";
$res = mysql_connect("localhost", "root", "");
mysql_select_db("calendar");
// $conn = new SchedulerConnector($res);
$details = new DataConnector($res);
$details->configure("cus", "c_id", "c_id,c_fname");
$conn = new SchedulerConnector($res);
$conn->mix("cus", $details, array("c_id" => "c_id"));
// function my_update($data){
// $data->add_field("c_id",1);
// $data->set_value("c_id","10");
// //will be included in update processing
// }
// $conn->event->attach("beforeUpdate","my_update");
$conn->enable_log("temp.log");
$c_id = $_SESSION["login"];
$type = $_GET['type'];
$eid = $_GET['eid'];
// $conn->render_table("bookevent","event_id","start_date,end_date,event_name");
function insert_session($action)
{
$action->add_field("cid", $_SESSION["login"]);
$action->add_field("eid", $_GET["eid"]);
}
$conn->event->attach("beforeProcessing", "insert_session");
// $conn->event->attach("Select","select * from bookevent where c_id={c_id}");
// $conn->render_table("bookevent","event_id","start_date,end_date,event_name,cid");
// $conn->render_sql("select * from bookevent where c_id = ".$c_id." AND `start_date` >= '2015-07-08 00:00:00' AND `end_date` <= '2015-07-11 00:00:00' ","event_id","start_date,end_date,event_name,rec_type,event_pid,event_length,details,event_location,lat,lng");
示例7: createDatabaseTable
/**
* Creats table of the model like it is defined.
* This is very usefull for the install process in your webapp.
*/
public function createDatabaseTable()
{
$notFirst = false;
$query = 'CREATE TABLE ' . $this->table . ' (';
foreach ($this->attributes as $attribute) {
if ($notFirst) {
$query .= ',';
} else {
$notFirst = true;
}
$query .= $attribute[0] . ' ' . $attribute[1];
}
$query .= ');';
DataConnector::getInstance()->query($query);
}
示例8: DataConnector
<?php
require_once "../../../common/config.php";
$data = new DataConnector($conn, $dbtype);
$data->render_table("packages_plain", "id", "package,version,maintainer");
示例9: DataConnector
// modify it under the terms of version 3 of the GNU General
// Public License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// http://www.gnu.org/licenses/
//
//
// Can be changed to another data connector class
require_once 'TME_MySQL_DataConnector.php';
// Check if a task is specified
if (isset($_REQUEST['task'])) {
// Make connection object
$dataConnector = new DataConnector();
// Check which task
switch ($_REQUEST['task']) {
// Fetch all statistical indicators in database
case 'indicators':
// Returns JSON encoded array of indicators
echo $dataConnector->getIndicators();
break;
// Fetch available years for one indicator
// Fetch available years for one indicator
case 'indYears':
$indicatorID = (int) $_REQUEST['id'];
// Avoid exploitation
// Returns JSON encoded array of available years for one indicator
echo $dataConnector->getIndicatorYears($indicatorID);
break;
示例10: DataConnector
<?php
require_once "../lib/DataConnector.class.php";
$myCon = new DataConnector("192.168.1.10", "8550", "rtls_user", "welcome");
$xmlRequest = new DOMDocument("1.0", "utf-8");
$xmlRequest->formatOutput = true;
$request = $xmlRequest->createElement("request");
$request = $xmlRequest->appendChild($request);
$params = $xmlRequest->createElement("PARAMS");
$params = $request->appendChild($params);
$params->appendChild($xmlRequest->createElement("fields", "all"));
try {
$xmlResponse = $myCon->request($xmlRequest, "epe/pos/taglist");
echo $xmlResponse->saveXML();
} catch (CannotConnectException $e) {
echo $e->getMessage();
}
示例11: array
$ano = $colunas[0];
$tipo = "year";
}
if (empty($barSize)) {
$barSize = 5000;
}
if (empty($maxHeight)) {
$maxHeight = 2000000;
}
$parametersTME = array('mapType' => 'bar', 'indicator' => 'valores', 'year' => $ano, 'classification' => 'quantile', 'mapTitle' => $_GET["titulo"], 'timeType' => $tipo, 'dirtmp' => $dir_tmp, 'barSize' => $barSize, 'maxHeight' => $maxHeight, 'outlinecolor' => $_GET["outlinecolor"], 'numvertices' => $_GET["numvertices"], 'symbolType' => 'polygon');
}
$nomeTemp = array_merge($_GET, $_POST);
$nomeTemp = md5(implode("", $nomeTemp));
$nomeFile = $dir_tmp . "/tme" . $nomeTemp . ".kmz";
//sesion e aberto com isso
$dataConnector = new DataConnector($_GET["sid"], $verificaSID);
if (!file_exists($nomeFile)) {
$dataStore = $dataConnector->getDataStore($_GET["nomelayer"], $colunas, $_GET["colunanomeregiao"], $_GET["titulo"], $_GET["descricao"], "", $parametersTME["mapType"]);
} else {
$dataStore = "";
}
$url = $_SESSION["tmpurl"] . "/tme" . $nomeTemp . ".kmz";
// Create thematic map object
$map = new ThematicMap($dataStore, $parametersTME, $nomeTemp);
$file = $map->getKML($dataConnector->url, $download, $nomeFile);
$nomeArquivo = $map->nomeArquivo;
$legenda = str_replace("kmz", "png", basename($nomeArquivo));
$legenda = str_replace("tme", "legend", $legenda);
$legenda = str_replace(basename($nomeArquivo), $legenda, $file);
if (isset($inclusao) && $inclusao == true) {
$download = true;
示例12: logToDatabase
private function logToDatabase($msg, $type)
{
DataConnector::getInstance()->query("INSERT INTO log (id,time,type,message,url) VALUES (NULL,NOW(),{$type},{$msg}," . $_SERVER['REQUEST_URI'] . ")");
}
示例13: session_start
<?php
session_start();
include_once "../check.php";
include_once "../defines.php";
include_once "../ClassLibrary/DataConnector.php";
include_once "../DataTransferObjects/ContractBonusDTO.php";
include_once "../DataAccessObjects/ContractBonusDAO.php";
include_once "../DataTransferObjects/CounterDTO.php";
include_once "../DataAccessObjects/CounterDAO.php";
$subContractId = 0;
if (isset($_REQUEST["subContractId"]) && $_REQUEST["subContractId"] != 0) {
$subContractId = $_REQUEST["subContractId"];
}
// Abre a conexao com o banco de dados
$dataConnector = new DataConnector('mySql');
$dataConnector->OpenConnection();
if ($dataConnector->mysqlConnection == null) {
echo 'Não foi possível se connectar ao bando de dados!';
exit;
}
$nivelAutorizacao = GetAuthorizationLevel($dataConnector->mysqlConnection, $functionalities["gerenciamentoContratos"]);
if ($nivelAutorizacao <= 1) {
DisplayNotAuthorizedWarning();
exit;
}
// Cria os objetos de mapeamento objeto-relacional
$contractBonusDAO = new ContractBonusDAO($dataConnector->mysqlConnection);
$contractBonusDAO->showErrors = 1;
$counterDAO = new CounterDAO($dataConnector->mysqlConnection);
$counterDAO->showErrors = 1;
示例14: executeSQL
public static function executeSQL($sql)
{
DataConnector::getConnection();
mysql_query($sql) or die(mysql_error());
}
示例15: getInstance
public static function getInstance()
{
if (null === self::$instance) {
self::$instance = new self();
}
return self::$instance;
}