public static function create_area_graph($title) { self::init(); $d = new solid_dot(); $d->size(3)->halo_size(1)->colour('#3D5C56'); $range_values = array(); foreach (self::$data_set as $data) { if (!is_array($data['values'])) { continue; } $area = new area(); // set the circle line width: $area->set_width(2); $area->set_default_dot_style($d); $area->set_colour($data['color']); $area->set_fill_colour($data['color']); $area->set_fill_alpha(0.3); $area->on_show(new line_on_show('pop-up', 2, 0.5)); $area->set_key($data['line_title'], 10); $area->set_values($data['values']); # Since there should be an even number on the xaxis for all sets $x_axis_titles = $data['titles']; # Add our values into a big bucket so we can get the highest and lowest $range_values = array_merge($range_values, $data['values']); self::$chart->add_element($area); } $x_labels = new x_axis_labels(); $x_labels->set_labels($x_axis_titles); $x_labels->set_vertical(); self::$x_axis->set_labels($x_labels); $range = self::get_range($range_values); self::$y_axis->set_range($range['min'], $range['max']); self::show_chart($title); }
public function getMyAddress($uid) { $addresses = $this->db->where(array('uid' => $uid))->select(); if (!empty($addresses)) { import('area'); $areaClass = new area(); foreach ($addresses as &$value) { $value['province_txt'] = $areaClass->get_name($value['province']); $value['city_txt'] = $areaClass->get_name($value['city']); $value['area_txt'] = $areaClass->get_name($value['area']); } } return $addresses; }
public function get_selffetch($pigcms_id, $store_id) { $condition_trade_selffetch['pigcms_id'] = $pigcms_id; $condition_trade_selffetch['store_id'] = $store_id; $selffetch = $this->db->where($condition_trade_selffetch)->find(); if ($selffetch) { import('source.class.area'); $area_class = new area(); $selffetch['province_txt'] = $area_class->get_name($selffetch['province']); $selffetch['city_txt'] = $area_class->get_name($selffetch['city']); $selffetch['county_txt'] = $area_class->get_name($selffetch['county']); } return $selffetch; }
public function getCompanyByUid($uid) { $company = $this->db->where(array('uid' => $uid))->find(); if ($company) { import('source.class.area'); $area_class = new area(); $company['province_code'] = $company['province']; $company['city_code'] = $company['city']; $company['area_code'] = $company['area']; $company['province'] = $area_class->get_name($company['province']); $company['city'] = $area_class->get_name($company['city']); $company['area'] = $area_class->get_name($company['area']); return $company; } return false; }
public function create($params) { $objMdlZiti = app::get('syslogistics')->model('ziti'); if (!area::checkArea($params['area_id'])) { throw new LogicException('请选择完整地区'); } $name = $objMdlZiti->getRow('id', ['name' => trim($params['name'])]); if ($name) { throw new LogicException('自提点名称已存在'); } $areaIds = explode(',', $params['area_id']); if (count($areaIds) == 2) { $insertData['area_state_id'] = 1; $insertData['area_city_id'] = $areaIds[0]; $insertData['area_district_id'] = $areaIds[1]; } else { $insertData['area_state_id'] = $areaIds[0]; $insertData['area_city_id'] = $areaIds[1]; $insertData['area_district_id'] = $areaIds[2]; } $insertData['name'] = trim($params['name']); $insertData['area'] = $params['area_id']; $insertData['addr'] = $params['addr']; $insertData['tel'] = $params['tel']; return $objMdlZiti->insert($insertData); }
public function get($params) { if (!area::checkArea($params['area_id'])) { throw new LogicException('请选择正确地区'); } $objMdlZiti = app::get('syslogistics')->model('ziti'); $areaIds = explode(',', $params['area_id']); if (count($areaIds) == 2) { $list = $objMdlZiti->getList('*', ['area_city_id' => $areaIds[0]]); } else { $list = $objMdlZiti->getList('*', ['area_state_id' => $areaIds[0], 'area_city_id' => $areaIds[1]]); } if (empty($list)) { return array(); } $data = array(); $tmpData = array(); foreach ($list as $key => $row) { if (count($areaIds) == 2 && $row['area_district_id'] == $areaIds[1] || $row['area_district_id'] == $areaIds[2]) { $row['area'] = area::getSelectArea($row['area'], ''); $tmpData[$key] = $row; unset($list[$key]); } else { $row['area'] = area::getSelectArea($row['area'], ''); $data[$key] = $row; } } $data = array_merge($tmpData, $data); return $data; }
private function init($request, $response) { $facultyId = Codec::getInstance()->decodeId($request->id); if ($facultyId <= 0) { exit; } $this->faculty = DAL::get()->find('faculty', $facultyId); if ($this->faculty->isNull()) { exit; } $this->facultyIdFrom = $this->faculty->id; $this->facultyIdTo = $facultyId + $this->faculty->mask; $province = $request->province; $this->province = empty($province) ? 'quanguo' : $province; $provList = area::provInfo(); $provinceList = array(); foreach($provList as $provkey => $value) { $provinceList[$provkey] = $value['Name']; } array_pop($provinceList); $provinceList = array_merge(array('quanguo'=>'х╚╧З'),$provinceList); $this->provinceList = $provinceList; $this->provinceName = $this->provinceList[$this->province]; $this->page = $request->getRequest('p', 1); $response->faculty = $this->faculty; $response->provinceName = $this->provinceName; $response->province = $this->province; $response->provinceList = $this->provinceList; }
public function get($params) { $objMdlZiti = app::get('syslogistics')->model('ziti'); $data = $objMdlZiti->getRow('*', ['id' => $params['id']]); $data['area_id'] = $data['area']; $data['area'] = area::getSelectArea($data['area'], ''); return $data; }
public function getList($params) { try { if (!$params['area']) { throw new Exception('地区id不能为空'); } $areaData = area::getSelectArea($params['area']); } catch (Exception $e) { throw new Exception($e->getMessage()); } return $areaData; }
public function getListByIDList($physical_id_list) { if (empty($physical_id_list) || !is_array($physical_id_list)) { return array(); } //$store_physical_list = $this->db->where(array('pigcms_id' => array('in', $physical_id_list)))->select(); $store_physical_list = D('')->field("`s`.`buyer_selffetch_name`, `sp`.*")->table(array('Store' => 's', 'Store_physical' => 'sp'))->where("`s`.`store_id` = `sp`.`store_id` AND `sp`.`pigcms_id` in (" . join(',', $physical_id_list) . ")")->select(); import('source.class.area'); $area_class = new area(); $return_data = array(); foreach ($store_physical_list as $value) { $value['images_arr'] = explode(',', $value['images']); foreach ($value['images_arr'] as &$image_value) { $image_value = getAttachmentUrl($image_value); } $value['province_txt'] = $area_class->get_name($value['province']); $value['city_txt'] = $area_class->get_name($value['city']); $value['county_txt'] = $area_class->get_name($value['county']); $return_data[$value['pigcms_id']] = $value; } return $return_data; }
/** * Creates a preconfigured area element (colors etc.) * */ protected function createArea($color = '#f58615', $fill_color = '#fcdeba') { $dot = $this->createDot($color); $area = new area(); // set the circle line width: $area->set_width(2); $area->set_default_dot_style($dot); $area->set_colour($color); $area->set_fill_colour($fill_color); $area->set_fill_alpha(0.8); return $area; }
public function modifier_areaNameById($areaIds) { $areaIdArr = explode(',', $areaIds); $areaKvdata = area::areaKvdata(); foreach ($areaIdArr as $id) { if ($areaKvdata[$id]['parentId'] == 1 || !area::getAreaNameById($areaKvdata[$id]['parentId'])) { $areaNameArr[] = area::getAreaNameById($id); } else { $area[area::getAreaNameById($areaKvdata[$id]['parentId'])][] = area::getAreaNameById($id); } } foreach ($area as $parent => $list) { $areaNameArr[] = $parent . '<em class="text-muted">(' . implode(',', $list) . ')</em>'; } return implode(',', $areaNameArr); }
public function update($params) { $objMdlZiti = app::get('syslogistics')->model('ziti'); $data = $objMdlZiti->getRow('id,name,area', ['id' => $params['id']]); if (empty($data)) { throw new LogicException('更新的自提点不存在'); } if ($params['area_id'] && $data['area'] != $params['area_id'] && !area::checkArea($params['area_id'])) { throw new LogicException('请选择完整地区'); } if (trim($params['name']) && $data['name'] != trim($params['name'])) { $name = $objMdlZiti->getRow('id', ['name' => trim($params['name'])]); if ($name && $name['id'] != $params['id']) { throw new LogicException('更新的自提点名称重复'); } $updata['name'] = trim($params['name']); } if ($params['area_id']) { $areaIds = explode(',', $params['area_id']); if (count($areaIds) == 2) { $updata['area_state_id'] = 1; $updata['area_city_id'] = $areaIds[0]; $updata['area_district_id'] = $areaIds[1]; } else { $updata['area_state_id'] = $areaIds[0]; $updata['area_city_id'] = $areaIds[1]; $updata['area_district_id'] = $areaIds[2]; } $updata['area'] = $params['area_id']; } if (trim($params['addr'])) { $updata['addr'] = $params['addr']; } if (trim($params['tel'])) { $updata['tel'] = $params['tel']; } return $objMdlZiti->update($updata, ['id' => $params['id']]); }
public function edit() { $pagedata['areaData'] = area::areaKvdata(); $pagedata['areaPath'] = area::getAreaIdPath(); if (input::get('id')) { $data = app::get('syslogistics')->rpcCall('logistics.ziti.get', ['id' => input::get('id')]); foreach ((array) explode(',', $data['area_id']) as $areaId) { if ($parentId) { $areaData[$areaId] = $pagedata['areaPath'][$parentId]; $parentId = $areaId; } else { $areaData[$areaId] = area::getAreaDataLv1(); $parentId = $areaId; } } $pagedata['selectArea'] = $areaData; $data['area'] = $data['area'] . ":" . $data['area_id']; $pagedata['data'] = $data; } else { $pagedata['areaLv1'] = area::getAreaDataLv1(); } return view::make('syslogistics/ziti/edit.html', $pagedata); }
/** * Method to render a statistical chart using Open Flash library. * * @return false if someting wrong */ function render() { $values = array(); foreach ($this->values as $number_variable => $variable) { $values[$number_variable] = (int) $variable; } $area = new area(); $area->set_default_dot_style(new hollow_dot()); $area->set_colour('#5B56B6'); $area->set_fill_alpha(0.4); $area->set_values($values); $area->set_key('Values', 12); $x_labels = new x_axis_labels(); $x_labels->set_steps(1); $x_labels->set_vertical(); $x_labels->set_colour('#A2ACBA'); $x_labels->set_labels($this->legend); $x = new x_axis(); $x->set_colour('#A2ACBA'); $x->set_grid_colour('#D7E4A3'); $x->set_offset(false); $x->set_steps(1); // Add the X Axis Labels to the X Axis $x->set_labels($x_labels); $y = new y_axis(); $y_max = max($values) > 0 ? max($values) : 4; $y_mod = (int) ($y_max / 4 + 1); $y_max += $y_mod - $y_max % $y_mod; $y->set_range(0, $y_max, $y_mod); $y->labels = null; $y->set_offset(false); $chart = new open_flash_chart(); $chart->set_x_axis($x); $chart->add_y_axis($y); $chart->add_element($area); return $chart; }
function indexAction() { // $this->_helper->layout->disableLayout(); // $login = "******"; // $password = "******"; // include_once 'sina.php'; // $resultarray = get_sinacontacts($login, $password); // Zend_Debug::dump($resultarray); // include_once '163.php'; // $login = '******'; // $password = '******'; // $resultarray = get_163contacts($login, $password); // Zend_Debug::dump($resultarray); // include_once 'yahoo.php'; // $obj = new GrabYahoo(); // $contacts = $obj->getAddressbook('*****@*****.**','19990402'); // Zend_Debug::dump($contacts); // include_once "contacts_fn.php"; // $ret_array = get_msncontacts('*****@*****.**', '1999040211'); // Zend_Debug::dump($ret_array); // $this->_helper->layout->setLayout("layout_admin"); $this->_helper->layout->disableLayout(); // get date from db $db = Zend_Registry::get('db'); $select = $db->select(); $select->from('report', array('left(create_date,10) as date', 'accesscode'))->where('report.campaign_id = 3')->where("report.state = 'APPROVED'")->order('date'); $results = $db->fetchAll($select); $accesscodeDbMatchArray = array(); foreach ($results as $result) { $accesscodeDbMatchArray[$result['accesscode']] = $result['date']; } $accesscodeArray = array_keys($accesscodeDbMatchArray); // Zend_Debug::Dump($accesscodematchArray); // get value from ws $indicate2Connect = new Indicate2_Connect(); $response = $indicate2Connect->getAnswerSetForSurvey(385, null, array(array('ContextIndex' => 1, 'QuestionIndex' => 1), array('ContextIndex' => 1, 'QuestionIndex' => 4)), 0); // Zend_Debug::Dump($response); $talkingdurationArray = array(); $accesscodeResponseMathArray = array(); if (isset($response->AnswerSetType)) { foreach ($response->AnswerSetType as $answerSet) { if (isset($answerSet->AnswerType) && is_array($answerSet->AnswerType) && !empty($answerSet->AnswerType)) { foreach ($answerSet->AnswerType as $answer) { if ($answer->QuestionId == 573) { $accesscodeResponseMathArray[$answerSet->AccessCode] = (int) iconv("UTF-8", "gb18030", preg_replace('/[\\n\\r\\t]/', ' ', base64_decode($answer->AnswerText))); } if ($answer->QuestionId == 576) { $talkingdurationArray[$answerSet->AccessCode] = (int) iconv("UTF-8", "gb18030", preg_replace('/[\\n\\r\\t]/', ' ', base64_decode($answer->AnswerText))); } } } else { //get min value, like '11-15' = 11 $accesscodeResponseMathArray[$answerSet->AccessCode] = (int) iconv("UTF-8", "gb18030", preg_replace('/[\\n\\r\\t]/', ' ', base64_decode($answerSet->AnswerType->AnswerText))); } } } // Zend_Debug::Dump($accesscodeResponseMathArray); // Zend_Debug::Dump($talkingdurationArray); $resultmatchArray = array(); foreach ($accesscodeArray as $accesscode) { $resultmatchArray[$accesscodeDbMatchArray[$accesscode]] = 0; } foreach ($accesscodeArray as $accesscode) { if (array_key_exists($accesscode, $accesscodeResponseMathArray)) { $resultmatchArray[$accesscodeDbMatchArray[$accesscode]] += $accesscodeResponseMathArray[$accesscode]; } } // Zend_Debug::Dump($resultmatchArray); $dateArray = array_keys($resultmatchArray); foreach ($dateArray as $date) { $resultmatchArray[$date] = floor($resultmatchArray[$date] * 1.65); } // Zend_Debug::Dump($resultmatchArray); include 'open-flash-chart.php'; $data_1 = array(); $base = floor(1472 * 1.65); $temp = 0; $resultmatchArray[0] = 0; foreach ($dateArray as $date) { $resultmatchArray[$date] += $resultmatchArray[$temp]; $data_1[] = $resultmatchArray[$date] + $base; $temp = $date; } // Zend_Debug::Dump($data_1); $title = new title("Impressions of BugsLock by day"); $y = new y_axis(); $y->set_range(0, 40000, 10000); $x = new x_axis(); $x_labels = new x_axis_labels(); $x_labels->set_labels($dateArray); $x_labels->set_steps(2); $x_labels->rotate(40); $x->set_labels($x_labels); $line_1_default_dot = new dot(); $line_1_default_dot->colour('#f00000')->tooltip('#x_label#: #val#'); $line_1 = new line(); $line_1->set_default_dot_style($line_1_default_dot); $line_1->set_values($data_1); $line_1->set_width(1); $line_1->set_key('Impression', 10); $this->view->chart = new open_flash_chart(); $this->view->chart->set_title($title); $this->view->chart->add_element($line_1); $this->view->chart->set_y_axis($y); $this->view->chart->set_x_axis($x); $this->view->chart->set_bg_colour('#FFFFFF'); // include 'ofc_sugar.php'; $this->view->chart2 = new open_flash_chart(); $this->view->chart2->set_title(new title('Generation Chart')); $line_1 = new line(); $array_1 = array(); $f = 1.5; for ($i = 0; $i <= 50; $i++) { array_push($array_1, $f); } $line_1->set_values($array_1); // $line_1->set_default_dot_style( new s_hollow_dot('#FBB829', 4) ); $line_1->set_width(1); $line_1->set_colour('#FF0000'); $line_1->set_tooltip("Gen0"); $line_1->set_key('Gen0', 10); $line_1->loop(); $area = new area(); // set the circle line width: $area->set_width(1); // $area->set_default_dot_style( new s_hollow_dot('#45909F', 5) ); $area->set_colour('#FF0000'); // $area->set_fill_colour( '#FF0000' ); // $area->set_fill_alpha( 0.4 ); $area->set_loop(); $area->set_values($array_1); $line_2 = new line(); $array_2 = array(); $f = 2.8; for ($i = 0; $i <= 50; $i++) { array_push($array_2, $f); } $line_2->set_values($array_2); // $line_2->set_default_dot_style( new s_hollow_dot('#FBB829', 4) ); $line_2->set_width(1); $line_2->set_colour('#FBB829'); $line_2->set_tooltip("Gold<br>#val#"); $line_2->set_key('Gen1', 10); $line_2->loop(); $line_4 = new line(); $array_4 = array(); $f = 5; for ($i = 0; $i <= 50; $i++) { array_push($array_4, $f); } $line_4->set_values($array_4); // $line_2->set_default_dot_style( new s_star('#8000FF', 4) ); $line_4->set_width(1); $line_4->set_colour('#3030D0'); $line_4->set_tooltip("Purple<br>#val#"); $line_4->set_key('Gen2', 10); $line_4->loop(); // add the area object to the chart: $this->view->chart2->add_element($line_1); $this->view->chart2->add_element($line_2); $this->view->chart2->add_element($line_4); $r = new radar_axis(5); $r->set_colour('#FFFFFF'); $r->set_grid_colour('#FFFFFF'); $labels = new radar_axis_labels(array('G0', '', 'G1', '', 'G2')); $labels->set_colour('#9F819F'); $r->set_labels($labels); $this->view->chart2->set_radar_axis($r); $tooltip = new tooltip(); $tooltip->set_proximity(); $this->view->chart2->set_tooltip($tooltip); $this->view->chart2->set_bg_colour('#ffffff'); // echo $this->view->chart2->toPrettyString(); }
echo url::modify('table/' . get('table') . '/type/search'); ?> '" class="btn_e" /> <div class="blank5"></div> 地区 <?php echo form::select('search_province_id', get('search_province_id') ? get('search_province_id') : 0, area::province_option()); ?> <?php echo form::select('search_city_id', get('search_city_id') ? get('search_city_id') : 0, area::city_option(get('search_city_id'))); ?> <?php echo form::select('search_section_id', get('search_section_id') ? get('search_section_id') : 0, area::section_option(get('search_section_id'))); ?> <div class="blank5"></div> 专题 <?php echo form::select('search_spid', get('search_spid') ? get('search_spid') : 0, special::option()); ?> </form> </div> <form name="listform" id="listform" action="<?php echo uri(); ?> " method="post">
public function getTakeselfList() { $id = IFilter::act(IReq::get('id'), 'int'); $type = IFilter::act(IReq::get('type')); $takeselfObj = new IQuery('takeself'); switch ($type) { case "province": $where = "province = " . $id; $takeselfObj->group = 'city'; break; case "city": $where = "city = " . $id; $takeselfObj->group = 'area'; break; case "area": $where = "area = " . $id; break; } $takeselfObj->where = $where; $takeselfList = $takeselfObj->find(); foreach ($takeselfList as $key => $val) { $temp = area::name($val['province'], $val['city'], $val['area']); $takeselfList[$key]['province_str'] = $temp[$val['province']]; $takeselfList[$key]['city_str'] = $temp[$val['city']]; $takeselfList[$key]['area_str'] = $temp[$val['area']]; } die(JSON::encode($takeselfList)); }
/** * 收货地址 */ function address() { if (empty($this->user_session)) { $referer = url('account:address'); redirect(url('account:login', array('referer' => $referer))); exit; } // 实例化user_address_model $user_address_model = M('User_address'); // 添加新收货地址 if (IS_POST) { $name = $_POST['name']; $tel = $_POST['tel']; $province = $_POST['province']; $city = $_POST['city']; $area = $_POST['area']; $address = $_POST['address']; $default = $_POST['default'] + 0; if (empty($name)) { echo json_encode(array('status' => false, 'msg' => '收货人没有填写')); exit; } if (empty($tel) || !preg_match("/1[3458]{1}\\d{9}\$/", $tel)) { echo json_encode(array('status' => false, 'msg' => '手机号码格式不正确')); exit; } if (empty($province)) { echo json_encode(array('status' => false, 'msg' => '省份没有选择')); exit; } if (empty($city)) { echo json_encode(array('status' => false, 'msg' => '城市没有选择')); exit; } if (empty($area)) { echo json_encode(array('status' => false, 'msg' => '地区没有选择')); exit; } if (empty($address)) { echo json_encode(array('status' => false, 'msg' => '街道没有填写')); exit; } // 更新数据库操作,当有address_id时做更新操作,没有时做添加操作 $data = array(); $data['uid'] = $this->user_session['uid']; $data['name'] = $name; $data['tel'] = $tel; $data['province'] = $province; $data['city'] = $city; $data['area'] = $area; $data['address'] = $address; $data['default'] = $default; $address_id = $_POST['address_id']; $msg = '添加成功'; if (!empty($address_id)) { $msg = '修改成功'; // 更改记录条件 $condition = array(); $condition['uid'] = $this->user_session['uid']; $condition['address_id'] = $address_id; $user_address_model->save_address($condition, $data); } else { $data['add_time'] = time(); $address_id = $user_address_model->add($data); } // 设置默认收货地址 if ($default == 1) { $user_address_model->canelDefaultAaddress($this->user_session['uid'], $address_id); } import('area'); $areaClass = new area(); $data['province_txt'] = $areaClass->get_name($data['province']); $data['city_txt'] = $areaClass->get_name($data['city']); $data['area_txt'] = $areaClass->get_name($data['area']); $data['address_id'] = $address_id; echo json_encode(array('status' => true, 'msg' => $msg, 'data' => array('nexturl' => 'refresh', 'address' => $data))); exit; } $address_list = $user_address_model->getMyAddress($this->user_session['uid']); $this->assign('address_list', $address_list); $this->display(); }
/* $line_max_default_dot = new dot(); $line_max_default_dot->size(3)->halo_size(2)->colour('#3D5C56'); */ /* $line_max = new line(); $line_max->set_default_dot_style($line_max_default_dot); $line_max->set_values( $data_max ); $line_max->set_colour( '#FEE88F' ); $line_max->set_width( 1 ); $line_max->set_key( 'Max (W)', 10 ); $line_max->set_tooltip( "#val# W" ); */ $line_watt_default_dot = new dot(); $line_watt_default_dot->size(4)->colour('#f00000'); $line_watt = new area(); $line_watt->set_default_dot_style($line_watt_default_dot); $line_watt->set_values($data_watt); $line_watt->set_colour('#4D4D4D'); $line_watt->set_fill_colour('#EFC01D'); $line_watt->set_fill_alpha(0.75); $line_watt->set_width(2); $line_watt->set_key('Leistung (W)', 10); $line_watt->set_tooltip("#val# W"); $line_tot_default_dot = new dot(); $line_tot_default_dot->size(4)->halo_size(2); $line_tot = new line(); $line_tot->set_default_dot_style($line_tot_default_dot); $line_tot->set_values($data_tot); $line_tot->set_colour('#A0A000'); $line_tot->set_width(2);
/** * @brief查看订单 */ public function order_show() { //获得post传来的值 $order_id = IFilter::act(IReq::get('id'), 'int'); $data = array(); if ($order_id) { $order_show = new Order_Class(); $data = $order_show->getOrderShow($order_id); if ($data) { //获得折扣前的价格 $rule = new ProRule($data['real_amount']); $this->result = $rule->getInfo(); //获取地区 $data['area_addr'] = join(' ', area::name($data['province'], $data['city'], $data['area'])); $this->setRenderData($data); $this->redirect('order_show', false); } } if (!$data) { $this->redirect('order_list'); } }
<?php /* [Destoon B2B System] Copyright (c) 2008-2013 Destoon.COM This is NOT a freeware, use is subject to license.txt */ defined('IN_DESTOON') or exit('Access Denied'); $menus = array(array('地区添加', '?file=' . $file . '&action=add'), array('地区管理', '?file=' . $file), array('导入省市', '?file=' . $file . '&action=import', 'onclick="return confirm(\'确定导入中国省市数据吗? 当前数据将被覆盖 \');"'), array('更新缓存', '?file=' . $file . '&action=cache')); $AREA = cache_read('area.php'); $areaid = isset($areaid) ? intval($areaid) : 0; $do = new area($areaid); $parentid = isset($parentid) ? intval($parentid) : 0; $table = $DT_PRE . 'area'; $this_forward = '?file=' . $file . '&parentid=' . $parentid; switch ($action) { case 'add': if ($submit) { if (!$area['areaname']) { msg('地区名不能为空'); } $area['areaname'] = trim($area['areaname']); if (strpos($area['areaname'], "\n") === false) { $do->add($area); } else { $areanames = explode("\n", $area['areaname']); foreach ($areanames as $areaname) { $areaname = trim($areaname); if (!$areaname) { continue; } $area['areaname'] = $areaname;
<td><div align="right"></div></td> <td> </td> </tr> <tr> <td colspan="2"><div align="center"> <input type="submit" name="SubmitButton" id="SubmitButton" value="<?php echo _ADD_TAKEOFF_TO_AREA; ?> "> <input type="hidden" name="addTakeoffForm" value="1" /> </div></td> </tr> </table> <p> </p> </form> <table> <?php list($takeoffs, $takeoffsID) = area::getTakeoffs($areaID); $i = 0; foreach ($takeoffs as $name) { $takeoffID = $takeoffsID[$i]; echo "<tr><td>{$name}</td><td><a href='GUI_area_remove_takeoff?areaId={$areaID}&takeoffID={$takeoffID}'>remove Takeoff from area</a></td></tr><br>"; $i++; } ?> </table> <?php close_inner_table();
function show_action() { if (!front::get('aid')) front::$get['aid'] = front::get('id'); front::check_type(front::$get['aid']); $this->view->aid = trim(front::get('aid')); $this->view->archive = archive::getInstance()->getrow(front::get('aid')); $this->view->categorys = category::getpositionlink2($this->view->archive['catid']); if (!is_array($this->view->archive)) $this->out('message/error.html'); if ($this->view->archive['checked'] < 1) exit(lang('未审核!<a href="'.front::$from.'">返回</a>')); if (!rank::arcget(front::get('aid'), $this->view->usergroupid)) { $this->out('message/error.html'); } $this->view->catid = $this->view->archive['catid']; $this->view->topid = category::gettopparent($this->view->catid); $this->view->parentid = $this->category->getparent($this->view->catid); if (!rank::catget($this->view->catid, $this->view->usergroupid)) $this->out('message/error.html'); if (!isset($this->category->category[$this->view->catid]) || !isset($this->category->category[$this->view->topid])) { } $template = @$this->view->archive['template']; $linkword = new linkword(); $linkwords = $linkword->getrows(null, 1000, 'linkorder desc'); $content = $this->view->archive['content']; $contents = preg_split('%<div style="page-break-after(.*?)</div>%si', $content); if ($contents) { $this->view->pages = count($contents); front::$record_count = $this->view->pages * config::get('list_pagesize'); $content = $contents[$this->view->page - 1]; } //$content = preg_replace("/(<a(.*))(>)(.*)(<)(\/a>)/isU", '\\1-]-\\4-[-\\6', $content); foreach ($linkwords as $linkword) { $linkword['linktimes'] = (int) $linkword['linktimes']; if (trim($linkword['linkurl']) && !preg_match('%^http://$%', trim($linkword['linkurl']))) { $link = "<a href='$linkword[linkurl]' target='_blank'>$linkword[linkword]</a>"; } else { $link = "<a href='" . url('archive/search/keyword/' . urlencode($linkword['linkword'])) . "' target='_blank'>$linkword[linkword]</a>"; } $content = _keylinks($content,$linkword['linkword'],$link,$linkword['linktimes']); } $this->view->likenews = $this->getLike($this->view->archive['tag'], $this->view->archive['keyword']); $taghtml = ''; $tag_table = new tag(); foreach ($tag_table->urls($this->view->archive['tag']) as $tag => $url) { $taghtml.="<a href='$url' target='_blank'>$tag</a> "; } $this->view->archive['tag'] = $taghtml; $this->view->archive['special'] = null; if ($this->view->archive['spid']) { $spurl = special::url($this->view->archive['spid'],special::getishtml($this->view->archive['spid'])); $sptitle = special::gettitle($this->view->archive['spid']); $this->view->archive['special'] = "<a href='$spurl' target='_blank'>$sptitle</a> "; } $this->view->archive['type'] = null; if ($this->view->archive['typeid']) { $typeurl = type::url($this->view->archive['typeid'],1); $typetitle = type::name($this->view->archive['typeid']); $this->view->archive['type'] = "<a href='$typeurl' target='_blank'>$typetitle</a> "; } $this->view->archive['area'] = null; $this->view->archive['area'] = area::getpositonhtml($this->view->archive['province_id'], $this->view->archive['city_id'], $this->view->archive['section_id']); $this->view->archive['content'] = $content; $aid = front::$get['aid']; $catid = $this->view->catid; if(!$this->view->archive['showform']) { $this->getshowform($catid); }else if($this->view->archive['showform'] && $this->view->archive['showform'] == '1') { $this->showform = 1; }else { $this->showform = $this->view->archive['showform']; } if(preg_match('/^my_/is',$this->showform)) { $this->view->archive['showform'] = $this->showform; $o_table = new defind($this->showform); front::$get['form'] = $this->showform; $this->view->primary_key = $o_table->primary_key; $field = $o_table->getFields(); $fieldlimit = $o_table->getcols('user_modify'); helper::filterField($field,$fieldlimit); $this->view->field = $field; }else { $this->view->archive['showform'] = ''; } $str = ""; cb_data($this->view->archive); foreach( $this->view->archive as $key => $value){ if(!preg_match('/^my/',$key) || !$value) continue; $category = category::getInstance(); $sonids = $category->sons(setting::$var['archive'][$key]['catid']); if(setting::$var['archive'][$key]['catid'] != $this->view->archive['catid'] && !in_array($this->view->archive['catid'],$sonids) && (setting::$var['archive'][$key]['catid'])){ unset($this->view->field[$key]); continue; } $str .= '<p> '.setting::$var['archive'][$key]['cname'].':'. $value.'</p>'; } $this->view->archive['my_fields'] = $str; $sql1 = "SELECT aid,title,catid FROM `{$this->archive->name}` WHERE catid = '$catid' AND aid > '$aid' ORDER BY aid ASC LIMIT 0,1"; $sql2 = "SELECT aid,title,catid FROM `{$this->archive->name}` WHERE catid = '$catid' AND aid < '$aid' ORDER BY aid DESC LIMIT 0,1"; $n = $this->archive->rec_query_one($sql1); $p = $this->archive->rec_query_one($sql2); $this->view->archive['p'] = $p; $this->view->archive['n'] = $n; $this->view->archive['p']['url'] = archive::url($p); $this->view->archive['n']['url'] = archive::url($n); $this->view->archive['strgrade'] = archive::getgrade($this->view->archive['grade']); $prices = getPrices($this->view->archive['attr2']); $this->view->archive['attr2'] = $prices['price']; $this->view->archive['oldprice'] = $prices['oldprice']; $this->view->groupname = $prices['groupname']; //$this->view->archive['pics'] = unserialize($this->view->archive['pics']); if(is_array($this->view->archive['pics']) && !empty($this->view->archive['pics'])){ foreach ($this->view->archive['pics'] as $k => $v){ if(strtolower(substr($v,0,7)) == 'http://'){ $this->view->archive['pics'][$k] = $v; }else{ $this->view->archive['pics'][$k] = $v; } } } //$this->view->archive['pics'] = unserialize($this->view->archive['pics']); //var_dump($this->view->archive); if (front::get('t') == 'wap') { $tpl = category::gettemplate($this->view->catid, 'showtemplatewap'); if(!$tpl) $tpl = 'wap/show.html'; $this->out($tpl); return; } if ($template && file_exists(TEMPLATE . '/' . $this->view->_style . '/' . $template)) $this->out($template); else { $tpl = category::gettemplate($this->view->catid, 'showtemplate'); if (category::getarcishtml($this->view->archive)) { $path = ROOT . archive::url($this->view->archive); if (!preg_match('/\.[a-zA-Z]+$/', $path)) $path = rtrim(rtrim($path, '/'), '\\') . '/index.html'; $this->cache_path = $path; } $this->out($tpl); } }
public function storeContactList($store_id_arr) { if (empty($store_id_arr) || !is_array($store_id_arr)) { return array(); } $store_contact_list = D('')->table(array('Store' => 's', 'Store_contact' => 'sc'))->where("`s`.`store_id` IN (" . join(',', $store_id_arr) . ") AND `s`.`store_id` = `sc`.`store_id`")->field(`sc.*, s.name`)->select(); import('area'); $areaClass = new area(); $return_data = array(); foreach ($store_contact_list as $value) { $value['province_txt'] = $areaClass->get_name($value['province']); $value['city_txt'] = $areaClass->get_name($value['city']); $value['county_txt'] = $areaClass->get_name($value['county']); $value['logo'] = getAttachmentUrl($value['logo']); $return_data[$value['store_id']] = $value; } return $return_data; }
public function conver($expressConfig, $order_id, $seller_id = 0) { $resultArray = array(); //函数返回数据 $wholeData = array(); //实际的数据 //获取订单信息 $id = intval($order_id); $orderObj = new IModel('order'); $orderRow = $orderObj->getObj('id = ' . $id . ' and seller_id = ' . $seller_id); if (empty($orderRow)) { return null; } //获取发货地址信息 $shipInfoObj = new IModel('merch_ship_info'); $shipList = $shipInfoObj->query('is_del = 1 and seller_id = ' . $seller_id, '*', 'is_default', 'desc', '1'); if (empty($shipList)) { $shipRow = array('ship_user_name' => '', 'address' => '', 'telphone' => '', 'mobile' => '', 'postcode' => '', 'province' => '', 'city' => '', 'area' => ''); } else { $shipRow = $shipList[0]; } //获取订单总重量和总数量 $orderGoodsObj = new IModel('order_goods'); $orderTotal = $orderGoodsObj->getObj('order_id = ' . $id, 'SUM(goods_nums) as num_total,SUM(goods_weight * goods_nums) as weight_total'); /*拼接实际数据 $wholeData*/ //查询area地域数据 $areaData = area::name($orderRow['province'], $orderRow['city'], $orderRow['area'], $shipRow['province'], $shipRow['city'], $shipRow['area']); //获取site_config配置信息 $site_config = new Config('site_config'); $site_config = $site_config->getInfo(); $wholeData['ship_name'] = $orderRow['accept_name']; $wholeData['ship_area_0'] = isset($areaData[$orderRow['province']]) ? $areaData[$orderRow['province']] : ''; $wholeData['ship_area_1'] = isset($areaData[$orderRow['city']]) ? $areaData[$orderRow['city']] : ''; $wholeData['ship_area_2'] = isset($areaData[$orderRow['area']]) ? $areaData[$orderRow['area']] : ''; $wholeData['ship_addr'] = $orderRow['address']; $wholeData['ship_tel'] = $orderRow['telphone']; $wholeData['ship_mobile'] = $orderRow['mobile']; $wholeData['ship_zip'] = $orderRow['postcode']; $wholeData['ship_detail_addr'] = $wholeData['ship_area_0'] . $wholeData['ship_area_1'] . $wholeData['ship_area_2'] . $orderRow['address']; $wholeData['dly_name'] = $shipRow['ship_user_name']; $wholeData['dly_area_0'] = isset($areaData[$shipRow['province']]) ? $areaData[$shipRow['province']] : ''; $wholeData['dly_area_1'] = isset($areaData[$shipRow['city']]) ? $areaData[$shipRow['city']] : ''; $wholeData['dly_area_2'] = isset($areaData[$shipRow['area']]) ? $areaData[$shipRow['area']] : ''; $wholeData['dly_address'] = $shipRow['address']; $wholeData['dly_tel'] = $shipRow['telphone']; $wholeData['dly_mobile'] = $shipRow['mobile']; $wholeData['dly_zip'] = $shipRow['postcode']; $wholeData['date_y'] = date('Y'); $wholeData['date_m'] = date('m'); $wholeData['date_d'] = date('d'); $wholeData['order_id'] = $orderRow['order_no']; $wholeData['order_price'] = $orderRow['order_amount']; $wholeData['order_weight'] = isset($orderTotal['weight_total']) ? $orderTotal['weight_total'] : ''; $wholeData['order_count'] = isset($orderTotal['num_total']) ? $orderTotal['num_total'] : ''; $wholeData['order_memo'] = $orderRow['note']; $wholeData['ship_time'] = $orderRow['accept_time']; $wholeData['shop_name'] = isset($site_config['name']) ? $site_config['name'] : ''; $wholeData['tick'] = '√'; //进行数据替换 foreach ($expressConfig as $key => $val) { $item_tmp = JSON::decode($val); $item_tmp['typeText'] = isset($wholeData[$item_tmp['typeId']]) ? $wholeData[$item_tmp['typeId']] : ''; $resultArray[] = JSON::encode($item_tmp); } return $resultArray; }
$q .= " SELECT jo.order_date, joi.order_quantity AS products"; $q .= " FROM jng_sp_orders jo"; $q .= " LEFT JOIN jng_sp_orders_items joi ON joi.jng_sp_orders_id=jo.jng_sp_orders_id"; $q .= " WHERE jo.jng_sp_id IN (" . implode(',', array_keys($sp_active)) . ") AND jo.order_date>=DATE_SUB(CURRENT_DATE(), INTERVAL {$days} DAY) AND joi.status NOT IN (10,12)"; $q .= ")dt ORDER BY order_date"; $res = tep_db_query($q); while ($r = tep_db_fetch_array($res)) { $p = date($format_date, strtotime($r['order_date'])); $bar_values[$p] += $r['products']; } //Start constructing charts $title = new title('Last ' . $days . ' Days Sales Chart'); $title->set_style("{font-size:14px; font-weight:bold; padding:10px;}"); $chart = new open_flash_chart(); $chart->set_title($title); $area = new area(); $area->set_colour('#5B56B6'); $area->set_values(array_values($bar_values)); $area->set_key('Products', 12); $chart->add_element($area); //define x-axis $x_labels = new x_axis_labels(); $x_labels->set_steps(4); $x_labels->set_labels($period); $x = new x_axis(); $x->set_grid_colour('#D7E4A3'); //$x->set_offset($period_offset); $x->set_steps(4); // Add the X Axis Labels to the X Axis $x->set_labels($x_labels); $chart->set_x_axis($x);
$area->{$varName} = $_POST[$varName]; } $area->ID = $areaID; $res = $area->putToDB($areaID ? 1 : 0); if ($res) { echo "<BR>Area updated! "; } else { echo "<BR>Problem in updating Area ! "; } if ($areaAction == 'Edit') { echo "<div align=center><a href='" . getLeonardoLink(array('op' => 'area_admin', 'areaAction' => 'Edit', 'areaID' => $areaID)) . "'>RETURN TO AREA</a> </div><BR>"; } } } else { if (in_array($areaAction, array('Add', 'Edit', 'Delete'))) { $area = new area($areaID); if ($areaID) { $area->getFromDB(); } } ?> <form id="areaForm" name="areaForm" method="post" action=""> <table width="700" border="1" cellspacing="0" cellpadding="0"> <tr> <td width="161">Area Name </td> <td width="533"> <input type="text" name="name" size="40" value="<?php echo $area->name; ?> "/> </td> </tr>
<?php $data = array(); for ($i = 0; $i < 6.2; $i += 0.2) { $tmp = sin($i) * 1.9; $data[] = $tmp; } include '../php-ofc-library/open-flash-chart.php'; $chart = new open_flash_chart(); $chart->set_title(new title('Area Chart')); // // Make our area chart: // $area = new area(); // set the circle line width: $area->set_width(2); $area->set_default_dot_style(new hollow_dot()); $area->set_colour('#838A96'); $area->set_fill_colour('#E01B49'); $area->set_fill_alpha(0.4); $area->set_values($data); // add the area object to the chart: $chart->add_element($area); $y_axis = new y_axis(); $y_axis->set_range(-2, 2, 2); $y_axis->labels = null; $y_axis->set_offset(false); $x_axis = new x_axis(); $x_axis->labels = $data; $x_axis->set_steps(2); $x_labels = new x_axis_labels();
$price[] = 77.90000000000001; $year[] = '2004'; $price[] = 77.90000000000001; $year[] = '2005'; $price[] = 79.90000000000001; $year[] = '2006'; $price[] = 88.90000000000001; $year[] = '2007'; $price[] = 87.90000000000001; $year[] = '2008'; $price[] = 103.9; $chart = new open_flash_chart(); $title = new title('UK Petrol price (pence) per Litre'); $title->set_style("{font-size: 20px; color: #A2ACBA; text-align: center;}"); $chart->set_title($title); $area = new area(); $area->set_colour('#8f8fbd'); $area->set_values($price); $area->set_key('Price', 12); $chart->add_element($area); $x_labels = new x_axis_labels(); $x_labels->set_steps(2); $x_labels->set_vertical(); $x_labels->set_colour('#A2ACBA'); $x_labels->set_labels($year); // ²åÈëÊý¾Ý $x = new x_axis(); $x->set_colour('#dadada'); $x->set_grid_colour('#D7E4A3'); $x->set_offset(false); $x->set_steps(4);