Пример #1
0
            foreach ($values as $com => $values1) {
                foreach ($values1 as $etat => $jour) {
                    if ($etat == 2 && $debutSR == true) {
                        $tableau .= '<strong>Congés acceptés sous réserves</strong><br />';
                        $debutSR = false;
                    } elseif ($etat == 3 && $debutR == true) {
                        $tableau .= '<strong>Congés refusés</strong><br />';
                        $debutR = false;
                    }
                    $tableau .= implode(',', $jour) . ':<br />' . $com . '<br />';
                }
            }
        }
        $tableau .= '</td>';
    }
    $tableau .= '<td class="not_printed">' . bouton('Gérer', 'voir', $row_coll['COL_NO']) . '</td>';
    echo $tableau . '</tr>';
}
?>
                </table>
            </div>
        </div>
<!--        <form action="#" method="post">
            <input type="hidden" name="col_id" value="0"/>
            <input type="hidden" name="mode" value="0"/>
            <input type="hidden" name="annee" value="<?php 
echo $_POST['annee'];
?>
"/>
            <input type="hidden" name="mois" value="<?php 
echo $_POST['mois'];
                    } else {
                        echo '<td>' . bouton('V', 'valider', $row_note['NOF_NSEQUENTIEL'], 'btn-black') . ' ' . bouton('R', 'refuser', $row_note['NOF_NSEQUENTIEL'], 'btn-black') . ' ' . bouton('A', 'attente', $row_note['NOF_NSEQUENTIEL'], 'btn-primary') . '</td>';
                    }
                } else {
                    if ($row_note['NOF_ETAT'] == 'V') {
                        echo '<td>' . bouton('V', 'valider', $row_note['NOF_NSEQUENTIEL'], 'btn-success') . ' ' . bouton('R', 'refuser', $row_note['NOF_NSEQUENTIEL'], 'btn-black') . ' ' . bouton('A', 'attente', $row_note['NOF_NSEQUENTIEL'], 'btn-black') . '</td>';
                    } elseif ($row_note['NOF_ETAT'] == 'R') {
                        echo '<td>' . bouton('V', 'valider', $row_note['NOF_NSEQUENTIEL'], 'btn-black') . ' ' . bouton('M', $row_note['TYF_NO'] . 'modifier', $row_coll['COL_NO'], 'btn-black') . ' ' . bouton('R', 'refuser', $row_note['NOF_NSEQUENTIEL'], 'btn-danger') . ' ' . bouton('A', 'attente', $row_note['NOF_NSEQUENTIEL'], 'btn-black') . '</td>';
                    } else {
                        echo '<td>' . bouton('V', 'valider', $row_note['NOF_NSEQUENTIEL'], 'btn-black') . ' ' . bouton('M', $row_note['TYF_NO'] . 'modifier', $row_coll['COL_NO'], 'btn-black') . ' ' . bouton('R', 'refuser', $row_note['NOF_NSEQUENTIEL'], 'btn-black') . ' ' . bouton('A', 'attente', $row_note['NOF_NSEQUENTIEL'], 'btn-primary') . '</td>';
                    }
                }
                if ($row_note['NOF_REGLER'] == 0) {
                    echo '<td>' . bouton('Non Payée', 'nonpayee', $row_note['NOF_NSEQUENTIEL'], 'btn-danger') . '</td>';
                } else {
                    echo '<td>' . bouton('Payée', 'payee', $row_note['NOF_NSEQUENTIEL'], 'btn-success') . '</td>';
                }
                echo '</tr>';
            }
        }
    } else {
        echo '<td class="nomColl" id="' . $row_coll['COL_NO'] . '" style="width: 300px">' . $row_coll['COL_NOM'] . " " . $row_coll['COL_PRENOM'] . " </td>";
        echo '<td></td><td></td><td></td>';
        echo '</tr>';
    }
}
?>
                </table>
                <br/>
                <br/>
            </div>
