コード例 #1
0
 function get_all_attendee_IDs()
 {
     $connect = SPDO::getInstance();
     $sth = $connect->prepare('SELECT `id_person` FROM `people` order by `id_person`');
     //$sth->bindParam(':login', $login);
     $sth->execute();
     $result = array();
     while ($row = $sth->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) {
         array_push($result, $row['id_person']);
     }
     return $result;
 }
コード例 #2
0
 public function updateOrder($sIdOrder, $aData)
 {
     $sReq = "UPDATE products_orders set id_transaction=:id_transaction, chekoutstatus=:status WHERE id_order=:id_order";
     $update = SPDO::getInstance()->prepare($sReq);
     $update->bindParam(':id_transaction', $aData['PAYMENTINFO_0_TRANSACTIONID']);
     $update->bindParam(':status', $aData['PAYMENTINFO_0_PAYMENTSTATUS']);
     $update->bindParam('id_order', $sIdOrder);
     try {
         $result = $update->execute();
     } catch (PDOException $e) {
         echo $e->getMessage();
     }
 }
コード例 #3
0
 /**
  * Vérification du mot de passe saisit par l'utilisateur et celui stocké en base.
  *
  * @param string $req Requête qui recupére le password haché en base
  * @param string $sPasswordUser Password saisit par l'utilisateur
  * @return boolean true:password OK ; false:password KO
  **/
 public function verify_password_database($req, $sloginEnter, $sPasswordUser)
 {
     $stmt = SPDO::getInstance()->prepare($req);
     $stmt->bindvalue(':sloginEnter', $sloginEnter);
     $stmt->execute();
     $aPwd_hash = $stmt->fetchAll();
     if (!empty($aPwd_hash)) {
         $sPwd_hash = $aPwd_hash[0][0];
     } else {
         $sPwd_hash = null;
     }
     return $this->pwd_verify($sPasswordUser, $sPwd_hash);
 }
コード例 #4
0
 /**
  * Update information in data-base (insert/update query)
  *
  * @param string $sReq Update SQL request
  * @param array $aData The list of data to be updated
  * @param string $sMsg Specific message (not standard message, ex: "Operation performed successfully")
  * @param string $slinkOK Link to return in initial page.
  * @param boolean $bMsgResult true:display result DB; false : don't display message
  */
 public function executeDbQuery($sReq, $aData, $sMsg, $slinkOk, $bMsgResult = '')
 {
     $update = SPDO::getInstance()->prepare($sReq);
     foreach ($aData as $key => $value) {
         foreach ($value as $cle => $val) {
             if ($cle == 'type') {
                 $type = $val;
             } elseif ($cle != 'type') {
                 $bindName = $cle;
                 $bindValue = $val;
                 // if it's not PDO::PARAM_STR (PDO::PARAM_LOB, for example)
                 if ($type != 2) {
                     $update->bindValue($cle, $val, $type);
                 } elseif ($type == '' or $type = 2) {
                     $update->bindValue($cle, $val);
                 }
             }
         }
     }
     try {
         $resultOK = $update->execute();
     } catch (PDOException $e) {
         echo $e->getMessage();
     }
     if (!isset($resultOK)) {
         $resultOK = false;
     }
     if ($bMsgResult) {
         $aMsg = $this->getItemTransation('BLOG', 'BACK', Admin::$lang, 'MSG_DB_RESULT');
         if ($resultOK) {
             $this->DisplayResultRqt($resultOK, $slinkOk, $aMsg[Admin::$lang]['ok_return'], '');
         } else {
             $this->DisplayResultRqt($resultOK, $slinkOk, '', $aMsg[Admin::$lang]['ko_return']);
         }
     }
     return $resultOK;
 }
コード例 #5
0
 public function selectOneCategory($id_cat)
 {
     $aResult = SPDO::getInstance()->query("select * from product_categories where id_cat={$id_cat}");
     return $select = $aResult->fetch(PDO::FETCH_ASSOC);
 }
