916 lines
53 KiB
PHP
916 lines
53 KiB
PHP
<?php
|
||
global $vblnEnvironementDev, $vDomaine,$strhomeclient;
|
||
$finlink='';
|
||
|
||
if(isset($eve_id))
|
||
$finlink='&eve_id='.$eve_id;
|
||
|
||
if (!isset($strhomeclient)){
|
||
$strhomeclient='index.php';
|
||
}
|
||
|
||
|
||
|
||
if ($tabResults['menu']['men_ajout'] == 1) {
|
||
if ($tabResults['menu']['sous_men_id'] != 0)
|
||
$strLinkRetour = $strhomeclient.'?t=' . urlencode(base64_encode(fxUnescape($tabResults['menu']['men_id']))) . '&a=add&id=' . $_GET['id'].$finlink;
|
||
else
|
||
$strLinkRetour = $strhomeclient.'?t=' . urlencode(base64_encode(fxUnescape($tabResults['menu']['men_id']))) . '&a=add'.$finlink;
|
||
}
|
||
|
||
$strTableHidden = $tabSubFields = $tabSubMenu = 0;
|
||
$blnDelete = $blnDuplicate = false;
|
||
$tabSomme = array();
|
||
|
||
if (isset($_GET['a'])) {
|
||
?>
|
||
<h1 id="list_<?php echo $tabResults['menu']['men_id']; ?>"><?php if ($_GET['a'] == 'report') {
|
||
if ($strLangue == 'fr') { ?>Rapport:<?php } else { ?>Report:<?php }
|
||
} else { ?>Liste des<?php } ?> <?php echo strtolower(fxUnescape($tabResults['menu']['men_nom'])); ?></h1>
|
||
|
||
<?php } ?>
|
||
<script type="text/javascript">
|
||
$(function () {
|
||
<?php
|
||
if ($tabResults['nb_data'] > 0 && $tabResults['menu']['men_delete'] == 1) {
|
||
?>
|
||
$('#btn_delete_<?php echo $tabResults['menu']['men_id']; ?>_top, #btn_delete_<?php echo $tabResults['menu']['men_id']; ?>_bot').click(function () {
|
||
bootbox.confirm({
|
||
title: "Supprimer",
|
||
message: "Êtes-vous certain de vouloir supprimer ces items ?",
|
||
buttons: {
|
||
confirm: {
|
||
label: 'Oui',
|
||
className: 'btn btn-success rounded-0'
|
||
},
|
||
cancel: {
|
||
label: 'Non',
|
||
className: 'btn btn-danger rounded-0'
|
||
}
|
||
},
|
||
callback: function (result) {
|
||
if (result === true) {
|
||
$form = $('#frm_list_<?php echo $tabResults['menu']['men_id']; ?>');
|
||
|
||
var $postData = $form.serialize();
|
||
|
||
$.post('enregistrer.php', $postData + '&action=delete' + '&men_id=<?php echo $tabResults['menu']['men_id']; ?>' + '&ajax=1', function ($result) {
|
||
if ($result.state == 'success') {
|
||
window.location.reload(true);
|
||
} else {
|
||
bootbox.alert($result.state);
|
||
}
|
||
}, 'json');
|
||
return false;
|
||
}
|
||
}
|
||
});
|
||
});
|
||
<?php
|
||
}
|
||
|
||
if ($tabResults['menu']['mem_exc_download'] == 1) { // export excell
|
||
?>
|
||
$('#btn_excel_top, #btn_excel_bot').click(function (e) {
|
||
e.preventDefault();
|
||
bootbox.confirm({
|
||
title: "<?php if ($strLangue == 'fr') { ?>Rapport Excel<?php } else { ?>Excell report<?php } ?>",
|
||
message: "<?php if ($strLangue == 'fr') { ?>Voulez-vous télécharger la version excel ?<?php } else { ?>Do you want to download the excel version?<?php } ?>",
|
||
buttons: {
|
||
confirm: {
|
||
label: '<?php if ($strLangue == 'fr') { ?>Oui<?php } else { ?>Yes<?php } ?>',
|
||
className: 'btn btn-success rounded-0'
|
||
},
|
||
cancel: {
|
||
label: '<?php if ($strLangue == 'fr') { ?>Non<?php } else { ?>No<?php } ?>',
|
||
className: 'btn btn-danger rounded-0'
|
||
}
|
||
},
|
||
callback: function (result) {
|
||
if (result) {
|
||
$('#frm_list_<?php echo $tabResults['menu']['men_id']; ?>').append('<input type="hidden" name="download" value="excel">');
|
||
$('#frm_list_<?php echo $tabResults['menu']['men_id']; ?>').submit();
|
||
}
|
||
}
|
||
});
|
||
});
|
||
<?php
|
||
}
|
||
?>
|
||
});
|
||
</script>
|
||
<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>?<?php echo $_SERVER['QUERY_STRING']; ?>"
|
||
|
||
method="post" id="frm_list_<?php echo $tabResults['menu']['men_id']; ?>"
|
||
name="frm_list_<?php echo $tabResults['menu']['men_id']; ?>">
|
||
<input type="hidden" id="strwhere" name="strwhere" value="<?php echo $strWhere; ?>">
|
||
<input type="hidden" id="strorder" name="strorder" value="<?php echo $strOrder; ?>">
|
||
<?php
|
||
if ($tabResults['menu']['sous_men_id'] != 0 && $tabResults['menu']['men_delete'] == 1) {
|
||
$strKey = fxUpdatePK($tabResults['menu']['sous_men_id']);
|
||
?>
|
||
<input type="hidden" id="<?php echo $strKey; ?>" name="<?php echo $strKey; ?>"
|
||
value="<?php echo $_GET['id']; ?>">
|
||
<?php
|
||
}
|
||
?>
|
||
|
||
|
||
<div class="mb-3">
|
||
<?php
|
||
if ($tabResults['menu']['men_ajout'] == 1 && $vblnEnvironementDev) {
|
||
?>
|
||
<a class="btn btn-success rounded-0" href="<?php echo $strLinkRetour; ?>"><i
|
||
class="fa fa-plus-circle mr-2" aria-hidden="true"></i>Ajouter</a>
|
||
<?php
|
||
}
|
||
|
||
if ($tabResults['menu']['men_id'] == 171 && $vblnEnvironementDev==0) {
|
||
?>
|
||
<a class="btn btn-success rounded-0" href="<?php echo $strLinkRetour; ?>"><i
|
||
class="fa fa-plus-circle mr-2" aria-hidden="true"></i>Ajouter</a>
|
||
<?php
|
||
}
|
||
|
||
if ($tabResults['menu']['men_ajout'] == 1 && $vblnEnvironementDev==0 && $tabResults['menu']['men_id'] == 246) {
|
||
?>
|
||
<H3> <?php afficheTexte('rabaisajoutpasdispo') ; fx_bouton_prod_test(); ?></H3>
|
||
<?php
|
||
afficheTexte('rabaisajoutpasdispomodif');
|
||
}
|
||
if ($tabResults['menu']['men_id'] == 13 && $vblnEnvironementDev) {
|
||
$strLink = $strhomeclient.'?t=' . urlencode(base64_encode(fxUnescape($tabResults['menu']['men_id']))) . '&a=importquestion&id=' . $_GET['id'].$finlink;
|
||
|
||
?> <a class="btn btn-success rounded-0" href="<?php echo $strLink; ?>"><i class="fa fa-plus-circle mr-2"
|
||
aria-hidden="true"></i>Importer</a> <?php
|
||
}
|
||
|
||
if ($tabResults['menu']['men_id'] == 5 && $vblnEnvironementDev) {
|
||
?>
|
||
<a class="btn btn-success rounded-0" href="<?php echo $strLinkRetour; ?>&batch=1"><i
|
||
class="fa fa-plus-square mr-2" aria-hidden="true"></i>Ajouter en batch</a>
|
||
<?php
|
||
}
|
||
if ($tabResults['nb_data'] > 0 && $tabResults['menu']['men_delete'] == 1 && $vblnEnvironementDev) {
|
||
$blnDelete = true;
|
||
?>
|
||
<button type="submit" class="btn btn-danger rounded-0"
|
||
id="btn_delete_<?php echo $tabResults['menu']['men_id']; ?>_top"
|
||
name="btn_delete_<?php echo $tabResults['menu']['men_id']; ?>_top"><i
|
||
class="fa fa-minus-circle mr-2" aria-hidden="true"></i>Supprimer
|
||
</button>
|
||
<?php
|
||
}
|
||
if ($tabResults['nb_data'] > 0 && $tabResults['menu']['men_duplicate'] == 1 && $vblnEnvironementDev) {
|
||
$blnDuplicate = true;
|
||
?>
|
||
<button type="submit" class="btn btn-info rounded-0"
|
||
id="btn_duplicate_<?php echo $tabResults['menu']['men_id']; ?>_top"
|
||
name="btn_duplicate_<?php echo $tabResults['menu']['men_id']; ?>_top"><i class="fa fa-copy mr-2"
|
||
aria-hidden="true"></i>Dupliquer
|
||
</button>
|
||
<?php
|
||
}
|
||
if ($tabResults['menu']['mem_exc_download'] == 1) { // export excell
|
||
?>
|
||
<button type="submit" class="btn btn-secondary rounded-0" id="btn_excel_top" name="btn_excel_top"><img
|
||
src="<?php echo $vDomaine; ?>/superadm/images/ico_excel.png"
|
||
alt=""> <?php if ($strLangue == 'fr') { ?>Exportation excel<?php } else { ?>Export to excel<?php } ?>
|
||
</button>
|
||
<?php
|
||
}
|
||
?>
|
||
</div>
|
||
<?php
|
||
if (isset($_SESSION['msg']) && $_SESSION['msg'] != 0)
|
||
echo fxMessage($_SESSION['msg'], $strLangue);
|
||
|
||
$maxwidth = 0;
|
||
|
||
// calculer le maxwidth
|
||
for ($intCtr2 = 1; $intCtr2 <= $tabResults['nb_fields']; $intCtr2++) {
|
||
if ($tabResults['fields'][$intCtr2]['for_width'] != '' && $tabResults['fields'][$intCtr2]['for_width'] != null)
|
||
$maxwidth += $tabResults['fields'][$intCtr2]['for_width'];
|
||
}
|
||
|
||
// print_r($tabResults);
|
||
?>
|
||
<div class="<?php
|
||
|
||
if ($_GET['a'] == 'report' || $tabResults['menu']['men_id'] == 246) { ?>table-responsive<?php } ?>">
|
||
<table width="<?php if ($_GET['a'] == 'report') {
|
||
echo $maxwidth . 'px';
|
||
} else { ?>100%<?php } ?>" class="table table-striped">
|
||
|
||
|
||
|
||
<?php
|
||
if ($tabResults['nb_data'] > 0) {
|
||
?>
|
||
<thead>
|
||
<tr>
|
||
<th style="text-align: center; width: 20px;">#</th>
|
||
<th style="text-align: center; width: 20px;"> </th>
|
||
<?php
|
||
$tabQuery = $_GET;
|
||
unset($tabQuery['o']);
|
||
$strQuery = http_build_query($tabQuery, '', '&');
|
||
// boucler parmi les champs ? afficher
|
||
for ($intCtr2 = 1; $intCtr2 <= $tabResults['nb_fields']; $intCtr2++) {
|
||
?>
|
||
<th style="text-align: <?php echo $tabResults['fields'][$intCtr2]['for_align']; ?>;<?php if ($tabResults['fields'][$intCtr2]['for_yesno'] == 1) { ?> width: 50px;<?php } elseif ($tabResults['fields'][$intCtr2]['for_width'] != '' && $tabResults['fields'][$intCtr2]['for_width'] != null) { ?> width: <?php echo $tabResults['fields'][$intCtr2]['for_width']; ?>px;<?php } ?>">
|
||
<?php
|
||
if ($tabResults['fields'][$intCtr2]['for_sort']) {
|
||
?>
|
||
<a href="?<?php echo $strQuery; ?>&o=<?php echo fxUnescape($tabResults['fields'][$intCtr2]['for_field']); ?>"><?php echo fxUnescape($tabResults['fields'][$intCtr2]['lab_texte_list']); ?></a>
|
||
<?php
|
||
} else
|
||
echo fxUnescape($tabResults['fields'][$intCtr2]['lab_texte_list']);
|
||
?>
|
||
</th>
|
||
<?php
|
||
}
|
||
if ($tabResults['menu']['men_id'] == 2 || $tabResults['menu']['men_id'] == 3) { // LOGIN
|
||
?>
|
||
<th style="text-align: left;">
|
||
login
|
||
</th>
|
||
<th></th>
|
||
<?php
|
||
}
|
||
|
||
// a faire coriger evec une switch
|
||
if ($tabResults['menu']['men_id'] != 251 && $tabResults['menu']['men_id'] != 30 && $tabResults['menu']['men_id'] != 2 && $tabResults['menu']['men_id'] != 3 && $tabResults['menu']['men_rapport'] == 0) { // BOUTON UPDATE PROD
|
||
?>
|
||
<th style="text-align: left;">
|
||
DEL
|
||
</th>
|
||
<?php
|
||
}
|
||
if ($tabResults['menu']['men_id'] == 5 || $tabResults['menu']['men_id'] == 12 || $tabResults['menu']['men_id'] == 4) { // BOUTON UPDATE PANIER
|
||
?>
|
||
<th style="text-align: left;">
|
||
Panier
|
||
</th>
|
||
<?php
|
||
}
|
||
|
||
|
||
if ($tabResults['menu']['men_id'] != 251 && $tabResults['menu']['men_id'] != 30 && $tabResults['menu']['men_id'] != 2 && $tabResults['menu']['men_id'] != 3 && $tabResults['menu']['men_rapport'] == 0) { // BOUTON UPDATE PROD
|
||
|
||
?>
|
||
|
||
<th style="text-align: left;">
|
||
PROD
|
||
</th>
|
||
<?php
|
||
}
|
||
|
||
|
||
if ($tabResults['menu']['men_id'] == 30) {
|
||
?>
|
||
<th style="text-align: left;">
|
||
import
|
||
</th>
|
||
<th style="text-align: left;">
|
||
produit copier
|
||
</th>
|
||
<?php
|
||
}
|
||
?>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<?php
|
||
// effacer les ligne en double
|
||
$mem_max_ligne = $mem_sup = 1;
|
||
$mem_avant = "";
|
||
$mem_skip = 0;
|
||
|
||
// boucler parmi les items
|
||
for ($intCtr = 1; $intCtr <= $tabResults['nb_data']; $intCtr++) {
|
||
// trouve le premier d'une série
|
||
if (trim($tabResults["menu"]["mem_ligne_double1"]) != '') {
|
||
if ($mem_avant != $tabResults['data'][$intCtr][$tabResults["menu"]["mem_ligne_double1"]]) {
|
||
$mem_avant = $tabResults['data'][$intCtr][$tabResults["menu"]["mem_ligne_double1"]];
|
||
$mem_skip = 0;
|
||
$mem_groupe1 = $mem_max_ligne = 1;
|
||
|
||
|
||
for ($intgroupe = 1; $intgroupe <= 5; $intgroupe++) {
|
||
$memgroupe = "groupe_" . $intgroupe;
|
||
$mem_count_groupe[$intgroupe] = 0;
|
||
|
||
if (isset($tabResults[$memgroupe]['data'][$mem_avant])) {
|
||
$mem_countmax_groupe[$intgroupe] = count($tabResults[$memgroupe]['data'][$mem_avant]);
|
||
$mem_count_groupe[$intgroupe] = 1;
|
||
} else
|
||
$mem_countmax_groupe[$intgroupe] = 0;
|
||
|
||
if ($mem_countmax_groupe[$intgroupe] > $mem_max_ligne)
|
||
$mem_max_ligne = $mem_countmax_groupe[$intgroupe];
|
||
}
|
||
} else
|
||
$mem_skip = 1;
|
||
}
|
||
|
||
for ($mem_sup = 1; $mem_sup <= $mem_max_ligne; $mem_sup++) {
|
||
if ($mem_skip == 0 && $mem_avant != "") {
|
||
?>
|
||
<tr style="background-color: #0c5460;color: white; ">
|
||
<td colspan="3"> <?php echo($mem_avant); ?> </td>
|
||
</tr>
|
||
|
||
<?php } ?>
|
||
<tr <?php if ($intCtr % 2) { ?>class="odd"<?php } ?>>
|
||
<td style="text-align: center;"><?php echo $intCtr + $tabResults['intStart']; ?></td>
|
||
<td style="text-align: center;">
|
||
<?php
|
||
if ($blnDelete || $blnDuplicate) {
|
||
?>
|
||
<div class="form-check">
|
||
<input class="form-check-input position-static" type="checkbox"
|
||
name="chk_<?php echo fxUnescape($tabResults['menu']['men_id']); ?>[]"
|
||
value="<?php echo $tabResults['data'][$intCtr][$tabResults['key']]; ?>"
|
||
aria-label="...">
|
||
</div>
|
||
<?php
|
||
} else {
|
||
?>
|
||
|
||
<?php
|
||
}
|
||
?>
|
||
</td>
|
||
|
||
<?php
|
||
// boucler parmi les champs à afficher
|
||
|
||
for ($intCtr2 = 1; $intCtr2 <= $tabResults['nb_fields']; $intCtr2++) {
|
||
?>
|
||
<td style="text-align: <?php echo $tabResults['fields'][$intCtr2]['for_align']; ?>;">
|
||
<?php
|
||
$mem_result = '';
|
||
$mem_champaffiche = 1;
|
||
|
||
// mettre la valeur dans une variable pour faire la gestion des groupe
|
||
$groupecourant = $tabResults['fields'][$intCtr2]['for_groupe'];
|
||
|
||
if ($groupecourant != 0) {
|
||
// $mem_champaffiche = 0;
|
||
$memgroupe = "groupe_" . $groupecourant;
|
||
|
||
if (isset($tabResults[$memgroupe]['data'][$mem_avant][$mem_sup][$tabResults['fields'][$intCtr2]['for_field']]))
|
||
$mem_result = $tabResults[$memgroupe]['data'][$mem_avant][$mem_sup][$tabResults['fields'][$intCtr2]['for_field']];
|
||
else
|
||
$mem_champaffiche = 0;
|
||
} else {
|
||
if ($mem_sup > 1 && $tabResults['fields'][$intCtr2]['for_double'] != 1)
|
||
$mem_champaffiche = 0;
|
||
|
||
if (isset($tabResults['data'][$intCtr][$tabResults['fields'][$intCtr2]['for_field']])) {
|
||
$mem_result = $tabResults['data'][$intCtr][$tabResults['fields'][$intCtr2]['for_field']];
|
||
}
|
||
}
|
||
|
||
if ($mem_champaffiche == 1) {
|
||
if ($tabResults['fields'][$intCtr2]['for_link'] == 1) {
|
||
$strTarget = '';
|
||
|
||
if ($tabResults['fields'][$intCtr2]['for_url_type'] === 1) {
|
||
$strTarget = ' target="_blank"';
|
||
}
|
||
|
||
if ($tabResults['fields'][$intCtr2]['for_link_url'] != '') {
|
||
?>
|
||
<a href="<?php echo str_replace('%id%', $tabResults['data'][$intCtr][$tabResults['key']], $tabResults['fields'][$intCtr2]['for_link_url']); ?>"
|
||
target="_blank">
|
||
<?php
|
||
|
||
} else {
|
||
|
||
?>
|
||
<a href="<?php echo $strhomeclient?>?t=<?php echo urlencode(fxUnescape(base64_encode($tabResults['menu']['men_id']))); ?>&a=mod&id=<?php echo $tabResults['data'][$intCtr][$tabResults['key']].$finlink; ?>">
|
||
<?php
|
||
}
|
||
}
|
||
if (isset($tabResults['data'][$intCtr][$tabResults['key']])) {
|
||
$mem_span = $tabResults['fields'][$intCtr2]['for_field'] . '_' . $tabResults['data'][$intCtr][$tabResults['key']];
|
||
} else {
|
||
$mem_span = "";
|
||
}
|
||
echo '<span id="' . $mem_span . '">';
|
||
|
||
|
||
if ($tabResults['fields'][$intCtr2]['for_list_edit'] == 1) {
|
||
echo(fxGetQuestionLabelselect($mem_result, $tabResults['data'][$intCtr][$tabResults['key']]));
|
||
?>
|
||
<!-- Champ de saisie personnalisé -->
|
||
<input
|
||
type="text"
|
||
id="custom-input-<?= $tabResults['data'][$intCtr][$tabResults['key']] ?>"
|
||
style="display: none;"
|
||
placeholder="Saisir un statut"
|
||
onkeyup="saveCustomInput(<?= $tabResults['data'][$intCtr][$tabResults['key']] ?>, this)"
|
||
/><?php
|
||
|
||
} elseif ($tabResults['fields'][$intCtr2]['for_yesno'] == 1) {
|
||
if ($mem_result == 1) {
|
||
$strChecked = ' checked';
|
||
$intValeur = 0;
|
||
$strClass = 'btn-success';
|
||
$strImage = '<i class="fa fa-check" aria-hidden="true"></i>';
|
||
} else {
|
||
$strChecked = "";
|
||
$intValeur = 1;
|
||
$strClass = 'btn-danger';
|
||
$strImage = '<i class="fa fa-times" aria-hidden="true"></i>';
|
||
}
|
||
|
||
// PATCH TEMPO MSIN-633 - Afficher le lien seulement si le client concern<72> est logg<67>
|
||
// mec cadeaux
|
||
if (base64_decode(urldecode($intMenu)) == 162) {
|
||
if (isset($_SESSION['com_info']['com_login'])) {
|
||
if ($_SESSION['com_info']['com_login'] == 'mecquebec' && $tabResults['fields'][$intCtr2]['for_field'] == 'pnq_cadeau1')
|
||
$blnLink = true;
|
||
elseif ($_SESSION['com_info']['com_login'] == 'mecmarchecentral' && $tabResults['fields'][$intCtr2]['for_field'] == 'pnq_cadeau2')
|
||
$blnLink = true;
|
||
elseif ($_SESSION['com_info']['com_login'] == 'meclongueuil' && $tabResults['fields'][$intCtr2]['for_field'] == 'pnq_cadeau3')
|
||
$blnLink = true;
|
||
elseif ($_SESSION['com_info']['com_login'] == 'mecstdenis' && $tabResults['fields'][$intCtr2]['for_field'] == 'pnq_cadeau4')
|
||
$blnLink = true;
|
||
elseif ($_SESSION['com_info']['com_login'] == 'meclaval' && $tabResults['fields'][$intCtr2]['for_field'] == 'pnq_cadeau5')
|
||
$blnLink = true;
|
||
else
|
||
$blnLink = false;
|
||
} else
|
||
$blnLink = false;
|
||
} else
|
||
$blnLink = true;
|
||
// mec cadeaux
|
||
// PATCH TEMPO MSIN-633 - Afficher le lien seulement si le client concern<72> est logg<67>
|
||
if (base64_decode(urldecode($intMenu)) == 182) {
|
||
if (isset($_SESSION['com_info']['com_login'])) {
|
||
if ($_SESSION['com_info']['com_login'] == 'mecquebec' && $tabResults['fields'][$intCtr2]['for_field'] == 'pnq_cadeau1')
|
||
$blnLink = true;
|
||
elseif ($_SESSION['com_info']['com_login'] == 'mecmarchecentral' && $tabResults['fields'][$intCtr2]['for_field'] == 'pnq_cadeau2')
|
||
$blnLink = true;
|
||
elseif ($_SESSION['com_info']['com_login'] == 'meclongueuil' && $tabResults['fields'][$intCtr2]['for_field'] == 'pnq_cadeau3')
|
||
$blnLink = true;
|
||
elseif ($_SESSION['com_info']['com_login'] == 'MECottawa@mec.ca' && $tabResults['fields'][$intCtr2]['for_field'] == 'pnq_cadeau4')
|
||
$blnLink = true;
|
||
elseif ($_SESSION['com_info']['com_login'] == 'meclaval' && $tabResults['fields'][$intCtr2]['for_field'] == 'pnq_cadeau5')
|
||
$blnLink = true;
|
||
else
|
||
$blnLink = false;
|
||
} else
|
||
$blnLink = false;
|
||
} else
|
||
$blnLink = true;
|
||
if (isset($_SESSION['com_info']['com_cadeau'])) {
|
||
if (trim($_SESSION['com_info']['com_cadeau']) <> "") {
|
||
if (strstr($_SESSION['com_info']['com_cadeau'], $tabResults['fields'][$intCtr2]['for_field']) != null) {
|
||
$blnLink = true;
|
||
} else {
|
||
$blnLink = false;
|
||
}
|
||
}
|
||
}
|
||
if ($blnLink === true) {
|
||
?>
|
||
<a class="btn btn-sm rounded-0 <?php echo $strClass; ?> btn_activation"
|
||
href="#" data-action="actif"
|
||
data-table="<?php echo urlencode(base64_encode(fxUnescape($tabResults['menu']['men_id']))); ?>"
|
||
data-field="<?php echo $tabResults['fields'][$intCtr2]['for_field']; ?>"
|
||
data-key="<?php echo $tabResults['key']; ?>"
|
||
data-valeur="<?php echo $intValeur; ?>"
|
||
data-id="<?php echo $tabResults['data'][$intCtr][$tabResults['key']]; ?>"><?php echo $strImage; ?></a>
|
||
<?php
|
||
} else {
|
||
echo $strImage;
|
||
}
|
||
} elseif ($tabResults['fields'][$intCtr2]['for_datetime'] == 1) {
|
||
if (trim($mem_result) != '' && $mem_result != '0000-00-00 00:00:00') {
|
||
echo fxShowDate($mem_result, $strLangue) . ' @ ' . fxShowTime($mem_result);
|
||
} else {
|
||
echo '-';
|
||
}
|
||
} elseif ($tabResults['fields'][$intCtr2]['for_date'] == 1) {
|
||
if (trim($mem_result) != '' && $mem_result != '0000-00-00') {
|
||
echo fxShowDate($mem_result, $strLangue);
|
||
} else {
|
||
echo '-';
|
||
}
|
||
} elseif ($tabResults['fields'][$intCtr2]['for_money'] == 1)
|
||
echo fxShowMoney($mem_result, $strLangue);
|
||
elseif ($tabResults['fields'][$intCtr2]['for_type'] == 'file') {
|
||
if ($tabResults['fields'][$intCtr2]['for_validation'] == 'image') {
|
||
$tabPath = $GLOBALS[fxUnescape($tabResults['fields'][$intCtr2]['for_file_path'])];
|
||
|
||
if ($tabResults['fields'][$intCtr2]['for_image_thumb'] == 1)
|
||
$strImage = fxUnescape($tabResults['data'][$intCtr][$tabResults['fields'][$intCtr2]['for_field'] . '_small']);
|
||
else
|
||
$strImage = $mem_result;
|
||
?>
|
||
<img src="<?php echo $tabPath['physical'] . fxUnescape($strImage); ?>"
|
||
alt="" height="80">
|
||
<?php
|
||
} else
|
||
echo $mem_result;
|
||
} else {
|
||
if ($tabResults['fields'][$intCtr2]['for_field'] == 'rab_key' && trim($tabResults['data'][$intCtr][$tabResults['fields'][$intCtr2]['for_field']]) != '') {
|
||
echo '<a href="' . $GLOBALS['vDomaine'] . '/maj_rabais.php?batch=' . $tabResults['data'][$intCtr][$tabResults['fields'][$intCtr2]['for_field']] . '" target="_blank">VOIR</a>';
|
||
} else {
|
||
if($tabResults['fields'][$intCtr2]['for_list_edit'] == 2){
|
||
|
||
?>
|
||
<input type="text"
|
||
class="form-control rounded-0 js-commit-on-enter"
|
||
id="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
||
name="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
||
value="<?php echo $mem_result; ?>"
|
||
data-action="actif"
|
||
data-table="<?php echo urlencode(base64_encode(fxUnescape($tabResults['menu']['men_id']))); ?>"
|
||
data-field="<?php echo $tabResults['fields'][$intCtr2]['for_field']; ?>"
|
||
data-key="<?php echo $tabResults['key']; ?>"
|
||
data-id="<?php echo $tabResults['data'][$intCtr][$tabResults['key']]; ?>"
|
||
<?php if (trim($tabResults['fields'][$intCtr]['for_maxlength']) > 0) { ?>
|
||
maxlength="<?php echo $tabResults['fields'][$intCtr]['for_maxlength']; ?>"
|
||
<?php } ?> >
|
||
|
||
<?php
|
||
|
||
}else{
|
||
echo $mem_result;
|
||
|
||
};
|
||
|
||
|
||
|
||
|
||
|
||
|
||
}
|
||
}
|
||
|
||
if ($tabResults['fields'][$intCtr2]['for_link'] == 1) {
|
||
?>
|
||
</a>
|
||
<?php
|
||
}
|
||
|
||
// calculer les + des colonnes
|
||
if ($tabResults['fields'][$intCtr2]['for_somme'] == 1) {
|
||
if (!array_key_exists($tabResults['fields'][$intCtr2]['for_field'], $tabSomme))
|
||
$tabSomme[$tabResults['fields'][$intCtr2]['for_field']] = 0;
|
||
|
||
$tabSomme[$tabResults['fields'][$intCtr2]['for_field']] += $mem_result;
|
||
}
|
||
}
|
||
|
||
echo '</span>';
|
||
?>
|
||
</td>
|
||
<?php
|
||
}
|
||
}
|
||
if ($tabResults['menu']['men_id'] == 2 || $tabResults['menu']['men_id'] == 3) { // LOGIN
|
||
?>
|
||
<td style="text-align: left;">
|
||
<button class="btn_login_as btn btn-sm btn-secondary rounded-0"
|
||
data-id="<?php echo $tabResults['data'][$intCtr][$tabResults['key']]; ?>"
|
||
data-usager="<?php echo $tabResults['data'][$intCtr]['nom_complet']; ?>"
|
||
type="button">LOGIN
|
||
</button>
|
||
</td>
|
||
<td style="text-align: left;">
|
||
<?php
|
||
if (trim($tabResults['data'][$intCtr]['com_reset_token']) != '') {
|
||
if (trim($tabResults['data'][$intCtr]['com_langue']) == '') {
|
||
$strPage = 'compte';
|
||
} else {
|
||
$strPage = 'account';
|
||
}
|
||
?>
|
||
<a class="btn btn-sm btn-secondary rounded-0"
|
||
href="<?php echo $vDomaine . '/' . $strPage . '/reset?t=' . $tabResults['data'][$intCtr]['com_reset_token'] . '&m=' . $tabResults['data'][$intCtr]['com_courriel'] . '&id=' . $tabResults['data'][$intCtr]['com_id']; ?>"
|
||
target="_blank">RESET PASSWORD</a>
|
||
<?php
|
||
}
|
||
?>
|
||
</td>
|
||
<?php
|
||
}
|
||
|
||
|
||
|
||
?>
|
||
|
||
<?php
|
||
|
||
$liste_ids = [13, 147, 5]; // ta liste de numéros
|
||
if (in_array($tabResults['menu']['men_id'], $liste_ids)) {
|
||
$strKey = $tabResults['menu']['men_pk'];
|
||
$arrProd = fxGetStatutProd($tabResults['menu']['men_table'], $strKey, $tabResults['data'][$intCtr][$tabResults['key']]);
|
||
if($arrProd['statut']!='existant') {
|
||
|
||
|
||
|
||
?>
|
||
<td>
|
||
<a class="fa fa-times-circle-o fa-2x btn_activation" style="color: #e74c3c; "
|
||
href="#" data-action="delete2"
|
||
data-table="<?php echo urlencode(base64_encode(fxUnescape($tabResults['menu']['men_id']))); ?>"
|
||
data-field="<?php echo $tabResults['fields'][$intCtr2]['for_field']; ?>"
|
||
data-key="<?php echo $tabResults['key']; ?>"
|
||
data-valeur="<?php echo $intValeur; ?>"
|
||
data-id="<?php echo $tabResults['data'][$intCtr][$tabResults['key']]; ?>"></a>
|
||
</td>
|
||
<?php }}?>
|
||
|
||
<?php
|
||
|
||
if ($tabResults['menu']['men_id'] == 5 || $tabResults['menu']['men_id'] == 12 || $tabResults['menu']['men_id'] == 4) { // BOUTON UPDATE PANIER
|
||
?>
|
||
<td class="text-center">
|
||
|
||
<?php
|
||
|
||
$arrPanier = fxGetStatutPanier($tabResults['menu']['men_table'], $tabResults['data'][$intCtr][$tabResults['key']]);
|
||
|
||
switch ($arrPanier['statut']) {
|
||
case 'non-existant':
|
||
case 'pareil':
|
||
if ($arrPanier['statut'] == 'pareil') {
|
||
$strTooltip = 'Pareil';
|
||
|
||
if (trim($arrPanier['date']) != '' && $arrPanier['date'] != '0000-00-00 00:00:00') {
|
||
$strTooltip .= ' - Modifié le ' . fxShowDate($arrPanier['date'], 'fr') . ' @ ' . fxShowTime($arrPanier['date']) . ' par ' . $arrPanier['qui'];
|
||
} else {
|
||
$strTooltip .= ' - Jamais mis à jour';
|
||
}
|
||
?>
|
||
<div class="panier-update text-success">
|
||
<i class="fa fa-check-circle-o fa-2x" aria-hidden="true"
|
||
data-toggle="tooltip" title="<?php echo $strTooltip; ?>"></i>
|
||
</div>
|
||
<?php
|
||
} else {
|
||
$strTooltip = 'Non-existant';
|
||
?>
|
||
<div class="panier-update text-warning">
|
||
<i class="fa fa-times-circle-o fa-2x" aria-hidden="true"
|
||
data-toggle="tooltip" title="<?php echo $strTooltip; ?>"></i>
|
||
</div>
|
||
<?php
|
||
}
|
||
break;
|
||
case 'different':
|
||
$strTooltip = 'Différent';
|
||
|
||
if (trim($arrPanier['date']) != '' && $arrPanier['date'] != '0000-00-00 00:00:00') {
|
||
$strTooltip .= ' - Modifié le ' . fxShowDate($arrPanier['date'], 'fr') . ' @ ' . fxShowTime($arrPanier['date']) . ' par ' . $arrPanier['qui'];
|
||
} else {
|
||
$strTooltip .= ' - Jamais mis à jour';
|
||
}
|
||
?>
|
||
<button class="btn_update_panier btn btn-sm btn-secondary rounded-0 mb-2"
|
||
data-id="<?php echo $tabResults['data'][$intCtr][$tabResults['key']]; ?>"
|
||
data-table="<?php echo $tabResults['menu']['men_table']; ?>"
|
||
type="button" data-toggle="tooltip" title="Mettre à jour">
|
||
<i class="fa fa-refresh" aria-hidden="true"></i>
|
||
</button>
|
||
<div class="panier-update text-danger"
|
||
id="details_panier_<?php echo $tabResults['data'][$intCtr][$tabResults['key']]; ?>">
|
||
<i class="fa fa-exclamation-triangle fa-2x" aria-hidden="true"
|
||
data-toggle="tooltip" title="<?php echo $strTooltip; ?>"></i>
|
||
</div>
|
||
<?php
|
||
break;
|
||
}
|
||
?>
|
||
</td>
|
||
|
||
|
||
<?php
|
||
}
|
||
if ($tabResults['menu']['men_id'] == 30) {
|
||
|
||
?>
|
||
<td class="text-center"><input type="checkbox" name="choix[]"
|
||
value="<?php echo $tabResults['data'][$intCtr]['que_id'] ?>">
|
||
</td>
|
||
<td class="text-center">
|
||
<?php if($tabResults['data'][$intCtr]['que_choix_produit']!=''){ ?>
|
||
|
||
<input type="checkbox" name="choix_produits[]"
|
||
value="<?php echo $tabResults['data'][$intCtr]['que_id'] ?>">
|
||
<?php }?>
|
||
</td>
|
||
|
||
<?php }
|
||
// a faire coriger evec une switch
|
||
if ($tabResults['menu']['men_id'] != 171 && $tabResults['menu']['men_id'] != 251 && $tabResults['menu']['men_id'] != 30 && $tabResults['menu']['men_id'] != 2 && $tabResults['menu']['men_id'] != 3 && $tabResults['menu']['men_rapport'] == 0) { // BOUTON UPDATE PROD
|
||
?>
|
||
<td class="text-center">
|
||
<?php
|
||
$strKey = $tabResults['menu']['men_pk'];
|
||
$arrProd = fxGetStatutProd($tabResults['menu']['men_table'], $strKey, $tabResults['data'][$intCtr][$tabResults['key']]);
|
||
|
||
// pour simuler une mise en prod
|
||
// $arrProd['statut']='non-existant';
|
||
switch ($arrProd['statut']) {
|
||
case 'existant':
|
||
$strTooltip = 'Déjà en PROD';
|
||
|
||
if (trim($arrProd['date']) != '' && $arrProd['date'] != '0000-00-00 00:00:00') {
|
||
$strTooltip .= ' - Mis en PROD le ' . fxShowDate($arrProd['date'], 'fr') . ' @ ' . fxShowTime($arrProd['date']) . ' par ' . $arrProd['qui'];
|
||
} else {
|
||
$strTooltip .= ' - Mis en PROD manuellement';
|
||
}
|
||
?>
|
||
<div class="panier-update text-success">
|
||
<i class="fa fa-check-circle-o fa-2x" aria-hidden="true"
|
||
data-toggle="tooltip" title="<?php echo $strTooltip; ?>"></i>
|
||
</div>
|
||
<?php
|
||
break;
|
||
case 'non-existant':
|
||
$strTooltip = 'Non en PROD';
|
||
?>
|
||
<button class="btn_update_prod btn btn-sm btn-secondary rounded-0 mb-2"
|
||
data-id="<?php echo $tabResults['data'][$intCtr][$tabResults['key']]; ?>"
|
||
data-key="<?php echo $tabResults['key']; ?>"
|
||
data-table="<?php echo $tabResults['menu']['men_table']; ?>"
|
||
type="button" data-toggle="tooltip" title="Pousser en PROD">
|
||
<i class="fa fa-upload" aria-hidden="true"></i>
|
||
</button>
|
||
<div class="panier-update text-danger"
|
||
id="details_panier_<?php echo $tabResults['data'][$intCtr][$tabResults['key']]; ?>">
|
||
<i class="fa fa-exclamation-triangle fa-2x" aria-hidden="true"
|
||
data-toggle="tooltip" title="<?php echo $strTooltip; ?>"></i>
|
||
</div>
|
||
<?php
|
||
break;
|
||
}
|
||
?>
|
||
</td>
|
||
<?php
|
||
}
|
||
?>
|
||
</tr>
|
||
<?php
|
||
}
|
||
?>
|
||
</tbody>
|
||
<tfoot>
|
||
<?php
|
||
if (count($tabSomme) > 0) {
|
||
?>
|
||
<tr>
|
||
<th style="text-align: center;"> </th>
|
||
<th style="text-align: center;"> </th>
|
||
<?php
|
||
// boucler parmi les champs ? afficher
|
||
for ($intCtr2 = 1; $intCtr2 <= $tabResults['nb_fields']; $intCtr2++) {
|
||
?>
|
||
<th style="text-align: <?php echo $tabResults['fields'][$intCtr2]['for_align']; ?>;">
|
||
<?php
|
||
if (array_key_exists($tabResults['fields'][$intCtr2]['for_field'], $tabSomme)) {
|
||
if ($tabResults['fields'][$intCtr2]['for_money'] == 1)
|
||
echo fxShowMoney($tabSomme[$tabResults['fields'][$intCtr2]['for_field']], $strLangue);
|
||
else
|
||
echo $tabSomme[$tabResults['fields'][$intCtr2]['for_field']];
|
||
} else
|
||
echo ' ';
|
||
?>
|
||
</th>
|
||
<?php
|
||
}
|
||
?>
|
||
</tr>
|
||
<?php
|
||
}
|
||
?>
|
||
<tr>
|
||
<th style="text-align: center;"
|
||
colspan="<?php echo $intCtr2 + 3; ?>"><?php echo $tabResults['nb_data']; ?>
|
||
/ <?php echo $tabResults['total']; ?>
|
||
item<?php if ($tabResults['total'] > 1) { ?>s<?php } ?></th>
|
||
</tr>
|
||
</tfoot>
|
||
<?php
|
||
} else {
|
||
?>
|
||
<tr>
|
||
<th> </th>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align: center;">
|
||
<p><span></span></p>
|
||
<p>
|
||
<strong><?php if ($strLangue == 'fr') { ?>Il n'y a aucun résultat.<?php } else { ?>There is no result.<?php } ?></strong>
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<?php
|
||
}
|
||
?>
|
||
</table>
|
||
</div>
|
||
<div class="mt-3">
|
||
<?php
|
||
if ($tabResults['menu']['men_ajout'] == 1 && $vblnEnvironementDev) {
|
||
?>
|
||
<a class="btn btn-success rounded-0" href="<?php echo $strLinkRetour; ?>"><i
|
||
class="fa fa-plus-circle mr-2" aria-hidden="true"></i>Ajouter</a>
|
||
<?php
|
||
}
|
||
if ($tabResults['menu']['men_id'] == 171 && $vblnEnvironementDev==0) {
|
||
?>
|
||
<a class="btn btn-success rounded-0" href="<?php echo $strLinkRetour; ?>"><i
|
||
class="fa fa-plus-circle mr-2" aria-hidden="true"></i>Ajouter</a>
|
||
<?php
|
||
}
|
||
|
||
|
||
if ($tabResults['nb_data'] > 0 && $tabResults['menu']['men_delete'] == 1 && $vblnEnvironementDev) {
|
||
?>
|
||
<button type="submit" class="btn btn-danger rounded-0"
|
||
id="btn_delete_<?php echo $tabResults['menu']['men_id']; ?>_bot"
|
||
name="btn_delete_<?php echo $tabResults['menu']['men_id']; ?>_bot"><i
|
||
class="fa fa-minus-circle mr-2" aria-hidden="true"></i>Supprimer
|
||
</button>
|
||
<?php
|
||
}
|
||
if ($tabResults['nb_data'] > 0 && $tabResults['menu']['men_duplicate'] == 1 && $vblnEnvironementDev) {
|
||
?>
|
||
<button type="submit" class="btn btn-info rounded-0"
|
||
id="btn_duplicate_<?php echo $tabResults['menu']['men_id']; ?>_bot"
|
||
name="btn_duplicate_<?php echo $tabResults['menu']['men_id']; ?>_bot"><i class="fa fa-copy mr-2"
|
||
aria-hidden="true"></i>Duplicate
|
||
</button>
|
||
<?php
|
||
}
|
||
if ($tabResults['menu']['mem_exc_download'] == 1) { // export excell
|
||
?>
|
||
<button type="submit" class="btn btn-secondary rounded-0" id="btn_excel_bot" name="btn_excel_bot"><img
|
||
src="<?php echo $vDomaine; ?>/superadm/images/ico_excel.png"
|
||
alt=""> <?php if ($strLangue == 'fr') { ?>Exportation excel<?php } else { ?>Export to excel<?php } ?>
|
||
</button>
|
||
<?php
|
||
}
|
||
?>
|
||
</div>
|
||
</form>
|
||
<script>
|
||
function toggleInput(id, selectElement) {
|
||
const customInput = document.getElementById(`custom-input-${id}`);
|
||
if (selectElement.value != 'vide') {
|
||
if (selectElement.value === 'custom') {
|
||
customInput.style.display = 'inline';
|
||
customInput.focus();
|
||
} else {
|
||
customInput.style.display = 'none';
|
||
updateStatus(id, selectElement.value); // Mise à jour avec la valeur sélectionnée
|
||
}
|
||
}
|
||
}
|
||
|
||
function updateStatus(id, value) {
|
||
const $postData = {
|
||
action: 'banquequestion',
|
||
id: id,
|
||
valeur: value,
|
||
ajax: 1
|
||
};
|
||
|
||
$.post('<?php echo $vDomaine; ?>/superadm/enregistrer.php', $postData, function ($result) {
|
||
|
||
}, 'json').fail(function (xhr, status, error) {
|
||
console.error("Erreur AJAX :", error);
|
||
|
||
});
|
||
|
||
return false;
|
||
}
|
||
|
||
|
||
function saveCustomInput(id, inputElement) {
|
||
const value = inputElement.value;
|
||
updateStatus(id, value); // Mettre à jour avec la valeur personnalisée
|
||
const selectElement = document.getElementById(`select-${id}`);
|
||
selectElement.value = 'custom';
|
||
}
|
||
</script>
|
||
<?php
|
||
|
||
if ($tabResults['nb_data'] > 0) {
|
||
// afficher pagination
|
||
$tabQuery = $_GET;
|
||
unset($tabQuery['pg']);
|
||
$strQuery = http_build_query($tabQuery, '', '&');
|
||
|
||
echo fxShowPaging($strhomeclient.'?' . $strQuery, $tabResults['total'], $tabResults['nb_page'], $intPage);
|
||
}
|