Optimisation du code
Résolu/Fermé
MiWi86-33
Messages postés
142
Date d'inscription
vendredi 8 août 2008
Statut
Membre
Dernière intervention
20 juin 2011
-
27 août 2009 à 10:26
MiWi86-33 Messages postés 142 Date d'inscription vendredi 8 août 2008 Statut Membre Dernière intervention 20 juin 2011 - 27 août 2009 à 11:00
MiWi86-33 Messages postés 142 Date d'inscription vendredi 8 août 2008 Statut Membre Dernière intervention 20 juin 2011 - 27 août 2009 à 11:00
A voir également:
- Optimisation du code
- Optimisation pc - Accueil - Utilitaires
- Voici du code ascii : - Guide
- Code puk bloqué - Guide
- Code telephone oublié - Guide
- Code activation windows 10 - Guide
1 réponse
MiWi86-33
Messages postés
142
Date d'inscription
vendredi 8 août 2008
Statut
Membre
Dernière intervention
20 juin 2011
9
27 août 2009 à 11:00
27 août 2009 à 11:00
$aDay = array(1 =>"Monday", 2 =>"Tuesday", 3 =>"Wednesday", 4 =>"Thursday", 5 =>"Friday", 6 =>"Saturday", 7 =>"Sunday"); if(mysql_num_rows($results)==0) { echo "<span style='font-family : verdana; font-size : 12px;'>"; echo "Aucun établissement à afficher"; echo "</span>"; echo "<br><br>"; echo "<input type='button' onclick='javascript:document.location.reload();' value='Actualiser'>"; } else { echo "</span>"; echo "<span style='font-family : verdana; font-size : 25px;'>Votre tableau de bord de la semaine - Orchestra Web Manager</span>"; echo "<br><br>"; $nNbFichiers = 0; $i = date("w"); echo $i; $index=1; $table=array(); while($i>0) { $table[$index]=$aDay[$i]; $index++; $i--; } $index2 = 7; $i = date("w"); while($i<$index2) { $table[$index]=$aDay[$index2]; $index2--; $index++; } for($t=1;$t<=7;$t++) { echo '<table border="0" cellpadding="5" cellspacing="1" bgcolor="#999999" style="font-family : verdana; font-size : 12px;">'; echo '<tr valign="top"><td style="font-weight:bold;" bgcolor="#DDDDDD">Données de gestion</td>'; $dda = $table[$t]; //$ddate = $DDay[$i]; echo "<b>".$dda."</b>"; echo $t; // AFFICHAGE DE LA LIGNE TITRES for($r=0; $r<mysql_num_rows($results); $r++) { $sLicence = mysql_result($results,$r,"cleident"); $sNom = mysql_result($results,$r,"nom"); // Lecture des données ([licence].xml) $sFileName = "upload/".$sLicence."/".$dda.".xml"; if (file_exists($sFileName)) { $sJour = $aDay[date("w", filemtime($sFileName))]; // Ajoute la date et l'heure du fichier $sTime = $sJour.", ".date("d/m/Y H:i", filemtime($sFileName)); echo "<td align='right' bgcolor='#DDDDDD' style='padding :5px;' nowrap>"; echo "<b>$sNom</b>"; echo "<br>"; echo "<span style='font-size : 10px;'>"; echo $sTime; echo "</span>"; echo "</td>"; $nNbFichiers++; } } if ($nNbFichiers>1) echo "<td align='right' width='100' bgcolor='#DD3333' style='color: #FFFFFF; font-weight:bold; padding :5px;' nowrap>Totaux</td>"; echo "</tr>"; // MEMORISATION DES TITRES ET VALEURS $asTitres = array(); $asValeurs = array(); // On récupère les titres et les valeurs ChargeTableaux($results, $asTitres, $asValeurs, $dda); // Si aucun fichier n'a été trouvé if (empty($asTitres)) { echo "</table><br><br><span style='font-family : verdana; font-size : 12px;'>Aucunes données n'a été transmises pour le moment</span>"; echo "<br><br>"; echo "<input type='button' onclick='javascript:document.location.reload();' value='Actualiser'>"; } else { // AFFICHAGE DE CHAQUE LIGNE $nTotalLignes = count($asTitres); for ($j=0;$j<$nTotalLignes; $j++) { $sTitre = $asTitres[$j]; if ($j%2>0) $sBGColor = "#F5F5F5"; else $sBGColor = "#FFFFFF"; echo "<tr><td bgcolor='$sBGColor' style='padding :5px;' nowrap>".$sTitre."</td>"; $rTotal = 0; foreach($asValeurs[$j] as $rValue) { $rTotal += $rValue; echo "<td align='right' style='padding :5px;' bgcolor='$sBGColor'>".$rValue."</td>"; } if ($nNbFichiers > 1) { $sTotal = sprintf("%.02f", $rTotal); echo "<td align='right' style='padding :5px;' bgcolor='#FFCCCC'>".$sTotal."</td>"; } echo "</tr>"; } if ($nNbFichiers>1) $nCols = $nNbFichiers+2; else $nCols = $nNbFichiers+1; echo "<tr><td align='right' colspan=".($nCols)." bgcolor=#999999>"; echo "<input type='button' onclick='javascript:document.location.reload();' value='Actualiser'>"; echo "</td></tr>"; echo "</table><br><br>"; } } }