Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64
Your IP : 3.145.65.133
<?
$today = date("D, d M Y H:i:s T ");
include('../../../administration/includes/mysql_connect.php');
$sql = "SELECT p. * , month( p.date_match ) AS monthstat, p.avnotes_fr, p.dern_mod, p.fusilladestatus, p.but_vis, p.but_dom, p.assistance, p.id_partie, p.gamestatus, p.notes_fr AS specialnotes, p.periode, c. *
FROM calendriers AS c
LEFT JOIN parties AS p ON p.id_calendrier = c.id_calendrier
WHERE c.date_match = CURDATE( )
ORDER BY p.id_match";
/*$sql = "SELECT p . * ,month(p.date_match) as monthstat, p.avnotes_fr, p.dern_mod, p.fusilladestatus, p.but_vis, p.but_dom, p.assistance, p.id_partie, p.gamestatus, p.notes_fr AS specialnotes, p.periode, c. *
FROM calendriers AS c
LEFT JOIN parties AS p ON p.id_calendrier = c.id_calendrier
WHERE c.date_match <= CURDATE( ) and c.date_match >= DATE_ADD(CURDATE(), INTERVAL -3 DAY)
order by p.id_match";
*/
//$mysql_link = mysql_connect('72.55.128.7', 'Lhcarranza', '899357');
mysql_select_db('lhjmq_pii', $mysql_link);
$result_count = mysql_query($sql, $mysql_link);
if (mysql_num_rows($result_count) > 0){
header("content-type: text/xml");
echo '<?xml version="1.0" encoding="ISO-8859-1" ?>';
echo '<root title="LHJMQ Resultats (Aujourd hui et 3 derniers jours)">';
while ($rowx = mysql_fetch_assoc($result_count)) {
$temp_restant = trim($rowx['temps_restant']);
$periode = trim($rowx['periode']);
$fusilladestatus = trim($rowx['fusilladestatus']);
$abrev_vis = trim($rowx['abrev_vis']);
$abrev_dom = trim($rowx['abrev_dom']);
$but_vis = trim($rowx['but_vis']);
$but_dom = trim($rowx['but_dom']);
$gamestatus = trim($rowx['gamestatus']);
$id_saison = trim($rowx['id_saison']);
$monthstat = trim($rowx['monthstat']);
$id_partie = trim($rowx['id_partie']);
$id_match = trim($rowx['id_match']);
$dern_mod = trim($rowx['dern_mod']);
$date_match = trim($rowx['date_match']);
$heure_match = trim($rowx['heure_match']);
$nom_equipe_dom = trim($rowx['nom_equipe_dom']);
$nom_equipe_vis = trim($rowx['nom_equipe_vis']);
$date= $date_match . ' ' . $heure_match;
//$date_match=date("D, d M Y H:i:s", strtotime($date));
$gameinfo = "";
$butassist = "";
$sql1 = "SELECT * FROM parties_events LEFT JOIN parties_subevents USING(id_partie_event) WHERE id_partie = " . $id_partie . " AND code_subevent = 1
AND code_event IN (4, 5) ORDER BY periode ASC, minutes ASC";
//$mysql_link1 = mysql_connect('72.55.128.7', 'Lhcarranza', '899357');
mysql_select_db('lhjmq_pii', $mysql_link);
$result_count1 = mysql_query($sql1, $mysql_link);
if (mysql_num_rows($result_count1) > 0){
//echo '<king>'.mysql_num_rows($result_count1).'</king>';
while ($event = mysql_fetch_assoc($result_count1)) {
$sql2 = "SELECT * FROM parties_subevents WHERE id_partie_event = $event[id_partie_event] AND code_subevent IN (1, 2) ORDER BY code_subevent";
//$mysql_link2 = mysql_connect('72.55.128.7', 'Lhcarranza', '899357');
mysql_select_db('lhjmq_pii', $mysql_link);
$result_count2 = mysql_query($sql2, $mysql_link);
if (mysql_num_rows($result_count2) > 0){
$counter = 0;
while ($subevent = mysql_fetch_assoc($result_count2)) {
$sql3 = "SELECT * FROM parties_joueurs LEFT JOIN parties_equipes USING(id_equipe) WHERE id_partie_joueur = $subevent[id_partie_joueur] AND parties_equipes.id_partie = $id_partie";
//$mysql_link3 = mysql_connect('72.55.128.7', 'Lhcarranza', '899357');
mysql_select_db('lhjmq_pii', $mysql_link);
$result_count3 = mysql_query($sql3, $mysql_link);
if (mysql_num_rows($result_count3) > 0){
$counter = $counter + 1;
if ($counter == 1){
$gameinfo = $gameinfo . '<but>';
}
if ($subevent[code_subevent] == 1) {
//Get the shooter
$shooter = mysql_fetch_assoc(mysql_query("SELECT * FROM parties_joueurs LEFT JOIN parties_equipes USING(id_equipe) WHERE id_partie_joueur = $subevent[id_partie_joueur] AND parties_equipes.id_partie = $id_partie", $mysql_link));
$sit = $subevent[param2];
$flags = $subevent[param1];
$minutes = $event[minutes];
if ($counter != 1){
$gameinfo = $gameinfo . '</but><but>';
}
$gameinfo = $gameinfo .'<periode>'.$event['periode'].'</periode><equipe>'.strtoupper($shooter['abreviation']).'</equipe><prenom>' . $shooter['prenom'] .'</prenom><nom>' . $shooter['nom'] .'</nom><temps>'.substr($minutes, 3).'</temps>';
/* if (isset($oldbutassist)){
$gameinfo = $gameinfo . $oldbutassist;
}*/
}
else
{
//Get the assistant
unset($assists);
$butassist = "";
$assists[] = mysql_fetch_assoc(mysql_query("SELECT * FROM parties_joueurs, parties_equipes WHERE id_partie_joueur = $subevent[id_partie_joueur] AND parties_joueurs.id_equipe = parties_equipes.id_equipe AND parties_equipes.id_partie = $id_partie", $mysql_link));
if (is_array($assists)) {
$count = 0;
$sep="";
$butassist = $butassist . "<assist>";
foreach ($assists as $assist) {
$butassist = $butassist. $sep ." ".$assist['prenom'] . " ". $assist['nom']." ";
$sep = ", ";
$count = $count + 1;
}
$butassist = $butassist . "</assist>";
}
else {
if ($sit != 0){
$butassist = $butassist . '<assist>sans aide</assist>';
}
}
$gameinfo = $gameinfo . $butassist;
//$oldbutassist = $butassist;
}
}
} $gameinfo = $gameinfo . '</but>';
}
}
}
echo '<match id="' . $id_partie . '">';
echo '<title>'. $but_dom . ' ' . $nom_equipe_dom . ' VS ' . $but_vis . ' ' . $nom_equipe_vis . '</title>';
echo '<link>http://www.lhjmq.qc.ca/lang_fr/index.php?page=342374&id_partie=' . $id_partie . '</link>';
echo '<scoreboard>'.$gameinfo.'</scoreboard>';
echo '<idmatch>' . $id_match . '</idmatch><local>'. $nom_equipe_dom . '</local><localabrev>'.$abrev_dom.'</localabrev><localscore>'. $but_dom . '</localscore><visiteur>' . $nom_equipe_vis . '</visiteur><visiteurabrev>'.$abrev_vis.'</visiteurabrev><visiteurscore>' . $but_vis . '</visiteurscore><date>' . $date_match . '</date><heure>' . $heure_match . '</heure><status>' . $gamestatus . '</status>';
echo '<fusilladestatus>'.$fusilladestatus.'</fusilladestatus>';
echo '<periode>'.$periode.'</periode>';
echo '<temprestant>'.$temp_restant.'</temprestant>';
echo '</match>';
unset($gameinfo);
}
echo '</root>';
}
?>
|