Jump to content

aebstract

Members
  • Posts

    1,105
  • Joined

  • Last visited

Posts posted by aebstract

  1. I have this in my .htaccess

     

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^([[:alnum:]_]+)/$ /index.php?page=$1 [NC,L]

    RewriteRule ^([[:alnum:]_]+)/([[:alnum:]]+)/$ /index.php?page=$1&var1=$2 [NC,L]

    RewriteRule ^([[:alnum:]_]+)/([[:alnum:]]+)/([[:alnum:]]+)/$ /index.php?page=$1&var1=$2&var2=$3 [NC,L]

    RewriteRule ^([[:alnum:]_]+)/([[:alnum:]]+)/([[:alnum:]]+)/([[:alnum:]]+)/$ /index.php?page=$1&var1=$2&var2=$3&var3=$4 [NC,L]

    RewriteRule ^([[:alnum:]_]+)/([[:alnum:]]+)/([[:alnum:]]+)/([[:alnum:]]+)/([[:alnum:]]+)/$ /index.php?page=$1&var1=$2&var2=$3&var3=$4&var4=$5  [NC,L]

     

    When I go to:

    url.com/Category/Intakes/ everything works fine

    url.com/Category/Motor Mounts/ I get 404 Not Found

     

    I know it's something to do with the space, cause I can manually type in anything without a space and it will go, anything with a space and 404. I'm unsure how to fix the regex to fix it though.

  2. Hello,

    I am not sure this is the correct location for this, but I think it is.. should be, hopefully.  8)

    We have an inventory control software that has a firebird sql based database, we have the odbc driver installed. This is on a windows server 2008 machine on our LAN. I need to access the information in that database from our web host so that I can use inventory counts on our website. I've got some very slight ideas of what to do but I have never done anything like this and for the most part am lost. Would really really appreciate any help I could get!

  3. I have an array, and to make it easy let's say they have 2 values: ET and SPEED

    Here is an example chart of the array printed out:

     

    KEY        ET          SPEED

    8          5.2          60

    3          5.3          60

    1          5.4          70

    7          5.4          60

    9          5.4          90

    6          5.5          60

    5          5.6          60

    2          5.6          65

    4          5.7          60

     

    I need to take this array and each group that has a matching ET, put them in order based on SPEED. The corrected chart should be like this:

     

    KEY        ET          SPEED

    8          5.2          60

    3          5.3          60

    9          5.4          90

    1          5.4          70

    7          5.4          60

    6          5.5          60

    2          5.6          65

    5          5.6          60

    4          5.7          60

     

    Just not sure of how to only arrange the section that need to be. Keys stay the same, just the order changes.

     

  4. I'll give your code a try and take a look at it. I was referring to q1s, etc and used X as a variable for them, sorry about that. I wasn't even thinking to mention it but, q1 q2 q3 would be lowest, but it's weird how it works. There is a target, say 4.70. You're trying to get as close as possible to that without going under, which I have taken and sorted out by creating an indexH and indexL. I didn't mention the L because I can do the same thing with it as I do with the H. There are 3 qualifying passes, if you run a 4.71 and then your other passes go under 4.70, you're still in a top spot because of your "best" time being that above 4.70 but very close to it. Hope that makes sense.

     

    I threw your code in to my 'compare' function, it didn't seem to change the results. Here is a link so you can see the output:

    http://www.outlawracing.com/index.php?page=ladders&event=8

    If you look under the class '5.30 index'

    I'm pretty bad with doing custom functions like this, but the bq is set as the "best qualifying time" and is the one that needs to be used for comparison against the others

  5. Oops! Forgot, this might help:

     

    function compare ($a, $b) {
         if (!array_key_exists('bq', $a) || !array_key_exists('bq', $b)) return -1;
         if ($a['bq'] == $b['bq']) return 0;
         return $a['bq'] > $b['bq'] ? 1 : -1; // switch to reverse the ordering
    }

  6. I've got a file that I haven't worked on in awhile and am needing to make a little change to it. Not too sure of how to do it though.

    The portion of the script I am looking at should be this:

     

    
    $indexH[$var][] = array('firstname' => "$r2[firstname]", 'lastname' => "$r2[lastname]", 'number' => "$r2[number]", 'id' => "$r2[id]", 'q1' => "$r2[q1]", 'q2' => "$r2[q2]", 'q3' => "$r2[q3]", 'q1rt' => "$r2[q1rt]", 'q2rt' => "$r2[q2rt]", 'q3rt' => "$r2[q3rt]", 'q1s' => "$r2[q1s]", 'q2s' => "$r2[q2s]", 'q3s' => "$r2[q3s]", 'regid' => "$r2[regid]", 'eventid' => "$r2[eventid]");
    
    

     

    
    $ir = 0;
    foreach ( $indexH[$var] as $val ){
    
    $q1 = $val[q1];
    $q2 = $val[q2];
    $q3 = $val[q3];
    
    	$var2 = substr($var,0,5);
    	$var2 = substr_replace($var2, "0", 4, 1);
    
    if ($q1 < "$var2") { $q1 = '99.999'; } else { $q1 = $val[q1]; }
    if ($q2 < "$var2") { $q2 = '99.999'; } else { $q2 = $val[q2]; }
    if ($q3 < "$var2") { $q3 = '99.999'; } else { $q3 = $val[q3]; }
    
    if (($q1 == $q2) && ($q1 == $q3)) {
    $indexH[$var][$ir][bq] = "$q1";
    } elseif (($q1 <= $q2) && ($q1 <= $q3)) {
    $indexH[$var][$ir][bq] = "$q1";
    } elseif ($q2 <= $q3) {
    $indexH[$var][$ir][bq] = "$q2";
    } else {
    $indexH[$var][$ir][bq] = "$q3";
    }
    
    $ir++;
    }
    
    
    foreach ($indexH[$var] as $key => $value) {
         uasort($indexH[$var], 'compare');
    }
    
    

     

     

    This is taking three dfferent values (q1, q2, q3) getting the best value of the three and then sorting the array based on the best value chosen. Now the addition. If two entries in the array have the same best value resulting in a tie, I need to compare their qXs from that best value, higher qXs gets put above the lower. X = 1,2,3 depending on which is best value. If any more information is needed let me know, sort of hard to explain.

     

  7. You don't have to redirect them to another script, you can just have it redirect them to the same page after you're done with what you're doing. Then you'll be there on a fresh page. Same concept I suppose, just doesn't use two separate scripts.

     

    if (isset($_POST[submit])) {
    do something
    }
    

  8. I have a text file with a lot of lines. Need to make each new line in the text file a new part of an array so I can loop through and remove everything except the first 5 characters. Unless there is a way to just remove everything except the first 5 characters of each line, they will also need a comma added to the end of them. If I get them in an array I can do whatever I need though.

  9. When you use the limit parameters in an explode function. ex: explode(" ", $something, -3);

    Is there a way to take your results and merge them to one variable. I'll have different amounts of results randomly. So I could have $var[0] - $var[5] or just $var[0] only. Wanting to turn the entire results range in to one, say just $var

  10. I'm not sure I 100% need ajax. I've never used ajax and have no clue where to really start. Basically, I have a dropdown that is generated based on folders in a specific directory. If I add an additional folder it'll be included in the dropdown.

     

    Easy enough

    <p><select name=\"category\">\n<option>Choose a Category:</option>\n";
    foreach ($categories as $value) {
    
    
    if ($_GET['class'] == $value) {
        $content .= "<option selected value=\"$value\">$value</option>\n";
    } else {
        $content .= "<option value=\"$value\">$value</option>\n";
    }
    
    
    
    }
    
    $content .= "</select>\n</p>
    

     

    I want it so that when you select one of the options, it creates another dropdown right below it. There will be folders inside the folder chosen in the first dropdown, and that's what I need generated in the second one. I'm thinking this should be very easy to do, I just have absolutely no clue at all how to approach it.

  11. I have an array/session set.

     

    $_SESSION[cart]

     

    It's in this format:

     

    Array
    (
        [0] => Array
            (
                [qty] => 1
                [cat] => EZ Street
                [file] => 844900751_iDZdR-M.jpg
            )
    
    )
    

     

    When I go to add another value to the array/session, I need to be able to look through and check to see if it's already set based on cat & file. If a record already exists, I just need to add +1 to the qty. Right now I got

     

    	foreach($_SESSION[cart] AS $key => $value){
    foreach($_SESSION[cart][$key] AS $key => $value){
    
    
    echo "$key $value";
    
    }}
    

     

    This to just get me my values, but I'm kind of stuck trying to figure out how to check it, and then if it already exists add the +1 and kill the rest of the add script.

  12. I didn't get this error in testing at all, and I tested many different times. Now it's show time and I'm getting an error, not sure why. I have a script for doing qualification times for runs in a drag racing organization. It'll be split up by races, I just added the race for this weekend and I'm getting an error. I have another race from a few weeks ago that is in, same file/script but has no errors.

    here are the two locations:

    errors: http://outlawracing.com/index.php?page=ladders&event=5

    non errors: http://outlawracing.com/index.php?page=ladders&event=1

     

    ladders.php

    <?php
    if (!isset($_GET[event])) {
    header("Location: index.php?page=standings");
    exit;
    } else {
    $content .= "
    <div id=\"content\">
    ";
    
    $loc = substr($_SERVER[REQUEST_URI], 1);
    $loc = explode("&o=", $loc);
    $loc = $loc[0];
    
    
    
    function compare ($a, $b) {
         if (!array_key_exists('bq', $a) || !array_key_exists('bq', $b)) return -1;
         if ($a['bq'] == $b['bq']) return 0;
         return $a['bq'] > $b['bq'] ? 1 : -1; // switch to reverse the ordering
    }
    function compare_reverse ($a, $b) {
         if (!array_key_exists('bq', $a) || !array_key_exists('bq', $b)) return -1;
         if ($a['bq'] == $b['bq']) return 0;
         return $a['bq'] < $b['bq'] ? 1 : -1; // switch to reverse the ordering
    }
    
    
    
    if ($_GET[lock] == 1) {
    mysql_query("UPDATE participants t1 JOIN registrations t2 ON (t1.regid = t2.id) SET `cr` = 'ql' WHERE class = '$_GET[class]' && eventid = '$_GET[event]'") or die(mysql_error());
    header("Location: index.php?page=ladders&event=$_GET[event]");
    }
    if ($_GET[unlock] == 1) {
    mysql_query("UPDATE participants t1 JOIN registrations t2 ON (t1.regid = t2.id) SET `cr` = '0' WHERE class = '$_GET[class]' && eventid = '$_GET[event]'") or die(mysql_error());
    header("Location: index.php?page=ladders&event=$_GET[event]");
    }
    if ($_GET[createp] == 1) {
    mysql_query("UPDATE events SET started = '1', round = '1' WHERE id = '$_GET[eventid]'") or die(mysql_error());
    mysql_query("UPDATE participants t1 JOIN registrations t2 ON (t1.regid = t2.id) SET `cr` = '1' WHERE class = '$_GET[class]' && eventid = '$_GET[event]'") or die(mysql_error());
    header("Location: index.php?page=ladders&event=$_GET[event]");
    }
    
    
    if (isset($_POST[submitq])){
    if(empty($_POST[q1])){ $_POST[q1] = '99.999'; }
    if(empty($_POST[q2])){ $_POST[q2] = '99.999'; }
    if(empty($_POST[q3])){ $_POST[q3] = '99.999'; }
    if(empty($_POST[q1s])){ $_POST[q1s] = '99.999'; }
    if(empty($_POST[q2s])){ $_POST[q2s] = '99.999'; }
    if(empty($_POST[q3s])){ $_POST[q3s] = '99.999'; }
    $query = mysql_query("UPDATE  participants SET q1 = '$_POST[q1]', q2 = '$_POST[q2]', q3 = '$_POST[q3]', q1s = '$_POST[q1s]', q2s = '$_POST[q2s]', q3s = '$_POST[q3s]' WHERE id = '$_POST[hidden]'") or DIE(mysql_error());
    }
    
    
    $query = mysql_query("SELECT * FROM events WHERE id = $_GET[event]") or DIE(mysql_error());
    if(mysql_num_rows($query)!=0){
    	while($r=mysql_fetch_array($query))
    	{
    
    $datestart1 = substr($r[datestart],0,-6);
    $datestart2 = substr($r[datestart],2,2);
    $datestart3 = substr($r[datestart],4,4);
    $datestart4 = substr($r[dateend],0,-6);
    $datestart5 = substr($r[dateend],2,2);
    $datestart6 = substr($r[dateend],4,4);
    
    $content .= "<h3><h1>$r[name]</h1>$datestart1/$datestart2/$datestart3 - $datestart4/$datestart5/$datestart6</h3><h3></h3>";
    
    
    
    	}
    }
    
    
    
    
    
    
    
    $var1 = "Outlaw 10.5";
    $var2 = "Limited Street";
    $var3 = "EZ Street";
    $var4 = "Real Street";
    $var5 = "Modified Street";
    $var6 = "4.70 Index";
    $var7 = "5.30 Index";
    $var8 = "6.00 Index";
    $var9 = "7.00 Index";
    
    
    
    
    $content .= "<strong><u>Pairing Ladders:</u></strong>";
    $content .= "<p>";
    
    
    for ($i = 1; $i <= 9; $i++){
    
    $primary = "var$i";
    $var = ${$primary};
    
    $query = mysql_query("
    SELECT * FROM participants INNER JOIN registrations ON registrations.id = regid WHERE class = '$var' && eventid = $_GET[event] && cr = '1' LIMIT 1
    ") or DIE(mysql_error());
    if(mysql_num_rows($query)!=0){
    	while($r=mysql_fetch_array($query))
    	{
    
    $content .= "<a href=\"pairings.php?event=$_GET[event]&class=$var\">$var</a><br />";
    
    }
    
    }
    
    }
    
    $content .= "</p><br />";
    
    
    
    
    for ($i = 1; $i <= 9; $i++){
    
    $primary = "var$i";
    $var = ${$primary};
    
    
    $count = 0;
    $content .= "<table cellspacing=\"0\" cellpadding=\"0\" style=\"margin: 0px; padding: 0px;\">";
    $content .= "<tr><td></td><td align=\"center\" width=\"140\"><strong>Round 1</strong></td><td align=\"center\" width=\"140\"><strong>Round 2</strong></td><td align=\"center\" width=\"140\"><strong>Round 3</strong></td><td></td></tr>";
    
    
    $content .= "<h3><a name=\"$var\">$var</a></h3>";
    
    
    
    
    
    
    
    
    
    if (($var == '4.70 Index') OR ($var == '5.30 Index') OR ($var == '6.00 Index') OR ($var == '7.00 Index')) {
    
    
    $query2 = mysql_query("
    SELECT participants.id, registrations.firstname, participants.eventid, registrations.lastname, participants.q1, participants.q2, participants.q3, participants.q1s, participants.q2s, participants.q3s, participants.q1rt, participants.q2rt, participants.q3rt, participants.regid
    FROM participants
    INNER JOIN registrations ON registrations.id = participants.regid
    WHERE participants.eventid = $_GET[event] AND registrations.class = '$var'") or DIE(mysql_error());
    if(mysql_num_rows($query)!=0){
    
    $indexL[$var] = array();
    $indexH[$var] = array();
    
    	while($r2=mysql_fetch_array($query2))
    	{
    
    	$var2 = substr($var,0,5);
    	$var2 = substr_replace($var2, "0", 4, 1);
    
    	if ((($r2[q1] + $r2[q1rt]) < $var2) && (($r2[q2] + $r2[q2rt]) < $var2) && (($r2[q3] + $r2[q3rt]) < $var2)){
    
    $indexL[$var][] = array('firstname' => "$r2[firstname]", 'lastname' => "$r2[lastname]", 'id' => "$r2[id]", 'q1' => "$r2[q1]", 'q2' => "$r2[q2]", 'q3' => "$r2[q3]", 'q1rt' => "$r2[q1rt]", 'q2rt' => "$r2[q2rt]", 'q3rt' => "$r2[q3rt]", 'q1s' => "$r2[q1s]", 'q2s' => "$r2[q2s]", 'q3s' => "$r2[q3s]", 'regid' => "$r2[regid]", 'eventid' => "$r2[eventid]");
    
    } else {
    
    $indexH[$var][] = array('firstname' => "$r2[firstname]", 'lastname' => "$r2[lastname]", 'id' => "$r2[id]", 'q1' => "$r2[q1]", 'q2' => "$r2[q2]", 'q3' => "$r2[q3]", 'regid' => "$r2[regid]", 'eventid' => "$r2[eventid]");
    
    }
    
    
    }
    }
    
    
    
    $ir = 0;
    foreach ( $indexH[$var] as $val ){
    
    $q1 = $val[q1];
    $q2 = $val[q2];
    $q3 = $val[q3];
    
    	$var2 = substr($var,0,5);
    	$var2 = substr_replace($var2, "0", 4, 1);
    
    if ($q1 < "$var2") { $q1 = '99.999'; } else { $q1 = $val[q1]; }
    if ($q2 < "$var2") { $q2 = '99.999'; } else { $q2 = $val[q2]; }
    if ($q3 < "$var2") { $q3 = '99.999'; } else { $q3 = $val[q3]; }
    
    if (($q1 == $q2) && ($q1 == $q3)) {
    $indexH[$var][$ir][bq] = "$q1";
    } elseif (($q1 <= $q2) && ($q1 <= $q3)) {
    $indexH[$var][$ir][bq] = "$q1";
    } elseif ($q2 <= $q3) {
    $indexH[$var][$ir][bq] = "$q2";
    } else {
    $indexH[$var][$ir][bq] = "$q3";
    }
    
    $ir++;
    }
    
    
    foreach ($indexH[$var] as $key => $value) {
         uasort($indexH[$var], 'compare');
    }
    
    
    
    
    
    $ir = 0;
    foreach ( $indexL[$var] as $val ){
    
    $q1 = $val[q1];
    $q2 = $val[q2];
    $q3 = $val[q3];
    
    	$var2 = substr($var,0,5);
    	$var2 = substr_replace($var2, "0", 4, 1);
    
    if (($q1 == $q2) && ($q1 == $q3)) {
    $indexL[$var][$ir][bq] = "$q1";
    } elseif (($q1 >= $q2) && ($q1 >= $q3)) {
    $indexL[$var][$ir][bq] = "$q1";
    } elseif ($q2 >= $q3) {
    $indexL[$var][$ir][bq] = "$q2";
    } else {
    $indexL[$var][$ir][bq] = "$q3";
    }
    
    $ir++;
    }
    
    
    foreach ($indexL[$var] as $key => $value) {
         uasort($indexL[$var], 'compare_reverse');
    }
    
    
    
    
    
    
    
    $query = mysql_query("
    SELECT registrations.firstname, registrations.lastname, participants.q1, participants.q2, participants.q3, participants.q1s, participants.q2s, participants.q3s, participants.id, participants.cr
    FROM events
    INNER JOIN participants ON participants.eventid = $_GET[event]
    INNER JOIN registrations ON registrations.id = participants.regid
    WHERE events.id = $_GET[event] AND registrations.class = '$var'") or DIE(mysql_error());
    if(mysql_num_rows($query)!=0){
    
    $query2 = mysql_query("
    SELECT * FROM participants INNER JOIN registrations ON registrations.id = regid WHERE class = '$var' && eventid = $_GET[event] LIMIT 1
    ") or DIE(mysql_error());
    if(mysql_num_rows($query2)!=0){
    
    	while($r2=mysql_fetch_array($query2))
    	{
    	$testcr = $r2[cr];
    	if ($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') {
    if ($r2[cr] == '0'){
    $content .= "<span style=\"float: right;\"><a href=\"index.php?page=ladders&lock=1&class=$var&event=$_GET[event]\">Lock $var</a></span>";
    } elseif ($r2[cr] == 'ql'){
    $content .= "<span style=\"float: right;\"><a href=\"index.php?page=ladders&unlock=1&class=$var&event=$_GET[event]\">Un-Lock $var</a></span><br /><span style=\"float: right;\"><a href=\"index.php?page=ladders&createp=1&class=$var&event=$_GET[event]\">Create Pairings</a></span>";
    }
    }
    if ($r2[cr] != '0' AND $r2[cr] != 'ql'){
    $content .= "<span style=\"float: right;\"><strong>Pairings Started</strong></span>";
    }
    	}
    }
    }
    
    
    
    
    
    $pos = 1;
    
    foreach ( $indexH[$var] as $val ){
    
    
    mysql_query("UPDATE participants SET qp = $pos WHERE regid = $val[regid]") or DIE(mysql_error());
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<form action=\"index.php?page=ladders&event=$_GET[event]\" method=\"post\" name=\"ladders\">\n";
    }
    
    $content .= "<tr><td style=\"line-height: 10px; border: 1px solid #555; padding: 10px; border-top: 0px; border-left: 0px; text-align: right;\">$pos) $val[firstname] $val[lastname]</td><td style=\"line-height: 10px; border-bottom: 1px solid #555; border-right: 1px solid #555; padding: 10px; padding-left: 20px; padding-right: 0px;\" align=\"left\">";
    
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q1\" value=\"$val[q1]\" size=\"4\" />";
    if(!empty($val[q1s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q1s\" value=\"$val[q1s]\" size=\"4\" />";
    } else {
    $content .= "$val[q1]";
    if(!empty($val[q1s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "$val[q1s]";
    }
    
    $content .= "</td><td style=\"line-height: 10px; border: 1px solid #555; padding: 10px; padding-left: 20px; padding-right: 0px; border-top: 0px; border-left: 0px; text-align: left;\" align=\"left\">";
    
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q2\" value=\"$val[q2]\" size=\"4\" />";
    if(!empty($val[q2s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q2s\" value=\"$val[q2s]\" size=\"4\" />";
    } else {
    $content .= "$val[q2]";
    if(!empty($val[q2s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "$val[q2s]";
    }
    
    
    $content .= "</td><td style=\"line-height: 10px; border-bottom: 1px solid #555; border-right: 1px solid #555; padding: 10px; padding-left: 20px; padding-right: 0px; text-align: left;\" align=\"left\">";
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q3\" value=\"$val[q3]\" size=\"4\" />";
    if(!empty($val[q3s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q3s\" value=\"$val[q3s]\" size=\"4\" />";
    } else {
    $content .= "$val[q3]";
    if(!empty($val[q3s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "$val[q3s]";
    }
    $content .= "</td>";
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<td> <input type=\"hidden\" name=\"hidden\" value=\"$val[id]\" /><input type=\"submit\" name=\"submitq\" value=\"Post\" /></td></tr></form>\n\n";
    } else {
    $content .= "<td></td></tr>\n\n";
    }
    
    
    $pos++;
    
    }
    
    
    
    
    
    
    
    
    
    
    foreach ( $indexL[$var] as $val ){
    
    mysql_query("UPDATE participants SET qp = $pos WHERE regid = $val[regid]") or DIE(mysql_error());
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<form action=\"index.php?page=ladders&event=$_GET[event]\" method=\"post\" name=\"ladders\">\n";
    }
    
    $content .= "<tr><td style=\"line-height: 10px; border: 1px solid #555; padding: 10px; border-top: 0px; border-left: 0px; text-align: right;\">$pos) $val[firstname] $val[lastname]</td><td style=\"line-height: 10px; border-bottom: 1px solid #555; border-right: 1px solid #555; padding: 10px; padding-left: 20px; padding-right: 0px;\" align=\"left\">";
    
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q1\" value=\"$val[q1]\" size=\"4\" />";
    if(!empty($val[q1s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q1s\" value=\"$val[q1s]\" size=\"4\" />";
    } else {
    $content .= "$val[q1]";
    if(!empty($val[q1s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "$val[q1s]";
    }
    
    $content .= "</td><td style=\"line-height: 10px; border: 1px solid #555; padding: 10px; padding-left: 20px; padding-right: 0px; border-top: 0px; border-left: 0px; text-align: left;\" align=\"left\">";
    
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q2\" value=\"$val[q2]\" size=\"4\" />";
    if(!empty($val[q2s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q2s\" value=\"$val[q2s]\" size=\"4\" />";
    } else {
    $content .= "$val[q2]";
    if(!empty($val[q2s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "$val[q2s]";
    }
    
    
    $content .= "</td><td style=\"line-height: 10px; border-bottom: 1px solid #555; border-right: 1px solid #555; padding: 10px; padding-left: 20px; padding-right: 0px; text-align: left;\" align=\"left\">";
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q3\" value=\"$val[q3]\" size=\"4\" />";
    if(!empty($val[q3s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q3s\" value=\"$val[q3s]\" size=\"4\" />";
    } else {
    $content .= "$val[q3]";
    if(!empty($val[q3s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "$val[q3s]";
    }
    $content .= "</td>";
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<td> <input type=\"hidden\" name=\"hidden\" value=\"$val[id]\" /><input type=\"submit\" name=\"submitq\" value=\"Post\" /></td></tr></form>\n\n";
    } else {
    $content .= "<td></td></tr>\n\n";
    }
    
    
    $pos++;
    
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    } else {
    
    
    
    
    
    
    
    
    
    
    
    
    $query = mysql_query("
    SELECT registrations.firstname, registrations.lastname, participants.q1, participants.q2, participants.q3, participants.q1s, participants.q2s, participants.q3s, participants.id, participants.cr
    FROM events
    INNER JOIN participants ON participants.eventid = $_GET[event]
    INNER JOIN registrations ON registrations.id = participants.regid
    WHERE events.id = $_GET[event] AND registrations.class = '$var'
    ORDER BY LEAST(q1, q2, q3)") or DIE(mysql_error());
    if(mysql_num_rows($query)!=0){
    
    
    
    
    $query2 = mysql_query("
    SELECT * FROM participants INNER JOIN registrations ON registrations.id = regid WHERE class = '$var' && eventid = $_GET[event] LIMIT 1
    ") or DIE(mysql_error());
    if(mysql_num_rows($query2)!=0){
    
    
    
    	while($r2=mysql_fetch_array($query2))
    	{
    	$testcr = $r2[cr];
    	if ($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') {
    if ($r2[cr] == '0'){
    $content .= "<span style=\"float: right;\"><a href=\"index.php?page=ladders&lock=1&class=$var&event=$_GET[event]\">Lock $var</a></span>";
    } elseif ($r2[cr] == 'ql'){
    $content .= "<span style=\"float: right;\"><a href=\"index.php?page=ladders&unlock=1&class=$var&event=$_GET[event]\">Un-Lock $var</a></span><br /><span style=\"float: right;\"><a href=\"index.php?page=ladders&createp=1&class=$var&event=$_GET[event]\">Create Pairings</a></span>";
    }
    }
    if ($r2[cr] != '0' AND $r2[cr] != 'ql'){
    $content .= "<span style=\"float: right;\"><strong>Pairings Started</strong></span>";
    }
    	}
    }
    
    
    $rn = 0;
    $pos = 1;
    	while($r=mysql_fetch_array($query))
    	{
    	mysql_query("UPDATE participants SET `qp` = '$pos' WHERE id = '$r[id]'") or die(mysql_error());
    
    	$t1 = $r[q1];
    	$t2 = $r[q2];
    	$t3 = $r[q3];
    $rn++;
    
    if ($r[q1] == '99.999') {
    $r[q1] = '';
    } elseif (($t1 == $t2) OR ($t1 == $t3)) {
    if (($t1 > $t2) OR ($t1 > $t3)) {
    } else {
    if ($user->data['username_clean'] != admin AND $user->data['user_id'] != '461' AND $user->data['user_id'] != '205') {
    $r[q1] = "<font color=red>$r[q1]</font>";
    }
    }
    } elseif (($t1 < $t2) && ($t1 < $t3)) {
    
    if ($user->data['username_clean'] != admin AND $user->data['user_id'] != '461' AND $user->data['user_id'] != '205') {
    $r[q1] = "<font color=red>$r[q1]</font>";
    }
    
    
    }
    
    
    
    
    if ($r[q2] == '99.999') {
    $r[q2] = '';
    } elseif (($t2 != $t1) && ($t2 == $t3)) {
    
    if ($user->data['username_clean'] != admin AND $user->data['user_id'] != '461' AND $user->data['user_id'] != '205') {
    $r[q2] = "<font color=red>$r[q2]</font>";
    }
    
    } elseif (($t2 < $t1) && ($t2 < $t3)) {
    
    if ($user->data['username_clean'] != admin AND $user->data['user_id'] != '461' AND $user->data['user_id'] != '205') {
    $r[q2] = "<font color=red>$r[q2]</font>";
    }
    
    
    }
    
    
    
    if ($r[q3] == '99.999') {
    $r[q3] = '';
    } elseif (($t3 < $t2) && ($t3 < $t1)) {
    if ($user->data['username_clean'] != admin AND $user->data['user_id'] != '461' AND $user->data['user_id'] != '205') {
    $r[q3] = "<font color=red>$r[q3]</font>";
    }
    }
    if ($r[q1s] == '99.999') {
    $r[q1s] = '';
    }
    if ($r[q2s] == '99.999') {
    $r[q2s] = '';
    }
    if ($r[q3s] == '99.999') {
    $r[q3s] = '';
    }
    
    
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<form action=\"index.php?page=ladders&event=$_GET[event]\" method=\"post\" name=\"ladders\">\n";
    }
    
    $content .= "<tr><td style=\"line-height: 10px; border: 1px solid #555; padding: 10px; border-top: 0px; border-left: 0px; text-align: right;\">$pos) $r[firstname] $r[lastname]</td><td style=\"line-height: 10px; border-bottom: 1px solid #555; border-right: 1px solid #555; padding: 10px; padding-left: 20px; padding-right: 0px;\" align=\"left\">";
    
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q1\" value=\"$r[q1]\" size=\"4\" />";
    if(!empty($r[q1s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q1s\" value=\"$r[q1s]\" size=\"4\" />";
    } else {
    $content .= "$r[q1]";
    if(!empty($r[q1s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "$r[q1s]";
    }
    
    $content .= "</td><td style=\"line-height: 10px; border: 1px solid #555; padding: 10px; padding-left: 20px; padding-right: 0px; border-top: 0px; border-left: 0px; text-align: left;\" align=\"left\">";
    
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q2\" value=\"$r[q2]\" size=\"4\" />";
    if(!empty($r[q2s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q2s\" value=\"$r[q2s]\" size=\"4\" />";
    } else {
    $content .= "$r[q2]";
    if(!empty($r[q2s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "$r[q2s]";
    }
    
    
    $content .= "</td><td style=\"line-height: 10px; border-bottom: 1px solid #555; border-right: 1px solid #555; padding: 10px; padding-left: 20px; padding-right: 0px; text-align: left;\" align=\"left\">";
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q3\" value=\"$r[q3]\" size=\"4\" />";
    if(!empty($r[q3s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q3s\" value=\"$r[q3s]\" size=\"4\" />";
    } else {
    $content .= "$r[q3]";
    if(!empty($r[q3s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "$r[q3s]";
    }
    $content .= "</td>";
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<td> <input type=\"hidden\" name=\"hidden\" value=\"$r[id]\" /><input type=\"submit\" name=\"submitq\" value=\"Post\" /></td></tr></form>\n\n";
    } else {
    $content .= "<td></td></tr>\n\n";
    }
    
    
    $pos++;
    	}
    
    
    
    
    
    
    
    
    
    
    $content .= "</table>";
    }
    
    
    
    		}
    
    
    
    }
    
    
    
    
    $content .= "
    </div>
    </div>
    </div>
    ";
    }
    ?>
    

     

  13. For size yes, but did you look at the quality difference in the two?

     

    http://rbnsn.com/phpfreaks/thumb_test.php?s=900

    http://outlawracing.com/gallery/Flyers/thumbs/huntsvillecard.jpg

     

    I'm thinking it has something to do with this:

     

          ImageColorAllocate($dimg, $colors['red'], $colors['green'], $colors['blue']);  // Tell The Server What Colors This Image Will Use

     

    When you look at it bigger like that, it's like it doesn't have enough colors to represent the image correctly?

  14. mhm, the only thing I can see that you would have to think a little harder on is: Can you have say 10 people pooling in for that 1200 points, but say each of them put 600 points? Meaning they went way over the 1200? Regardless you would still handle it the same, just using everyone's value added together. Good luck.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.