예제 #1
0
                    //trigger_error('OK');
                    if ($mode == 'edit') {
                        $geo_poster_id = $edit_poster;
                    } else {
                        $geo_poster_id = $user->data['user_id'];
                    }
                    $data_geo = array('geo_meeting_id' => 0, 'geo_marshrut_id' => 0, 'geo_name' => $geo_name, 'geo_country' => $geo_country, 'geo_region' => $geo_region, 'geo_link' => $geo_link, 'geo_poster_id' => $geo_poster_id, 'geo_last_edit_user' => time(), 'geo_save' => 0, 'geo_coord' => $geo_coord, 'geo_google' => $geo_google, 'geo_type' => $geo_type, 'geo_author' => $geo_author, 'geo_date' => $geo_date);
                    $redirect_url = append_sid("{$phpbb_root_path}meeting_cash.{$phpEx}");
                    if ($mode == 'edit') {
                        $data_geo_2 = array('geo_id' => $edit);
                        $data_geo = array_merge($data_geo, $data_geo_2);
                        update_geocash($geo_id, $data_geo, $i);
                        meta_refresh(2, $redirect_url);
                        trigger_error(sprintf($user->lang['GEO_EDITED'], '<a href="' . $redirect_url . '">', '</a>') . '<br />');
                    } else {
                        proverka_geo($data_geo, 0);
                        meta_refresh(2, $redirect_url);
                        trigger_error(sprintf($user->lang['GEO_ADDED'], '<a href="' . $redirect_url . '">', '</a>') . '<br />');
                    }
                }
            }
        }
        /**  template **/
        $geouid = $mode == 'edit' ? $edit_link : $geouid;
        $template->assign_vars(array('EDIT_NAME' => $edit_name, 'L_GEO' => $page_title, 'L_GO' => $user->lang['Submit'], 'GEO_UID' => $geouid, 'ERROR' => $errors, 'VIEW_DATA' => $view_data ? $view_data : ($mode == 'edit' ? $user->lang['INFO_EDIT_DATA'] : $user->lang['INFO_VIEW_DATA']), 'S_ACTION_SEND' => append_sid("{$phpbb_root_path}meeting_cash.{$phpEx}", "mode=new&amp;action=send"), 'S_ACTION_SEND_E' => append_sid("{$phpbb_root_path}meeting_cash.{$phpEx}", "mode=edit&amp;action=send&amp;edit={$edit}"), 'S_ACTION' => append_sid("meeting_cash.{$phpEx}"), 'EDIT' => $mode == 'edit' ? true : false, 'GEO_ID' => $edit));
        $template->set_filenames(array('body' => 'meetings_cashnew.html'));
        page_footer();
    }
}
/*
else if ($mode == 'edit')
예제 #2
0
                 $errors .= '<font size="3">' . $nameg . '</font><hr>';
                 // тип
                 get_type($line);
                 $errors .= '<font size="3">' . $type . '</font><hr>';
             }
             $first_line = false;
             find_me('<body>', $line);
             //если результат, то данные из следующей линии
             $first_line = $find_res == false ? false : true;
             // аттрибуты
             //--------
         }
         get_region_id($geo_region);
         $data_geo = array('geo_meeting_id' => $id, 'geo_marshrut_id' => $meeting_marshrut, 'geo_name' => htmlspecialchars($nameg), 'geo_country' => $region_id[1], 'geo_region' => $region_id[0], 'geo_link' => $meeting_geo[$i]['link'], 'geo_save' => $meeting_geo[$i]['save'], 'geo_poster_id' => $user->data['user_id'], 'geo_last_edit_user' => time(), 'geo_coord' => $wgsfull, 'geo_google' => $lat . ',' . $lon, 'geo_type' => $type, 'geo_author' => $author, 'geo_date' => $geo_date);
         //trigger_error($type. '+'. $author. '+'.$geo_date);
         proverka_geo($data_geo, $i);
         $geocashing[] = $geo_old['geo_id'];
     }
 }
 $field_g = 'mode=conf';
 $field_g .= $id == 0 ? '' : '&amp;id=' . $data_geo['geo_meeting_id'];
 $field_g .= !$meeting_marshrut ? '' : '&amp;m=' . $meeting_marshrut;
 $field_g .= !$id || $id == 0 ? '&amp;n=' . $next_id : '';
 for ($i = 0; $i < count($geocashing); $i++) {
     $field_g .= '&amp;t[' . $i . ']=' . $geocashing[$i] . '&amp;s[' . $i . ']=' . $meeting_geo[$i]['save'];
 }
 //Проверка, есть ли уже в Покатушке?
 for ($i = 0; $i < count($geocashing); $i++) {
     if ($geocashing[$i]) {
         $sql = "SELECT * FROM " . GEO_DATA_TABLE . " \n\t\t\t\t\tWHERE geo_meeting_id=" . (int) $data_geo['geo_meeting_id'] . "\n\t\t\t\t\tAND geo_id=" . $geocashing[$i];
         $result = $db->sql_query($sql);