예제 #1
0
    while (!$recordSet->EOF) {
        $tiles += $mosaic->expirePosition($recordSet->fields['x'], $recordSet->fields['y'], 0, true);
        print "tiles = {$tiles}<br/>";
        flush();
        $count++;
        $recordSet->MoveNext();
    }
    $recordSet->Close();
    print "<h2>All Done</h2>";
    print "Squares done = {$count}<br/>";
    print "Tiles deleted = {$tiles}";
    flush();
    exit;
} elseif (isset($_GET['gridref'])) {
    $square = new GridSquare();
    $ok = $square->validGridRef($_GET['gridref']);
    if ($ok) {
        $gridref = $_GET['gridref'];
        $smarty->assign_by_ref('gridref', $gridref);
        $smarty->assign('showinfo', 1);
        //can we find a square?
        $sq = $db->GetRow("select * from gridsquare where grid_reference='{$gridref}'");
        if (count($sq)) {
            $smarty->assign('percent_land', $sq['percent_land']);
        }
        //update?
        if (isset($_GET['save'])) {
            $percent = intval($_GET['percent_land']);
            if (count($sq)) {
                //update existing square
                $db->Execute("update gridsquare set percent_land='{$percent}' where gridsquare_id='{$sq['gridsquare_id']}'");
예제 #2
0
 $data['location'] = '';
 if (!empty($_GET['label'])) {
     $data['description'] = "labeled [" . strip_tags($_GET['label']) . "]";
     $db = NewADOConnection($GLOBALS['DSN']);
     $where = "label = " . $db->Quote($_GET['label']);
 } else {
     $data['description'] = "in a cluster";
     $where = 1;
 }
 $data['searchq'] = "inner join gridimage_group using (gridimage_id) where {$where} group by gridimage_id";
 $data['distance'] = 1;
 $nearstring = 'in';
 if (!empty($data['gridref'])) {
     require_once 'geograph/gridsquare.class.php';
     $square = new GridSquare();
     if ($square->validGridRef(preg_replace('/[^\\w]/', '', $data['gridref']))) {
         $grid_ok = $square->setByFullGridRef($data['gridref'], false, true);
         if ($grid_ok || $square->x && $square->y) {
             $data['description'] .= ", {$nearstring} grid reference " . $square->grid_reference;
             $data['x'] = $square->x;
             $data['y'] = $square->y;
         }
     }
     unset($data['gridref']);
 }
 if (empty($data['displayclass'])) {
     $data['displayclass'] = 'cluster2';
 }
 $data['breakby'] = 'label+';
 switch ($data['orderby']) {
     case 'label':