|
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/MC/test/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
// $a = 2 ;
// $b = 6 ;
// $somme = $a + $b ;
// echo "la somme est ==> $somme <br/>" ;
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;
session_start();
?><html>
<head>
<?php include('header.php'); ?>
</head>
<body class="hold-transition sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">
<!-- TOP MENU -->
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
<!-- Menu extensible -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
</li>
<!-- liens TOP MENU GAUCHE-->
</ul>
<!-- liens TOP MENU DROITE -->
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a href="login.php?dec=1" class="nav-link">
<i class="nav-icon fas fa-power-off"></i>
</a>
</li><!-- Placer ici l'élément à positionner à droite du TOP MENU -->
</ul>
</nav>
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a href="index3.html" class="brand-link">
<img src="dist/img/logomcpro.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"
style="opacity: .8">
<span class="brand-text font-weight-light">MC PRO</span>
</a>
<!-- Sidebar -->
<div class="sidebar">
<!-- Sidebar user panel (optional) -->
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div class="image">
<img src="dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">
</div>
<div class="info">
<a href="#" class="d-block">Steeven ROBLOT</a>
</div>
</div>
<?php include('menu.php') ?>
<!-- Sidebar Menu -->
</div>
<!-- /.sidebar -->
</aside>
<!-- DEMARRAGE DE LA PAGE PRINCIPALE -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
</div>
<div class="col-sm-6">
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- /.content-header -->
<!-- PAGE PRINCIPALE -->
<script language="Javascript">
function GetIdBureau()
{
var id_statu="";
id_statu = document.client_statu_form.client_statu.value ;
if( id_statu > 0 || id_statu=="INDEFINI" )
window.location = "tarif.php?id_statu="+id_statu;
else
window.location = "tarif.php";
}
</script>
<script language="Javascript">
function GetIdBureauB()
{
var id_etab="";
id_etab = document.client_statu_form.client_etab.value ;
if( id_etab > 0 || id_etab=="INDEFINI" )
window.location = "tarif.php?id_etab="+id_etab;
else
window.location = "tarif.php";
}
</script>
<?php
$_SESSION["id_etab"]= 111 ;
$_SESSION["id_statu"]=2 ;
// echo "==>".$_SESSION["id_etab"]."<br/>" ;
// echo "==>".$_SESSION["id_statu"]."<br/>" ;
if(!empty( $_GET["id_statu"]))
{
$_SESSION["id_statu"] = $_GET["id_statu"];
}
if(!empty( $_GET["id_etab"]))
{
$_SESSION["id_etab"] = $_GET["id_etab"];
}
if($_SESSION["id_etab"]== 111){
$where_etablissement_id="" ;
}
else{
$where_etablissement_id = " AND c.etablissement_id = ".$_SESSION["id_etab"] ;
}
// <!-- 6 ya3ni tous les clients / 4 ya3ni Clients inactifs / 2 Client actifs -->
if($_SESSION["id_statu"]==6)
{
$where_statut = "" ;
}
if($_SESSION["id_statu"]==4)
{
$where_statut = " AND c.client_statut = '0' " ;
}
if($_SESSION["id_statu"]==2)
{
$where_statut = " AND c.client_statut = '1' " ;
}
// echo "<pre>" ;
// print_r($_GET) ;
// echo "</pre>" ;
// echo "--------- <br/>" ;
// echo "<pre>" ;
// print_r($_SESSION) ;
// echo "</pre>" ;
?>
<section class="content">
<div class="row">
<div class="col-12">
<div class="card card-info">
<div class="card-body">
<form id="client_statu_form" name="client_statu_form" method="POST" action="">
<div class="form-row">
<!-- 6 ya3ni tous les clients / 4 ya3ni Clients inactifs / 2 Client actifs -->
<div class="form-group col-md-6">
<div class="input-group">
<?php $qa = dbi_query("SELECT * FROM `etablissement`") ; ?>
<select class="form-control select" style="width: 100%;" id="client_etab" name="client_etab" onchange="GetIdBureauB()"; >
<?php while($etab=dbi_fetch_row($qa)) {?>
<option value="<?php echo $etab['etablissement_id'] ;?> " <?php if($etab['etablissement_id']==$_SESSION["id_etab"]){echo "selected" ;} ?> ><?php echo $etab['etablissement_nom'] ;?></option>
<?php } ?>
<option value="111" <?php if($_SESSION["id_etab"]== 111 ){echo "selected" ;} ?> >Tous les Etablissements</option>
</select>
</div>
</div>
</div>
</form>
<div class="onglet_dotted">
<div style="width:100%; float:left; vertical-align:top" class="header_ray">
<div id="tab">
<div class="box-body">
<form id="tarifs" name="tarifs" method="POST" action="">
<?php
$datapre = array();
dbi_query("CREATE TABLE IF NOT EXISTS `prest_temp_$agence` (`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 ) ) ENGINE = MYISAM ;");
$q4 = dbi_query("SELECT * FROM ".TABLE_CLIENT." where agence_id=$agence ".( $_SESSION['client_actif']=='off' ? "" : "AND client_actif='0'")." $where1 order by client_nom, client_pnom ");
while($clien = dbi_fetch_row($q4))
{
$client_id=$clien['client_id'];
$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 is NULL ");
$date = time2int($time) ;
$datapre[$client_id] = array();
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']) ;
$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'] ;
}
// $inter = dbi_fetch_row(dbi_query("SELECT * FROM ".TABLE_INTERV." WHERE inter_id = '".$data['inter']."' 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'];
$datapre[$client_id][] = $presta_id;
$jour=$data['jour'];
$Hdeb=$data['deb'];
$Hduree=$data['duree'];
$taux=$data['taux'];
$sqlinsert = "INSERT INTO prest_temp_".$agence." VALUES ('','$agence', '$client_bureau', '$inter_bureau', '$inter_id', '$inter_genre', '".$inter_nom."', '$client_id', '".$client_nom."', '$presta_id', '$Hdeb', '$Hduree', '$jour', '$taux')";
//echo $sqlinsert;
dbi_query ( $sqlinsert );
}
}
?>
<table id="example1" class="table table-bordered table-hover">
<thead>
<tr>
<th scope="col">Client</th>
<th scope="col">Durée</th>
<th scope="col">Taux</th>
<td ></td>
</tr>
</thead>
<tbody>
<?php
$sql .="SELECT * ,sum( presta_Hduree ) AS nbprest ";
$sql .=" FROM prest_temp_".$agence." $where11 $where2 ";
$sql .=" group by client_id order by nbprest ";
$req = dbi_query($sql);
while($info = dbi_fetch_row($req))
{
echo '<tr>';
?>
<td><A href="top.php?link=client&page=aaa&id=<?=$info['client_id'] ?>"><?=ucwords($info['client_nom'])?></A></td>
<td><?=$info['nbprest']/60?> h</td>
<td><?=number_format($info['presta_forfait'], 2, ',', ' ')?> €/h</td>
<td><INPUT type="checkbox" name="coches[]" value="<?=$info['client_id'];?>"/></td>
</tr>
<?php
}
?>
</tbody>
<tr>
<td ></td>
<td ></td>
<td ><input type="submit" name="valider1" class="bigbutton" value=" Valider " ></td>
<td ></td>
</tr>
</table>
<input type = "hidden" name = "data" value = "<?php echo base64_encode( serialize( $datapre) ); ?>">
</form>
</div><!-- /.box-body -->
</div><!-- /.tab -->
</div><!-- /.header_ray -->
</div><!-- /.onglet_dotted -->
</div><!-- /.card-body -->
</div><!-- /.card card-primary card-outline -->
</div> <!-- /.col-12 -->
</div> <!-- /.row -->
</section> <!-- /.section -->
</div>
<?php include('footerr.php'); ?>
<script type="text/javascript">
$(document).ready(function(){
$('#myModal').on('show.bs.modal', function (e) {
var rowid = $(e.relatedTarget).data('id');
$.ajax({
type : 'post',
url : 'ajaxAjoutMatR.php', //Here you will fetch records
data : 'rowid='+ rowid, //Pass $id
success : function(data){
$('#fetch').html(data);//Show fetched data from database
}
});
});
});
</script>
</body>
</html>
