PHP - 使用jquery对表/表进行排序

时间:2015-06-25 15:32:30

标签: javascript php jquery

我正在使用tablefilter.free.fr的免费代码并将其添加到我的代码中,但它没有被执行。

我已将html和javascript添加到https://jsfiddle.net/koalyptus/eCqG3/中,但它工作正常,但当我使用我的页面时 - > http://mr-tipster.com/pages/newcard.php?venue=Southwell虽然输出了相同的html,但由于某种原因它不会呈现。

下面是我在页面上使用的完整代码,用于创建表格并添加javascript。

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript"  src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="../table/tablefilter.js"></script>

<?php

//show today's meeting name

    if ($numrows > 0) {
        echo '<a href="http://mr-tipster.com/pages/newcard.php?venue=' . urlencode($entry) . '" class="button green">' . $entry . '</a>';
    } else {
        echo '<a href="http://mr-tipster.com/pages/newcard.php?venue=' . urlencode($entry) . '" class="button jump">' . $entry . '</a>';
    }
    $met1 = array_values($meeting);

    if (array_shift($met1) == $entry && $venue ==""  || $venue == $entry)
    {
    echo '<a href="http://mr-tipster.com/pages/newcard.php?venue='.urlencode($entry).'" class="button green">'.$entry.'</a>';
    if ($venue =="")
    {
    $venue = array_shift($met1);
    }
    }
    else
    {



}
// pull the times for that meeting
$grabtracktimes = mysqli_query($db, 'SELECT Racetime,Going,distance, COUNT(*) c FROM tom_cards Where Track = "' . $venue . '" GROUP BY Racetime HAVING c > 1;');
$meetingtime    = array();
echo "<br />";
while ($grabtodaystracktimes = mysqli_fetch_array($grabtracktimes)) {
    $meetingtime[] = $grabtodaystracktimes['Racetime'];
}
$meetingtime1 = array_unique($meetingtime);
foreach ($meetingtime1 as $entrytime) {
    if ($time == "") {
        $time = array_shift(array_values($meetingtime1));
    }
    if (array_shift($meetingtime1) == $entrytime and $time == "" or $time == $entrytime) {
        echo '<a href="http://mr-tipster.com/pages/newcard.php?venue=' . urlencode($venue) . '&amp;time=' . $entrytime . '" class="button green medium">' . $entrytime . '</a>';
        if ($time == "") {
            $time = array_shift($meetingtime1);
        }
    } else {
        echo '<a href="http://mr-tipster.com/pages/newcard.php?venue=' . urlencode($venue) . '&amp;time=' . $entrytime . '" class="button white medium">' . $entrytime . '</a>';
    }
}
echo "<br /><b>" . $venue . "(" . $time . ")</b>";


  $sqltodaystrack  = "";
     $sqltodaystrack2  = mysqli_query($db,  $sqltodaystrack );
$todaystrackleftorright = "";
$todaystrackspeed = "";
$todaystracksurface = "";
    while ( $sqltodaystrack3 = mysqli_fetch_array($sqltodaystrack2)) {

    $todaystrackleftorright = $sqltodaystrack3['Left_or_Right'];
    $todaystrackspeed = $sqltodaystrack3['speed'];
    $todaystracksurface = $sqltodaystrack3['surface'];
    }








$sql     = 'SELECT Race_Name,distance,going,surface FROM tom_cards Where Track ="' . $venue . '" and Racetime = "' . $time . '" group by Racetime  ';
$horses2 = mysqli_query($db, $sql);
$first   = true;
while ($todayhorse = mysqli_fetch_array($horses2)) {
    if ($first == true) {
        // do something
        $first          = false;
        $todaysgoing    = $todayhorse['going'];
        $todaysdistance = miletofurlong($todayhorse['distance']);
        echo "<br /><br /><b>" . $todayhorse['Race_Name'] . "</b>";
        //add notes about the race course here
$sqlfortrack     = 'SELECT notes,Handicaps, Non_Handicaps FROM RaceCourse Where Course ="' . $venue . '"';
$fortrack = mysqli_query($db, $sqlfortrack  );

while ($fortrack2 = mysqli_fetch_array($fortrack)) {

echo "<br /><span style='font-size:11px'><b>Course Notes:</b> ".$fortrack2['notes']."</span><BR />";
//check if handicap or not and check for any course details

if (strpos($todayhorse['Race_Name'], 'Handicap') !== FALSE)
{
echo "<span style='font-size:11px'>".$fortrack2['Handicaps']."<span/>";
}
else
{
echo "<span style='font-size:11px'>".$fortrack2['Non_Handicaps']."</span>";
}



}
        echo " <br /><br />Distance: <b>" . miletofurlong($todayhorse['distance']) . "f </b>(" . $todayhorse['distance'] . ") Going: <b>" . $todayhorse['going'] . "</b>";
        $surface = trim($db->real_escape_string($todayhorse['surface']));
    }
}

