AnonSec Team
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/mcg/pages/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/mcg/pages/ajax_CDI.php
<?php

// echo "yassin <br/>" ; 
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;
// echo "<pre>" ; 
// print_r($_POST) ; 
// echo "</pre>" ; 

$salarie_contrat_id = $_POST['rowid'] ; 
function convertToHoursMins($time, $format = '%02d:%02d') {
    if ($time < 1) {
        return;
    }
    $hours = floor($time / 60);
    $minutes = ($time % 60);
    return sprintf($format, $hours, $minutes);
}

function count_week_days($__date_from, $__date_to, $__holidays_between=array(), $__weekend_days=array()) { 
   $total_days_count = $__date_to > $__date_from ? round(($__date_to - $__date_from)/(24*3600)) : 0;
   $full_weeks_count = floor($total_days_count/7);
   $weekend_days_count = $full_weeks_count*count($__weekend_days);
   $days_left_uncovered = $total_days_count - $full_weeks_count*7;
   for($i = 0; $i < $days_left_uncovered; $i++) {
      $date_to_check = $i ? strtotime("+{$i} day", $__date_from) : $__date_from;
      if(in_array(date('N', $date_to_check), $__weekend_days)) {
         $weekend_days_count++; 
      }
   }
   $week_days_count = $total_days_count - $weekend_days_count - count($__holidays_between); 
   return $week_days_count;
}
function type_pre_GET ($value =12)
{
	$tab = array(10 => 'Viste medicale', 11 => 'Entretien',  12 => 'Autre ');
	return $tab[$value] ;
}
 

// $R=dbi_query("SELECT client_id id, concat(client_nom, ' ', client_pnom) civ, client_prospect, IF(client_genre='SERENA',1,0) as serena, IF(client_genre='FORMATION',1,0) as formation FROM ".TABLE_CLIENT." where agence_id=$agence ".( $_SESSION['client_actif']=='off' ? "" : "AND client_actif='0'")."  ");





 


// $R=dbi_query("SELECT client_id id, concat(client_nom, ' ', client_pnom) civ, client_prospect, IF(client_genre='SERENA',1,0) as serena, IF(client_genre='FORMATION',1,0) as formation FROM ".TABLE_CLIENT." where agence_id=$agence ".( $_SESSION['client_actif']=='off' ? "" : "AND client_actif='0'")."  ");

// exit() ; 
function daysfr ($value = 0)
{
$tab = array(0 => 'Dimanche', 1 => 'Lundi',  2 => 'Mardi', 3 => 'Mercredi', 4 => 'Jeudi', 5 => 'Vendredi', 6 => 'Samedi');
	 return $tab[$value];
}
if($_POST['rowid']>0)
{
	$id_relance_programee =$_POST['rowid'] ; 
}

function daysfr_new ($value = 0)
{
$tab = array('Mon' => 'Lundi', 'Tue' => 'Mardi', 'Wed' => 'Mercredi', 'Thu' => 'Jeudi', 'Fri' => 'Vendredi', 'Sat' => 'Samedi', 'Sun' => 'Dimanche' );
	 return $tab[$value];
}


// $days =  daysfr('Mon') ; 
// echo $days."<br/>" ; 
// exit() ;
function date_prestation_to_jour($dat)
{
$a=int2date_autre_format_deux($dat) ; 
$dt = strtotime($a);
$day = date("D", $dt);
$jour=daysfr_new($day) ; 
return $jour ; 
// return $day ; 

}

// echo "testddd <br/> " ; 

// exit() ; 




// echo "==> ".$_GET['chantier_ID']."<br/>"

	
	// $qm = dbi_query('scddelect * from contact where contact_id='.$contact_id.'') ;
	// $tabmod = dbi_fetch_row($qm);
	
	// $contact_nom=$tabmod['contact_nom'];
	// $contact_pnom=$tabmod['contact_pnom'];
	// $contact_fonction=$tabmod['contact_fonction'];
	// $contact_tele1=$tabmod['contact_tele1'];
	// $contact_tele2=$tabmod['contact_tele2'];
	// $contact_email=$tabmod['contact_email'];
	
	
	$salarie_id=$_SESSION["salarie_id"] ; 
	$chaine = 'Nouvelle annexe CDI' ;  
	

?>


             

            <div class="modal-header task-single-header" data-task-single-id="5" data-status="4">
              <h4 class="modal-title"><?php echo $chaine ;?></h4>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body">
 

   <form action="" method="POST">   
 <!-- ///////Ligne société & Catégorie --> 
 
