Beispiel #1
0
 public function getPoster($id, $mid)
 {
     $map['id'] = $id;
     $result = $this->where($map)->find();
     $posterSmallTypeDao = D('PosterSmallType');
     $posterTypeDao = D('PosterType');
     if (!$result) {
         return false;
     }
     //if($mid !=$result['uid'] && $result['private'] == 1 && 'unfollow' == getFollowState($result['uid'],$mid)) return false;
     $result['posterType'] = $posterTypeDao->getTypeName($result['pid']);
     $result['posterSmallType'] = $posterSmallTypeDao->getTypeName($result['type']);
     isset($result['cover']) && ($result['cover'] = DATA_URL . '/upload/' . $result['cover']);
     $result['address'] = getAreaInfo($result['address_province'] . ',' . $result['address_city'] . ',' . $result['address_area']);
     return $result;
 }
 public function getArea($pid = 0)
 {
     //   	 $apptype = !empty(I('post.apptype')) and I('post.apptype')==C('APP_KEY') ?true:false;//手机app接口密钥
     $apptype = $this->appParam();
     if ($apptype == -1) {
         $area_info["area"] = getAreaInfo($pid);
         //获取地区子类
         return $area_info["area"];
     } else {
         $pid = intval(I("post.id"));
         //地区父类id
         $area_info["area"] = getAreaInfo($pid);
         //获取地区子类
         $this->ajaxReturn($area_info);
         //返回json
     }
     //   	 if($apptype){
     //   	 	$area_info["area"]=getAreaInfo($pid);//获取地区子类
     //   	 	$this->ajaxReturn($area_info);//返回json
     //   	 }else{
     //   	 	$this->error("非法访问",'',true);
     //   	 }
 }
<?php

require "../includes/includeMeBlank.php";
//This function returns all the shifts for an employee in a given period
$weekStart = $_GET['startDate'];
$employee = $_GET['employee'];
$areaInfo = getAreaInfo($area);
$numberOfSchedulableDays = $areaInfo['endDay'] - $areaInfo['startDay'];
if ($numberOfSchedulableDays < 0) {
    $numberOfSchedulableDays += 7;
}
$numberOfDaysToReturn = $numberOfSchedulableDays;
if ($numberOfDaysToReturn < 6) {
    $numberOfDaysToReturn = 6;
}
$endDate = date("Y-m-d", strtotime($weekStart . "+{$numberOfDaysToReturn} days"));
$date = $weekStart;
$shiftArray = array();
if (!$areaInfo['postSchedulesByDefault']) {
    //Check if the schedule has been posted.
    try {
        $postingQuery = $db->prepare("SELECT * FROM schedulePosting WHERE area = :area AND weekStart = :start");
        $postingQuery->execute(array(':area' => $area, ':start' => $weekStart));
    } catch (PDOException $e) {
        exit("error in query");
    }
    if ($checkArray = $postingQuery->fetch(PDO::FETCH_ASSOC)) {
        if ($checkArray['post'] == 0 && !can("update", "1689443f-8c4c-4874-8ee3-a3137db32d85")) {
            echo json_encode($shiftArray);
            return;
        }
 public function getArea()
 {
     $apptype = (!empty(I('post.apptype')) and I('post.apptype') == C('APP_KEY')) ? true : false;
     //手机app接口密钥
     $pid = I("post.id");
     //地区父类id
     if ($apptype) {
         $area_info["area"] = getAreaInfo($pid);
         //获取地区子类
         $this->ajaxReturn($area_info);
         //返回json
     } else {
         $this->error("非法访问", '', true);
     }
 }
 function _addInfoFeed($posts)
 {
     return false;
     if (isset($posts['ts_hometown'])) {
         $posts['ts_hometown'] = getAreaInfo($posts['ts_hometown'], $posts['ts_hometown']);
     }
     if (isset($posts['ts_areaval'])) {
         $posts['ts_areaval'] = getAreaInfo($posts['ts_areaval'], $posts['ts_areaval']);
     }
     unset($posts['extra']);
     foreach ($posts as $name => $v) {
         if (strpos($name, "__") !== 0 && strpos($name, "old_") !== 0) {
             //if(strcmp($posts["old_".$name],$post[$name]))
             $update[$name] = $v;
         }
     }
     if ($update["name"]) {
         //更新session
         $user["id"] = $this->mid;
         $user["name"] = $update["name"];
         $_SESSION["userInfo"] = serialize($user);
     }
     foreach ($update as $name => $v) {
         if ($name == "sex") {
             $v = $v ? "男" : "女";
         }
         if (getFieldName($name)) {
             $feed_title .= "将" . getFieldName($name) . "改为 \"" . $v . "\",";
         }
     }
     $feed_title = rtrim($feed_title, ",");
     if ($feed_title) {
         $title_data["content"] = $feed_title;
         $feedId = $this->api->feed_publish("info", $title_data, $body_data);
     }
 }
 private function __paramAddress($param)
 {
     $result = $input = $param;
     if (isset($input)) {
         list($province, $city) = explode(',', $input);
         isset($input) && ($result = getAreaInfo($province) . " " . getAreaInfo($city));
     }
     return $result;
 }
 private function __paramAddress($param)
 {
     $result = $input = $param;
     if (isset($input)) {
         $result = getAreaInfo($input);
     }
     return $result;
 }
Beispiel #8
0
function getUserCity($uid)
{
    $uid = abs(intval($uid));
    $info = D("User")->field('current_city,current_province')->find($uid);
    return getAreaInfo($info['current_province'] . ',' . $info["current_city"]);
}