示例#1
0
 /**
  * 获取底部导航
  * @return array 底部导航
  */
 public function getBottomNav()
 {
     $city = get_city();
     if (($bottomNav = model('Cache')->get('bottomNav_' . $city)) === false) {
         $map['status'] = 1;
         $map['position'] = 1;
         $map['city'] = $city;
         $list = $this->where($map)->order('order_sort ASC')->findAll();
         foreach ($list as $v) {
             $v['url'] = empty($v['url']) ? 'javascript:;' : str_replace('{website}', SITE_URL, $v['url']);
             if ($v['parent_id'] == 0) {
                 $navlist[$v['navi_id']] = $v;
             }
         }
         foreach ($list as $v) {
             if ($v['parent_id'] > 0) {
                 $navlist[$v['parent_id']]['child'][] = $v;
             }
         }
         $bottomNav = $navlist;
         empty($bottomNav) && ($bottomNav = array());
         model('Cache')->set('bottomNav_' . $city, $bottomNav);
     }
     return $bottomNav;
 }
示例#2
0
文件: Loader.php 项目: padideIt/wall
 public function loadCity_option()
 {
     $this->load->helper('wall_mapdb');
     $state = $this->input->post('state');
     $cities = get_city(false, $state);
     foreach ($cities as $city) {
         echo "<option value=\"{$city['id']}\" >{$city['title']}</option>";
     }
 }
 public function getAllWeibaCate()
 {
     $map['city'] = get_city();
     $list = $this->where($map)->findAll();
     $temp = array();
     foreach ($list as $v) {
         $temp[$v['id']] = $v['name'];
     }
     return $temp;
 }
示例#4
0
function print_form($db, $smarty, $print_ad = 0)
{
    if ($print_ad) {
        $print_ad = get_ad($db, $print_ad);
    }
    $add = get_all($db);
    $smarty->assign('add', $add);
    $smarty->assign('print_ad', $print_ad);
    $smarty->assign('city', get_city($db));
    $smarty->assign('category', get_category($db));
    $smarty->display('form.tpl');
}
 /**
  * 登录后台
  * @return boolean 登录后台是否成功
  */
 public function adminLogin()
 {
     if (is_numeric($_POST['uid'])) {
         $map['uid'] = intval($_POST['uid']);
     } else {
         $map['email'] = t($_POST['email']);
     }
     $login = M('User')->where($map)->find();
     if ($this->loginLocal($login['email'], $_POST['password'])) {
         $GLOBALS['ts']['mid'] = $_SESSION['adminLogin'] = intval($_SESSION['mid']);
         if ($_SESSION['mid'] != 1) {
             $city = getMyCity($_SESSION['mid']);
             get_city($city);
         }
         return true;
     } else {
         return false;
     }
 }
 /**
  * 用户管理 - 用户列表
  */
 public function index()
 {
     $_REQUEST['tabHash'] = 'index';
     // 初始化用户列表管理菜单
     $this->_initUserListAdminMenu('index');
     // 数据的格式化与listKey保持一致
     // 列表批量操作按钮
     $this->pageButton[] = array('title' => L('PUBLIC_SEARCH_USER'), 'onclick' => "admin.fold('search_form')");
     $this->pageButton[] = array('title' => '禁用用户', 'onclick' => "admin.delUser()");
     $map = array();
     if ($_SESSION['mid'] != 1) {
         $map['city_id'] = get_city();
     } else {
         $this->pageButton[] = array('title' => L('PUBLIC_TRANSFER_USER_GROUP'), 'onclick' => "admin.changeUserGroup()");
     }
     $listData = $this->_getUserList('20', $map, 'index');
     // 转移用户部门,如果需要请将下面的注释打开
     // $this->pageButton[] = array('title'=>L('PUBLIC_TRANSFER_DEPARTMENT'),'onclick'=>"admin.changeUserDepartment()");
     $this->displayList($listData);
 }
