function getGoogleMapURL($address, $lang, $latLng="") { $zoom = 17; $googleURL = $lang == "tc" ? "http://www.google.com.tw/" : "http://www.google.com/"; $hl = $lang == "tc" ? "zh-TW" : "en"; $queryStr = $address ;// $latLng == "" ? $address : $latLng.'('.$address.')'; return $googleURL.'maps?f=q&hl='.$hl.'&geocode=&q='.$queryStr.'&z='.$zoom.'&ll='.$latLng.'&output=embed&iwloc='; } function check_in_range($start_date, $end_date, $date_from_user) { // Convert to timestamp $start_ts = strtotime($start_date); $end_ts = strtotime($end_date); $user_ts = strtotime($date_from_user); // Check that user date is between start & end return (($user_ts >= $start_ts) && ($user_ts <= $end_ts)); } function check_even_inside($even_list , $search_date){ foreach($even_list as $v){ $res_single_day = false; $res_range = false; $res_ext_range = false; $res_ext_single_day = false; //search programe range if(count($v['program_range']['range'])>0){ $res_range = check_in_range($v['program_range']['range'][0],$v['program_range']['range'][1],$search_date); } //search program single day if($v['program_range']['single_day']==$search_date){ $res_single_day = true; } //search program res if($res_range ||$res_single_day ){ return true; } foreach($v['ext_item'] as $ext_item){ $res_ext_single_day = false; //search programe ext range if(count($ext_item['data_range'])>1){ $res_ext_range = check_in_range($ext_item['data_range'][0],$ext_item['data_range'][1],$search_date); } else{ //search programe ext day if($ext_item['data_range'][0]==$search_date){ $res_ext_single_day = true; } } if($res_ext_range ||$res_ext_single_day ){ return true; } } } return false; } ?>