<?php 


	$q = dbi_query("
							SELECT * FROM PRESTATIONS p where  `presta_date_fin` IS NULL ORDER BY presta_jour ASC " );
							// SELECT * FROM PRESTATIONS p where  `presta_date_fin` IS NULL  " );

							// SELECT * FROM PRESTATIONS p where  `presta_date_fin` IS NULL ORDER BY presta_jour ASC " );
								while($prest = dbi_fetch_row($q))
							{		
									$date_presta_sem = $prest['presta_date_debut'] ;
									$q1 = dbi_query("SELECT * FROM PRESTATIONS_MODIF WHERE presta_id = ".$prest['presta_id']." order by start, modif_id ") ;
									// while (($m = dbi_fetch_row($q1)) && $date >= $m['start'])
									while (($m = dbi_fetch_row($q1)))
									{
										if( $m['presta_sem'] != NULL ) $date_presta_sem = $m['start'];
										$prest['salarie_id'] = $m['salarie_id'] === NULL ? $prest['salarie_id'] : $m['salarie_id'] ; 
										$prest['presta_sem'] = $m['presta_sem'] === NULL ? $prest['presta_sem'] : $m['presta_sem'] ;
										$prest['presta_jour'] = $m['presta_jour'] === NULL ? $prest['presta_jour'] : $m['presta_jour'] ;
										$prest['presta_Hdeb'] = $m['presta_Hdeb'] === NULL ? $prest['presta_Hdeb'] : $m['presta_Hdeb'] ;
										$prest['presta_Hduree'] = $m['presta_Hduree'] === NULL ? $prest['presta_Hduree'] : $m['presta_Hduree'] ;
										
									}
									if( $prest['salarie_id'] == $salarie_id ) {

										$a[] = $prest ; 
									
								}
							}
							
							
							
							
							
							
							$taille=count($a) ;
							for ($i=0 ; $i<$taille ; $i++){
											
										list($client_nom)	= dbi_fetch_row(dbi_query("SELECT client_nom  FROM `client` WHERE `client_id` = ".$a[$i]['client_id'] )) ;
									
                                          										
										$desc  =   daysfr($a[$i]['presta_jour'])." de ".int2heure($a[$i]['presta_Hdeb'])." à <strong> ".int2heure(addDuree($a[$i]['presta_Hdeb'], $a[$i]['presta_Hduree']) )." : ".$client_nom ; 
										
									   	
										 dbi_query("INSERT INTO `annexe_trie` (`id`, `jour`, `description` , presta_id , presta_Hdeb) VALUES (NULL, '".$a[$i]['presta_jour']."', '".addslashes($desc)."' ,'".$a[$i]['presta_id']."','".$a[$i]['presta_Hdeb']."')") ;     										
											
										}
										
											?>
										<input id="prodId" name="annexe" type="hidden" value="annexe">
										<table id="example1" class="table table-bordered table-striped">
											<thead>
											<tr>
											  <th>Sujet</th>     		<!-- /.Table Client - Champs client_nom -->
											 
											  <th>Priorité</th> 	<!-- /.Table Client - Champs client_cp -->
											</tr>
											</thead>
											<tbody>
										
										
										<?php
										// echo "===>".$taille."<br/>" ;
										
										$quu = dbi_query("SELECT * FROM `annexe_trie` ORDER BY `annexe_trie`.`jour`, presta_Hdeb ASC") ;
										
										// $i = 0 ; 
										while($res=dbi_fetch_row($quu)){
									     echo "<tr> <td> " ; 
										 echo  $res['description']."</td>" ; 
									     
										 
										echo "<td> <input type='checkbox' id='scales' name='presta_id[]' value='".$res['presta_id']."'</td>" ; 	
										echo "</tr>" ; 
								
										}
										 dbi_query("TRUNCATE TABLE  annexe_trie ") ; 
										?>
										
											
											<tbody>
										</table>



 
<!-- ///////Ligne -->   
         <div class="modal-footer justify-content-between">
              <button type="button" class="btn btn-primary" data-dismiss="modal">Fermer</button>
              <button type="submit" name="submitbtn" class="btn btn-primary">Enregistrer</button>
			  
			  </form>



               </div>
			  </div>

			
			
			
			

	  
	  



AnonSec - 2021