94 lines
3.2 KiB
PHP
Executable File
94 lines
3.2 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
//
|
|
function checkProfil($idOpt, $cliOpt, $statutP, $desc, $prixProfil) {
|
|
//
|
|
$trouve=false;
|
|
global $admMsg;
|
|
$optionExist=false;
|
|
|
|
// -----------------------------------------------------
|
|
// Recup profil : plus de profil toujours 6
|
|
// -----------------------------------------------------
|
|
switch ($cliOpt) {
|
|
|
|
case 1:
|
|
case 2:
|
|
$comment='Profil gestionnaire';
|
|
$idProfil=6;
|
|
$optionExist=true;
|
|
break;
|
|
|
|
case 3:
|
|
case 4:
|
|
$comment='Profil webmaster';
|
|
$idProfil=6;
|
|
$optionExist=true;
|
|
break;
|
|
|
|
case 5:
|
|
case 6:
|
|
$comment='Profil expert';
|
|
$idProfil=6;
|
|
$optionExist=true;
|
|
break;
|
|
|
|
case 0:
|
|
case '':
|
|
default:
|
|
$comment='Pas de Profil';
|
|
$idProfil=6;
|
|
$optionExist=true;
|
|
break;
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Mise en session
|
|
// -----------------------------------------------------
|
|
$_SESSION['prixProfil']=$prixProfil;
|
|
$_SESSION['cliOpt']=$cliOpt;
|
|
$_SESSION['idProfil']=$idProfil;
|
|
$_SESSION['desc']=$desc;
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['idOpt' => $idOpt, ' cliOpt' => $cliOpt, 'statut' => $statutP, ' prixProfil' => $prixProfil, ' desc' => $desc, ' optionExist' => $optionExist], '');}
|
|
|
|
// -----------------------------------------------------
|
|
// Case a cocher
|
|
// -----------------------------------------------------
|
|
// profil expert activé => on coche id=1 et id=2, lien vers desabo
|
|
// -----------------------------------------------------
|
|
if ($cliOpt==$idOpt && $statutP=='actif') {
|
|
if ($_SESSION['isDemo']!=1) {
|
|
echo '<input type="checkbox" onClick="cancelProfil(' .$idOpt. ');" checked>';
|
|
echo '<span class="boutonsWebmaster" onClick="cancelProfil(' .$idOpt. ');" style="color:black;" >';
|
|
echo '<i class="fad fa-trash-alt" style="color:red;fill:red;cursor:pointer;" ></i>';
|
|
echo 'Désactivation</span>';
|
|
}
|
|
|
|
// on peut pas désactiver le profil si Démo
|
|
else {
|
|
echo '<input type="checkbox" onClick="cancelProfil(3);" checked disabled>';
|
|
echo '<span class="boutonsWebmaster" onClick="alert(\'Pas disponible en démo\');" style="color:grey;" >';
|
|
echo '<i class="fad fa-trash-alt" style="color:grey;fill:red;" ></i>';
|
|
echo 'Désactivation</span>';
|
|
}
|
|
$trouve=true;
|
|
}
|
|
|
|
// profil pas activé : lien vers abonnement
|
|
if ($trouve==false) {
|
|
if ($optionExist==true) {
|
|
echo '<input type="checkbox" disabled " >';
|
|
echo '<span class="boutonsWebmaster" onClick="alert(\'Veuillez désactiver votre abonnement existant.\');" >';
|
|
echo '<i class="fad fa-check" style="color:green; fill:green; cursor:pointer;" ></i>';
|
|
echo 'Activation </span>';
|
|
}
|
|
else {
|
|
echo '<input type="checkbox" onClick="window.open(\'./profils/createProfil.modale.php?desc=' .$desc. '&cliOpt=' .$idOpt. '&idProfil=' .$idProfil. '\', \'_blank\');" >';
|
|
echo '<span class="boutonsWebmaster" onClick="window.open(\'./profils/createProfil.modale.php?desc=' .$desc. '&cliOpt=' .$idOpt. '&idProfil=' .$idProfil. '\', \'_blank\');" >';
|
|
echo '<i class="fad fa-check" style="color:green; fill:green; cursor:pointer;" ></i>';
|
|
echo 'Activation </span>';
|
|
}
|
|
} //trouve
|
|
} //function
|
|
?>
|