本文整理汇总了PHP中Connexion::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Connexion::getInstance方法的具体用法?PHP Connexion::getInstance怎么用?PHP Connexion::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connexion
的用法示例。
在下文中一共展示了Connexion::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAdwordsData
public function getAdwordsData()
{
$targetingIdeaService = $this->user->GetService('TargetingIdeaService', ADWORDS_VERSION);
$selector = new TargetingIdeaSelector();
$selector->requestType = 'STATS';
$selector->ideaType = 'KEYWORD';
$selector->requestedAttributeTypes = array('SEARCH_VOLUME', 'COMPETITION');
$selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);
$selector->localeCode = 'fr_FR';
$selector->currencyCode = 'EUR';
$language = new Language();
$language->id = '1002';
$selector->searchParameters[] = new LanguageSearchParameter($language);
$relatedToQuerySearchParameter = new RelatedToQuerySearchParameter();
$relatedToQuerySearchParameter->queries = $this->keyword['keyword'];
$selector->searchParameters[] = $relatedToQuerySearchParameter;
$page = $targetingIdeaService->get($selector);
if (sizeof($page->entries) > 0) {
$vol = $page->entries[0]->data[0]->value->value == 0 ? 5 : $page->entries[0]->data[0]->value->value;
$comp = (double) round($page->entries[0]->data[1]->value->value, 2);
Connexion::getInstance()->query("UPDATE keyword SET search = '" . $vol . "', competition = '" . round($comp, 2) . "' WHERE id_keyword = '" . $this->keyword['id_keyword'] . "' ");
} else {
Connexion::getInstance()->query("UPDATE keyword SET search = '5', competition = '0' WHERE id_keyword = '" . $this->keyword['id_keyword'] . "' ");
}
}
示例2: __construct
public function __construct($host, $dbName, $login, $password)
{
$this->host = $host;
$this->dbName = $dbName;
$this->login = $login;
$this->password = $password;
$this->dbpdo = Connexion::getInstance($host, $dbName, $login, $password)->getConnexion();
}
示例3: __construct
public function __construct($idTerrain)
{
$bdd = Connexion::getInstance();
$query = $bdd->getData('SELECT * FROM terrain WHERE idTerrain=' . $idTerrain);
$data = $query->fetch(PDO::FETCH_ASSOC);
$this->_idTerrain = $data['idTerrain'];
$this->_emplacement = $data['emplacementTerrain'];
}
示例4: identification
public function identification()
{
Connexion::getInstance()->query("SELECT name FROM user\r\n WHERE mail = '" . $this->login . "'\r\n AND password = '" . md5($this->pass) . "' ");
$nom = Connexion::getInstance()->result();
if ($nom) {
return true;
}
return false;
}
示例5: __construct
public function __construct($idMatch)
{
$bdd = Connexion::getInstance();
$query = $bdd->getData('SELECT * FROM matchs WHERE idMatchs=' . $idMatch);
$data = $query->fetch(PDO::FETCH_ASSOC);
$this->_idMatch = $data['idMatchs'];
$this->_equipe1 = new Equipe($data['idEquipe1']);
$this->_equipe2 = new Equipe($data['idEquipe2']);
$this->_date = date_format(date_create($data['dateMatchs']), "d/m - H:i");
$this->_terrain = new Terrain($data['idTerrain']);
}
示例6: __construct
public function __construct($idEquipe)
{
$bdd = Connexion::getInstance();
$query = $bdd->getData('SELECT * FROM equipe WHERE idEquipe=' . $idEquipe);
$data = $query->fetch(PDO::FETCH_ASSOC);
$this->_idEquipe = $data['idEquipe'];
$this->_joueur1 = new Joueur($data['idJoueur1']);
if ($data['idJoueur2'] != null) {
$this->_joueur2 = new Joueur($data['idJoueur2']);
}
}
示例7: __construct
public function __construct($idJoueur)
{
$bdd = Connexion::getInstance();
$query = $bdd->getData('SELECT * FROM personnes WHERE idPersonne=' . $idJoueur);
$data = $query->fetch(PDO::FETCH_ASSOC);
$this->_idJoueur = $data['idPersonne'];
$this->_nom = $data['nomPersonne'];
$this->_prenom = $data['prenomPersonne'];
$this->_sexe = $data['sexePersonne'];
$this->_nationalite = $data['nationalitePersonne'];
$this->_classementATP = $data['classementJoueur'];
}
示例8: __construct
public function __construct()
{
$bdd = Connexion::getInstance();
$this->_listeMatchs = array();
$query = $bdd->getData('SELECT idMatchs FROM matchs');
$i = 0;
while ($data = $query->fetch(PDO::FETCH_ASSOC)) {
$match = new Match($data['idMatchs']);
$this->_listeMatchs[$i] = $match;
$i = $i + 1;
}
}
示例9: IndexAction
protected function IndexAction()
{
$this->data->keywords = Keyword::getKeywords($this->user->user['id']);
Connexion::getInstance()->query("SELECT gg, delay, url, frequency FROM user WHERE id = '" . $this->user->user['id'] . "' ");
$this->data->parameters = Connexion::getInstance()->fetch();
$numbers = array('0' => 0, '1' => 0, '2' => 0, '3' => 0);
foreach ($this->data->keywords as $keyword) {
if ($keyword['position'] > 0 && $keyword['position'] < 11) {
$numbers[0]++;
} elseif ($keyword['position'] >= 11 && $keyword['position'] < 31) {
$numbers[]++;
} elseif ($keyword['position'] >= 31 && $keyword['position'] < 51) {
$numbers[2]++;
} else {
$numbers[3]++;
}
}
$this->data->numbers = $numbers;
}
示例10: getposition
public function getposition()
{
Connexion::getInstance()->query("SELECT id_keyword, keyword FROM keyword WHERE id_keyword NOT IN (SELECT id_keyword FROM position) AND id_user = '" . $this->user['id'] . "' LIMIT 0,1 ");
$keyword = Connexion::getInstance()->fetch();
if (isset($keyword['id_keyword'])) {
$keyword['url'] = $this->user['url'];
$keyword['gg'] = $this->user['gg'];
$keyword['delay'] = $this->user['delay'];
echo json_encode($keyword);
} else {
$date = new DateTime();
$date->modify('- ' . ($this->user['frequency'] - 1) . ' days');
Connexion::getInstance()->query("SELECT id_keyword, keyword FROM keyword WHERE id_keyword NOT IN (SELECT id_keyword FROM position WHERE date BETWEEN '" . $date->format('Y-m-d') . "' AND '" . date('Y-m-d') . "') AND id_user = '" . $this->user['id'] . "' LIMIT 0,1 ");
$keyword = Connexion::getInstance()->fetch();
if (isset($keyword['id_keyword'])) {
$keyword['url'] = $this->user['url'];
$keyword['gg'] = $this->user['gg'];
$keyword['delay'] = $this->user['delay'];
echo json_encode($keyword);
}
}
exit;
}
示例11: __construct
public function __construct($mail)
{
Connexion::getInstance()->query("SELECT * FROM user WHERE mail = '" . $mail . "' ");
$this->user = Connexion::getInstance()->fetch();
return $this->user;
}
示例12:
<?php
require_once '../Model/Connexion.php';
require_once '../Model/Equipe.php';
require_once '../Model/Joueur.php';
require_once '../Model/Terrain.php';
require_once '../Model/Match.php';
require_once '../Model/ListeMatchs.php';
$bdd = Connexion::getInstance();
$prix = $_POST['prix'];
if ($prix < 0) {
$prix = 0;
}
$query = $bdd->setData('UPDATE matchs SET prixMatchs="' . $prix . '" WHERE idMatchs=' . $_POST['match']);
require_once '../View/view_pageDeValidation.php';
示例13: getConcurrents
public function getConcurrents($keyword)
{
Connexion::getInstance()->query("SELECT max(date) FROM position WHERE id_keyword = '" . $keyword['id_keyword'] . "' ");
$date = Connexion::getInstance()->result();
Connexion::getInstance()->query("SELECT u.*, p.position FROM position p LEFT JOIN url u ON p.id_url = u.id_url WHERE p.id_keyword = '" . $keyword['id_keyword'] . "' AND date = '" . $date . "' ");
return Connexion::getInstance()->fetchAll();
}
示例14: session_start
<?php
session_start();
header('Content-Type: application/json');
require './liste_include_ajax.php';
require '../classes/connexion.class.php';
require '../classes/produits_m.class.php';
require '../classes/produits_m_manager.class.php';
$db = Connexion::getInstance($dsn, $user, $pass);
try {
$mg = new produits_m_manager($db);
if ($_SESSION['lignedf'] == 0) {
$_SESSION['test'] = $mg->addFacture($_POST['id_utilisateur']);
$_SESSION['lignedf'] = 1;
}
if ($_SESSION['test'] != 0) {
$retour = $mg->addDetail($_SESSION['test'], $_POST['id_prod'], $_POST['quantite']);
if ($retour != 0) {
$_SESSION['choix'] = "default";
$_SESSION['valeur'] = "default";
} else {
$_SESSION['choix'] = "default";
}
}
print json_encode(array("retour" => $retour));
} catch (PDOException $e) {
print "Echec de la connexion" . $e;
}
示例15: __construct
public function __construct()
{
$this->dbpdo = Connexion::getInstance()->getConnexion();
}