示例#7
0
function cookie_city($city)
{
    global $INI;
    if ($city) {
        cookieset('city', $city['id']);
        return $city;
    }
    $city_id = cookieget('city');
    if (!$city_id) {
        $city = get_city();
        if (!$city) {
            $city = Table::Fetch('category', $INI['hotcity'][0]);
        }
        if ($city) {
            cookie_city($city);
        }
        return $city;
    } else {
        if (in_array($city_id, $INI['hotcity'])) {
            return Table::Fetch('category', $city_id);
        }
        $INI['hotcity'] = array_diff($INI['hotcity'], array(0, NULL));
        $city = Table::Fetch('category', $INI['hotcity'][0]);
    }
    return $city;
}
示例#8
0
}
if (isset($_COOKIE['renrenid'])) {
    $_SESSION['email'] = $_COOKIE['renrenid'];
    $mark = 1;
} else {
    $mark = 0;
}
if (isset($_GET['shopid'])) {
    $smarty->assign('shopname', get_shopname($db, $_GET['shopid']));
}
if (isset($_SESSION['email']) && isset($_COOKIE['renrenid'])) {
    $user = get_user($db, $_SESSION['email']);
    $nc = "<img src='./images/ico_renren.gif' align='bottom'/><a href='http://www.renren.com'  target='_blank'>" . $user['nickname'] . "</a>&nbsp;积分:" . $user['jifen'] . "&nbsp;&nbsp;<a id='feed_link' href='javascript:void(0);'>告诉好友</a>";
} elseif (isset($_SESSION['email']) && !isset($_COOKIE['renrenid'])) {
    $user = get_user($db, $_SESSION['email']);
    $nc = $user['nickname'] . "&nbsp;积分:" . $user['jifen'];
} else {
    $nc = NULL;
}
$city = get_city($db, $bulid);
$area = get_area($db, $bulid);
$shopcount = getshopcounts($db, $bulid);
$dinnercount = getdinnercounts($db, $bulid);
$smarty->assign("city", $city);
$smarty->assign("dinnercount", $dinnercount);
$smarty->assign("shopcount", $shopcount);
$smarty->assign("build", $area['b']);
$smarty->assign('mark', $mark);
$smarty->assign('nc', $nc);
$smarty->assign('tag', $tag);
$smarty->display("header.tpl");
示例#9
0
              <div id="cont-postalcode" class="row">
                <label for="postalcode">Zip / Postal Code</label>
                <input type="text" name="postalcode" id="postalcode" value=""/>
              </div>               

              <div id="cont-country" class="row">
                <label for="country">Country</label>
                <input type="text" name="country" id="country" value="Indonesia" readonly="readonly"/>
              </div>      

              <div class="row">
                <label for="city">City</label>
                <select class="select" name="city" id="city">
                  <?php 
$data = get_city();
if ($data["result"]) {
    foreach ($data["result"] as $row) {
        $city_id = $row->city_id;
        $city_name = $row->city_name;
        $type = $row->type;
        echo "\n                          <option value='" . $city_id . "'>" . $city_name . " [" . $type . "]</option>\t\t\t\t\n                        ";
    }
}
?>
   
                </select>
              </div>                         


              <div class="row">