コード例 #6
0
    $sReq = "SELECT * FROM blog_comments WHERE id_com={$id}";
} elseif ($type == 'rep') {
    $sReq = "SELECT * FROM blog_reply WHERE id_rep={$id}";
}
//Recherche de la valeur du jeton
$sRequete = SPDO::getInstance()->query($sReq);
$aResult = $sRequete->fetch(PDO::FETCH_ASSOC);
if ($aResult['jeton'] == $t) {
    $oAdmin->DisplayResultRqt(TRUE, 'blog.php', $aMsg[$lang]['msg_valid_email'], '');
    $val_confirm = 1;
    if ($type == 'com') {
        $sReq = "UPDATE blog_comments SET email_valid = :val WHERE id_com={$id}";
    } elseif ($type == 'rep') {
        $sReq = "UPDATE blog_reply SET email_valid = :val WHERE id_rep={$id}";
    }
    $update = SPDO::getInstance()->prepare($sReq);
    $update->bindValue(':val', $val_confirm);
    try {
        $result = $update->execute();
    } catch (PDOException $e) {
        echo $e->getMessage();
    }
} else {
    $oAdmin->DisplayResultRqt(FALSE, 'blog.php', '', $aMsg[$lang]['msg_notvalid_email']);
}
?>

    </body>

</html>
コード例 #7
0
ファイル: info_client.php プロジェクト: benzirab/SMT
?>
">Démarer une visite du client</a>
    </li>
        </div>


<!--
</div>-->
</nav>
<div class="container-fluid well col-sm-8 text-center" style="margin-left: 50px; border-radius:0px;">

    <?php 
