1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
|
// retour
echo '<div class="right"><a href="index.php?page=note_de_frais"><img src="./images/icons/coquette/16x16/blue_arrow_down.png"/>Retour</a></div><br/>
<form name="form_newfrais" method="post" action="">
<div class="padding10">
<table class="tablesorter" width="97%">
<thead>
<tr>
<th colspan="5" class="left">Saisie des Frais</th>
</tr>
</thead>
<tr>
<td width="20%" class="gras">MOIS</td>
<td>
<select id="mois" name="mois">';
// on récupere les informations du rendez-vous ajouté
$select = 'SELECT * FROM '.$CONFIG['bdd']['notedefrais']['mois'].' ORDER BY id_mois ASC';
$BD->req($select,0,7);
while($data = $BD->obj(0))
{
echo '<option value="'.$data->id_mois.'">'.$data->nom_mois.'</option>';
}
echo '</select>
</td>
<td width="20%" class="gras">ANNEE</td>
<td>';
$date = date('Y'); //On prend l'année en cours
echo '<SELECT name="y" id="y" Size="1">';
for ($y=2007; $y<=$date; $y++) { //De l'année 2007 à l'année actuelle
echo "<OPTION><br>$y<br></OPTION>"; }
echo "</SELECT>";
echo '</td>
<td align="center">
<input type="button" class="bouton" name="validerPeriode" id="validerPeriode" value="Valider"/>
</td>
</tr>
</table>';
echo "<div id='notesfr' style='display:none;'>";
echo "<input type='text' name='variable' id='variable' value='0'>";
echo '<table class="tablesorter" width="97%">
<thead>
<tr>
<th> Salarié</th>
<th> Date </th>
<th> Dépense</th>
<th> Tx de déduc</th>
<th> TVA</th>
<th> Montant TTC</th>
<th> Montant TVA</th>
<th> Montant HT</th>
<th></th>
</tr>
</thead>';
for($i=0;$i<20;$i++)
{
echo '<tr id="ligne'.$i.'" style="display:none;">
<td>
<select name="salarie'.$i.'" id="salarie'.$i.'">';
// on récupere les informations du rendez-vous ajouté
$select = 'SELECT * FROM '.$CONFIG['bdd']['notedefrais']['salarie']." ORDER BY nom_sal, prenom_sal ASC";
$BD->req($select,1,7);
if($BD->nb(1)>0)
{
while($data = $BD->obj(1))
{
echo '<option value="'.$data->id_sal.'">'.$data->nom_sal.' '.$data->prenom_sal.'</option>';
}
}
else
{
echo "<option>pas d'employé enregistré</option>";
}
echo '</select>
</td>
<td>';
// on affiche la liste des jour correspondant au mois et à l'année en cours.
echo '<input type="text" size="2" maxlength="2" name="jour'.$i.'" id="jour'.$i.'">/<label size="2" name="aff_mois'.$i.'" id="aff_mois'.$i.'" value="" readonly="true"></label>/<label size="4" name="aff_annee'.$i.'" id="aff_annee'.$i.'" value="" readonly="true"></label>';
echo '</td>
<td>
<select name="typdepense'.$i.'" id="typdepense'.$i.'">';
// on récupere les informations du rendez-vous ajouté
$select = 'SELECT * FROM '.$CONFIG['bdd']['notedefrais']['typ_dep']." ORDER BY type_dep ASC";
$BD->req($select,2,7);
if($BD->nb(2)>0)
{
while($data = $BD->obj(2))
{
echo '<option value="'.$data->id_dep.'">'.$data->type_dep.'</option>';
}
}
else
{
echo "<option>pas de type de dépense enregistré</option>";
}
echo "</select>
</td>
<td>
<select name='tx_deduc".$i."' id='tx_deduc".$i."' onChange='calculTVA(\"montant_TVA".$i."\",\"montant_HT".$i."\",\"montant_TTC".$i."\",\"tva".$i."\",\"tx_deduc".$i."\")'>";
// on récupere les informations du rendez-vous ajouté
$select = 'SELECT * FROM '.$CONFIG['bdd']['notedefrais']['tx_reduc']." ORDER BY taux_reduc ASC";
$BD->req($select,3,7);
if($BD->nb(3)>0)
{
while($data = $BD->obj(3))
{
echo '<option value="'.$data->taux_reduc.'">'.$data->taux_reduc.'</option>';
}
}
else
{
echo "pas de tx de reduction enregistré";
}
echo "</select>
</td>
<td>
<select name='tva".$i."' id='tva".$i."' onChange='calculTVA(\"montant_TVA".$i."\",\"montant_HT".$i."\",\"montant_TTC".$i."\",\"tva".$i."\",\"tx_deduc".$i."\")'>";
// on récupere les informations du rendez-vous ajouté
$select = 'SELECT * FROM '.$CONFIG['bdd']['notedefrais']['TVA']." ORDER BY val_tva ASC";
$BD->req($select,4,7);
if($BD->nb(4)>0)
{
while($data = $BD->obj(4))
{
echo '<option value="'.$data->val_tva.'">'.$data->val_tva.'</option>';
}
}
else
{
echo "<option>pas de TVA enregistré</option<";
}
echo '</select>
</td>
<td><input type="text" name="montant_TTC'.$i.'" id="montant_TTC'.$i.'" onKeyUp="calculTVA(\'montant_TVA'.$i.'\',\'montant_HT'.$i.'\',\'montant_TTC'.$i.'\',\'tva'.$i.'\',\'tx_deduc'.$i.'\')" size="10"></td>
<td><input type="text" name="montant_TVA'.$i.'" id="montant_TVA'.$i.'" value="" size="10" readonly=\"true\"></td>
<td><input type="text" name="montant_HT'.$i.'" id="montant_HT'.$i.'" value="" size="10" readonly=\"true\"></td>';
if($i!=19)
{
echo '<td><input type="button" name="suivant'.$i.'" id="suivant'.$i.'" value="Ajouter une ligne"></td>';
}
else
{
echo "<td></td>";
}
echo'</tr>';
}
echo '</table>';
echo '<div class="center"><input type="button" class="bouton" name="validerFrais" id="validerFrais" value="Enregistrer"/></div><br /><br /><br /><br />';
echo '</div>';
echo "</form>"; |
Partager