function get_shipping_fee($shippingid, $countyid, $stateid, $city, $weight)
 {
     $fee = array();
     $dao = D("Shipping_area");
     if (!is_numeric($city)) {
         $cityid = get_region_id($city);
     } else {
         $cityid = $city;
     }
     $list = $dao->where("shipping_id=" . $shippingid)->findall();
     if ($list) {
         foreach ($list as $k => $v) {
             $config = unserialize($v["config"]);
             if (is_numeric($cityid) && $cityid && in_array($cityid, $config)) {
                 return $this->shipping_fee($v, $weight);
             } elseif (is_numeric($stateid) && $stateid && in_array($stateid, $config)) {
                 return $this->shipping_fee($v, $weight);
             } elseif (is_numeric($countyid) && $countyid && in_array($countyid, $config)) {
                 return $this->shipping_fee($v, $weight);
             }
         }
     } else {
         $price['price'] = 0;
         return $price;
     }
 }
Esempio n. 2
0
function item_region_box($region_txt, $region_select_txt)
{
    $aRegions = osc_get_regions();
    $item = osc_item() != null ? osc_item() : array();
    switch (count($aRegions)) {
        case 0:
            // 0 regions
            ?>
                        <div class="clearfix">
                            <label><?php 
            echo $region_txt;
            ?>
</label>
                            <div class="input">
                                <input class="region_name" id="region_name" type="text" name="region" value="<?php 
            echo get_region_name($item);
            ?>
" />
                            </div>
                        </div>
            <?php 
            break;
        case 1:
            // only one region
            ?>
                        <input class="region_id" id="region_id" type="hidden" name="regionId" value="<?php 
            echo get_region_id($item);
            ?>
" />
            <?php 
            break;
        default:
            // more than one region
            ?>
                        <div class="clearfix">
                            <label><?php 
            echo $region_txt;
            ?>
</label>
                            <div class="input">
                                <select class="region_id" id="region_id" name="regionId">
                                    <option value=""><?php 
            echo $region_select_txt;
            ?>
</option>
                                    <?php 
            foreach ($aRegions as $region) {
                ?>
                                        <option value="<?php 
                echo $region['pk_i_id'];
                ?>
"><?php 
                echo $region['s_name'];
                ?>
</option>
                                    <?php 
            }
            ?>
                                </select>
                            </div>
                        </div>
            <?php 
            break;
    }
}
Esempio n. 3
0
?>
 ;
            twitter_theme.photo_remove_text       = "<?php 
_e('Remove', 'twitter_bootstrap');
?>
" ;
            twitter_theme.max_images_fields_txt   = "<?php 
_e('Sorry, you have reached the maximum number of images per ad', 'twitter_bootstrap');
?>
" ;
            twitter_theme.country_select_id       = "<?php 
echo get_country_id(osc_item() != null ? osc_item() : array());
?>
" ;
            twitter_theme.region_select_id        = "<?php 
echo get_region_id(osc_item() != null ? osc_item() : array());
?>
" ;
            twitter_theme.city_select_id          = "<?php 
echo get_city_id(osc_item() != null ? osc_item() : array());
?>
" ;
            twitter_theme.ajax_url                = "<?php 
echo osc_base_url(true) . '?page=ajax';
?>
" ;
            twitter_theme.text_select_country     = "<?php 
_e('Select a country...', 'twitter_bootstrap');
?>
" ;
            twitter_theme.text_select_region      = "<?php 
Esempio n. 4
0
function get_region_id($name, $first = 1)
{
    global $ft;
    $sys = $ft->dbh->_select_row_as_object('SELECT regionid FROM tbl:regions WHERE name = ?', array($name));
    if ($sys) {
        return $sys->regionid;
    }
    if ($first) {
        $ft->dbh->_do_query('INSERT INTO tbl:regions (name) VALUES (?)', array($name));
        return get_region_id($name, 0);
        # 0 to not retry the insert if we fail again
    }
    return 0;
}
Esempio n. 5
0
                     		Замечательные люди 5
                     		Исторический 6
                     		Логический 10
                     		Музей/экскурсия 8
                     		Природный 1
                     		Прогулка 9
                     		Техноген 3
                     		Фортификация 7
                     		Экстремальный 11
                     		Неопределенный  0
                     		*/
                     // аттрибуты
                     //----------
                 }
                 $geo_region = $region_Grab['oblast'] != '' ? $region_Grab['oblast'] : $region_Grab['strana'];
                 get_region_id($geo_region, $region_Grab['strana']);
                 //$errors .= '<font size="3">'. $region_id[0] .'</font><hr>';
                 $s_hidden_fields = build_hidden_fields(array('geo_name' => htmlspecialchars($nameg), 'geo_link' => $geouid, 'geo_country' => $region_id[1], 'geo_region' => $region_id[0], 'geo_last_edit_user' => time(), 'geo_poster_id' => $user->data['user_id'], 'geo_coord' => $wgsfull, 'geo_google' => $lat . ',' . $lon, 'geo_type' => $gtype, 'geo_author' => $author, 'geo_date' => $geo_date));
                 $template->assign_vars(array('HIDDEN_FIELD' => $s_hidden_fields));
             }
         } else {
             $errors .= $user->lang['Error_url'];
         }
     }
 }
 if ($action == 'send') {
     if ($user->data['user_id'] == ANONYMOUS) {
         trigger_error($user->lang['Error_auth']);
     }
     include_once $phpbb_root_path . 'portal/includes/functions_meeting.' . $phpEx;
     $geo_name = utf8_normalize_nfc(request_var('geo_name', '', true));
Esempio n. 6
0
                 $errors .= '<font size="3">' . $author . '</font><hr>';
                 // название
                 get_name($line);
                 $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++) {