<?php
include '../Pdo_start.inc.php';
$pdo = pdo_connexion('natels');
$sql_prepare = "SELECT `abonnement`.`IdAbonnement`, `abonnement`.`NomAbonnement`, `abonnement`.`OperateurId`, round((`abonnement`.`PrixMensuel` + `abonnement`.`CentimesMinuteFixeCh` * :fixe + `abonnement`.`CentimesMinuteMobileCh` * :mobile),2) AS 'Prix de consommation' ,`abonnement`.`DonneesMoInclus`
FROM `abonnement` WHERE `abonnement`.`DonneesMoInclus` > :mo AND `abonnement`.`OperateurId` = :OperateurId";
$pdo_prepare = $pdo->prepare($sql_prepare);
$pdo_prepare->bindValue(":OperateurId", $OperateurId);
$pdo_prepare->bindValue(":fixe", $fixe);
$pdo_prepare->bindValue(":mobile", $mobile);
$pdo_prepare->bindValue(":mo", $mo);
$pdo_prepare->execute();
$tab_prepare = $pdo_prepare->fetchAll();
$liens = "";
if (count($tab_prepare) == 0) {
$liens .= "<a href='ref41.php'>Aucun abonnement ne correspond aux critères</a>";
} else {
foreach ($tab_prepare as $row) {
$idAbo = $row['IdAbonnement'];
$liens .= "<a href='ref43.php?idAbo=$idAbo'>";
$liens .= $row['NomAbonnement'];
$liens .= " à ";
$liens .= $row['Prix de consommation'];
$liens .= " Fr/mois ";
$liens .= "</a>, ";
}
$liens = rtrim($liens, ", ");
}
?>
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form>
<h1>D'après votre consomamtion, voici les abonnements les plus favorables</h1>
<?= $liens ?>
</form>
</body>
</html>
Replies to ref42.php
Title |
Name |
Language |
UNIX |
When |
Re: ref43.php |
Tiny Rhinoceros |
php |
1604397388 |
3 Years ago. |
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}