public function edit($id) { ini_set('memory_limit', '256M'); $data['employee'] = $this->db->where('id', $id)->get('employee')->result(); $data['province'] = get_province(); $firstday = $data['employee'][0]->firstday; $lastday = $data['employee'][0]->lastday; $day = get_day($firstday); $month = get_month_num($firstday); $month = monthnum_to_eng($month); $year = get_year($firstday); $data['firstday'] = $day . "-" . $month . "-" . $year; $day1 = get_day($lastday); $month1 = get_month_num($lastday); $month1 = monthnum_to_eng($month1); $year1 = get_year($lastday); $data['lastday'] = $day1 . "-" . $month1 . "-" . $year1; $this->load->view('employee/header'); $this->load->view('employee/edit', $data); $this->load->view('footer'); }
// 分类树加强版/* 周改 */ $smarty->assign('navigator_list', get_navigator($ctype, $catlist)); //自定义导航栏 $smarty->assign('helps', get_shop_help()); // 网店帮助 $act = isset($_REQUEST['act']) ? trim($_REQUEST['act']) : ''; //echo 'bbb'.$act; //echo ROOT_PATH; /*------------------------------------------------------ */ //-- 初始化special_product.dwt页面 /*------------------------------------------------------ */ $page_items = 3; //每页需要显示的数据题目数量 if ($act == '') { //get_special_goods(6); $province = get_province(); //获取用户所在的省份 $smarty->assign('province', $province); $total_items = get_total_items($province['province_id']); //获取用户所在省份的特产商品总数 $page_str = $total_items > $page_items ? get_page_str($province['province_id'], $total_items, $page_items, 1) : ''; $smarty->assign('page_str', $page_str); //获取特产商品列表 $condition = array(); //获取特产商品的条件 $condition = array('province_id' => $province['province_id'], 'begin_item' => 0, 'end_item' => $page_items); $smarty->assign('special_goods', get_special_goods($condition)); //获取特产商品列表 $ads_list = get_special_ads(); //获取广告列表 //dump($ads_list);
public function form() { $data = get_province(); $this->load->view('form', $data); }
$row = array(); while ($result = mysql_fetch_array($query)) { array_push($row, $result); } return $row; } /* # ---------------------------------------------------------------------- # DEFINED VARIABLE # ---------------------------------------------------------------------- */ $country = $_POST['country']; /* # ---------------------------------------------------------------------- # CALL FUNCTIONS # ---------------------------------------------------------------------- */ $count_province = count_province($country); $data_province = get_province($country); /* # ---------------------------------------------------------------------- # CONTROL # ---------------------------------------------------------------------- */ if ($count_province['rows'] > 0) { foreach ($data_province as $data_province) { echo '<option value="' . $data_province['province_name'] . '">' . $data_province['province_name'] . '</option>'; } } else { echo '0'; }
<?php // CALL FUNCTION $provinces = get_province(); $country = get_country(); if (isset($_POST['btn-add-shipping'])) { // DEFINED VARIABLE $courier_name = $_POST['courier_name']; $courier_description = $_POST['description']; $service = $_POST['courier_service']; $weight = $_POST['courier_weight']; insertCourier($courier_name, $courier_description, $service, $weight); $courier_id = get_max_courier(); $courier_service = $_POST['courier_service']; if ($courier_service == "Local Only") { $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++;