示例#10
0
                update_country($recData['ID'], $recData['value_est'], $recData['value_eng'], $recData['value_rus']);
            }
        }
        $refresh = true;
    }
}
$strTemplate = "pop.edasimuuja.location.tpl";
if (!$_POST['formUser_submit']) {
    $recData['country'] = $_GET['country'];
    $recData['region'] = $_GET['region'];
    $recData['ID'] = $_GET['ID'];
}
if ($recData['country']) {
    if ($recData['region']) {
        if ($recData['ID']) {
            $city = get_city($recData['ID']);
            $recData['city'] = $recData['ID'];
            if (!$_POST['formUser_submit']) {
                $recData['value_est'] = $city[0]['name_est'];
                $recData['value_eng'] = $city[0]['name_eng'];
                $recData['value_rus'] = $city[0]['name_rus'];
            }
        }
        $region = get_region($recData['region']);
    } else {
        if ($recData['ID']) {
            $region = get_region($recData['ID']);
            if (!$_POST['formUser_submit']) {
                $recData['value_est'] = $region[0]['name_est'];
                $recData['value_eng'] = $region[0]['name_eng'];
                $recData['value_rus'] = $region[0]['name_rus'];
示例#11
0
文件: Ads.php 项目: padideIt/wall
 public function checkCity()
 {
     $this->load->helper('wall_mapdb');
     $city = get_city($this->security->xss_clean($_POST['city']));
     if (isset($city[0])) {
         return true;
     } else {
         return false;
     }
 }
示例#12
0
     foreach ($courier_city as $key => $city) {
         insertCourierRate($courier_name, $courier_province, $city, $courier_rate[$key], $courier_weight);
     }
     foreach ($courier_rate as $rate) {
         update_rate($initial_id, $courier_id['latest_id'], $rate);
         $initial_id++;
     }
 } else {
     if ($courier_service == "Local & International") {
         // LOCAL
         $foreach_province = $_POST['province_name'];
         $foreach_city_name = $_POST['city_name'];
         $foreach_rate = clean_price($_POST['array_rate']);
         $weight = $_POST['courier_weight'];
         foreach ($foreach_province as $provinces) {
             $city = get_city($provinces);
             foreach ($city as $key => $city) {
                 insertCourierRate($courier_id['latest_id'], $provinces, $city['city_name'], '0', $weight);
             }
         }
         $rate = clean_price($_POST['courier_rate']);
         $courier_rate_id = get_min_courier($courier_id['latest_id']);
         $initial_id = $courier_rate_id['latest_id'];
         foreach ($rate as $rate) {
             update_rate($initial_id, $courier_id['latest_id'], $rate);
             $initial_id++;
         }
         // INTERNATIONAL
         $courier_name = $courier_id['latest_id'];
         $courier_province = "international";
         $courier_city = $_POST['international_id'];
示例#13
0
$default_sort_by = "category_name";
$pgdata = page_init($equal_search, $default_sort_by);
// static/general.php
$page = $pgdata['page'];
$query_per_page = $pgdata['query_per_page'];
$sort_by = $pgdata['sort_by'];
$first_record = $pgdata['first_record'];
$search_parameter = $pgdata['search_parameter'];
$search_value = $pgdata['search_value'];
$search_query = $pgdata['search_query'];
$search = $pgdata['search'];
$full_order = count_city($search_query, $sort_by, $query_per_page);
$total_query = $full_order['total_query'];
$total_page = ceil($full_order['total_query'] / $query_per_page);
// CALL FUNCTION
$listing_order = get_city($search_query, $sort_by, $first_record, $query_per_page);
// HANDLING ARROW SORTING
if ($_REQUEST['srt'] == "category_name DESC") {
    $arr_order_number = "<span class=\"sort-arrow-up\"></span>";
} else {
    if ($_REQUEST['srt'] == "category_name") {
        $arr_order_number = "<span class=\"sort-arrow-down\"></span>";
    } else {
        $arr_order_number = "<span class=\"sort-arrow-down\"></span>";
    }
}
// STORED VALUE
echo "<input type=\"hidden\" name=\"url\" id=\"url\" class=\"hidden\" value=\"http://" . $_SERVER['HTTP_HOST'] . get_dirname($_SERVER['PHP_SELF']) . "/career-city-view\">\n";
echo "<input type=\"hidden\" name=\"page\" id=\"page\" class=\"hidden\" value=\"" . $page . "\" /> \n";
echo "<input type=\"hidden\" name=\"query_per_page\" id=\"query_per_page\" class=\"hidden\" value=\"" . $query_per_page . "\" /> \n";
echo "<input type=\"hidden\" name=\"total_page\" id=\"total_page\" class=\"hidden\" value=\"" . ceil($full_order['total_query'] / $query_per_page) . "\" /> \n";
示例#14
0
文件: Admin.php 项目: padideIt/wall
 public function manage_ads($offset = 0)
 {
     if ($this->ion_auth->is_admin() or $this->ion_auth->in_group(3) && $this->permission(2)) {
         $this->load->model('admin_model');
         $this->load->library('pagination');
         $this->load->helper('wall_mapdb');
         $get = array();
         $query = urldecode($_SERVER['QUERY_STRING']);
         if ($query != null || $query != "") {
             $a = explode('&', $query);
             foreach ($a as $key => $b) {
                 $b = explode('=', $b);
                 if (isset($b[0]) && isset($b[1])) {
                     $get[htmlspecialchars(urldecode($b[0]))] = htmlspecialchars(urldecode($b[1]));
                 }
             }
         }
         // pagination offset
         if (!isset($get['ipp']) || !is_numeric($get['ipp'])) {
             $get['ipp'] = 0;
         }
         $search['page'] = $this->security->xss_clean($get['ipp']);
         $str = "";
         $flag = true;
         // ads id filter
         if (isset($get['id']) && $get['id'] != "") {
             $recived['id'] = $this->security->xss_clean($get['id']);
             $id = $recived['id'];
             $search['id'] = $id;
             if (!$flag) {
                 $str .= "&id={$recived['id']}";
             } else {
                 $str .= "id={$recived['id']}";
             }
             $flag = false;
             $data['searchId'] = $recived['id'];
         } else {
             $data['searchId'] = "";
         }
         // ads cat filter
         if (isset($get['cat']) && $get['cat'] != "") {
             $recived['cat'] = $this->security->xss_clean($get['cat']);
             $cat = $recived['cat'];
             $search['cat'] = $cat;
             if (!$flag) {
                 $str .= "&cat={$recived['cat']}";
             } else {
                 $str .= "cat={$recived['cat']}";
             }
             $flag = false;
             $data['searchCat'] = $recived['cat'];
         } else {
             $data['searchCat'] = "";
         }
         // ads status filter
         if (isset($get['status']) && $get['status'] != 'false') {
             $recived['status'] = $this->security->xss_clean($get['status']);
             $status = $recived['status'];
             $search['status'] = $status;
             if (!$flag) {
                 $str .= "&status={$recived['status']}";
             } else {
                 $str .= "status={$recived['status']}";
             }
             $flag = false;
             $data['searchStatus'] = $recived['status'];
         } else {
             $data['searchStatus'] = "";
         }
         // ads state filter
         if (isset($get['state']) && $get['state'] != 0) {
             $recived['state'] = $this->security->xss_clean($get['state']);
             $search['state'] = $recived['state'];
             if (!$flag) {
                 $str .= "&state={$recived['state']}";
             } else {
                 $str .= "state={$recived['state']}";
             }
             $flag = false;
             $data['searchState'] = $recived['state'];
             $data['states'] = get_state();
         } else {
             $data['searchState'] = "";
             $data['states'] = get_state();
         }
         // ads city filter
         if (isset($get['city']) && $get['city'] != 0 && (isset($get['state']) && $get['state'] != 0)) {
             $recived['city'] = $this->security->xss_clean($get['city']);
             $search['city'] = $recived['city'];
             if (!$flag) {
                 $str .= "&city={$recived['city']}";
             } else {
                 $str .= "city={$recived['city']}";
             }
             $flag = false;
             $data['searchCity'] = $recived['city'];
             $data['cities'] = get_city(false, $get['state']);
         } else {
             if (isset($get['state']) && $get['state'] != 0) {
                 $data['cities'] = get_city(false, $get['state']);
             }
             $data['searchCity'] = "";
         }
         // sort order
         if (isset($get['sortby']) && $get['sortby'] != 0) {
             $recived['sortby'] = $this->security->xss_clean($get['sortby']);
             $search['sortby'] = $recived['sortby'];
             if (!$flag) {
                 $str .= "&sortby={$recived['sortby']}";
             } else {
                 $str .= "sortby={$recived['sortby']}";
             }
             $flag = false;
             $data['searchSort'] = $recived['sortby'];
         } else {
             $data['searchSort'] = "";
         }
         // perpage number
         if (isset($get['perpage']) && $get['perpage'] != 0) {
             $recived['perpage'] = $this->security->xss_clean($get['perpage']);
             $search['perpage'] = $recived['perpage'];
             if (!$flag) {
                 $str .= "&perpage={$recived['perpage']}";
             } else {
                 $str .= "perpage={$recived['perpage']}";
             }
             $flag = false;
             $data['searchPerpage'] = $recived['perpage'];
         } else {
             $search['perpage'] = 20;
             $data['searchPerpage'] = "";
         }
         $data['ads'] = $this->admin_model->get_ads($search);
         // create pagination links
         $config['base_url'] = site_url('admin/manage_ads?');
         $config['total_rows'] = $data['ads']['num'];
         $config['per_page'] = $search['perpage'];
         $config['first_url'] = site_url('admin/manage_ads?');
         $config['num_links'] = 5;
         $config['cur_page'] = $get['ipp'];
         $config['page_query_string'] = TRUE;
         if ($str == "") {
             $str = "ipp";
         } else {
             $str .= "&ipp";
         }
         $config['query_string_segment'] = $str;
         $config['full_tag_open'] = '<ul class="tsc_pagination">';
         $config['full_tag_close'] = '</ul>';
         $config['prev_link'] = '&#x21AB;';
         $config['prev_tag_open'] = '<p class="paginationPrevTag">';
         $config['prev_tag_close'] = '</p>';
         $config['next_link'] = '&#x21AC';
         $config['next_tag_open'] = '<p class="paginationNextTag">';
         $config['next_tag_close'] = '</p>';
         $config['cur_tag_open'] = '<li class="paginationCurrentTag"><a href="#">';
         $config['cur_tag_close'] = '</a></li>';
         $config['num_tag_open'] = '<li>';
         $config['num_tag_close'] = '</li>';
         $config['first_link'] = '&#1575;&#1608;&#1604;';
         $config['last_link'] = '&#1570;&#1582;&#1585;';
         $this->pagination->initialize($config);
         $data['page'] = $this->pagination->create_links();
         $data['activeButton'] = "manAds";
         $this->load->view('admin/manageAds/manage', $data);
     } else {
         $error = "عدم دسترسی ! لطفا وارد شوید.";
         $this->session->set_userdata('error', $error);
         $this->session->set_userdata('redirect', 'admin/manage_ads');
         redirect(site_url('user/login'));
     }
 }
示例#15
0
<?php

/* -- DEFINED VARIABLE -- */
// REQUEST
$category_id = $_REQUEST['cat_id'];
// CALL FUNCTION
$category = get_city($category_id);
$check = count_job($category_id);
$city = get_cities();
//$category_name =
if (isset($_POST['btn_detail_store_job'])) {
    // DEFINED VARIABLE
    $active = '1';
    $visibility = $_POST['visibility_status'];
    $city_name = stripslashes($_POST['category_name']);
    $cat_id = $_POST['cat_id'];
    $category = $_POST['category_department'];
    $desc = stripslashes($_POST['career_description']);
    $map = stripslashes($_POST['category_maps']);
    if ($_POST['btn_detail_job'] == 'Delete') {
        delete($cat_id);
        $_SESSION['alert'] = 'success';
        $_SESSION['msg'] = 'Item has been successfully deleted.';
    } else {
        update($city_name, $category, $desc, $map, $visibility, $cat_id);
        $_SESSION['alert'] = 'success';
        $_SESSION['msg'] = 'Item has been successfully saved.';
    }
}
示例#16
0
}
if (!empty($area)) {
    switch ($area) {
        case "vancouverwest":
            $filter .= " AND area_desc ='VVW' AND sub_area_desc!='VVWDT'";
            break;
        case "vancouvereast":
            $filter .= " AND area_desc='VVE'";
            break;
        case "all":
            break;
        case "downtown":
            $filter .= " AND sub_area_desc='VVWDT'";
            break;
        default:
            $city_array = get_city($area);
            //var_dump($city_array);
            if (1 <= count($city_array)) {
                $filter .= " AND";
                for ($i = 0; $i < count($city_array); $i++) {
                    $filter .= ($i == 0 ? '' : ' OR') . " LOWER(listings.city)='" . $city_array[$i]['en'] . "'";
                }
            } else {
                $sub_area_array = get_sub_area($area);
                if (1 <= count($sub_area_array)) {
                    $filter .= " AND";
                    for ($i = 0; $i < count($sub_area_array); $i++) {
                        $filter .= ($i == 0 ? '' : ' OR') . " LOWER(listings.sub_area)='" . $sub_area_array[$i]['sub_area'] . "'";
                    }
                } else {
                    //echo "<br/>city array has no value<br/>";
示例#17
0
//подключаемся к самой БД
require_once "bd_script.php";
//подключаем файл со скриптами для БД
// подключаем smarty
$smarty_dir = 'Smarty/';
require $smarty_dir . 'libs/Smarty.class.php';
$smarty = new Smarty();
$smarty->compile_check = TRUE;
$smarty->debugging = FALSE;
$smarty->template_dir = $smarty_dir . 'templates/';
$smarty->compile_dir = $smarty_dir . 'templates_c/';
$smarty->cache_dir = $smarty_dir . 'cache/';
$smarty->config_dir = $smarty_dir . 'configs/';
//передаем 'имя переменной' и 'значение'
$smarty->assign('title', 'Наше объявление');
$smarty->assign('city', get_city($db));
$smarty->assign('category', get_category($db));
if (filter_input(INPUT_POST, 'confirm_add')) {
    // кнопка добавить
    if (is_numeric($_POST['id_r'])) {
        // если присутствует метка id_r то сохраняем редактируемое объявление
        edit_ads($db, $_POST);
    } else {
        ads_ad($db, $_POST);
        // иначе добавляем новое объявление
    }
    restart();
    // вызываем restart(); для очистки формы
} elseif (filter_input(INPUT_POST, 'clear_form') || filter_input(INPUT_POST, 'back')) {
    // кнопка очистить форму  вызывает restart();
    restart();
示例#18
0
 /**
  * 微吧审核
  *
  * @return void
  */
 public function weibaAudit()
 {
     $_REQUEST['tabHash'] = 'weibaAudit';
     $this->_initWeibaListAdminMenu();
     // 设置列表主键
     $this->_listpk = 'weiba_id';
     $this->pageButton[] = array('title' => '搜索', 'onclick' => "admin.fold('search_form')");
     $this->pageButton[] = array('title' => '通过', 'onclick' => "admin.doWeibaAudit('', 1)");
     $this->pageButton[] = array('title' => '驳回', 'onclick' => "admin.doWeibaAudit('', -1)");
     $this->searchKey = array('weiba_name');
     $this->pageKeyList = array('weiba_id', 'weiba_name', 'weiba_cate', 'info', 'uid', 'uinfo', 'live', 'ctime', 'DOACTION');
     if (!empty($_POST['weiba_name'])) {
         $maps['weiba_name'] = array('like', '%' . t($_POST['weiba_name']) . '%');
         $map['weiba_id'] = array('in', getSubByKey(D('weiba')->where($maps)->field('weiba_id')->findAll(), 'weiba_id'));
     }
     $map['status'] = 0;
     if ($this->mid != 1) {
         $map['city'] = get_city();
     }
     // 数据的格式化与listKey保持一致
     $listData = D('weiba')->where($map)->order('ctime desc')->findPage(20);
     $weibacate = D('weiba_category')->findAll();
     $cids = array();
     foreach ($weibacate as $c) {
         $cids[$c['id']] = $c['name'];
     }
     foreach ($listData['data'] as $k => $v) {
         $listData['data'][$k]['weiba_name'] = '<a target="_blank" href="' . U('weiba/Index/detail', array('weiba_id' => $v['weiba_id'])) . '">' . $v['weiba_name'] . '</a>';
         $listData['data'][$k]['logo'] && ($listData['data'][$k]['logo'] = '<img src="' . getImageUrlByAttachId($v['logo']) . '" width="50" height="50">');
         $create_uid = model('User')->getUserInfoByUids($v['uid']);
         $listData['data'][$k]['uid'] = $create_uid[$v['uid']]['space_link'];
         $listData['data'][$k]['uinfo'] = $create_uid[$v['uid']]['group_icon'];
         $listData['data'][$k]['live'] = $create_uid[$v['uid']]['credit_info']['level']['name'];
         $listData['data'][$k]['ctime'] = friendlyDate($v['ctime']);
         $listData['data'][$k]['weiba_cate'] = $cids[$v['cid']];
         $listData['data'][$k]['DOACTION'] = '<a href="javascript:void(0)" onclick="admin.doWeibaAudit(' . $v['weiba_id'] . ',1);">通过</a>&nbsp;-&nbsp;<a href="javascript:void(0)" onclick="admin.doWeibaAudit(' . $v['weiba_id'] . ',-1);">驳回</a>';
     }
     $this->displayList($listData);
 }
示例#19
0
    $sql = "SELECT * FROM tbl_user WHERE `user_id` = '{$post_user_id}'";
    $query = mysql_query($sql, $conn);
    $result = mysql_fetch_array($query);
    return $result;
}
function get_city($post_province)
{
    $conn = connDB();
    $sql = "SELECT * FROM cities WHERE `province` = '{$post_province}' ORDER BY city_name ASC";
    $query = mysql_query($sql, $conn);
    $row = array();
    while ($result = mysql_fetch_array($query)) {
        array_push($row, $result);
    }
    return $row;
}
updateProvince($province, $user_id);
// CALL FUNCTION
$get_city = get_city($province);
$temp_ajx_user = get_user_ajax($user_id);
?>


   <?php 
foreach ($get_city as $city) {
    echo "<option value=\"" . $city['city_name'] . "\"";
    if ($city['city_name'] == $temp_ajx_user['user_city']) {
        echo "selected=\"selected\"";
    }
    echo ">" . $city['city_name'] . "</option>";
}
示例#20
0
function generate_xr_projects($projects, $parameters)
{
    $spam_mode = $parameters['spam_mode'];
    $xr_label = $parameters['xr_label'];
    $xr_tpl = $parameters['xr_tpl'];
    //$content = preg_replace("/\[BANER\-$W\-$H\]/",get_baner($W,$H),$content,1);
    $tpl_name = $xr_tpl['tpl_name'];
    $tpl_content = $xr_tpl['tpl_content'];
    $id_mail_type = $xr_tpl['id_mail_type'];
    $id_hp_links = $xr_tpl['id_hp_links'];
    $id_sign_links = $xr_tpl['id_sign_links'];
    $id_post_links = $xr_tpl['id_post_links'];
    $lang = $xr_tpl['lang'];
    $rand_text = $xr_tpl['rand_text'];
    //echo get_nick_mask("NICK_MASK-3-8") ;
    //exit;
    foreach ($projects as $project) {
        //print_r($project);
        $tpl = $tpl_content;
        $project_names = get_project_names();
        //$tpl = preg_replace("/\[NICK\_MASK\-$X\-$Y\]/",get_nick_mask("NICK_MASK-$X-$Y"),$tpl,1);
        //$tpl = preg_replace('/\[NICK_MASK\-(\d+)\-(\d+)\]/',get_nick_mask("NICK_MASK-$1-$2"),$tpl);
        //$tpl = str_replace('NICK_MASK',get_nick_mask(),$tpl);
        $HOME_RAND_URL_VARS = get_home_rand_url_vars($id_hp_links, $project);
        $NICK_MASK = get_nick_mask();
        $CITY = get_city();
        $city = $CITY['city'];
        $country = $CITY['country'];
        $occupation = get_occupation($lang);
        $interest = get_interest($lang);
        $genders = get_gender();
        $gender = $genders['gender'];
        $firstname = ucfirst(strtolower($genders['firstname']));
        echo $gender . "\n" . $firstname;
        exit;
        //разделение по типам проектов
        # Href:
        $href_tpl = $tpl;
        $href_project_name = $project_names['Href'];
    }
}
示例#21
0
    $recData['index'] = $muujad[0]['postalcode'];
    $recData['country'] = $muujad[0]['country'];
    $recData['region'] = $muujad[0]['region'];
    $recData['city'] = $muujad[0]['city'];
    $recData['address'] = $muujad[0]['address'];
    $country = get_country();
    $region = get_region(0, $recData['country']);
    $city = get_city(0, $recData['region'], $recData['country']);
} else {
    $country = get_country();
    if ($_POST['form_country']) {
        $recData['country'] = $_POST['form_country'];
        $region = get_region(0, $_POST['form_country']);
        if ($_POST['form_region']) {
            $recData['region'] = $_POST['form_region'];
            $city = get_city(0, $_POST['form_region'], $_POST['form_country']);
            $recData['city'] = $_POST['form_city'];
        }
    }
}
$engSmarty->assign("region", $region);
$engSmarty->assign("country", $country);
$engSmarty->assign("city", $city);
if (is_array($muujad)) {
    $engSmarty->assign("muujad", $muujad);
}
if ($_POST['formUser_submit']) {
    if (!$recData['fname']) {
        $recError['fname'] = 1;
    }
    if (!$recData['email']) {
 /**
  * 导航配置的添加和修改
  */
 public function doNav()
 {
     $map['navi_name'] = t($_POST['navi_name']);
     $map['app_name'] = t($_POST['app_name']);
     $map['url'] = t($_POST['url']);
     $map['target'] = t($_POST['target']);
     $map['status'] = intval($_POST['status']);
     $map['position'] = t($_POST['position']);
     $map['guest'] = intval($_POST['guest']);
     $map['is_app_navi'] = intval($_POST['is_app_navi']);
     $map['order_sort'] = intval($_POST['order_sort']);
     $map['navi_name'] = t($_POST['navi_name']);
     $map['app_name'] = t($_POST['app_name']);
     $map['url'] = t($_POST['url']);
     if ($map['navi_name'] == '') {
         $this->error(L('PUBLIC_NAVIGATION_NAME_NOEWPTY'));
     }
     if ($map['app_name'] == '') {
         $this->error('英文名称不能为空');
     }
     if ($map['url'] == '') {
         $this->error(L('PUBLIC_LINK_NOEMPTY'));
     }
     if ($map['position'] == '') {
         $this->error(L('PUBLIC_NAVIGATION_POSITION_NOEWPTY'));
     }
     if ($map['order_sort'] == '') {
         $this->error(L('PUBLIC_APPLICATION_SORT_NOEMPTY'));
     }
     if ($_GET['type']) {
         $map['parent_id'] = intval($_GET['id']);
         $rel = model('Navi')->add($map);
     } else {
         if (!$_GET['id']) {
             $map['parent_id'] = 0;
             $map['city'] = get_city();
             $rel = model('Navi')->add($map);
         } else {
             $rel = model('Navi')->where('navi_id=' . intval($_GET['id']))->save($map);
         }
         $rel = true;
     }
     // 清除导航缓存
     model('Navi')->cleanCache();
     if ($rel) {
         $jumpstr = 'nav';
         if ($map['position'] == 1) {
             $jumpstr = "footNav&tabHash=foot";
         } else {
             if ($map['position'] == 2) {
                 $jumpstr = 'guestNav&tabHash=guest';
             }
         }
         $this->assign('jumpUrl', U('admin/Config/' . $jumpstr));
         $this->success(L('PUBLIC_ADMIN_OPRETING_SUCCESS'));
     } else {
         $this->error(model()->getError());
     }
 }
示例#23
0
function cookie_city($city)
{
    if ($city) {
        $city_v = uencode("{$city['id']}|{$city['ename']}|{$city['name']}");
        $expire = time() + 365 * 86400;
        cookieset('city', $city_v);
    } else {
        if (!cookieget('city')) {
            $city = get_city();
            if (!$city) {
                return array();
            }
            return cookie_city($city);
        } else {
            $v = explode('|', udecode(cookieget('city')));
            return array('id' => $v[0], 'ename' => $v[1], 'name' => $v[2]);
        }
    }
    return $city;
}
示例#24
0
function cookie_city($city)
{
    global $hotcities;
    if ($city) {
        cookieset('city', $city['id']);
        return $city;
    }
    $city_id = cookieget('city');
    $city = Table::Fetch('category', $city_id);
    if (!$city) {
        $city = get_city();
    }
    if (!$city) {
        $city = array_shift($hotcities);
    }
    if ($city) {
        return cookie_city($city);
    }
    return $city;
}
示例#25
0
    $sql = "SELECT * FROM tbl_courier_rate WHERE `courier_name` = '{$courier}' AND `active_status` = '{$status}'";
    $query = mysql_query($sql, $conn);
    $result = mysql_fetch_array($query);
    return $result;
}
/*
# ----------------------------------------------------------------------
# DEFINED VARIABLE
# ----------------------------------------------------------------------
*/
$country = $_POST['country'];
$province = $_POST['province'];
/*
# ----------------------------------------------------------------------
# CALL FUNCTIONS
# ----------------------------------------------------------------------
*/
$count_city = count_city($country, $province);
$data_city = get_city($country, $province);
/*
# ----------------------------------------------------------------------
# CONTROL
# ----------------------------------------------------------------------
*/
if ($count_city['rows'] > 0) {
    foreach ($data_city as $data_city) {
        echo '<option value="' . $data_city['city_name'] . '">' . $data_city['city_name'] . '</option>';
    }
} else {
    echo '0';
}
示例#26
0
echo "<input type=\"hidden\" name=\"search\" id=\"search\" class=\"hidden\" value=\"" . $search_parameter . "-" . $search_value . "\" /> \n";
/* -- BUTTON RESET -- */
if (empty($search_parameter)) {
    $reset = "hidden";
} else {
    $reset = "";
}
if (isset($_POST['btn_index_filter_sub'])) {
    // DEFINED VARIABLE
    $career_id = $_POST['category_id'];
    $action = $_POST['option-action'];
    $option = $_POST['option-option'];
    if ($action == 'delete') {
        foreach ($career_id as $career_id) {
            // CALL FUNCTION
            $category = get_city($career_id);
            unlink('../' . $category['image']);
            delete($career_id);
            $_SESSION['alert'] = 'success';
            $_SESSION['msg'] = 'Item(s) has been successfully deleted';
        }
    } else {
        foreach ($career_id as $career_id) {
            if ($option == 'yes') {
                update_visibility(1, $career_id);
            } else {
                if ($option == 'no') {
                    update_visibility(0, $career_id);
                }
            }
        }
示例#27
0
                                    <p class="fl" style="width: 60px; margin-left: 10px" id="per_weight"> / 0.5 kg</p>
                                    </span>
                                    -->
                                    
                                </div>
                            </li>
                            
                            <div class="field-divider"></div>
                        <?php 
        }
    } else {
        // LOCAL
        $row = 0;
        foreach ($shipping as $provinces) {
            $row++;
            $city = get_city($provinces['province'], $ship_id);
            ?>
                                
                            <li class="field field-checkbox" style="position: relative" id="courier-city-<?php 
            echo $row;
            ?>
">
                                <label><?php 
            echo $provinces['province'];
            ?>
</label>
                                <input type="checkbox" disabled class="input-checkbox hidden" value="<?php 
            echo $provinces['province_name'];
            ?>
" name="province_name[]" onclick="selectProvince('<?php 
            echo $row;
示例#28
0
 /**
  * 获取帖子列表,后台可以根据条件查询
  * 
  * @param integer $limit
  *        	结果集数目,默认为20
  * @param array $map
  *        	查询条件
  * @return array 微吧列表信息
  */
 public function getPostList($limit = 20, $map = array())
 {
     if (isset($_POST)) {
         // 搜索时用到
         $_POST['post_id'] && ($map['post_id'] = intval($_POST['post_id']));
         $_POST['title'] && ($map['title'] = array('like', '%' . $_POST['title'] . '%'));
         $_POST['post_uid'] && ($map['post_uid'] = intval($_POST['post_uid']));
         $_POST['recommend'] && ($map['recommend'] = $_POST['recommend'] == 1 ? 1 : 0);
         $_POST['digest'] && ($map['digest'] = $_POST['digest'] == 1 ? 1 : 0);
         $_POST['top'] && ($map['top'] = intval($_POST['top']));
         $_POST['weiba_id'] && ($map['weiba_id'] = intval($_POST['weiba_id']));
     }
     // 查询数据
     if (!$map['weiba_id']) {
         $map['weiba_id'] = array('in', getSubByKey(D('weiba')->where('is_del=0')->findAll(), 'weiba_id'));
     }
     if ($_SESSION['mid'] != 1) {
         $map['city'] = get_city();
     }
     $list = D('weiba_post')->where($map)->order('last_reply_time desc,post_time desc')->findPage($limit);
     // 数据组装
     foreach ($list['data'] as $k => $v) {
         $list['data'][$k]['title'] = '<a target="_blank" href="' . U('weiba/Index/postDetail', array('post_id' => $v['post_id'])) . '">' . $v['title'] . '</a>';
         $author = model('User')->getUserInfoByUids($v['post_uid']);
         $list['data'][$k]['post_uid'] = $author[$v['post_uid']]['space_link'];
         $list['data'][$k]['post_time'] = friendlyDate($v['post_time']);
         $list['data'][$k]['last_reply_time'] = friendlyDate($v['last_reply_time']);
         $list['data'][$k]['read_count/reply_count'] = $v['read_count'] . '/' . $v['reply_count'];
         $list['data'][$k]['weiba_id'] = $this->where('weiba_id=' . $v['weiba_id'])->getField('weiba_name');
         if ($v['is_del'] == 0) {
             $isRecommend = $v['recommend'] ? '取消推荐' : '推荐到首页';
             $isDigest = $v['digest'] ? '取消精华' : '设为精华';
             $isGlobalTop = $v['top'] == 2 ? '取消全局置顶' : '设为全局置顶';
             $isLocalTop = $v['top'] == 1 ? '取消吧内置顶' : '设为吧内置顶';
             // $list['data'][$k]['DOACTION'] = '<a href="javascript:void(0)" onclick="admin.setPost('.$v['post_id'].',1,'.$v['recommend'].');">'.$isRecommend.'</a>|<a href="javascript:void(0)" onclick="admin.setPost('.$v['post_id'].',2,'.$v['digest'].')">'.$isDigest.'</a>|<a href="javascript:void(0)" onclick="admin.setPost('.$v['post_id'].',3,'.$v['top'].',2)">'.$isGlobalTop.'</a>|<a href="javascript:void(0)" onclick="admin.setPost('.$v['post_id'].',3,'.$v['top'].',1)">'.$isLocalTop.'</a>|<a href="'.U('weiba/Admin/editPost',array('post_id'=>$v['post_id'],'tabHash'=>'editPost')).'">编辑</a>|<a href="javascript:void(0)" onclick="admin.doStorey('.$v['post_id'].')">调整回复楼层</a>|<a href="javascript:void(0)" onclick="admin.delPost('.$v['post_id'].')">删除</a>';
             $list['data'][$k]['DOACTION'] = '<a href="javascript:void(0)" onclick="admin.setPost(' . $v['post_id'] . ',1,' . $v['recommend'] . ');">' . $isRecommend . '</a>&nbsp;-&nbsp;<a href="javascript:void(0)" onclick="admin.setPost(' . $v['post_id'] . ',2,' . $v['digest'] . ')">' . $isDigest . '</a>&nbsp;-&nbsp;<a href="javascript:void(0)" onclick="admin.setPost(' . $v['post_id'] . ',3,' . $v['top'] . ',2)">' . $isGlobalTop . '</a>&nbsp;-&nbsp;<a href="javascript:void(0)" onclick="admin.setPost(' . $v['post_id'] . ',3,' . $v['top'] . ',1)">' . $isLocalTop . '</a>&nbsp;-&nbsp;<a href="' . U('weiba/Admin/editPost', array('post_id' => $v['post_id'], 'tabHash' => 'editPost')) . '">编辑</a>&nbsp;-&nbsp;<a href="javascript:void(0)" onclick="admin.delPost(' . $v['post_id'] . ')">删除</a>';
         } else {
             $list['data'][$k]['DOACTION'] = '<a href="javascript:void(0)" onclick="admin.recoverPost(' . $v['post_id'] . ')">还原</a>&nbsp;-&nbsp;<a href="javascript:void(0)" onclick="admin.deletePost(' . $v['post_id'] . ')">彻底删除</a>';
         }
     }
     return $list;
 }