コード例 #1
0
 function __construct($idrepresentant, $idproduit, $quantite)
 {
     //$this->idrepresentant = $idrepresentant;
     $this->idproduit = $idproduit;
     $this->quantite = $quantite;
     $this->dateheure = date('Y-m-d H:i:s', time());
     $functionClass = new FunctionClass();
     $this->idinventaire = $functionClass->getInventaireForIdRepresentant($idrepresentant);
 }
コード例 #2
0
$gMessage->showThemeBody(false);
$gMessage->showInModaleWindow();
if (strlen($_POST['ecard_template']) === 0) {
    $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('ECA_TEMPLATE')));
}
// Initialize and check the parameters
$ecardMessage = '';
$postTemplateName = admFuncVariableIsValid($_POST, 'ecard_template', 'file', array('requireValue' => true));
$postPhotoId = admFuncVariableIsValid($_POST, 'photo_id', 'int', array('requireValue' => true));
$postPhotoNr = admFuncVariableIsValid($_POST, 'photo_nr', 'int', array('requireValue' => true));
$nameRecipient = admFuncVariableIsValid($_POST, 'name_recipient', 'string');
$emailRecipient = admFuncVariableIsValid($_POST, 'email_recipient', 'string');
if (isset($_POST['ecard_message'])) {
    $ecardMessage = $_POST['ecard_message'];
}
$imageUrl = $g_root_path . '/adm_program/modules/photos/photo_show.php?pho_id=' . $postPhotoId . '&photo_nr=' . $postPhotoNr . '&max_width=' . $gPreferences['ecard_thumbs_scale'] . '&max_height=' . $gPreferences['ecard_thumbs_scale'];
$funcClass = new FunctionClass($gL10n);
// read content of template file
$ecardDataToParse = $funcClass->getEcardTemplate($postTemplateName, THEME_SERVER_PATH . '/ecard_templates/');
if ($ecardDataToParse === '') {
    $gMessage->show($gL10n->get('SYS_ERROR_PAGE_NOT_FOUND'));
}
echo '
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title">' . $gL10n->get('SYS_NOTE') . '</h4>
</div>
<div class="modal-body" id="preview_content">';
// show output of parsed template
echo $funcClass->parseEcardTemplate($imageUrl, $ecardMessage, $ecardDataToParse, $nameRecipient, $emailRecipient);
echo '</div>';
コード例 #3
0
ファイル: ecards.php プロジェクト: martinbrylski/admidio
 *
 * pho_id:      Id of photo album whose image you want to send
 * photo_nr:    Number of the photo of the choosen album
 * usr_id:      (optional) Id of the user who should receive the ecard
 ***********************************************************************************************
 */
