db = &$db; $this->table = DB_PRE.'content'; $this->tickettable = DB_PRE.'c_product'; $this->pricetable = DB_PRE.'c_ticketprice'; } //查询所有该门票的价格列表 function listprice($ticket_id, $pid = '', $array = array()) { if($array) @extract($array); $ticket_id = intval($ticket_id); if(!$ticket_id)return false; if($pid) { $p_sql = strpos($pid, ',') ? "AND contentid IN($pid)" : "AND contentid=$pid"; } $array = array(); $in_where = $in_where ? $in_where : 'seattype ASC'; $result = $this->db->query("SELECT * FROM `$this->pricetable` WHERE ticket_id=$ticket_id $p_sql ORDER BY $in_where"); while($r = $this->db->fetch_array($result)) { unset($r['content']); if($toarray && $r[upper_price]) $r[upper_price] = @string2array($r[upper_price]); $array[] = $r; } $this->db->free_result($result); return $array; } //根据id查找 function getbyid($contentid){ $sql = "select * from `$this->pricetable` WHERE contentid = $contentid"; $data = $this->db->get_one($sql); return $data; } //转化周末 function get_weekend($daystr){ if($daystr == '5,6') return '周五、周六'; if($daystr == '6,7') return '周六、周日'; $cn = array("一", "二", "三", "四", "五", "六", "日"); $str = ''; $Arr = explode(',', $daystr); foreach((array)$Arr as $r) { $str .= '、周'.$cn[$r-1]; } $str = $str ? substr($str,3) : ''; return $str; } //转化工作日 function get_workday($daystr){ if($daystr == '5,6') return '周日至周四'; if($daystr == '6,7') return '周一至周五'; $cn = array("一", "二", "三", "四", "五", "六", "日"); $str = ''; $daystr = ' '.$daystr; for($i = 1; $i < 8; $i++){ if(!strpos($daystr, ''.$i) > 0){ $str .= '、周'.$cn[$i-1]; } } $str = $str ? substr($str,3) : ''; return $str; } //根据指定的规则检索出指定票务的价格 function getAuth($ticketid, $avadate, $array = array()) { $ticketid = intval($ticketid); if(!$ticketid || !$avadate) return 0; if($array) @extract($array); $r_price = array(); if(!$priceid && !$seattype && !$adultorchild) { $result = $this->listprice($ticketid); $r_price = $result[0]; } if(!$r_price) return 0; $price = 0; //返回价格 //看看是否有升价或降价 if($r_price['upper_price']) { $upper_price = @string2array($r_price['upper_price']); if($upper_price[$avadate]) { $price = $upper_price[$avadate]; } } if(!$price) { $w = getdate(strtotime($avadate)); $price = ($w[wday] == 6 || $w[wday] == 0) ? $r_price['price56'] : $r_price['price74']; } return intval($price); } //*************************************************************************管理员权限功能 function updateSppriceday($contentid, $value){ if(empty($contentid)) return ''; $sql = "UPDATE $this->pricetable SET upper_price = '".$value."' WHERE contentid = $contentid LIMIT 1"; return $this->db->query($sql); } function update($contentid, $array) { $contentid = intval($contentid); if(!$contentid || !is_array($array) || !$array) return false; $this->db->update($this->pricetable, $array, "contentid=$contentid LIMIT 1"); } } //删除数组中重复元素的函数 function delmember(&$array, $id) { $size = count($array); for($i = 0; $i <$size - $id - 1; $i ++) { $array[$id + $i] = $array[$id + $i + 1]; } unset($array[$size - 1]); } function delsame(&$array) { $i = 0; while(isset($array[$i])) { $j = $i + 1; while(isset($array[$j])) { if($array[$i] == $array[$j]) //如果发现后面有重复的元素 { delmember($array, $j); //把它删除 $j--; //重新检查补上来的元素是否是重复的 } $j ++; } $i ++; } } ?> Skyview Motel Fort Lee-标间-酒店房型-回归旅游网
回归旅游网
首页酒店房型价格

Skyview Motel Fort Lee-标间

图片:
  • 图片
更多信息  请点击这里
标签:
 
我要评论
网友评论仅供其表达个人看法,并不表明本站同意其观点或证实其描述。