|
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/TEST/www/../../MC/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include_once 'code/init.php';
print_header ( array(), '', 'style="margin:5px 10px 5px 10px; padding:5px 10px 5px 10px; border:solid 1px #778;"' );
// print_r($_GET);
?>
<script type="text/javascript">
function action(inter,client_id,checked){
if(inter > 0);
window.location = "depl.php?iddepl="+inter+"&client_id="+client_id+"&checked="+checked;
}
</script>
<?php
$client_id = @(int)$_GET['client_id'] ;
if(isset($_GET['iddepl'])) {
$iddepl = @(int)$_GET['iddepl'] ;
if($_GET['checked'])
dbi_query("UPDATE remplacement SET pas_remplacement='0' WHERE client_id=$client_id AND inter_id=$iddepl AND agence_id=$agence");
else
dbi_query("INSERT INTO remplacement ( client_id ,inter_id ,pas_remplacement,agence_id ) VALUES ( $client_id , $iddepl, '1' , $agence)");
}
$remplacement=array();
$client_id = @(int)$_GET['client_id'] ;
$rempl = dbi_query("SELECT * FROM remplacement where client_id=".$client_id." AND pas_remplacement='1' ");
while($tabrempl = dbi_fetch_row($rempl))
{
array_push($remplacement,$tabrempl['inter_id']);
}
$dat = date("Ymd");
$p=array();
$p['id'] = array();
$p['date']= array();
$p['presta_id'] = array();
$p['presta_date_debut'] = array();
$p['presta_Hdeb'] = array();
$p['presta_Hduree'] = array();
$p['presta_recur'] = array();
$p['presta_date_fin'] = array();
$p['presta_jour'] = array();
$p['presta_forfait'] = array();
$p['presta_forfaitHT'] = array();
$p['client_id'] = array();
$p['inter_id'] = array();
$p['inter_genre'] = array();
$p['inter_nom'] = array();
$p['inter_pnom'] = array();
$p['agence_id'] = array();
$id=0;
// $q2 = dbi_query("SELECT * FROM ".TABLE_PREST." p where p.client_id=".$clien['client_id']." AND p.agence_id=$agence AND presta_date_debut <= $to AND (p.presta_date_fin >= $from OR p.presta_date_fin >= $to OR p.presta_date_fin IS NULL) ");
$date = time2int($time) ;
$q2 = dbi_query("SELECT * FROM ".TABLE_PREST." p where p.client_id=".$client_id." AND p.agence_id=$agence AND presta_date_debut <= $dat ");
while($prest = dbi_fetch_row($q2))
{
// echo $prest['presta_id'].' ! ';
$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 = ".$prest['presta_id']." order by `start`, `date`") ;
$journow=$prest['presta_jour'];
while (($m = dbi_fetch_row($q1)) )
{
$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_id=$data['inter'] ;
$client_id=$prest['client_id'];
$presta_recur=$prest['presta_recur'];
$presta_date_debut=$prest['presta_date_debut'];
$presta_date_fin=$prest['presta_date_fin'];
$presta_id=$prest['presta_id'];
$presta_jour=$data['jour'];
if($presta_jour===NULL)
$presta_jour=date("w",strtotime($presta_date_fin));
$prestdebut=$data['deb'];
$prestfin=$data['duree'];
$presta_forfait=$data['taux'];
$presta_forfaitHT=$prest['presta_forfaitHT'];
$inter = dbi_fetch_row(dbi_query("SELECT * FROM ".TABLE_INTERV." WHERE inter_id = '".$data['inter']."' AND inter_actif='0' ")) ;
$inter_genre=$inter['inter_genre'];
$inter_nom=addslashes($inter['inter_nom']);
$inter_pnom=addslashes($inter['inter_pnom']);
$positioninter = array_search($inter_id,$p['inter_id']);
if($positioninter === false && !empty($inter))
{
++$id;
array_push($p['id'],$id);
array_push($p['date'],$dat);
array_push($p['presta_id'],$presta_id);
array_push($p['presta_date_debut'],$presta_date_debut);
array_push($p['presta_Hdeb'],$prestdebut);
array_push($p['presta_Hduree'],$prestfin);
array_push($p['presta_recur'],$presta_recur);
array_push($p['presta_date_fin'],$presta_date_fin);
array_push($p['presta_jour'],$presta_jour);
array_push($p['presta_forfait'],$presta_forfait);
array_push($p['presta_forfaitHT'],$presta_forfaitHT);
array_push($p['client_id'],$client_id);
array_push($p['inter_id'],$inter_id);
array_push($p['inter_genre'],$inter_genre);
array_push($p['inter_nom'],$inter_nom);
array_push($p['inter_pnom'],$inter_pnom);
array_push($p['agence_id'],$agence);
}
}
$inter_id=$data['inter'] ;
$client_id=$prest['client_id'];
$presta_recur=$prest['presta_recur'];
$presta_date_debut=$prest['presta_date_debut'];
$presta_date_fin=$prest['presta_date_fin'];
$presta_id=$prest['presta_id'];
$presta_jour=$data['jour'];
if($presta_jour===NULL)
$presta_jour=date("w",strtotime($presta_date_fin));
$prestdebut=$data['deb'];
$prestfin=$data['duree'];
$presta_forfait=$data['taux'];
$presta_forfaitHT=$prest['presta_forfaitHT'];
$inter = dbi_fetch_row(dbi_query("SELECT * FROM ".TABLE_INTERV." WHERE inter_id = '".$data['inter']."' AND inter_actif='0' ")) ;
$inter_genre=$inter['inter_genre'];
$inter_nom=addslashes($inter['inter_nom']);
$inter_pnom=addslashes($inter['inter_pnom']);
$positioninter = array_search($inter_id,$p['inter_id']);
if($positioninter === false && !empty($inter))
{
++$id;
array_push($p['id'],$id);
array_push($p['date'],$dat);
array_push($p['presta_id'],$presta_id);
array_push($p['presta_date_debut'],$presta_date_debut);
array_push($p['presta_Hdeb'],$prestdebut);
array_push($p['presta_Hduree'],$prestfin);
array_push($p['presta_recur'],$presta_recur);
array_push($p['presta_date_fin'],$presta_date_fin);
array_push($p['presta_jour'],$presta_jour);
array_push($p['presta_forfait'],$presta_forfait);
array_push($p['presta_forfaitHT'],$presta_forfaitHT);
array_push($p['client_id'],$client_id);
array_push($p['inter_id'],$inter_id);
array_push($p['inter_genre'],$inter_genre);
array_push($p['inter_nom'],$inter_nom);
array_push($p['inter_pnom'],$inter_pnom);
array_push($p['agence_id'],$agence);
}
}
// for ( $indice = 1 ; $indice < count($p['planning_id']);$indice++)
// {
// print_r($p);
// }
// print_r($p);
?>
<TABLE id="ver-minimalist" width="50%">
<thead>
<TR>
<th><A href="#">Intervenants</A><SPAN class="sort">↑</SPAN></th>
<th align="center"><A href="#">Ne peut effectuer de remplacement</A></th>
</TR>
</thead>
<tbody>
<?php for ( $indice = 0 ; $indice < count($p['id']);$indice++)
{
// print_r($p['inter_id'][$indice]);
// print_r($p['inter_nom'][$indice]);
$inter=$p['inter_id'][$indice];
$checked=0;
if (in_array($inter, $remplacement))
$checked=1;
?>
<TR>
<TD ><?=$p['inter_genre'][$indice].' '?><?=ucwords($p['inter_nom'][$indice].' '.$p['inter_pnom'][$indice])?></TD>
<TD align="center"><input type="checkbox" onclick="action(<?php echo $inter.' , '.$client_id.' , '.$checked?>)" name="pas" <?=$checked?' checked="checked"':''?>/></TD>
</TR>
<? }
// print_r($p['inter_nom']);
// .($checked?' checked="checked"':'').' />'.($checked?'<b>':'').($checked?'</b>':'').'';
?>
</tbody>
</TABLE>
