Changeset 50

Show
Ignore:
Timestamp:
11/04/06 15:37:36 (14 years ago)
Author:
exi
Message:

Removed the pass-by-reference from class.http.php.
Changed Custom Shipvalue add-table to not show already entered ships - moved searchmask to top.

Location:
dev/common
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dev/common/admin_shp_val.php

    r47 r50  
    3131        { 
    3232            $search = true; 
    33             $searchstr = ' where shp.shp_class != 18 and shp.shp_id='.$id; 
     33            $searchstr = ' where ksb.shp_value is null and shp.shp_class != 18 and shp.shp_id='.$id; 
    3434        } 
    3535    } 
     
    3737    { 
    3838        $search = true; 
    39         $searchstr = " where shp.shp_class != 18 and shp.shp_name like '%{$name}%'"; 
     39        $searchstr = " where ksb.shp_value is null and shp.shp_class != 18 and shp.shp_name like '%{$name}%'"; 
    4040    } 
    4141    else 
     
    4747    { 
    4848        $query = 'select shp.shp_id as id, shp.shp_externalid as ext, shp.shp_name, shp.shp_class, 
    49                          shp.shp_baseprice, scl.scl_class, shp.shp_techlevel, scl.scl_value 
    50                          from kb3_ships shp inner join kb3_ship_classes scl on (shp.shp_class = scl.scl_id)'; 
     49                         shp.shp_baseprice, scl.scl_class, shp.shp_techlevel, scl.scl_value, ksb.shp_value 
     50                         from kb3_ships shp inner join kb3_ship_classes scl on (shp.shp_class = scl.scl_id) 
     51                         left join kb3_ships_values ksb on (shp.shp_id = ksb.shp_id)'; 
     52        $order = ' order by shp.shp_name asc'; 
    5153        $qry = new DBQuery(); 
    52         $qry->execute($query.$searchstr); 
     54        $qry->execute($query.$searchstr.$order); 
    5355        while ($data = $qry->getRow()) 
    5456        { 
     
    9597            $html .= '</form>'; 
    9698        } 
     99        else 
     100        { 
     101            $html .= 'No Ships found to be added.<br/>'; 
     102            unset($_REQUEST['opt']); 
     103        } 
    97104    } 
    98105} 
     
    143150    $page->setTitle("Administration - Shipvalues"); 
    144151 
     152    $html .= '<div class=block-header2>Add a Shipvalue</div>'; 
     153    $html .= '<form id="search" action="?a=admin_shp_val" method=post>'; 
     154    $html .= '<input type="hidden" name="opt" value="search"/>'; 
     155    $html .= '<table class="kb-subtable"><tr>'; 
     156    $html .= '<td>ShipID</td><td>or Shipname</td>'; 
     157    $html .= '</tr><tr>'; 
     158    $html .= '<td><input id="searchid" name="searchid" type="text" size="4"/></td>'; 
     159    $html .= '<td><input id="searchname" name="searchname" type="text" size="30"/></td>'; 
     160    $html .= '<td><input type="submit" name="submit" value="Search"/></td>'; 
     161    $html .= '</tr></table>'; 
     162    $html .= '</form><br/>'; 
     163 
    145164    $html .= "<div class=block-header2>View/Change Shipvalues</div>"; 
    146165    $qry = new DBQuery(); 
     
    149168                     from kb3_ships_values kbs 
    150169                     inner join kb3_ships shp on (kbs.shp_id = shp.shp_id) 
    151                      inner join kb3_ship_classes scl on (shp.shp_class = scl.scl_id)'; 
     170                     inner join kb3_ship_classes scl on (shp.shp_class = scl.scl_id) order by shp.shp_name asc'; 
    152171    $qry->execute($query); 
    153172    while ($data = $qry->getRow()) 
     
    215234        $html .= 'No Data.<br/>'; 
    216235    } 
    217  
    218     $html .= '<br/><br/><div class=block-header2>Add a Shipvalue</div>'; 
    219     $html .= '<form id="search" action="?a=admin_shp_val" method=post>'; 
    220     $html .= '<input type="hidden" name="opt" value="search"/>'; 
    221     $html .= '<table class="kb-subtable"><tr>'; 
    222     $html .= '<td>ShipID</td><td>or Shipname</td>'; 
    223     $html .= '</tr><tr>'; 
    224     $html .= '<td><input id="searchid" name="searchid" type="text" size="4"/></td>'; 
    225     $html .= '<td><input id="searchname" name="searchname" type="text" size="30"/></td>'; 
    226     $html .= '<td><input type="submit" name="submit" value="Search"/></td>'; 
    227     $html .= '</tr></table>'; 
    228     $html .= '</form>'; 
    229236} 
    230237$page->addContext($menubox->generate()); 
  • dev/common/class.http.php

    r44 r50  
    7777                $data .="--$boundary\r\n"; 
    7878            } 
    79             $request_string .= "Content-Length: ".strlen(&$data)."\r\n"; 
     79            $request_string .= "Content-Length: ".strlen($data)."\r\n"; 
    8080            $request_string .= "Content-Type: multipart/form-data, boundary=$boundary\r\n"; 
    8181        } 
     
    8787 
    8888        fputs($fp, $request_string.$data); 
    89         $this->sent = strlen(&$header)+strlen(&$data); 
     89        $this->sent = strlen($header)+strlen($data); 
    9090 
    9191        $header = 1; 
     
    109109        $this->header = $http_header; 
    110110        $this->content = $file; 
    111         $this->recv = strlen(&$http_header)+strlen(&$file); 
     111        $this->recv = strlen($http_header)+strlen($file); 
    112112        $this->requested = true; 
    113113    }