$temp_journal['prix'] = $row['quantite']; //$bought_id = $functionObject->getBoughtIssueMembre($member_id, $row['id']); //if($bought_id != NULL) { //$temp_journal['bought'] = 1; $temp_journal['telechargementRestant'] = $functionObject->getNbTelechargementIssueForAchat($member_id, $row['id']); //} //else { // $temp_journal['bought'] = verifProductForAbonnement($row, $abonnementArray); //} //} $json[$x] = $temp_journal; ++$x; } //print_r($json); //echo json_encode($json); $topPub = $member_id = $functionObject->getPubForSection(1); $bottomPub = $member_id = $functionObject->getPubForSection(2); if ($topPub == NULL) { $topPub = array('image' => '', 'url' => ''); } if ($bottomPub == NULL) { $bottomPub = array('image' => '', 'url' => ''); } echo json_encode(array("resultat" => "true", "data" => array('publications' => $json, 'topPub' => $topPub, 'bottomPub' => $bottomPub))); } catch (PDOException $e) { //echo $e->getMessage(); echo json_encode(array("resultat" => "false", "data" => $e->getMessage())); } // a déplacer dans un fichier de fonction function verifProductForAbonnement($productArray, $abonnementArray) {