$result_coll = $GLOBALS['connexion']->query($query_coll);
function bouton($texte, $classe, $valeur)
{
    return '<button style="display: none" type="button" class="btn btn-primary ' . $classe . '" value="' . $valeur . '">' . $texte . '</button>';
}
while ($row_coll = $result_coll->fetch_assoc()) {
    echo '<tr>';
    echo '<td class="nomColl" id="coll' . $row_coll['COL_NO'] . '" style="width: 300px">' . $row_coll['COL_NOM'] . " " . $row_coll['COL_PRENOM'] . " </td>";
    echo '<td style="width: 15px"><i id=chk-' . $row_coll['COL_NO'] . ' class="icon-remove"></i></td>';
    echo '<td>' . bouton('Visualiser le RAM', 'voir', $row_coll['COL_NO']) . '</td>';
    if ($_SESSION['accreditation'] < 4) {
        echo '<td>' . bouton('Valider le RAM', 'valider', $row_coll['COL_NO']) . bouton('Invalider le RAM', 'invalider', $row_coll['COL_NO']) . '</td>';
        echo '<td>' . bouton('Modifier le RAM', 'modifier', $row_coll['COL_NO']) . '</td>';
        echo '<td>' . bouton('Supprimer le RAM', 'supprimer', $row_coll['COL_NO']) . '</td>';
    }
    echo '<td>' . bouton('Imprimer le RAM', 'imprimer', $row_coll['COL_NO']) . '</td>';
    echo '</tr>';
}
$query_ram = "SELECT * FROM RAM WHERE RAM_MOIS = " . $_POST['mois'] . " AND RAM_ANNEE = " . $_POST['annee'];
echo $query_ram;
$result_ram = $GLOBALS['connexion']->query($query_ram);
$invalide = '';
$valide = '';
if (mysqli_num_rows($result_ram) >= 1) {
    $precedent = '';
    while ($row_ram = $result_ram->fetch_assoc()) {
        if ($row_ram['COL_NO'] != $precedent) {
            if ($row_ram['RAM_VALIDATION'] == 0) {
                $invalide .= $row_ram['COL_NO'] . ', ';
            } elseif ($row_ram['RAM_VALIDATION'] == 1) {
                $valide .= $row_ram['COL_NO'] . ', ';
    foreach ($listeInvisible as $ligne) {
        echo '<input class="hidden" name="' . $ensNomInvisible[$j] . '" value="' . $ligne . '"/>';
        $j++;
    }
    echo '<input class="hidden" name="ensNomVisible" value="' . $listeNomVisible . '"/>';
    echo '<input class="hidden" name="ensNomInvisible" value="' . $listeNomInvisible . '"/>';
    ?>
                    <fieldset>
                        <legend>Element(s) supplémentaire(s) à facturer</legend>
                        <table id='tableau0' border="1" class="table-bordered table-condensed" width="85%" align="center">
                            <tr>
                                <th>Désignation</th>
                                <th>Détail projet</th>
                                <th>Montant à facturer</th>
                                <th><?php 
    echo bouton('Ajouter une ligne', 'btn', 'primary', 'ajoutElement', 'ajout_element()');
    ?>
</th>
                            </tr>
                        </table>
                    </fieldset>
                    </br>
                    <div class="text-center">
                        <input class="btn btn-primary" type="submit" value="Generer et stocker une facture officiel" name="Generer"/><i class="icon-ok"></i></input>
                        <input class="btn btn-primary" type="submit" value="Generer et stocker une facture au pro-format" name="Stocker"/><i class="icon-ok"></i></input>
                    </div>
                </fieldset>
            </form>
        <?php 
}
function bouton($texte, $classe, $classeCouleur, $name, $fonction)
    echo '<td id="PROFORMA' . $ligne['COL_NO'] . '">' . $ligne['PROFORMA'] . '</td>';
    echo '<td id="FACTURE' . $ligne['COL_NO'] . '">' . $ligne['FACTURE'] . '</td>';
    echo '<td id="AVOIR' . $ligne['COL_NO'] . '">' . $ligne['AVOIR'] . '</td>';
    echo '</tr>';
}
echo '</tbody></table><br><br><br><br>';
$query_ext = "SELECT F.FAC_NO, F.FAC_DEV, F.FAC_NUM, C.COL_NOM, C.COL_PRENOM, 1 AS INT_FACTURABLE, F.FAC_NOMCLI, F.FAC_NOMPRO, F.COL_NO, F.PRO_NO\n                            FROM FACTURE F, COLLABORATEUR C, EXTERNE E \n                            WHERE E.COL_NO = C.COL_NO\n                            AND F.COL_NO = C.COL_NO\n                            AND F.FAC_MOIS = '" . $mois . "'\n                            AND F.FAC_ANNEE = '" . $annee . "'\n                            GROUP BY F.COL_NO, F.PRO_NO \n                            ORDER BY C.COL_NOM, C.COL_PRENOM";
$result_ext = $GLOBALS['connexion']->query($query_ext);
$tableau_ext = array();
while ($row_ext = $result_ext->fetch_assoc()) {
    $valeur_ext = $row_ext['COL_NO'] . '.' . $row_ext['PRO_NO'];
    $valmod = $row_ext['FAC_NUM'] != '' ? '' : bouton('Modifier', 'valider', 'modif(' . $row_ext['FAC_NO'] . ');', 'btn-primary');
    $valpro = $row_ext['FAC_NUM'] != '' ? '' : bouton2($row_ext['FAC_DEV'], 'valider', $row_ext['FAC_NO'], 'proforma', 'btn-primary');
    $valfac = '';
    if ($row_ext['FAC_NUM'] == '' && $row_ext['FAC_AVO'] == '') {
        $valfac = bouton('Facturer', 'valider', 'facturer(' . $row_ext['FAC_NO'] . ');', 'btn-primary');
    } else {
        if ($row_ext['FAC_NUM'] != '' && $row_ext['FAC_AVO'] == '') {
            $valfac = bouton2($row_ext['FAC_NUM'], 'valider', $row_ext['FAC_NO'], 'facture', 'btn-primary');
        }
    }
    $tableau_ext[] = array('COL_NO' => $valeur_ext, 'COL_NOM' => $row_ext['COL_NOM'] . ' ' . $row_ext['COL_PRENOM'], 'INT_FACTURABLE' => $row_ext['INT_FACTURABLE'] == 1 ? 'Oui' : 'Non', 'CLI_NOM' => $row_ext['FAC_NOMCLI'], 'PRO_NOM' => $row_ext['FAC_NOMPRO'], 'MODIFIER' => $valmod, 'PROFORMA' => $valpro, 'FACTURE' => $valfac);
}
//On remplace le mot "internes" par externes pour le deuxième tableau
$table = str_replace('internes', 'externes', $table);
//On change l'id
$table = str_replace('tableau1', 'tableau2', $table);
echo $table;
foreach ($tableau_ext as $ligne_ext) {
    echo '<tr id=' . $ligne_ext['COL_NO'] . '>';
    echo '<td id="COL_NOM' . $ligne_ext['COL_NO'] . '">' . $ligne_ext['COL_NOM'] . '</td>';
Пример #6
0
            }
            if ($_SESSION['config']['affiche_bouton_config_absence_pour_admin']) {
                bouton_popup(_('admin_button_config_abs_2'), 'tux_config_22x22.png', ROOT_PATH . 'config/config_type_absence.php?session=' . $session, 'configabs', 800, 600);
            }
            if ($_SESSION['config']['affiche_bouton_config_pour_admin']) {
                bouton_popup(_('admin_button_config_2'), 'tux_config_22x22.png', ROOT_PATH . 'config/configure.php?session=' . $session, 'config', 800, 600);
            }
        }
        bouton('All config', 'tux_config_22x22.png', ROOT_PATH . 'config/index.php?session=' . $session);
        break;
    case 'utilisateur':
        if ($_SESSION['config']['export_ical_vcal']) {
            bouton_popup(_('Exporter cal'), 'export-22x22.png', ROOT_PATH . 'export/export_vcalendar.php?session=' . $session . '&user_login='******'userlogin'], 'icalvcal', 457, 280);
        }
        if ($_SESSION['config']['editions_papier']) {
            bouton(_('button_editions'), 'edition-22x22.png', ROOT_PATH . 'edition/edit_user.php?session=' . $session);
        }
        break;
}
echo '</div>';
if (false) {
    if ($info == "responsable") {
        if ($_SESSION['config']['resp_affiche_calendrier']) {
            // bouton calendrier
            if ($_SESSION['config']['resp_affiche_calendrier']) {
                echo '<div style="float: right;">';
                echo "<a href=\"javascript:void(0);\" onClick=\"javascript:OpenPopUp('../calendrier.php?session={$session}','calendrier',1050,600);\">" . "<img src=\"" . TEMPLATE_PATH . "img/rebuild.png\" width=\"17\" height=\"17\" border=\"0\" title=\"" . _('button_calendar') . "\" alt=\"" . _('button_calendar') . "\">" . _('button_calendar') . "</a>\n";
                echo '</div>';
            }
            // bouton imprim calendrier
            echo '<div style="float: right;">';
     $query_abs_ext = $rq_abs_ext . ' AND COL_NO=' . $row_ext['COL_NO'] . ';';
     $result_we_ext = $GLOBALS['connexion']->query($query_we_ext);
     $row_we_ext = mysqli_fetch_assoc($result_we_ext);
     $result_abs_ext = $GLOBALS['connexion']->query($query_abs_ext);
     $row_abs_ext = mysqli_fetch_assoc($result_abs_ext);
     if ($row_we_ext['WE'] == null) {
         $row_we_ext['WE'] = 0;
     }
     if ($row_abs_ext['ABS'] == null) {
         $row_abs_ext['ABS'] = 0;
     }
     $prefacturation_ext = $row_ext['MIS_TJM'] * ($row_ext['JW'] - $row_we_ext['WE']);
     $prefacturation_ext += $nbSamedi * $row_ext['MIS_TJM'] * 1.5;
     $prefacturation_ext += ($nbDimanche + $nbFerie) * $row_ext['MIS_TJM'] * 2;
     $valeur_ext = $row_ext['COL_NO'] . '.' . $row_ext['PRO_NO'];
     $tableau_ext[] = array('COL_NO' => $valeur_ext, 'COL_NOM' => $row_ext['COL_NOM'] . ' ' . $row_ext['COL_PRENOM'] . ' &shy', 'INT_FACTURABLE' => 'Oui', 'COL_JW' => $row_ext['JW'], 'COL_ABS' => $row_abs_ext['ABS'], 'COL_WE' => $row_we_ext['WE'], 'RAM_SAMEDI' => !empty($samedi_travaille) ? implode($samedi_travaille, ',') : ' &shy', 'RAM_DIMANCHE' => !empty($dimanche_travaille) ? implode($dimanche_travaille, ',') : ' &shy', 'RAM_FERIE' => !empty($ferie_travaille) ? implode($ferie_travaille, ',') : ' &shy', 'RAM_CLIENT' => $row_ext['RAM_CLIENT'], 'PRO_NOM' => $row_ext['PRO_NOM'], 'MIS_TJM' => $row_ext['MIS_TJM'], 'PRO_PREFAC' => $row_ext['JW'] * $row_ext['MIS_TJM'], 'BOUTON' => bouton('Générer', 'valider', $valeur_ext, 'btn-primary'), 'MNEMONIC' => $row_ext['COL_MNEMONIC']);
 }
 echo $table;
 foreach ($tableau_ext as $ligne_ext) {
     echo '<tr id=' . $ligne_ext['COL_NO'] . '>';
     echo '<td id="COL_NOM' . $ligne_ext['COL_NO'] . '">' . $ligne_ext['COL_NOM'] . '</td>';
     echo '<td id="INT_FACTURABLE' . $ligne_ext['COL_NO'] . '">' . $ligne_ext['INT_FACTURABLE'] . '</td>';
     echo '<td id="COL_JW' . $ligne_ext['COL_NO'] . '">' . $ligne_ext['COL_JW'] . '</td>';
     echo '<td id="COL_ABS' . $ligne_ext['COL_NO'] . '">' . $ligne_ext['COL_ABS'] . '</td>';
     echo '<td id="COL_WE' . $ligne_ext['COL_NO'] . '">' . $ligne_ext['COL_WE'] . '</td>';
     echo '<td id="RAM_SAMEDI' . $ligne_ext['COL_NO'] . '">' . $ligne_ext['RAM_SAMEDI'] . '</td>';
     echo '<td id="RAM_DIMANCHE' . $ligne_ext['COL_NO'] . '">' . $ligne_ext['RAM_DIMANCHE'] . '</td>';
     echo '<td id="RAM_FERIE' . $ligne_ext['COL_NO'] . '">' . $ligne_ext['RAM_FERIE'] . '</td>';
     echo '<td id="RAM_CLIENT' . $ligne_ext['COL_NO'] . '">' . $ligne_ext['RAM_CLIENT'] . '</td>';
     echo '<td id="PRO_NOM' . $ligne_ext['COL_NO'] . '">' . $ligne_ext['PRO_NOM'] . '</td>';
     echo '<td id="MIS_TJM' . $ligne_ext['COL_NO'] . '">' . $ligne_ext['MIS_TJM'] . '</td>';