echo "</div>";

echo "<table  id='table1'   style='border:0px;margin-top:50px;text-align: center ;'>";
echo "<tr style='font-weight: bold;'><td>Horse</td><td>Form</td><td>History</td><td>OR/Class</td><td>MT Rating</td><td>Naps</td></tr>";
$sql     = 'SELECT horse,rp,ts,Naps,`OR`,Class,Jockeys_Claim,Trainer,Track FROM tom_cards Where Track ="' . $venue . '" and Racetime = "' . $time . '"';
$horses2 = mysqli_query($db, $sql);
$loop    = 0;
while ($todayhorse = mysqli_fetch_array($horses2)) {
    $placed  = "";
    $data    = "";
    $horse   = trim($todayhorse['horse']);
    $jockeys = $todayhorse['Jockeys_Claim'];
    $trainer = $todayhorse['Trainer'];
    $class   = $todayhorse['Class'];
    $or      = $todayhorse['OR'];
    $rp      = $todayhorse['rp'];
    $ts      = $todayhorse['ts'];
    $naps    = $todayhorse['Naps'];
    if ($surface == "Turf") {
        $win          = 0;
        $runs         = 0;
        $place        = 0;
        $horsesplaced = ;
        $check        = "no";
        while ($pasthorse = mysqli_fetch_array($horsesplaced)) {
            $dbDate     = $pasthorse['Date'];
            $placeddata = intval($pasthorse['Place']);
            //add 1 to runs everyloop to show how many runs they have had
            $runs       = $runs + 1;
            //if the horse has won a race then mark it red and add 1 point to the win tally
            if ($placeddata == 1) {
                $placed .= "<b><span style='color:#8DB600'>" . $pasthorse['Place'] . "</span></b>";
                $win = $win + 1;
            } else {
                //if the horse was placed higher then 9th just add 0
                if (intval($pasthorse['Place']) > 9) {
                    $pasthorse['Place'] = 0;
                }
                //echo all the places
                if ($pasthorse['Place'] == "PU") {
                    $pasthorse['Place'] = str_replace($pasthorse['Place'], 'PU', '<b>P</b>');
                }
                if ($pasthorse['Place'] == "F") {
                    $pasthorse['Place'] = str_replace($pasthorse['Place'], 'F', '<b>F</b>');
                }
                if ($pasthorse['Place'] == "2" or $pasthorse['Place'] == "3") {
                    $pasthorse['Place'] = str_replace($pasthorse['Place'], $pasthorse['Place'], "<span style='color:#8DB600'>" . $pasthorse['Place'] . "</span>");
                }
                $placed .= $pasthorse['Place'];
                // if runners are greater then 4 and less the 8 only 2 to place
                if ($pasthorse['Runners'] < 4 and $pasthorse['Runners'] > 8) {
                    if ($pasthorse['Place'] == 2) {
                        $place = $place + 1;
                    }
                }
                if ($pasthorse['Runners'] < 7 and $pasthorse['Runners'] > 16) {
                    if ($pasthorse['Place'] == 2 or $pasthorse['Place'] == 3) {
                        $place = $place + 1;
                    }
                }
                if ($pasthorse['Runners'] < 15) {
                    if ($pasthorse['Place'] == 2 or $pasthorse['Place'] == 3 or $pasthorse['Place'] == 4) {
                        $place = $place + 1;
                    }
                }
            }
        }
    } elseif ($surface == "AW") {
        $win          = 0;
        $runs         = 0;
        $place        = 0;
        $horsesplaced = ;
        while ($pasthorse = mysqli_fetch_array($horsesplaced)) {
            $placeddata = intval($pasthorse['Place']);
            //add 1 to runs everyloop to show how many runs they have had
            $runs       = $runs + 1;
            //if the horse has won a race then mark it red and add 1 point to the win tally
            if ($placeddata == 1) {
                $placed .= "<b><span style='color:red'>" . $pasthorse['Place'] . "</span></b>";
                $win = $win + 1;
            } else {
                //if the horse was placed higher then 9th just add 0
                if (intval($pasthorse['Place']) > 9) {
                    $pasthorse['Place'] = 0;
                }
                //echo all the places
                $placed .= $pasthorse['Place'];
                // if runners are greater then 4 and less the 8 only 2 to place
                if ($pasthorse['Runners'] < 4 and $pasthorse['Runners'] > 8) {
                    if ($pasthorse['Place'] == 2) {
                        $place = $place + 1;
                    }
                }
                if ($pasthorse['Runners'] < 7 and $pasthorse['Runners'] > 16) {
                    if ($pasthorse['Place'] == 2 or $pasthorse['Place'] == 3) {
                        $place = $place + 1;
                    }
                }
                if ($pasthorse['Runners'] < 15) {
                    if ($pasthorse['Place'] == 2 or $pasthorse['Place'] == 3 or $pasthorse['Place'] == 4) {
                        $place = $place + 1;
                    }
                }
            }
        }
    }
    $winner  = "";
    $placed1 = "";
    if ($runs != 0) {
        $winner  = "(" . round(($win / $runs) * 100) . "%) ";
        $placed1 = "(" . round((($place + $win) / $runs) * 100) . "%) ";
    }
    $thetrack = horseontrack($horse, $venue, $db);
    list($corseruns, $corsewins, $corseplace) = explode("/", $thetrack);
    $sqlhorses   = "SELECT distance,Place,Runners FROM  `horsesrp`  WHERE  `Horse` = '" . $horse . "' order by distance + 0,
         substring_index(distance, 'm', -1) + 0";
    $horseplaced = mysqli_query($db, $sqlhorses);
    $data        = "";
    $dataleftorright = "";
    $dataspeed = ""; 
        $datasurface = ""; 
    $storage     = array();
    $storetrackdirection = array();
   $storetrackdirectionsurface= array();
   $storetrackspeed= array();
    while ($pasthorse = mysqli_fetch_array($horseplaced)) {
        // check to see if its distance is that of today
        $placetotals = 0;
        $wintotals   = 0;
        $test        = "";
        $placeddata  = intval($pasthorse['Place']);
        if ($placeddata == 1) {

        } else {
            if ($pasthorse['Runners'] > 4 and $pasthorse['Runners'] < 8) {
                $test = "--between 5 and 7--" . $pasthorse['Place'];
                if ($pasthorse['Place'] == 2) {
                    $placetotals = 1;
                }
            }
            if ($pasthorse['Runners'] > 7 and $pasthorse['Runners'] < 16) {
                $test = "--Between 8 and 15--" . $pasthorse['Place'];
                if ($pasthorse['Place'] == 2 or $pasthorse['Place'] == 3) {
                    $placetotals = 1;
                }
            }
            if ($pasthorse['Runners'] > 15) {
                $test = "over 15" . $pasthorse['Place'];
                if ($pasthorse['Place'] == 2 or $pasthorse['Place'] == 3 or $pasthorse['Place'] == 4) {
                    $placetotals = 1;
                }
            }
        }
        // if the distance is the same
        // Take this outside of the if statements
        $mtfl = miletofurlong($pasthorse['distance']);
        if ($mtfl == $todaysdistance) {
            $Horsedist = "<b><span style='color:#ff4500 '>" . $mtfl . "f</span></b>";
        } elseif (($mtfl >= $todaysdistance - 1) && ($mtfl <= $todaysdistance + 1)) {
            // You don't need to check for equality here - if you get here it is because
            // the values are not equal
            $Horsedist = "<b><span style='color:#8DB600'>" . $mtfl . "f</span></b>";
        } else {
            $Horsedist = $mtfl . "f";
        }
        if (!isset($storage[$Horsedist])) {
            $storage[$Horsedist] = array(
                "win" => 0,
                "placed" => 0,
                "raced" => 0
            );
        }
        // Then increment if required

        // $data .= "<span style='font-size:10.5px'>".$Horsedist. " -Won:".$wintotals. " Placed:".$placetotals."  </span><br />";
    }
    $sqlhorsesgoing   = "SELECT going,Place,Runners FROM  `horsesrp`  WHERE  `Horse` = '" . $horse . "' order by going";
    $horseplacedgoing = mysqli_query($db, $sqlhorsesgoing);
    $datagoing        = "";
    $storagegoing     = array();
    while ($pasthorsegoing = mysqli_fetch_array($horseplacedgoing)) {
        // check to see if its going is that of today

        $placeddatagoing  = intval($pasthorsegoing['Place']);
        if ($placeddatagoing == 1) {

        } else {
            if ($pasthorsegoing['Runners'] > 4 and $pasthorsegoing['Runners'] < 8) {
                if ($pasthorsegoing['Place'] == 2) {
                    $placetotalsgoing = 1;
                }
            }
            if ($pasthorsegoing['Runners'] > 7 and $pasthorsegoing['Runners'] < 16) {
                if ($pasthorsegoing['Place'] == 2 or $pasthorsegoing['Place'] == 3) {
                    $placetotalsgoing = 1;
                }
            }
            if ($pasthorsegoing['Runners'] > 15) {
                if ($pasthorsegoing['Place'] == 2 or $pasthorsegoing['Place'] == 3 or $pasthorsegoing['Place'] == 4) {
                    $placetotalsgoing = 1;
                }
            }
        }
        // if the going is the same
        // Take this outside of the if statements
        $mtfl1 = $pasthorsegoing['going'];
        if ($mtfl1 == $todaysgoing) {
            $Horsegoing = "<b><span style='color:#ff4500 '>" . $mtfl1 . "</span></b>";
        } else {
            $Horsegoing = $mtfl1;
        }
        if (!isset($storagegoing[$Horsegoing])) {
            $storagegoing[$Horsegoing] = array(
                "win" => 0,
                "placed" => 0,
                "raced" => 0
            );
        }
        // Then increment if required

    }


    $data = "<table class='tg' align='center' style='font-size:10.5px;'><tr><th style='padding-right:5px;'></th><th style='padding-right:5px;'> Runs </th><th style='padding-right:5px;'> Wins </th><th style='padding-right:5px;'> Placed </th></tr>";
    foreach ($storage as $pony => $tab) {
        // $data .= "<span style='font-size:10.5px'>".$Horsedist. " -Won:".$wintotals. " Placed:".$placetotals."  </span><br />";
        if ($tab["win"] !== 0) {
            $distancewinners = "<b><span style='color:#ff4500 '>" . $tab["win"] . "</span></b>";
        } else {
            $distancewinners = $tab["win"];
        }
        if ($tab["placed"] !== 0) {
            $distanceplace = "<b><span style='color:#ff4500 '>" . $tab["placed"] . "</span></b>";
        } else {
            $distanceplace = $tab["placed"];
        }

    }
    $data .= "</table>";



    foreach ($storagegoing as $ponygoing => $tabgoing) {
                  if ($tabgoing["win"] !== 0) {
            $distancewinners = "<b><span style='color:#ff4500 '>" . $tabgoing["win"] . "</span></b>";
        } else {
            $distancewinners = $tabgoing["win"];
        }
        if ($tabgoing["placed"] !== 0) {
            $distanceplace = "<b><span style='color:#ff4500 '>" . $tabgoing["placed"] . "</span></b>";
        } else {
            $distanceplace = $tabgoing["placed"];
        }


    //work out which courses the horse has ran at

 $horseplacedtracks  = "SELECT track,Place,Runners FROM  `horsesrp`  WHERE  `Horse` = '" . $horse . "'";
   $horseplacedtracks2  = mysqli_query($db, $horseplacedtracks  );
$track ="";
$leftorright = "";
$surface = "";
$speed = "";

 while ($pasthorsetracks  = mysqli_fetch_array($horseplacedtracks2 )) 
 {
 //remove (aw) and get the track name
$track = trim(str_replace("(AW)", "", $pasthorsetracks['track']));
//is the track left or right??


 // check to see if its going is that of today
        $placetotalstrack = 0;
        $wintotalstrack   = 0;
        $placeddatatrack  = intval($pasthorsetracks['Place']);
        if ($placeddatatrack == 1) {
            $placetotalstrack = 1;
            $wintotalstrack   = 1;
        } else {
            if ($pasthorsetracks['Runners'] > 4 and $pasthorsetracks['Runners'] < 8) {
                if ($pasthorsetracks['Place'] == 2) {
                    $placetotalstrack = 1;
                }
            }
            if ($pasthorsetracks['Runners'] > 7 and $pasthorsetracks['Runners'] < 16) {
                if ($pasthorsetracks['Place'] == 2 or $pasthorsetracks['Place'] == 3) {
                    $placetotalstrack = 1;
                }
            }
            if ($pasthorsetracks['Runners'] > 15) {
                if ($pasthorsetracks['Place'] == 2 or $pasthorsetracks['Place'] == 3 or $pasthorsetracks['Place'] == 4) {
                    $placetotalstrack = 1;
                }
            }
        }



// check the track against the database and asign left or right
$grabtrackdetails  = "SELECT Left_or_Right FROM  `RaceCourse`  WHERE  `Course` = '" . $track . "'";
   $grabtrackdetails2  = mysqli_query($db, $grabtrackdetails );
while ($pastgrabtrackdetails  = mysqli_fetch_array($grabtrackdetails2 )) 
 {
$leftorright = $pastgrabtrackdetails['Left_or_Right'];
/////////////////////////////////////////////////////////////////////////////////////
  if (!isset($storetrackdirection[$leftorright])) {
            $storetrackdirection[$leftorright] = array(
              "win" => 0,
                "placed" => 0,
                "raced" => 0
            );
        }
        // Then increment if required
       $storetrackdirection[$leftorright]["win"] += $wintotalstrack;
    $storetrackdirection[$leftorright]["placed"] += $placetotalstrack;
        $storetrackdirection[$leftorright]["raced"] += 1;
         }






         // check the track against the database and asign left or right
$grabtrackdetailssurface  = "SELECT surface FROM  `RaceCourse`  WHERE  `Course` = '" . $track . "'";
   $grabtrackdetailssurface2  = mysqli_query($db, $grabtrackdetailssurface );
while ($pastgrabtrackdetailssurface  = mysqli_fetch_array($grabtrackdetailssurface2 )) 
 {
$surface = $pastgrabtrackdetailssurface['surface'];

if ($surface == "")
{
$surface = "Mix";
}
/////////////////////////////////////////////////////////////////////////////////////
  if (!isset($storetrackdirectionsurface[$surface])) {
            $storetrackdirectionsurface[$surface] = array(
              "win" => 0,
                "placed" => 0,
                "raced" => 0
            );
        }
        // Then increment if required
       $storetrackdirectionsurface[$surface]["win"] += $wintotalstrack;
    $storetrackdirectionsurface[$surface]["placed"] += $placetotalstrack;
        $storetrackdirectionsurface[$surface]["raced"] += 1;
         }


             $horsehistory  = "SELECT Date,track,Class,Distance,going,Place,Jockeys_claim,`OR`,Runners FROM  `horsesrp`  WHERE  `Horse` = '" . $horse . "' order by Date DESC";
   $horsehistory2  = mysqli_query($db, $horsehistory  );
$horseshistoryget = "<br />";

?>
<script type="text/javascript">
var tf<?php echo $loop; ?> = setFilterGrid("loop<?php echo $loop; ?>");
</script>
<?

$horseshistoryget .= "<table id='loop".$loop."' class='mytable'  align='center' style='font-size:10.5px;'><tr><th style='padding-right:5px;'></th><th style='padding-right:5px;'> Course </th><th style='padding-right:5px;'> Class</th><th style='padding-right:5px;'> Distance </th><th style='padding-right:5px;'> Going</th><th style='padding-right:5px;'> Outcome </th><th style='padding-right:5px;'> Jockey </th><th style='padding-right:5px;'> OR </th></tr>";

 while ($gethorsehistory  = mysqli_fetch_array($horsehistory2 )) 
 {

    //$horseshistoryget .= "<tr style='height:18px;   border-top:1pt solid black;  border-bottom:0pt solid black;'><td  style='border-top:1pt solid black;  border-bottom:0pt solid black;'>" .$gethorsehistory["Date"] . "</td><td style='border-top:1pt solid black;  border-bottom:0pt solid black;'>" . $gethorsehistory["Track"] . "</td><td style='border-top:1pt solid black;  border-bottom:0pt solid black;'>" . $gethorsehistory["Class"]  . "</td><td style='border-top:1pt solid black;  border-bottom:0pt solid black;'>" . $gethorsehistory["Distance"]  . "</td><td style='border-top:1pt solid black;  border-bottom:0pt solid black;'>" . $gethorsehistory["Place"]  . "</td><td style='border-top:1pt solid black;  border-bottom:0pt solid black;'>" . $gethorsehistory["Jockeys_claim"]  . "</td><td style='border-top:1pt solid black;  border-bottom:0pt solid black;'>" . $gethorsehistory["`OR`"]  . "</td></tr>";
$timestamp = strtotime($gethorsehistory["Date"]);
 $newDate = date('d.m.y', $timestamp); 

 // check if the value is the same as today and bold it



$horseshistoryget .= "<tr><td>". $newDate. "</td>";



//check what todays course speed and surface is like
$todayscourseprofile = "SELECT speed,surface from RaceCourse where course = '".$venue."'    ";
  $todayscourseprofile2  = mysqli_query($db, $todayscourseprofile  );
   $todayscoursespeed = "" ;
 $todayscoursesurface = "";
 while ($gettodayscourseprofile  = mysqli_fetch_array($todayscourseprofile2 )) 
 {
 $todayscoursespeed = $gettodayscourseprofile["speed"] ;
 $todayscoursesurface = $gettodayscourseprofile ["surface"];
 }

//check if venue has the same profile as this one 
$trackprofie = trim(str_replace("(AW)", "", $gethorsehistory["track"]));
 $allcourseprofile = "SELECT speed, surface from RaceCourse where course = '".$trackprofie."' ";

  $allcourseprofile2  = mysqli_query($db, $allcourseprofile  );

 while ($getallcourseprofile  = mysqli_fetch_array($allcourseprofile2 )) 
 {
   $allcoursespeed = "" ;
 $allcoursesurface = "";
 $allcoursespeed = $getallcourseprofile["speed"] ;
 $allcoursesurface = $getallcourseprofile ["surface"];
 } 
 //if they match colour them


 if($todayscoursespeed ==  $allcoursespeed and  $allcoursesurface == $todayscoursesurface  )
 {
 if ($todayscoursespeed <> "" and $todayscoursesurface <> "")
 {
  $showtrack = "<span style='color:#336600 '>".$gethorsehistory["track"]."</span>";
  }
  else
  {
   $showtrack = $gethorsehistory["track"];
  }
 }
 elseif ($todayscoursespeed ==  $allcoursespeed)
 {

 if ($todayscoursespeed <> "")
 {
 $showtrack = "<span style='color:#996600 '>".$gethorsehistory["track"]."</span>";
  }
  else
  {
   $showtrack = $gethorsehistory["track"];
  }
 }
 elseif($todayscoursesurface ==  $allcoursesurface)
 {
  if ($todayscoursesurface <> "")
 {
 $showtrack = "<span style='color:#CC3300 '>".$gethorsehistory["track"]."</span>";
  }
  else
  {
   $showtrack = $gethorsehistory["track"];
  }

 }
 else

 {
 $showtrack = $gethorsehistory["track"];
 }




 if ($gethorsehistory["track"] == $venue)
{
$horseshistoryget .= "<td><b>" .  $showtrack.  "</b></td>";
}
else{
$horseshistoryget .= "<td>" .  $showtrack."</td>";
}





if ($gethorsehistory["Class"] == "Class".$class)
{
$horseshistoryget .= "<td><b>" . $gethorsehistory["Class"] . "</b></td>";
}
else
{
$horseshistoryget .= "<td>" . $gethorsehistory["Class"] .  "</td>";
}



if (miletofurlong($gethorsehistory["Distance"]) ==  $todaysdistance)
{
$horseshistoryget .= "<td><b>" . miletofurlong($gethorsehistory["Distance"]). "f" . "</b></td>";
}
else
{
$horseshistoryget .= "<td>" . miletofurlong($gethorsehistory["Distance"]). "f" . "</td>";
}

if ($gethorsehistory["going"]  ==  $todaysgoing)
{
$horseshistoryget .= "<td><b>" . $gethorsehistory["going"] .  "</b></td>";
}
else{
$horseshistoryget .= "<td>" .$gethorsehistory["going"] . "</td>";
}

if ($gethorsehistory["Place"] == 1){
$pastplace = "<b><span style='color:#ff4500 '>".$gethorsehistory["Place"]."</span></b>";
}
else{
$pastplace = $gethorsehistory["Place"];
}
$horseshistoryget .= "<td>" . $pastplace ."/". $gethorsehistory["Runners"].  "</td>";



if ($gethorsehistory["Jockeys_claim"] ==  $jockeys)
{
$horseshistoryget .= "<td><b>" .$gethorsehistory["Jockeys_claim"].  "</b></td>";
}
else{
$horseshistoryget .= "<td>" . $gethorsehistory["Jockeys_claim"] .  "</td>";
}

$horseshistoryget .= "<td>" .$t1. $gethorsehistory["OR"]  .$t2. "</td></tr>";


    }


$horseshistoryget .= "</table><br />";

    //does the jockey only have one ride today???
    echo "<tr valign='top'><td  >";
    echo "<b><span style='font-size:12px'> " . $horse . "</span></b> <sup><span style='font-size:10px;color:gray'><abbr title='Days Since Last Race'>" . horselastrace($horse, $db) . "</abbr> </span><b><span style='font-size:10px;color:red'><abbr title='Beaten Favourite'>" . horsebeatenfav($horse, $db) . "</abbr></span></sup></b>
<br /><span style='font-size:10.5px'><abbr title='Jockey'>J: " . $jockeys . "</abbr><abbr title='Jockey Win rate last 4 months'> (" . round(howhotisjockey($jockeys, $db)) . "%)</abbr> " . " <abbr title='Jockey Win rate on horse'>(" . round(howhotisjockeyonhorse($jockeys, $db, $horse)) . "%)</abbr><abbr title='Jockey rides today'> " . jockeyridestoday($jockeys, $db) . "</abbr>
<br /><abbr title='Trainer'> T: " . $trainer . "</abbr> <abbr title='Trainer Win rate last 4 months'>(" . round(howhotistrainer($trainer, $db)) . "%)</abbr> <abbr title='Trainers horses out today'>  " . trainersridestoday($trainer, $db) . "</abbr> </span></td>";
    echo "<td ><span style='font-size:11px'><abbr title='P = Pulled Up , F = Fell'> " . $placed . "</abbr></span> <span style='font-size:10.5px'> <abbr title='Win Percent'> " . $winner . "</abbr> <abbr title='Place Percent'>" . $placed1 . "</abbr></span>  </td>";
  //  echo "<td ><span style='font-size:11px'>".$dataleftorright.$dataspeed.$datasurface."</span></td>";
   // echo "<td >" . $data . "<br /></td>";
  //  echo "<td >" . $datagoing . "<br /></td>";
echo "<td >".$horseshistoryget."</td>";

    echo "<td ><span style='font-size:11px'><abbr title='class and highest winning OR'> " . classtop2($horse, $db, $or, $class) . "</abbr></span> </td>";
    echo "<td ><span style='font-size:11px'><abbr title='Mr-Tipster speed rating'> " . round((($rp + $ts) / 2)) . "</abbr> </span></td>";
    echo "<td ><span style='font-size:11px'>" . $naps . "</span></td>";
    echo "</tr>";
    $loop = $loop + 1;
}
?>
       </table>    
    </div>
                </body>

                </html>

0 个答案:

没有答案