1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348
| <?php
session_start();
date_default_timezone_set('Europe/Paris');
$titre="Gestion production";
include_once'PHP_include/date-script.php';
include_once'CLASS/Intermittents.class.php';
include_once'CLASS/calculjour.class.php';
include_once'CLASS/date.class.php';
include_once'CLASS/prod.class.php';
include_once'CLASS/identification.class.php';
include_once'manager/manager.php';
$bdd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$intermittent = new intermittent();
$prod=new prod();
$ladate=new ladate();
$calculjour= new calculjour();
$identifiant=new identification();
// ********************************
// si la prod est annulée UPDATE et retour à a la liste
// ******************************
if(isset($_POST['annul'])){
$annul_prod->bindParam(1,$_POST['idprod'], PDO::PARAM_INT);
$annul_prod->execute();
?>
<script>window.location.assign('prod_liste.php')</script>
<?php
}
// ********************************
// si la prod est rétablie UPDATE et retour à la fiche prod
// ******************************
else if(isset($_POST['retab'])){
$retablissment_prod->bindParam(1,$_POST['idprod'], PDO::PARAM_INT);
$retablissment_prod->execute();
$affich="Prod rétablie";
}
// ********************************
// modif d'infos de prod
// ******************************
else if(isset($_POST['modifprod'])){
$affich="Modifications enregistrées";
// affectation des variables pourle UPDATE géré par manager PHP
$update_prod->bindParam(1, $titre_prod, PDO::PARAM_STR);
$update_prod->bindParam(2, $charge_prod, PDO::PARAM_STR);
$update_prod->bindParam(3, $lieu, PDO::PARAM_STR);
$update_prod->bindParam(4, $client, PDO::PARAM_STR);
$update_prod->bindParam(5, $contact, PDO::PARAM_STR);
$update_prod->bindParam(6, $tel_contact, PDO::PARAM_INT);
$update_prod->bindParam(7, $mail_contact, PDO::PARAM_INT);
$update_prod->bindParam(8, $commentaires, PDO::PARAM_INT);
$update_prod->bindParam(9, $datedebutEN, PDO::PARAM_INT);
$update_prod->bindParam(10, $datefinEN, PDO::PARAM_INT);
$update_prod->bindParam(11, $heuredebut, PDO::PARAM_INT);
$update_prod->bindParam(12, $affaire, PDO::PARAM_INT);
$update_prod->bindParam(13, $pole_emploi, PDO::PARAM_INT);
$update_prod->bindParam(14, $idprod, PDO::PARAM_INT);
// boucle pour récupérer toutes les entrées et affectation des variables utilisées ci dessus
foreach ($_POST as $key =>$val){
$$key=$val;
}
//traitement des dates
$ladate->setDatedebut($datedebut);
$ladate->setDatefin($datefin);
$datedebutEN=$ladate->datedebut();
$datefinEN=$ladate->datefin();
// execution de l'update
$update_prod->execute();
}else $affich=NULL;
// get données dans l'URL par la page précédente execution de la requête
$affich_prod2->execute(array($_GET['nb']));
$affich_intermittents->execute(array($_GET['nb']));
echo "get".$_GET['nb'];// TEST pour vérifier la bonne réception du GET
$donnes = $affich_prod2->fetch();
print_r($donnes);// TEST pour vérifier le contenu de $donnes
$prod->hydrate($donnes);
$identifiant->hydrate($donnes);
$calculjour->setdifference($prod->datedebutEN(),$prod->datefinEN());
?>
<!-- ******************************************************* -->
<!-- Début HTML affichage page -->
<!-- ******************************************************* -->
<!DOCTYPE html>
<html lang="fr">
<head>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="CSS/bootstrap/bootstrap.css" type="text/css" />
<link href="CSS/datepicker.css" rel="stylesheet">
<link rel="stylesheet" href="CSS/syle.css" type="text/css" />
<style type="text/css">
body{
font-size:1.4em;
}
nav{
margin-bottom:1%;
}
.intermittents-2{
height:30vh;
}
thead{
/* Permalink - use to edit and share this gradient: http://colorzilla.com
/gradient-editor/#6b6b6b+0,bfbfbf+100 */
background: rgb(107,107,107); /* Old browsers */
background: -moz-linear-gradient(top, rgba(107,107,107,1) 0%, rgba(191,191,191,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(107,107,107,1) 0%,rgba(191,191,191,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(107,107,107,1) 0%,rgba(191,191,191,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6b6b6b', endColorstr='#bfbfbf',GradientType=0 ); /* IE6-9 */
color:white;
}
.table{
margin-top:5%;
}
.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td{
border-color:#E6E6E6;
}
.table > tbody > tr {
/* Permalink - use to edit and share this gradient: http://colorzilla.com
/gradient-editor/#ffffff+0,e5e5e5+100;White+3D */
background-color: white; /* Old browsers */
background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(229,229,229,1) 100%); /* FF3.6-15 */*/
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
}
.table-hover > tbody > tr:hover{
//* Permalink - use to edit and share this gradient: http://colorzilla.com
// /gradient-editor/#020202+0,000000+100&0.52+0,0+100 */
background: -moz-linear-gradient(top, rgba(2,2,2,0.52) 0%, rgba(0,0,0,0) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(2,2,2,0.52) 0%,rgba(0,0,0,0) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(2,2,2,0.52) 0%,rgba(0,0,0,0) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#85020202', endColorstr='#00000000',GradientType=0 ); /* IE6-9 */
color:white;
}
</style>
<meta charset="UTF-8">
<title>Gestion de production</title>
</head>
<body>
<header>
<p class="titrepage"><?php echo $titre ?></p>
<img src="images/banniere.jpg">
<?php
include_once'PHP_include/nav.php';
include'PHP_include/identite.php'
?>
</header>
<div class="container-fluid">
<div class= "row" >
<div class="col-sm-12 " style="margin-bottom:2%;background-color:#EFEFEF; padding:2%;">
<a href="generation_doc/lettre-engagement.php?n=<?php echo $_GET['nb']?>" target="pdf"><input type="button" class="col-sm-3 col-sm-offset-1 btn btn-primary btn-lg" value="lettres d'engagement"></a>
<input type="button" class="col-sm-3 col-sm-offset-3 btn btn-primary btn-lg" value="feuille de route">
</div>
<?php
echo "<h1 style='text-align:center;'>".$affich."</h1>";
?>
<form action="" method="post">
<input type="hidden" name="idprod" value="<?php echo $prod->id_prod() ?>">
<div class="form-group col-sm-10 col-sm-offset-1 col-xs-12 ">
<div class="col-sm-5 "><label>Titre de la prod</label><input type="text" name="titre_prod" value="<?php echo $prod->titre_presta();?>" class="form-control <?php echo $prod->classerreurtitre();?>"></div>
<div class="col-sm-2"><label> client</label><input type="text" name="client" value="<?php echo $prod->client();?>" class="form-control <?php echo $prod->classerreurclient();?>"></div>
<?php if($_SESSION['typeadmin']==TRUE):?>
<div class="col-sm-2"><label> responsable de prod</label>
<H4><?php echo $identifiant->prenom()." ".$identifiant->nom() ?></H4></div>
<?php endif ?>
<div class="col-sm-3"><label> lieu</label>
<input type="text" name="lieu" value="<?php echo $prod->lieu();?>" class="form-control ">
</div>
</div>
<div class="form-group col-sm-10 col-sm-offset-1 col-xs-12 ">
<div class="col-sm-2">
<label> Nom contact client</label>
<input type="text" name="contact" value="<?php echo $prod->contact();?>" class="form-control ">
</div>
<div class="col-sm-2">
<label> tel contact</label>
<input type="text" name="tel_contact" value="<?php echo $prod->tel_contact();?>" class="form-control ">
</div>
<div class="col-sm-3">
<label> mail contact</label>
<input type="text" name="mail_contact" value="<?php echo $prod->mail_contact();?>" class="form-control ">
</div>
</div>
<div class="form-group col-sm-10 col-sm-offset-1 col-xs-12 ">
<div class="col-sm-2 ">
<label>début presta</label>
<input type="text" value="<?php echo $prod->datedebutFR();?>" name="datedebut" class="datepicker">
</div>
<div class="col-sm-2">
<label>heure debut presta</label>
<input type="text" value="<?php echo $prod->heure_debut_presta();?>" name="heuredebut" class="form-control timepicker2">
</div>
<div class="col-sm-2 ">
<label>fin presta</label>
<input type="text" value="<?php echo $prod->datefinFR();?>" name="datefin" class="datepicker">
</div>
<div class="col-sm-2">
<label>durée</label><br>
<?php echo $calculjour->duree($prod->datedebutEN(),$prod->datefinEN());?>
</div>
<div class="col-sm-2"><label>Affaire</label>
<input type="text" name="affaire" value="<?php echo $prod->affaire();?>" class="form-control <?php echo $prod->classerreuraffaire(); ?>">
</div>
<div class="col-sm-2">
<label>N° POLE EMPLOI</label>
<input type="text" name="pole_emploi" value="<?php echo $prod->pole_emploi();?>" class="form-control <?php echo $prod->classerreurpole_emploi(); ?>" >
</div>
</div>
<div class="col-sm-6 col-sm-offset-3" style="margin-bottom:2%">
<label for="comm">commentaires</label>
<textarea class="form-control" rows="4" name="commentaires"><?php echo $prod->commentaires_prod() ?>
</textarea>
</div>
<div class="col-sm-12 " style="margin-bottom:2%;background-color:#EFEFEF; padding:2%;">
<input type="submit" name="modifprod" value="Modifier les infos" class="button btn btn-warning btn-lg col-sm-2 col-sm-offset-2 col-xs-12">
<?php
if($prod->annul()==FALSE){
echo'<input type="submit" name="annul" value="Annuler cette prod" class="button btn btn-danger btn-lg col-sm-2 col-sm-offset-1 col-xs-12">';
}else{
echo'<input type="submit" name="retab" value="Rétablir la prod" class="button btn-lg col-sm-2 col-sm-offset-1 col-xs-12" style="background-color:#09f409">';
}
?>
<input type="button" name="modele" value="enregistrer comme modèle" class="button btn btn-success btn-lg col-sm-2 col-sm-offset-1 col-xs-12">
</div>
</form>
</div>
<!-- ******************************************
liste des intermittents de la prod
**************************************** -->
<div class="row">
<form action="equipe_intermittents.php" method="post">
<input type="hidden" name="idprod" value="<?php echo $prod->id_prod() ?>">
<input type="hidden" name="datedebut" value="<?php echo $prod->datedebutEN() ?>">
<input type="hidden" name="datefin" value="<?php echo $prod->datefinEN() ?>">
<div class="form-group col-sm-10 col-sm-offset-1 col-xs-12 table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Confirmé</th>
<th>NOM</th>
<th>PRENOM</th>
<th>FONCTION</th>
<th>durée contrat</th>
<th>SALAIRE/J</th>
<th>SALAIRE TOTAL</th>
<th>SALAIRE Chargé</th>
</thead>
<tbody>
<?php while ($donnes = $affich_intermittents->fetch()):
$intermittent->hydrate($donnes);
$prod->hydrate($donnes);
$calculjour->setdifference();
$duree=$calculjour->duree();
$salairepresta=$prod->tarif()*$calculjour->duree($intermittent->datedebutEN(),$intermittent->datefinEN());
$salairecharge=($prod->tarif()*$calculjour->duree($intermittent->datedebutEN(),$intermittent->datefinEN()))*1.62;
?>
<tr>
<td class="attente-fond <?php echo $prod->classconfirmfond()?>"></td>
<td><?php echo $intermittent->nom()?></td>
<td><?php echo $intermittent->prenom()?></td>
<td><?php echo $intermittent->fonction_presta()?></td>
<td><?php echo $duree?></td>
<td><?php echo $prod->tarif()?></td>
<td><?php echo $salairepresta?></td>
<td><?php echo $salairecharge?></td>
</tr>
<?php endwhile ?>
</table>
<input type="submit" name="modif" value="Modifier l'équipe"
class="button btn btn-primary btn-lg col-sm-10 col-sm-offset-1 col-
xs-12">
</div>
</div>
</body>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/locales/bootstrap-datepicker.fr.js"></script>
<script type="text/javascript" src="js/bootstrap-timepicker.js"></script>
<script type="text/javascript">
$('.datepicker').datepicker({
immediateUpdates:true,
weekStart: 1,
format: 'dd-mm-yyyy',
language: 'fr'
})
</script>
<script>
$('.timepicker2').timepicker({
minuteStep: 1,
template: 'modal',
appendWidgetTo: 'form',
showSeconds: false,
showMeridian: false,
defaultTime: false
});
</script>
</html> |
Partager