require_once '../../system/common.php';
require_once 'ecard_function.php';
require_once '../../system/login_valid.php';
// Initialize and check the parameters
$getPhotoId = admFuncVariableIsValid($_GET, 'pho_id', 'int', array('requireValue' => true));
$getUserId = admFuncVariableIsValid($_GET, 'usr_id', 'int');
$getPhotoNr = admFuncVariableIsValid($_GET, 'photo_nr', 'int', array('requireValue' => true));
$showPage = admFuncVariableIsValid($_GET, 'show_page', 'int', array('defaultValue' => 1));
// Initialisierung lokaler Variablen
$funcClass = new FunctionClass($gL10n);
$templates = $funcClass->getFileNames(THEME_SERVER_PATH . '/ecard_templates/');
$template = THEME_SERVER_PATH . '/ecard_templates/';
$headline = $gL10n->get('ECA_GREETING_CARD_EDIT');
// pruefen ob das Modul ueberhaupt aktiviert ist
if ($gPreferences['enable_ecard_module'] != 1) {
    // das Modul ist deaktiviert
    $gMessage->show($gL10n->get('SYS_MODULE_DISABLED'));
}
// URL auf Navigationstack ablegen
$gNavigation->addUrl(CURRENT_URL, $headline);
// Fotoveranstaltungs-Objekt erzeugen oder aus Session lesen
if (isset($_SESSION['photo_album']) && $_SESSION['photo_album']->getValue('pho_id') == $getPhotoId) {
    $photo_album =& $_SESSION['photo_album'];
    $photo_album->setDatabase($gDb);
} else {
コード例 #4
0
ファイル: resetPasswordMail.php プロジェクト: kostya1017/our
<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');
//include "../includes/functions.php";
include "includes/db.php";
require_once "Objects/FunctionClass.php";
require_once "PHPMailer-master/class.phpmailer.php";
$username = $_GET['username'];
try {
    $functionObject = new FunctionClass('./');
    $usager_id = $functionObject->getIdMembreFromEmail($username);
    // si l'usager existe
    if ($usager_id !== FALSE) {
        $tokenString = rand_str();
        $DBH->query('BEGIN');
        $STH = $DBH->prepare("\n\t\tUPDATE `member` \n\t\tSET `reset_token` = :tokenString, `reset_time` = :resetTime \n\t\tWHERE `id` = :usager_id \n\t\tLIMIT 1 \n\t\t");
        $currTime = date('Y-m-d H:i:s');
        $STH->bindParam(":tokenString", $tokenString);
        $STH->bindParam(":resetTime", $currTime);
        $STH->bindParam(":usager_id", $usager_id);
        $STH->execute();
        $usager_affected = $STH->rowCount();
        if ($usager_affected == 1) {
            $DBH->query('COMMIT');
            $url = "http://api.ngser.gnetix.com/v1.1/ResetPasswordWithToken.php?member_id=" . $usager_id . "&token=" . $tokenString;
            $html = file_get_contents('emailbaseresethtml.html');
            $html = str_replace("--URLTOREPLACE--", $url, $html);
            $result = send_email($username, "Récupération du mot de passe de votre compte ekiosk mobile", $html, "envoi_ngser@gnetix.com");
            if ($result === true) {
                echo json_encode(array("resultat" => "true", "data" => "Courriel envoyé avec succès"));
コード例 #5
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');
//include "../includes/functions.php";
include "includes/db.php";
require_once "Objects/FunctionClass.php";
$id = isset($_GET['id']) ? $_GET['id'] : "";
$month = isset($_GET['month']) ? $_GET['month'] : "";
$username = isset($_GET['username']) ? $_GET['username'] : "";
$password = isset($_GET['password']) ? $_GET['password'] : "";
$date = date("Y-m%", strtotime("-" . $month . " month"));
//echo $date;
$json = array();
try {
    $functionObject = new FunctionClass('./');
    $member_id = $functionObject->getIdMembre($username, $password);
    $abonnementArray = $functionObject->getJournauxForCurrentAbonnement($member_id);
    $STH = $DBH->prepare("\n\tSELECT editions.id, editions.id_journal, editions.datePublication, editions.downloadPath, editions.imagePath, editions.quantite, \n\tjournal.nom, journal.type, journal.categorie, subscription.until\n\tFROM editions \n\tLEFT JOIN journal ON journal.id = editions.id_journal \n\tLEFT JOIN subscription ON journal.id = subscription.journal_id AND until > NOW() AND member_id = '" . (int) $member_id . "'\n\tWHERE editions.id_journal = :id \n\tAND editions.visible = 1 \n\tAND editions.datePublication LIKE :date \n\tORDER BY datePublication ASC\n\t");
    $STH->bindParam(":id", $id);
    $STH->bindParam(":date", $date);
    $STH->execute();
    $STH->setFetchMode(PDO::FETCH_ASSOC);
    $x = 0;
    while ($row = $STH->fetch()) {
        //print_r($row);
        $temp_journal = array();
        $temp_journal['id'] = $row['id'];
        $temp_journal['id_journal'] = $row['id_journal'];
        $temp_journal['nom'] = $row['nom'];
        $temp_journal['type'] = $row['type'];
コード例 #6
0
ファイル: AddPayload.php プロジェクト: kostya1017/our
<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');
include "../includes/db.php";
require_once "../Objects/InsertAchatAndroidPayloadClass.php";
require_once "../Objects/FunctionClass.php";
//$json = json_decode($_GET['data']);
$username = isset($_POST['username']) ? $_POST['username'] : "";
$password = isset($_POST['password']) ? $_POST['password'] : "";
$sku = isset($_POST['sku']) ? $_POST['sku'] : "";
$quantite = isset($_POST['quantite']) ? $_POST['quantite'] : "";
$prix = isset($_POST['prix']) ? $_POST['prix'] : "";
$payload = isset($_POST['payload']) ? $_POST['payload'] : "";
$functionObject = new FunctionClass('./../');
$user_id = $functionObject->getIdMembre($username, $password);
$virtual_currency_bought = $functionObject->getVirtualCurrencyBundleIdForAndroidWithQuantite($quantite);
try {
    $DBH->query('BEGIN');
    $dateheure = date('Y-m-d H:i:s', time());
    /*
    enregistrer la transaction
    */
    $STH = $DBH->prepare("\n\tINSERT IGNORE INTO `achats_android` (\n\t`user_id`, `sku`, `virtual_currency_bought`, `quantite`, `prix`, `payload`, `date`) \n\tVALUES (\n\t:user_id, :sku, :virtual_currency_bought, :quantite, :prix, :payload, :date)\n\t");
    //print_r($json);
    $achatAndroidPayloadClass = new InsertAchatAndroidPayloadClass($user_id, $sku, $virtual_currency_bought, $quantite, $prix, $payload, $dateheure);
    $STH->execute((array) $achatAndroidPayloadClass);
    $achatAndroidPayloadClass_affected = $STH->rowCount();
    $idachat = $DBH->lastInsertId('id');
    if ($achatAndroidPayloadClass_affected == 1) {
        $DBH->query('COMMIT');
コード例 #7
0
ファイル: AddAchatIndividuel.php プロジェクト: kostya1017/our
<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');
include "includes/db.php";
require_once "Objects/InsertAchatEkCreditClass.php";
require_once "Objects/FunctionClass.php";
//$json = json_decode($_GET['data']);
$data = isset($_POST['data']) ? json_decode($_POST['data']) : "";
$username = $data->username;
$password = $data->password;
$edition_id = $data->editionid;
$quantite = $data->quantite;
$functionObject = new FunctionClass('./');
$user_id = $functionObject->getIdMembre($username, $password);
try {
    $DBH->query('BEGIN');
    $dateheure = date('Y-m-d H:i:s', time());
    /*
    enregistrer la transaction
    */
    $STH = $DBH->prepare("\n\tINSERT INTO `achat_ekcredit` (\n\t`user_id`,`edition_id`, `package_id`, `quantite`, `date`) \n\tVALUES (\n\t:user_id, :edition_id, :package_id, :quantite, :date)\n\t");
    //print_r($json);
    $achatEkCreditClass = new InsertAchatEkCreditClass($user_id, $edition_id, NULL, $quantite, $dateheure);
    $STH->execute((array) $achatEkCreditClass);
    $achatEkCreditClass_affected = $STH->rowCount();
    if ($username == "" || $password == "") {
        if ($achatEkCreditClass_affected == 1) {
            $DBH->query('COMMIT');
            echo json_encode(array("resultat" => "true", "data" => array('total' => $quantite)));
        } else {
コード例 #8
0
<?php

/*
error_reporting(E_ALL);
ini_set('display_errors', '1');
*/
//include "../includes/functions.php";
include "includes/db.php";
require_once "Objects/FunctionClass.php";
$functionObject = new FunctionClass('./');
$username = isset($_GET['username']) ? $_GET['username'] : "";
$password = isset($_GET['password']) ? $_GET['password'] : "";
$member_id = $functionObject->getIdMembre($username, $password);
$categorie = isset($_GET['categorie']) ? $_GET['categorie'] : "";
$pays = isset($_GET['pays']) ? (int) $_GET['pays'] : "";
$abonnement = isset($_GET['abonnement']) ? $_GET['abonnement'] : "";
if ($categorie == "" || $categorie == "Tous") {
    $sql = "\n\t\tSELECT journal.nom, journal.type, journal.categorie, pays.id AS pays_id, pays.nom AS pays_nom, pays.abbrev AS pays_abbrev, pays.image AS pays_image, \n\t\teditions.id, editions.id_journal, editions.datePublication, editions.downloadPath, editions.imagePath, editions.quantite, subscription.until  \n\t\tFROM journal \n\t\tLEFT JOIN subscription ON journal.id = subscription.journal_id AND until > NOW() AND member_id = '" . (int) $member_id . "'\n\t\tLEFT JOIN pays ON journal.id_pays = pays.id\n\t\tLEFT JOIN editions ON editions.id_journal = journal.id \n\t\t\tAND editions.visible = 1 \n\t\t\tAND editions.datePublication = (SELECT MAX(editions.datePublication) FROM editions WHERE editions.id_journal = journal.id AND editions.visible=1)\n\t\tWHERE editions.id IS NOT NULL\n\t\tAND journal.visible = 1\n\t\t" . ($pays != '' ? " AND journal.id_pays = '" . $pays . "'" : '') . "\n\t\t" . ($abonnement ? " AND subscription.until <> '' " : '') . "\n\t\t\n\t\tGROUP BY journal.id\n\t\tORDER BY journal.nom ASC ,editions.datePublication ASC\n\t\t";
} else {
    $sql = "\n\t\tSELECT journal.nom, journal.type, journal.categorie, pays.id AS pays_id, pays.nom AS pays_nom, pays.abbrev AS pays_abbrev, pays.image AS pays_image, \n\t\teditions.id, editions.id_journal, editions.datePublication, editions.downloadPath, editions.imagePath, editions.quantite, subscription.until  \n\t\t\t\tFROM journal \n\t\tLEFT JOIN subscription ON journal.id = subscription.journal_id AND until > NOW() AND member_id = '" . (int) $member_id . "'\n\t\tLEFT JOIN pays ON journal.id_pays = pays.id\n\t\tLEFT JOIN editions ON editions.id_journal = journal.id \n\t\t\tAND editions.visible = 1 \n\t\t\tAND editions.datePublication = (SELECT MAX(editions.datePublication) FROM editions WHERE editions.id_journal = journal.id AND editions.visible=1)\n\t\tWHERE journal.categorie = '" . $categorie . "' \n\t\tAND journal.visible = 1\n\t\t" . ($pays != '' ? " AND journal.id_pays = '" . $pays . "'" : '') . "\n\t\tAND editions.id IS NOT NULL\n\t\t" . ($abonnement ? " AND subscription.until <> '' " : '') . "\n\t\t\n\t\tGROUP BY journal.id\n\t\tORDER BY journal.nom ASC ,editions.datePublication ASC\n\t\t";
}
//$idrepresentant = 3;
$json = array();
//$abonnementArray = $functionObject->getJournauxForCurrentAbonnement($member_id);
try {
    $STH = $DBH->prepare($sql);
    $STH->execute();
    $STH->setFetchMode(PDO::FETCH_ASSOC);
    //$STH2 = $DBH->prepare("
    //SELECT editions.id, editions.id_journal, editions.datePublication, editions.downloadPath, editions.imagePath, editions.quantite
    //FROM editions
コード例 #9
0
ファイル: getAbonnements.php プロジェクト: kostya1017/our
<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');
//include "../includes/functions.php";
include "includes/db.php";
require_once "Objects/FunctionClass.php";
//$idrepresentant = 3;
$json = array();
$username = isset($_GET['username']) ? $_GET['username'] : "";
$password = isset($_GET['password']) ? $_GET['password'] : "";
try {
    $functionObject = new FunctionClass('./');
    $package_id = $functionObject->getPackageMembre($username, $password);
    $STH = $DBH->prepare("\n\t\tSELECT id, nom, prix_1, prix_3 \n\t\tFROM package \n\t\tWHERE deactivated = 0\n\t\t");
    $STH->execute();
    $STH->setFetchMode(PDO::FETCH_ASSOC);
    $STH2 = $DBH->prepare("\n\t\tSELECT id, type, amount \n\t\tFROM package_item  \n\t\tWHERE package_id = :idpackage \n\t\tORDER BY rank ASC\n\t\t");
    $STH3 = $DBH->prepare("\n\t\tSELECT id, type, itunes, google, prix_usd \n\t\tFROM prix \n\t\tWHERE id = :idprix\n\t\t");
    $x = 0;
    while ($row = $STH->fetch()) {
        //print_r($row);
        $temp_abonnement = array();
        $temp_abonnement['id'] = $row['id'];
        $temp_abonnement['nom'] = $row['nom'];
        $temp_abonnement['prix_1'] = array();
        $temp_abonnement['prix_3'] = array();
        $temp_abonnement['items'] = array();
        if ($package_id != NULL && $package_id == $row['id']) {
            $temp_abonnement['bought'] = 1;
        } else {
コード例 #10
0
ファイル: AddCreditWithCode.php プロジェクト: kostya1017/our
<?php

/*
 *error_reporting(E_ALL);
 *ini_set('display_errors', '1');
 */
include "includes/db.php";
require_once "Objects/InsertAchatEkCreditClass.php";
require_once "Objects/FunctionClass.php";
//$json = json_decode($_GET['data']);
$data = isset($_POST['data']) ? json_decode($_POST['data']) : "";
$username = $data->username;
$password = $data->password;
$code = $data->code;
$functionObject = new FunctionClass('');
$user_id = $functionObject->getIdMembre($username, $password);
try {
    $DBH->query('BEGIN');
    $dateheure = date('Y-m-d H:i:s', time());
    /*
    enregistrer la transaction
    */
    /////////////
    //faire un log des essai
    /////////////
    /*$STH = $DBH->prepare("
    	INSERT INTO `achat_ekcredit` (
    	`user_id`,`edition_id`, `package_id`, `quantite`, `date`)
    	VALUES (
    	:user_id, :edition_id, :package_id, :quantite, :date)
    	");
コード例 #11
0
ファイル: getPubImage.php プロジェクト: kostya1017/our
<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');
set_time_limit(0);
//include "../includes/functions.php";
include "includes/db.php";
require_once "Objects/FunctionClass.php";
$username = isset($_GET['username']) ? $_GET['username'] : "";
$password = isset($_GET['password']) ? $_GET['password'] : "";
$ads_id = isset($_GET['ads_id']) ? $_GET['ads_id'] : "";
try {
    $functionObject = new FunctionClass('./');
    $member_id = $functionObject->getIdMembre($username, $password);
    $image = $functionObject->getPubImage($ads_id);
    $date = date('Y-m-d', time());
    $STH = $DBH->prepare("\n\tSELECT id, count \n\tFROM ads_displayed \n\tWHERE ads_id = :ads_id \n\tAND date = :date \n\tLIMIT 1");
    $STH->bindParam(":ads_id", $ads_id);
    $STH->bindParam(":date", $date);
    $STH->execute();
    $STH->setFetchMode(PDO::FETCH_ASSOC);
    $row = $STH->fetch();
    if (empty($row)) {
        $STH = $DBH->prepare("\n\t\tINSERT INTO `ads_displayed` (`ads_id`, `date`) \n\t\tVALUES (:ads_id, :date) \n\t\t");
        $STH->bindParam(":ads_id", $ads_id);
        $STH->bindParam(":date", $date);
        $STH->execute();
        $tacking_id = $DBH->lastInsertId();
        $count = 0;
    } else {
        $tacking_id = $row['id'];
コード例 #12
0
ファイル: getEditionDownload.php プロジェクト: kostya1017/our
<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');
set_time_limit(0);
//include "../includes/functions.php";
include "includes/db.php";
require_once "Objects/InsertDownloadAchatClass.php";
require_once "Objects/FunctionClass.php";
$username = isset($_GET['username']) ? $_GET['username'] : "";
$password = isset($_GET['password']) ? $_GET['password'] : "";
$edition_id = isset($_GET['editionid']) ? $_GET['editionid'] : "";
$subscription = isset($_GET['subscription']) ? $_GET['subscription'] : 0;
try {
    $functionObject = new FunctionClass('./');
    $user_id = $functionObject->getIdMembre($username, $password);
    //$edition_id = $functionObject->getEditionIdForUrl($url);
    $achat_id = $functionObject->getIssueForAchat($user_id, $edition_id);
    $url = $functionObject->getUrlForEditionId($edition_id);
    $download_id = $functionObject->getDownloadIdIfExist($user_id, $edition_id);
    $dateheure = date('Y-m-d H:i:s', time());
    if ($subscription) {
        $STH = $DBH->prepare("\n\t\tINSERT INTO `editions_download_member` (\n\t\t`member_id`, `edition_id`,`date`) \n\t\tVALUES (\n\t\t:member_id, :edition_id, :date)\n\t\t");
        $STH->execute(array('member_id' => $user_id, 'edition_id' => $edition_id, 'date' => $dateheure));
    } else {
        $STH = $DBH->prepare("\n\t\tINSERT INTO `editions_download_achat_member` (\n\t\t`member_id`, `achat_id`,`date`) \n\t\tVALUES (\n\t\t:member_id, :achat_id, :date)\n\t\t");
        $downloadAchatClass = new InsertDownloadAchatClass($user_id, $achat_id, $dateheure);
        $STH->execute((array) $downloadAchatClass);
    }
    //$downloadEditionClass_affected = $STH->rowCount();
    $filename = $url;
コード例 #13
0
ファイル: getPubLink.php プロジェクト: kostya1017/our
<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');
set_time_limit(0);
//include "../includes/functions.php";
include "includes/db.php";
require_once "Objects/FunctionClass.php";
$username = isset($_GET['username']) ? $_GET['username'] : "";
$password = isset($_GET['password']) ? $_GET['password'] : "";
$ads_id = isset($_GET['ads_id']) ? $_GET['ads_id'] : "";
try {
    $functionObject = new FunctionClass('./');
    $member_id = $functionObject->getIdMembre($username, $password);
    $url = $functionObject->getPubUrl($ads_id);
    $date = date('Y-m-d', time());
    $STH = $DBH->prepare("\n\tSELECT id, clicked \n\tFROM ads_clicked \n\tWHERE ads_id = :ads_id \n\tAND date = :date \n\tLIMIT 1");
    $STH->bindParam(":ads_id", $ads_id);
    $STH->bindParam(":date", $date);
    $STH->execute();
    $STH->setFetchMode(PDO::FETCH_ASSOC);
    $row = $STH->fetch();
    if (empty($row)) {
        $STH = $DBH->prepare("\n\t\tINSERT INTO `ads_clicked` (`ads_id`, `date`) \n\t\tVALUES (:ads_id, :date) \n\t\t");
        $STH->bindParam(":ads_id", $ads_id);
        $STH->bindParam(":date", $date);
        $STH->execute();
        $tacking_id = $DBH->lastInsertId();
        $clicked = 0;
    } else {
        $tacking_id = $row['id'];
コード例 #14
0
 $achatItunesClass = new UpdateAchatItunesClass($achat_id, $transaction_id, $unique_identifier, $receiptdata);
 $STH->execute((array) $achatItunesClass);
 $achatItunesClass_affected = $STH->rowCount();
 if ($username == "" || $password == "") {
     $functionObject = new FunctionClass();
     $quantite_a_ajouter = $functionObject->getQuantiteFromIdTransaction($achat_id);
     if ($achatItunesClass_affected == 1) {
         $DBH->query('COMMIT');
         echo json_encode(array("resultat" => "true", "data" => array('total' => $quantite_a_ajouter)));
     } else {
         $DBH->query('ROLLBACK');
         echo json_encode(array("resultat" => "false", "data" => "Erreur d'enregistrement de la transaction sans compte"));
     }
     exit;
 }
 $functionObject = new FunctionClass();
 $user_id = $functionObject->getIdMembre($username, $password);
 $quantite_a_ajouter = $functionObject->getQuantiteFromIdTransaction($achat_id);
 $quantite_au_compte = $functionObject->getQuantiteFromMember($user_id);
 $nouveau_total = $quantite_au_compte + $quantite_a_ajouter;
 $STH = $DBH->prepare("\n\tUPDATE `member` \n\tSET `ek_credit` = :total \n\tWHERE `id` = :user_id\n\tLIMIT 1\n\t");
 $STH->bindParam(':total', $nouveau_total);
 $STH->bindParam(':user_id', $user_id);
 $STH->execute();
 $updateMemberClass_affected = $STH->rowCount();
 if ($achatItunesClass_affected == 1 && $updateMemberClass_affected == 1) {
     $DBH->query('COMMIT');
     echo json_encode(array("resultat" => "true", "data" => array('total' => $nouveau_total)));
 } else {
     if ($achatItunesClass_affected == 1) {
         $DBH->query('ROLLBACK');
コード例 #15
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');
//include "../includes/functions.php";
include "includes/db.php";
require_once "Objects/FunctionClass.php";
$username = isset($_GET['username']) ? $_GET['username'] : "";
$password = isset($_GET['password']) ? $_GET['password'] : "";
//$idrepresentant = 3;
$json = array();
try {
    $functionObject = new FunctionClass('./');
    $member_id = $functionObject->getIdMembre($username, $password);
    $STH = $DBH->prepare("\n\t\tSELECT editions.id, editions.id_journal, editions.datePublication, editions.downloadPath, editions.imagePath, editions.quantite, \n\tjournal.nom, journal.type, journal.categorie \n\t\tFROM member \n\t\tLEFT JOIN package_association ON package_association.member_id = member.id \n\t\tLEFT JOIN editions ON editions.id_journal = package_association.journal_id \n\t\tLEFT JOIN editions_download_member ON editions_download_member.member_id = member.id AND editions_download_member.edition_id = editions.id \n\t\tLEFT JOIN achats_package ON achats_package.user_id = member.id AND achats_package.package_id = member.package_id \n\t\tLEFT JOIN journal ON journal.id = editions.id_journal \n\t\tWHERE member.id = :memberId \n\t\tAND editions_download_member.id IS NULL\n\t\tAND editions.datePublication BETWEEN achats_package.date_achat AND achats_package.date_fin \n\t\tAND editions.id_journal = package_association.journal_id \n\t\tORDER BY editions.datePublication ASC\n\t\t");
    $STH->bindParam(":memberId", $member_id);
    $STH->execute();
    $STH->setFetchMode(PDO::FETCH_ASSOC);
    $x = 0;
    while ($row = $STH->fetch()) {
        //print_r($row);
        $temp_journal = array();
        $temp_journal['id'] = $row['id'];
        $temp_journal['id_journal'] = $row['id_journal'];
        $temp_journal['nom'] = $row['nom'];
        $temp_journal['type'] = $row['type'];
        $temp_journal['categorie'] = $row['categorie'];
        $temp_journal['id_journal'] = $row['id_journal'];
        $temp_journal['datePublication'] = $row['datePublication'];
        $temp_journal['downloadPath'] = $row['downloadPath'];
        $temp_journal['coverPath'] = $row['imagePath'];
コード例 #16
0
ファイル: ConsumePayload.php プロジェクト: kostya1017/our
 $STH = $DBH->prepare("\n\t\tUPDATE `achats_android` \n\t\tSET `consume_date` = :consume_date \n\t\tWHERE `payload` = :payload \n\t\tAND `sku` = :sku \n\t\tLIMIT 1 \n\t");
 //print_r($json);
 $updateAchatAndroidPayloadClass = new UpdateAchatAndroidPayloadClass($sku, $payload, $consume_date);
 $STH->execute((array) $updateAchatAndroidPayloadClass);
 $achatAndroidClass_affected = $STH->rowCount();
 /*
 	if($achatAndroidClass_affected == 1) {
 		$DBH->query('COMMIT');
 		
 		echo json_encode(array("resultat" => "true", "data" => array('idachat'=>$idachat)));
 	}
 	else {
 		$DBH->query('ROLLBACK');
 		echo json_encode(array("resultat" => "false", "data" => "Erreur de consomation de l'achat"));
 	}*/
 $functionObject = new FunctionClass();
 $idachat = $functionObject->getIdFromPayloadAndSkuTransactionAndroid($payload, $sku);
 if ($username == "" || $password == "") {
     $quantite_a_ajouter = $functionObject->getQuantiteFromIdTransactionAndroid($idachat);
     if ($achatAndroidClass_affected == 1) {
         $DBH->query('COMMIT');
         echo json_encode(array("resultat" => "true", "data" => $quantite_a_ajouter));
     } else {
         $DBH->query('ROLLBACK');
         echo json_encode(array("resultat" => "false", "data" => "Erreur d'enregistrement de la transaction sans compte"));
     }
     exit;
 }
 $user_id = $functionObject->getIdMembre($username, $password);
 $quantite_a_ajouter = $functionObject->getQuantiteFromIdTransactionAndroid($idachat);
 $quantite_au_compte = $functionObject->getQuantiteFromMember($user_id);
コード例 #17
0
ファイル: ecard_send.php プロジェクト: bash-t/admidio
/******************************************************************************
 * Send ecard to users and show status message
 *
 * Copyright    : (c) 2004 - 2015 The Admidio Team
 * Homepage     : http://www.admidio.org
 * License      : GNU Public License 2 http://www.gnu.org/licenses/gpl-2.0.html
 *
 *****************************************************************************/
require_once '../../system/common.php';
require_once 'ecard_function.php';
// Initialize and check the parameters
$postTemplateName = admFuncVariableIsValid($_POST, 'ecard_template', 'file', array('requireValue' => true));
$postPhotoId = admFuncVariableIsValid($_POST, 'photo_id', 'numeric', array('requireValue' => true));
$postPhotoNr = admFuncVariableIsValid($_POST, 'photo_nr', 'numeric', array('requireValue' => true));
$funcClass = new FunctionClass($gL10n);
$photoAlbum = new TablePhotos($gDb, $postPhotoId);
$imageUrl = $g_root_path . '/adm_program/modules/photos/photo_show.php?pho_id=' . $postPhotoId . '&photo_nr=' . $postPhotoNr . '&max_width=' . $gPreferences['ecard_card_picture_width'] . '&max_height=' . $gPreferences['ecard_card_picture_height'];
$imageServerPath = SERVER_PATH . '/adm_my_files/photos/' . $photoAlbum->getValue('pho_begin', 'Y-m-d') . '_' . $postPhotoId . '/' . $postPhotoNr . '.jpg';
$template = THEME_SERVER_PATH . '/ecard_templates/';
$_SESSION['ecard_request'] = $_POST;
// pruefen ob das Modul ueberhaupt aktiviert ist
if ($gPreferences['enable_ecard_module'] != 1) {
    // das Modul ist deaktiviert
    $gMessage($gL10n->get('SYS_MODULE_DISABLED'));
}
// pruefen ob User eingeloggt ist
if (!$gValidLogin) {
    $gMessage($gL10n->get('SYS_INVALID_PAGE_VIEW'));
}
$senderName = $gCurrentUser->getValue('FIRST_NAME') . ' ' . $gCurrentUser->getValue('LAST_NAME');
コード例 #18
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');
//include "../includes/functions.php";
include "includes/db.php";
require_once "Objects/FunctionClass.php";
$id = isset($_GET['id']) ? $_GET['id'] : "";
$username = isset($_GET['username']) ? $_GET['username'] : "";
$password = isset($_GET['password']) ? $_GET['password'] : "";
$editionId = isset($_GET['editionId']) ? $_GET['editionId'] : "";
$json = array();
try {
    $functionObject = new FunctionClass('./');
    $member_id = $functionObject->getIdMembre($username, $password);
    //$abonnementArray = $functionObject->getJournauxForCurrentAbonnement($member_id);
    $STH = $DBH->prepare("\n\tSELECT editions.id, editions.id_journal, editions.datePublication, editions.downloadPath, editions.imagePath, editions.quantite,\n\tjournal.nom, journal.type, journal.categorie, subscription.until\n\tFROM editions\n\tLEFT JOIN journal ON journal.id = editions.id_journal\n    LEFT JOIN subscription ON journal.id = subscription.journal_id AND until > NOW() AND member_id = '" . (int) $member_id . "'\n\tWHERE editions.id = :editionId\n\tGROUP BY editions.datePublication\n\tORDER BY datePublication DESC\n\tLIMIT 1\n\t");
    /* le vrai SQL. l'autre est seulement le SQL de démo
    	$STH = $DBH->prepare("
    	SELECT editions.id, editions.id_journal, editions.datePublication, editions.downloadPath, editions.imagePath, editions.prix,
    	journal.nom, journal.type, journal.categorie
    	FROM editions
    	LEFT JOIN journal ON journal.id = editions.id_journal
    	WHERE editions.id_journal = :id
    	ORDER BY datePublication DESC
    	LIMIT 7
    	");
    	*/
    $STH->bindParam(":editionId", $editionId);
    $STH->execute();
    $STH->setFetchMode(PDO::FETCH_ASSOC);