if (isset($_POST['idClient'])) {
    $idClient = trim(stripcslashes(htmlspecialchars($_POST['idClient'])));
    $query = "Select * from Client c  ,manager m, bde b WHERE idClient = {$idClient} and c.idClient = liste_clients.idClient and m.id = liste_clients.idManager and b.id = liste_clients.idBde";
    $reponse = SPDO::getInstance()->query($query);
    while ($requete = $reponse->fetch()) {
        ?>
        <form>
            <legend class="text-center">Information du client : <?php 
        echo $requete['nom'] . ' ' . $requete['prenom'];
        ?>
</legend>
            <!-- Code ITP -->
            <div class="container-fluid well-sm col-sm-12">
                <label class="form-control title input-sm col-sm-3">Code ITP : </label>
                <label class="form-control col-sm-8 col-sm-push-1 input-sm "><?php 
        echo $requete['idClient'];
        ?>
</label>
                <input type="hidden" name="codeITP" id="codeITP" value="<?php 
コード例 #8
0
 public function __construct()
 {
     $this->instance = SPDO::getInstance();
 }
コード例 #9
0
ファイル: Client.php プロジェクト: benzirab/SMT
 public static function getClient($idClient)
 {
     $query = "Select * from Client WHERE id = {$idClient}";
     return SPDO::getInstance()->query($query);
 }
コード例 #10
0
ファイル: Commande.php プロジェクト: benzirab/SMT
 /**
  * @param $mois
  * @param $idBDE
  * @return mixed
  *
  */
 public static function caMensuelBDE($mois, $idBDE)
 {
     $query = "SELECT SUM(`total`) as ca FROM commande WHERE MONTH(`date`) = " . $mois . " and idbde =" . $idBDE;
     $reponse = SPDO::getInstance()->query($query);
     return $reponse->fetch();
 }
コード例 #11
0
ファイル: Game.php プロジェクト: jcaillon/battle-code
 public static function addTeamInGame($gameId)
 {
     $req = SPDO::getInstance()->prepare('UPDATE game SET nbTeam = nbTeam + 1 WHERE gameId = :gameId');
     $req->execute(array('gameId' => $gameId));
 }
コード例 #12
0
 /**
  * Read "blog_conf" in database (The blog configuration parameters)
  * and feed classe attributs
  *
  */
 public function ReadBlogConfig()
 {
     $sReq = 'SELECT * FROM blog_config';
     $sRequete = SPDO::getInstance()->query($sReq);
     $aRequete = $sRequete->fetch(PDO::FETCH_ASSOC);
     $this->aff_xs = $aRequete['aff_xs'];
     $this->aff_sm = $aRequete['aff_sm'];
     $this->aff_md = $aRequete['aff_md'];
     $this->aff_lg = $aRequete['aff_lg'];
     $this->art_page = $aRequete['nbr_art_page'];
     $this->ctrl_comm = $aRequete['control_comm'];
     $this->mail_exp = $aRequete['email_from'];
     $this->mail_obj = $aRequete['email_objet'];
     $this->mail_txt = $aRequete['email_text'];
     $this->name_exp = $aRequete['name_from'];
 }
コード例 #13
0
ファイル: BDE.php プロジェクト: benzirab/SMT
 public function checkConnexion($login, $password)
 {
     SPDO::getInstance()->query("select * from bde WHERE immatricule = {$login} AND password = {$password}");
 }
コード例 #14
0
 /**
  * Transactions research sort by :
  *
  * @param string $search_mod module filtering parameter
  * @param string $search_lang langauge filtering parameter
  * @param string $search_office back or front filtering parameter
  * @param string $search_type Type filtering parameter
  * @return array filtred translation
  */
 public function getSearchTranslations($search_mod, $search_lang, $search_office, $search_type)
 {
     $where = '';
     if ($search_mod != 'ALL') {
         $where = "module='{$search_mod}'";
     }
     if ($search_lang != 'ALL' && $where != '') {
         $where .= " and lang='{$search_lang}'";
     } elseif ($search_lang != 'ALL' && $where == '') {
         $where = "lang='{$search_lang}'";
     }
     if ($search_office != 'ALL' & $where != '') {
         $where .= " and office='{$search_office}'";
     } elseif ($search_office != 'ALL' & $where == '') {
         $where = "office='{$search_office}'";
     }
     if ($search_type != 'ALL' & $where != '') {
         $where .= " and type='{$search_type}'";
     } elseif ($search_type != 'ALL' & $where == '') {
         $where = "type='{$search_type}'";
     }
     if ($where == '') {
         $sReq = "SELECT * FROM adm_translation order by description";
     } else {
         $sReq = "SELECT * FROM adm_translation WHERE {$where} order by description";
     }
     $result = SPDO::getInstance()->query($sReq);
     $aTrans = $result->fetchAll(PDO::FETCH_ASSOC);
     return $aTrans;
 }
コード例 #15
0
 private function CheckPayerRecorded($id_paypal)
 {
     $sReq = "SELECT count(id_payer) nbr FROM products_payer WHERE id_paypal='{$id_paypal}' ";
     $aResult = SPDO::getInstance()->query($sReq);
     return $aResult->fetch(PDO::FETCH_ASSOC);
 }
コード例 #16
0
ファイル: RecapEn.php プロジェクト: benzirab/SMT
<?php

/**
 * Created by PhpStorm.
 * User: admin
 * Date: 13/08/2015
 * Time: 09:39
 */
session_start();
$bde = $_SESSION['immatricule'];
include 'menu.php';
include '../../Models/SPDO.php';
$querry = "SELECT * FROM remontee_terrain WHERE idbde = '{$bde}' ORDER BY Date DESC";
$result = SPDO::getInstance()->query($querry);
?>
<div class="container-fluid well col-sm-10 col-sm-offset-1">
<table class="table table-bordered">
    <legend class="text-center">Les enquêtes passées par le BDE : <i class="text-success"><?php 
echo $_SESSION['login'];
?>
</i></legend>
    <tbody>
    <tr>
        <td class="td-info" width="15%">Date </td>
        <td class="td-info" width="15%">Secteur</td>
        <td class="td-info" width="15%">Marque</td>
        <td class="td-info" width="15%">Sujet</td>
        <td class="td-info" width="40%">Commentaire</td>

    </tr>
    <?php 
コード例 #17
0
    <![endif]-->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 
</head>
<body>
  <div class="container-fluid">
    <div class="row">
      <div class="col-sm-12 col-md-12 col-lg-12">
      <!--#include virtual="includes/menu.html" -->
      </div>
    </div>

  <?php 
}
//Seach paypal settings
$sReq = "SELECT * FROM adm_paypal";
$select = SPDO::getInstance()->query($sReq);
$aSet = $select->fetch(PDO::FETCH_ASSOC);
// initialize Paypal configuration.
$oPaypal = new Paypal($aSet['user'], $aSet['pwd'], $aSet['signature'], $aSet['prod'], $aSet['version'], $aSet['endpoint'], $aSet['money']);
//Inialize strategy for 'Ticket' products
$oTicket = new ProductContext('Ticket');
$aDataTickets = $oTicket->readProducts();
if (!isset($c)) {
    include 'core/Product/view/front-display-all-shows.php';
} else {
    if ($c == 'select') {
        // user select a show for booking it.
        $aDataShow = $oTicket->readProduct($id_prod);
        $aDataPrices = $oTicket->readAllPrices($id_prod);
        include 'core/Product/view/front-display-one-show.php';
    } elseif ($c == 'pay') {
コード例 #18
0
ファイル: enqueteController.php プロジェクト: benzirab/SMT
 * Created by PhpStorm.
 * User: Ach-Khalil
 * Date: 19/08/15
 * Time: 10:10
 */
session_start();
include '../Models/SPDO.php';
$idBde = $_SESSION['immatricule'];
if (isset($_POST['inserer'])) {
    //$dt=$_POST['dt'];
    $sjt = $_POST['sjt'];
    $cmt = $_POST['cmt'];
    $sct = $_POST['sct'];
    $mrq = $_POST['mrq'];
    $requete = "INSERT INTO `SMT`.`remontee_terrain` (`id`, `date`, `idbde`, `sujet`, `commentaire`, `Secteur`, `Marque`)  VALUES (NULL,CURRENT_TIMESTAMP , {$idBde},'{$sjt}','{$cmt}','{$sct}','{$mrq}')";
    $reponse = SPDO::getInstance()->exec($requete);
    if ($reponse == 1) {
        $_SESSION['enquete'] = true;
        ?>
        <script>
            var obj = 'window.location.replace("http://localhost/Stage_SMT/Views/pages/Enquete.php");';
            setTimeout(obj,1000);
        </script>
        <?php 
    } else {
        $_SESSION['enquete'] = false;
        ?>
        <script>

            var obj = 'window.location.replace("http://localhost/Stage_SMT/Views/pages/Enquete.php");';
            setTimeout(obj,1000);
コード例 #19
0
<?php

require_once "superPdo.class.php";
$db = SPDO::getInstance();
$insert = $db->prepare('
					INSERT INTO test (test)
					VALUES(' . rand(10, 500) . ')
				');
$insert->execute();
echo $db->lastInsertId() . PHP_EOL;
$select = $db->prepare('
						SELECT *
						FROM test
		');
$select->execute();
print_r($select->fetchAll());
コード例 #20
0
ファイル: produits.php プロジェクト: benzirab/SMT
<?php

include_once '../jcart/JCart.php';
if (isset($_POST['site'])) {
    $marque = $_POST['site'];
    $sql = "SELECT * from Produits where Marque LIKE '{$marque}'";
    $reponse2 = SPDO::getInstance()->query($sql);
    while ($row = $reponse2->fetch()) {
        ?>
        <div class="well col-sm-4" style="background-color: white;width:220px;margin-left:17px">

        <form method="post" action="" class="jcart">
            <fieldset>
                <input type="hidden" name="jcartToken"
                       value="<?php 
        echo $_SESSION['jcartToken'];
        ?>
"/>
                <input type="hidden" name="my-item-id" value="<?php 
        echo $row['id'];
        ?>
"/>
                <input type="hidden" name="my-item-name"
                       value="<?php 
        echo utf8_encode($row['nomProduit']);
        ?>
"/>
                <input type="hidden" name="my-item-price" value="<?php 
        echo $row['prix'];
        ?>
"/>
コード例 #21
0
ファイル: commande.php プロジェクト: benzirab/SMT
    }
}
?>
                </select>
                    <input id="idClient" value="<?php 
echo $_GET['id'];
?>
" hidden>
                    <button type="submit" name="submit" id="valos" hidden>Valider une commande</button>
            </form>
                </div>
                <div class="col-sm-12">
                <label for="select" class="col-sm-6 control-label text-primary">Mode de paiement</label>
                <select class="form-control col-sm-6 input-sm" id="modePaiement" name="site">
                    <?php 
$reponseDelai = SPDO::getInstance()->query("select * from Client WHERE idClient = {$idClient}");
$row = $reponseDelai->fetch();
if ($row['delaiDePaiment'] == 30) {
    ?>
                        <option value="especes">Espèces</option>
                        <option value="cheque_30_jours">Chèque 30 Jours</option>
                        <option value="cheque_3_jours">Chèque 3 Jours</option>
                        <option value="cheque_7_jours">Chèque 7 Jours</option>
                        <?php 
} else {
    if ($row['delaiDePaiment'] == 7) {
        ?>
                            <option value="especes">Espèces</option>
                            <option value="cheque_3_jours">Chèque 3 Jours</option>
                            <option value="cheque_7_jours">Chèque 7 Jours</option>
                            <?php 
コード例 #22
0
function rollbackAndDie()
{
    SPDO::getInstance()->rollBack();
    die;
}
コード例 #23
0
ファイル: gameSavesDB.php プロジェクト: jcaillon/battle-code
if (!$req->execute(array('id' => $id, 'server' => $server))) {
    die;
}
$data = $req->fetch()['game'];
$rowExists = strlen($data) > 0;
# POST
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $data = json_encode(array('method' => 'POST', 'id' => $id, 'server' => $server, 'post' => $_POST['data'], 'exists' => $rowExists), JSON_PRETTY_PRINT);
    if ($rowExists) {
        $req = SPDO::getInstance()->prepare('UPDATE gamesaves SET game = :game WHERE id = :id AND server = :server');
        $req->execute(array('id' => $id, 'server' => $server, 'game' => $_POST['data']));
        if ($req->rowCount() < 1) {
            die;
        }
    } else {
        $req = SPDO::getInstance()->prepare('INSERT INTO gamesaves(id, server, game) VALUES(:id, :server, :game)');
        $req->execute(array('id' => $id, 'server' => $server, 'game' => $_POST['data']));
        if ($req->rowCount() < 1) {
            die;
        }
    }
    # GET
} elseif ($_SERVER['REQUEST_METHOD'] === 'GET') {
    if (!$rowExists) {
        $data = "{}";
    }
} else {
    die;
}
# JSON if no callback
if (!isset($_GET['callback'])) {
コード例 #24
0
ファイル: Team.php プロジェクト: jcaillon/battle-code
 public static function nbOfTeamPlayedThisRound($gameId, $round)
 {
     $req = SPDO::getInstance()->prepare('SELECT COUNT(DISTINCT sourceTeamId) AS numb FROM action WHERE gameId = :gameId AND round = :round');
     $req->execute(array('gameId' => $gameId, 'round' => $round));
     return intval($req->fetch()['numb']);
 }
コード例 #25
0
 public function readPrices($id_prod)
 {
     $sReq = "select * from products_prices where id_product={$id_prod}";
     $aResult = SPDO::getInstance()->query($sReq);
     return $aResult->fetchAll(PDO::FETCH_ASSOC);
 }