alert(\"$str\"); ";
if(!$url) {
echo "history.back();";
} else {
if( $target ) echo $target . ".";
echo "location.href='$url';";
}
echo "";
die();
}
function nvl($str, $replacestr="") {
if(!$str){
return $replacestr;
}else{
return $str;
}
}
function fnGetDocExt($param){
$allfile = strtolower($param);
$fileinfo = pathinfo($allfile);
$ext = $fileinfo['extension'];
if($ext=="doc" || $ext=="hwp" || $ext=="ppt" || $ext=="pptx" || $ext=="docx" || $ext=="pdf"){
return "doc";
}else{
return "img";
}
}
FUNCTION error_page($str="오류발생",$url="") {
$str = addslashes($str);
if(!$url) $url = $PHP_SELF;
echo "";
die();
}
function move_page($path,$time = 0) {
die("");
}
function js_msg($str) {
$str = addslashes($str);
echo "";
}
FUNCTION login_please($url) {
$url = urlencode($url);
if(!session_is_registered(MEM_SESS)) {
js_msg('로그인이 필요합니다');
move_page("/login/login.html?url=$url");
}
}
function message($msg){
global $head_url,$foot_url,$head_html,$foot_html;
if ($head_url) include $head_url;
echo stripslashes($head_html);
echo "
";
echo stripslashes($foot_html);
if ($foot_url) include $foot_url;
exit;
}
function avoid_crack($data)
{
// Fix &entity\n;
$data = str_replace(array('&','<','>'), array('&','<','>'), $data);
$data = preg_replace('/(*\w+)[\x00-\x20]+;/u', '$1;', $data);
$data = preg_replace('/(*[0-9A-F]+);*/iu', '$1;', $data);
$data = html_entity_decode($data, ENT_COMPAT, 'UTF-8');
// Remove any attribute starting with "on" or xmlns
$data = preg_replace('#(<[^>]+?[\x00-\x20"\'])(?:on|xmlns)[^>]*+>#iu', '$1>', $data);
// Remove javascript: and vbscript: protocols
$data = preg_replace('#([a-z]*)[\x00-\x20]*=[\x00-\x20]*([`\'"]*)[\x00-\x20]*j[\x00-\x20]*a[\x00-\x20]*v[\x00-\x20]*a[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2nojavascript...', $data);
$data = preg_replace('#([a-z]*)[\x00-\x20]*=([\'"]*)[\x00-\x20]*v[\x00-\x20]*b[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2novbscript...', $data);
$data = preg_replace('#([a-z]*)[\x00-\x20]*=([\'"]*)[\x00-\x20]*-moz-binding[\x00-\x20]*:#u', '$1=$2nomozbinding...', $data);
// Only works in IE:
$data = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?expression[\x00-\x20]*\([^>]*+>#i', '$1>', $data);
$data = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?behaviour[\x00-\x20]*\([^>]*+>#i', '$1>', $data);
$data = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:*[^>]*+>#iu', '$1>', $data);
// Remove namespaced elements (we do not need them)
$data = preg_replace('#*\w+:\w[^>]*+>#i', '', $data);
do
{
// Remove really unwanted tags
$old_data = $data;
$data = preg_replace('#*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $data);
}
while ($old_data !== $data);
$data = preg_replace("/[\"\']/i", '\"', $data); //쌍따옴표 치환
$data = preg_replace("/[\"\']/i", "\'", $data); //따옴표 치환
// we are done...
return $data;
}
function text_cut($str, $len){
if(strlen($str) > $len){
if(ord($str[$len - 1]) <= 127) $pos = $len;
else{
for($pos = $len - 1; $pos >= 0; $pos--){
if (ord($str[$pos]) > 127) $h++;
else break;
}
if ($h%2==0) $pos += $h + 1;
else $pos += $h;
}
$str = mb_substr($str, 0, $pos, 'UTF-8');
$str .="..";
}
return $str;
}
function validateAuth($dbpwd, $userpwd) {
global $admin, $uadmin;
if(session_is_registered("administrator")) {
return true;
} else {
if($userpwd == $admin[passwd]) {
// js_msg("유저가 입력한 패스워드와 전체관리자 패스워드가 동일");
return true;
} else if($uadmin[passwd] == crypt($userpwd, $uadmin[passwd])) {
// js_msg("유저가 입력한 패스워드가 로컬관리자 패스워드와 동일");
return true;
}else if(!$dbpwd || !$userpwd) {
// js_msg("db패스워드가 없거나 유저가 패스워드를 입력하지 않음");
return false;
} else if($dbpwd != $userpwd) {
// js_msg("DB패스워드와 유저가 입력한 패스워드는 일치하지 않음");
return false;
} else return true;
} // end outer if
}
function setLocalAdminSession($db, $pwd) {
global $uadmin;
if(!$db || !$pwd) return false;
if($uadmin[passwd] == crypt($pwd, $uadmin[passwd])) {
session_register($db);
return true;
} else {
return false;
}
}
function safeHTML($html, $tags = "b|br|i|u|ul|ol|li") {
$html = preg_replace('/\0/', '', $html);
$html = preg_replace('/\&/', '\0', $html);
$html = htmlspecialchars($html);
$html = str_replace(chr(13).chr(10),"
",$html);
if($tags) {
$html = preg_replace("/<($tags).*?>/i",'<\1>', $html);
$html = preg_replace("/<\\/($tags)>/i",'\1>', $html);
}
$html = preg_replace('/\0/', '&', $html);
// $html = preg_replace("/>(http|https|ftp)(:\/\/\S+)<(.+?)");
// $pattern = "(http://|ftp://)+([0-9a-zA-Z./@~?&=_]+)";
// $html = ereg_replace($pattern, "\\1\\2", $html);
return $html;
}
function utf8_length($str) {
$len = strlen($str);
for ($i = $length = 0; $i < $len; $length++) {
$high = ord($str[$i]);
if ($high < 0x80)//0<= code <128 범위의 문자(ASCII 문자)는 인덱스 1칸이동
$i += 1;
else if ($high < 0xE0)//128 <= code < 224 범위의 문자(확장 ASCII 문자)는 인덱스 2칸이동
$i += 2;
else if ($high < 0xF0)//224 <= code < 240 범위의 문자(유니코드 확장문자)는 인덱스 3칸이동
$i += 3;
else//그외 4칸이동 (미래에 나올문자)
$i += 4;
}
return $length;
}
function cutstring($str, $chars, $tail = '..') {
if (utf8_length($str) <= $chars)//전체 길이를 불러올 수 있으면 tail을 제거한다.
$tail = '';
else
$chars -= utf8_length($tail);//글자가 잘리게 생겼다면 tail 문자열의 길이만큼 본문을 빼준다.
$len = strlen($str);
for ($i = $adapted = 0; $i < $len; $adapted = $i) {
$high = ord($str[$i]);
if ($high < 0x80)
$i += 1;
else if ($high < 0xE0)
$i += 2;
else if ($high < 0xF0)
$i += 3;
else
$i += 4;
if (--$chars < 0)
break;
}
return trim(substr($str, 0, $adapted)) . $tail;
}
function getFileType($filename) {
$ext = substr($filename, strpos($filename, "."));
}
// 문자열에 한글이 포함되어 있는지 검사하는 함수
// ord - 문자의 ASCII 값을 가져옴
function is_hangul($str) {
// 특정 문자가 한글의 범위내(0xA1A1 - 0xFEFE)에 있는지 검사
for($i = 0; $i < strlen($str); $i++) {
$char = ord($str[$i]);
if($char >= 0xa1 && $char <= 0xfe)
return 1;
}
}
// 알파벳인지 그리고 대문자(0x41 - 0x5a)인지 소문자(0x61 - 0x7a)인지
// 검사하는 함수
//
// ord - 문자의 ASCII 값을 가져옴
function is_alpha($char) {
$char = ord($char);
if($char >= 0x61 && $char <= 0x7a)
return 1;
if($char >= 0x41 && $char <= 0x5a)
return 2;
}
// URL이 정확한 것인지 검사하는 함수
//
// eregi - 정규 표현식을 이용한 검사 (대소문자 무시)
// eregi_replace - 정규 표현식을 이용한 치환 (대소문자 무시)
function check_url($url) {
$url = trim($url);
if(is_hangul($url))
return;
// 프로토콜(http://, ftp://...)을 나타내는 부분이 없을 때 기본값으로
// http://를 붙임
if(!eregi("^(http://|https://|ftp://|telnet://|news://)", $url))
$url = preg_match("^", "http://", $url);
if(!eregi("(http|https|ftp|telnet|news):\/\/[a-z0-9-]+\.[][a-zA-Z0-9:@=_~%;\?\/\.\+-]+", $url))
return;
return $url;
}
// E-MAIL 주소가 정확한 것인지 검사하는 함수
//
// eregi - 정규 표현식을 이용한 검사 (대소문자 무시)
function check_email($email) {
$email = trim($email);
if(is_hangul($email))
return;
if(!eregi("^[a-z0-9_-]+@[a-z0-9-]+\.[a-z0-9\.-]+", $email))
return;
return $email;
}
function getLatestList($db, $num=5) {
global $PHP_SELF;
$query = "select * from $db order by no desc limit 0, $num";
$result = sql_query($query);
if(sql_num_rows($result)) {
while($list = sql_fetch_array($result)) {
printLatestList($db,$list);
}
} else {
echo "| 등록된 글이 없습니다 |
";
}
sql_free_result($result);
}
function printLatestList($db, $list) {
$list[title] = preg_match("\"",""",$list[title]);
$title = sprintf(" |
 |
", $db, $list[no], $list[title]);
echo "$title\n";
}
function getExt($filename) {
$filename = trim($filename);
$right = strrchr($filename, ".");
return strtolower(substr($right,1));
}
/// 게시물 자동링크 ///
function autolink($str){
// URL
$str=preg_match("(http|https|ftp|telnet|news)://([-/.a-zA-Z0-9_~#%$?&=:\200-\377\(\)]+)"," \\1://\\2",$str);
$str=str_replace("=","=",$str);
$str=str_replace("=\" ","=\"",$str);
$str=str_replace("='","='",$str);
$str=preg_match(" (http|https|ftp|telnet|news)://([-/.a-zA-Z0-9_~#%$?&=:\200-\377\(\)]+)","\\1://\\2",$str);
// MAIL
$str=preg_match("([\xA1-\xFEa-z0-9_-]+@[\xA1-\xFEa-z0-9-]+\.[a-z0-9-]+)"," \\1",$str);
$str=str_replace("mailto:","mailto:",$str);
$str=preg_match(" ([\xA1-\xFEa-z0-9_-]+@[\xA1-\xFEa-z0-9-]+\.[a-z0-9-]+)","\\1",$str);
return $str;
}
//아스키 문자열을 헥사 코드로..
function asc_hex($char){
$j = 0;
$word_length=strlen($char);
for($i = 0;$i<$word_length;$i++) {
if($j == 0){
if(ord(substr($char,$i,1)) > 0xa1 && ord(substr($char,$i,1)) <= 0xfe) {
if($i>0)$str .= ' ';
$j = 1; $str = $str.bin2hex(substr($char,$i,1));
}else{
if($i>0)$str .= ' ';
$str = $str.'00'.bin2hex(substr($char,$i,1));
}
}else{
$str = $str.bin2hex(substr($char,$i,1));
$j = 0;
}
}
return $str;
}
//헥사 코드 문자열을 아스키 코드 문자열로
function hex_asc($str){
$word_length=strlen($str);
for($i = 0;$i<$word_length;$i+=5){
$tmp1=HexDec(substr($str,$i,2));
if($tmp1==0){
$tmp2=HexDec(substr($str,$i+2,2));
$str2.=chr($tmp2);
}else{
$tmp2=HexDec(substr($str,$i+2,2));
$str2.=chr($tmp1).chr($tmp2);
}
}
return $str2;
}
// 사용법
// $str=fuck2xxx($str,$fil,'XX');
function fuck2xxx($str,$fil,$replace_str){
$fil=explode(',',$fil);
$replace_str=asc_hex($replace_str);
$filter_str='/(';
for($i=0;$i0)$filter_str.='|';
$filter_str.=asc_hex($fil[$i]);
}
$filter_str.=')+/';
$str=preg_replace($filter_str,$replace_str,asc_hex($str));
return hex_asc($str);
}
// 쓰기금지할 단어들을 검색해서 있으면 true
function is_fuck($str,$fil){
$fil=explode(',',$fil);
$filter_str='/(';
for($i=0;$i0)$filter_str.='|';
$filter_str.= $fil[$i];
}
$filter_str.=')+/';
if( preg_match($filter_str,$str) ) {
return true;
} else {
return false;
}
}
function get_microtime($old, $new) {
$old = explode(" ", $old);
$new = explode(" ", $new);
$time[msec] = $new[0] - $old[0];
$time[sec] = $new[1] - $old[1];
if($time[msec] < 0) {
$time[msec] = 1.0 + $time[msec];
$time[sec]--;
}
$time = sprintf("%.2f", $time[sec] + $time[msec]);
return $time;
}
function print_microtime($old, $new) {
$old = explode(" ", $old);
$new = explode(" ", $new);
$time[msec] = $new[0] - $old[0];
$time[sec] = $new[1] - $old[1];
if($time[msec] < 0) {
$time[msec] = 1.0 + $time[msec];
$time[sec]--;
}
$time = sprintf("%.2f", $time[sec] + $time[msec]);
$str = "PageLoding Time : " . $time ." sec";
echo "";
}
// 날짜를 date 형식으로 받아서 그날시작되는 UNIX TIMESTAMP 를 반환해준다
function str2date($in){
$t = split("/",$in);
if (count($t)!=3) $t = split("-",$in);
if (count($t)!=3) $t = split(" ",$in);
if (count($t)!=3) return -1;
if (!is_numeric($t[0])) return -1;
if (!is_numeric($t[1])) return -2;
if (!is_numeric($t[2])) return -3;
if ($t[2]<1902 || $t[2]>2037) return -3;
return mktime (0,0,0, $t[1], $t[0], $t[2]);
}
/* ============================================================================
Return :
Comment: 화일이 이미지인지 체크
Usage :
------------------------------------------------------------------------------*/
function img_type( $srcimg )
{
if(is_file($srcimg)) {
$image_info = @getimagesize($srcimg);
switch ($image_info['mime']) {
case 'image/gif': return true; break;
case 'image/jpeg': return true; break;
case 'image/png': return true; break;
case 'image/bmp': return true; break;
default : return false; break;
}
} else {
return false;
}
}
//기타이동함수
function AlertBack($msg){
echo("
");
exit;
}
function Alert($msg){
echo("
");
exit;
}
function AlertExit($msg){
echo("
");
exit;
}
function AlertRedirect($msg,$url){
echo("
");
exit;
}
function AlertRedirectRefresh($msg,$url){
echo("
");
exit;
}
function AlertLogin($msg){
echo("
");
exit;
}
function Redirect($url){
echo("
");
exit;
}
function AlertExitRefresh($msg,$tourl){
echo("
");
exit;
}
function Replace($tourl){
echo("
");
exit;
}
function ExitRedirect($tourl){
echo("
");
exit;
}
function ExitRefresh(){
echo("
");
exit;
}
function TopExit($tourl){
echo("
");
exit;
}
function URL2($tourl,$url){
echo("
");
exit;
}
/*
//Ajax페이징
function ListPgAjax($url,$pageno,$PageSize,$BlockPage,$totalrows)
{
$lastpgno=(int)@ceil($totalrows/$PageSize); //마지막 페이지
$now_num = (int) @ceil($pageno/$BlockPage);
$start_num = (int) ($now_num - 1) * $BlockPage;
$end_num = (int) $now_num * $BlockPage;
$next_num = (int) $end_num + 1;//마지막 페이지 값 구함
$prev_num = (int) $start_num;//시작 페이지 값 구함
$html = "";
//처음
if($pageno<>1) {
$html += "맨 처음";
}
//이전
if($now_num > 1) {
$html += "이전";
}
//블럭단위 페이징
for ($i = $start_num + 1; $i <= $end_num && $i <= $lastpgno; $i++) {
if ($i == $pageno) {
$html += " $i ";
}
else {
$html += "$i ";
}
}
//다음
if($end_num < $lastpgno) {
$html += " 다음";
}
//마지막
if($pageno<>$lastpgno && $lastpgno>0 ) {
$html += "맨 마지막";
}
return $html;
}
*/
//게시판페이징
// function ListPg($url,$pageno,$PageSize,$BlockPage,$totalrows)
// {
//
// $lastpgno=(int)@ceil($totalrows/$PageSize); //마지막 페이지
// $now_num = (int) @ceil($pageno/$BlockPage);
// $start_num = (int) ($now_num - 1) * $BlockPage;
// $end_num = (int) $now_num * $BlockPage;
// $next_num = (int) $end_num + 1;//마지막 페이지 값 구함
// $prev_num = (int) $start_num;//시작 페이지 값 구함
//
// // echo '';
// echo '';
//
// // echo '';
// }
//게시판페이징 - 사용자
function ListPg($url,$pageno,$PageSize,$BlockPage,$totalrows)
{
$lastpgno=(int)@ceil($totalrows/$PageSize); //마지막 페이지
$now_num = (int) @ceil($pageno/$BlockPage);
$start_num = (int) ($now_num - 1) * $BlockPage;
$end_num = (int) $now_num * $BlockPage;
$next_num = (int) $end_num + 1;//마지막 페이지 값 구함
$prev_num = (int) $start_num;//시작 페이지 값 구함
echo "";
echo "";
echo "";
}
//게시판페이징 - 사용자
function ListMobilePg($url,$pageno,$PageSize,$BlockPage,$totalrows)
{
$lastpgno=(int)@ceil($totalrows/$PageSize); //마지막 페이지
$now_num = (int) @ceil($pageno/$BlockPage);
$start_num = (int) ($now_num - 1) * $BlockPage;
$end_num = (int) $now_num * $BlockPage;
$next_num = (int) $end_num + 1;//마지막 페이지 값 구함
$prev_num = (int) $start_num;//시작 페이지 값 구함
echo "";
}
//게시판페이징1
function ListPg1($url,$pageno,$PageSize,$BlockPage,$totalrows)
{
$lastpgno=(int)@ceil($totalrows/$PageSize); //마지막 페이지
$now_num = (int) @ceil($pageno/$BlockPage);
$start_num = (int) ($now_num - 1) * $BlockPage;
$end_num = (int) $now_num * $BlockPage;
$next_num = (int) $end_num + 1;//마지막 페이지 값 구함
$prev_num = (int) $start_num;//시작 페이지 값 구함
if($pageno<>1 || $now_num > 1) {
echo "";
}
//처음
if($pageno<>1) {
echo "맨앞";
}
//이전
if($now_num > 1) {
echo "이전";
}
if($pageno<>1 || $now_num > 1) {
echo "";
}
//블럭단위 페이징
for ($i = $start_num + 1; $i <= $end_num && $i <= $lastpgno; $i++) {
if ($i == $pageno) {
echo "$i";
}
else {
echo "$i ";
}
}
if( $end_num < $lastpgno || ($pageno<>$lastpgno && $lastpgno>0) ){
echo "";
}
//다음
if($end_num < $lastpgno) {
echo " 다음";
}
//마지막
if($pageno<>$lastpgno && $lastpgno>0 ) {
echo "맨뒤";
}
if( $end_num < $lastpgno || ($pageno<>$lastpgno && $lastpgno>0) ){
echo "";
}
}
function ListPgFront($url,$pageno,$PageSize,$BlockPage,$totalrows)
{
/*
맨 처음
이전
1
2
3
4
5
다음
맨 마지막
*/
$lastpgno=(int)@ceil($totalrows/$PageSize); //마지막 페이지
$now_num = (int) @ceil($pageno/$BlockPage);
$start_num = (int) ($now_num - 1) * $BlockPage;
$end_num = (int) $now_num * $BlockPage;
$next_num = (int) $end_num + 1;//마지막 페이지 값 구함
$prev_num = (int) $start_num;//시작 페이지 값 구함
//처음
if($pageno<>1) {
echo "맨앞";
}
//이전
if($now_num > 1) {
echo "이전";
}
//블럭단위 페이징
for ($i = $start_num + 1; $i <= $end_num && $i <= $lastpgno; $i++) {
if ($i == $pageno) {
echo " $i ";
}
else {
echo "$i ";
}
}
//다음
if($end_num < $lastpgno) {
echo " 다음";
}
//마지막
if($pageno<>$lastpgno && $lastpgno>0 ) {
echo "맨뒤";
}
}
//원격지 아이피 얻기
function getIp() {
return $_SERVER["REMOTE_ADDR"];
}
/*
파일을 다운로드 받고자 할때 사용하는 함수이다.
사용법은 자기 자신의 페이지를 리플래쉬 하면서
함수를 호출하는 방식으로 하면된다.
downloadname : 다운로드 받을때의 이름
filepath : 화일의 서버경로(시스템 경로나 상대경로)
*/
function fileDownload($downloadname, $filepath) {
$HTTP_USER_AGENT=$_SERVER["HTTP_USER_AGENT"];
Header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
$filesize=@filesize($filepath);
if(strstr($HTTP_USER_AGENT, "MSIE 6.")) {
Header("Content-type: application/x-msdownload");
Header("Content-Length: $filesize");
Header("Content-Disposition: attachment; filename=$downloadname");
Header("Content-Transfer-Encoding: binary");
Header("Pragma: no-cache");
Header("Expires: 0");
}
else if(strstr($HTTP_USER_AGENT, "MSIE 5.5")) {
header("Content-Type: doesn/matter");
header("Content-disposition: filename=$downloadname");
header("Content-Transfer-Encoding: binary");
header("Pragma: no-cache");
header("Expires: 0");
}
else if(strstr($HTTP_USER_AGENT, "MSIE 5.0")) {
Header("Content-type: file/unknown");
header("Content-Disposition: attachment; filename=$downloadname");
Header("Content-Description: PHP3 Generated Data");
header("Pragma: no-cache");
header("Expires: 0");
}
else {
if (eregi('(htm|php|txt|gif|jpg|jpeg|png)',$tmp1)) {
$filename .='.file';
}
Header("Content-type: file/unknown");
header("Content-Disposition: attachment; filename=$downloadname");
Header("Content-Description: PHP3 Generated Data");
header("Pragma: no-cache");
header("Expires: 0");
}
header("Content-Description: File Transfert");
@readfile($filepath);
exit;
}
//파일사이즈
function getFileSize($userfile_size) {
if($userfile_size < 1024) $userfile_size=$userfile_size." B";
else if ($userfile_size >1024 && $userfile_size < 1024 *1024) $userfile_size=sprintf("%0.1f K",$userfile_size / 1024);
else $userfile_size=sprintf("%0.1f M",$userfile_size / (1024*1024));
return $userfile_size;
}
function total_size($USER_PATH){
$quota = exec("du -sk $USER_PATH");
$Total = explode("$USER_PATH", $quota);
$Total = trim($Total[0]);
$Total=getFileSize(($Total*1024));
return $Total;
}
function val_array($userval,$keyval) {
while(list($key,$val) = each($userval)) {
if($keyval==$key) $Val_Array=$val;
}
return $Val_Array;
}
function mod_checked($usercol,$userval) {
if($usercol==$userval) $Val_Array= "checked"; return $Val_Array;
}
function mod_selected($usercol,$userval) {
if($usercol==$userval) $Val_Array= "selected"; return $Val_Array;
}
function mod_filepath($usercol,$userval,$url,$width='35') {
if(file_exists($usercol)) {
$Val_Array="
Del";
return $Val_Array;
}
}
function view_filepath($usercol,$userval) {
if($usercol) {
$Val_Array="
";
return $Val_Array;
}
}
function view_file($usercol,$userval) {
if($usercol) {
$Val_Array="
";
echo $Val_Array;
}
}
function getDatePlus($plus_y,$plus_m,$plus_d,$type)
{
return date($type,mktime(0,0,0,date("m")+$plus_m,date("d")+$plus_d,date("Y")+$plus_y));
}
function getDateDay($y,$m,$d,$type)
{
return date($type,mktime(0,0,0,$m,$d,$y));
}
function getDaySearchForm($yp,$mp,$dp,$ys,$ms,$ds,$yg,$mg,$dg,$oc,$nm,$el,$sy)
{
//getDaySearchForm(출력(년,월,일),삽입(년,월,일),초기값(년,월,일),event,name,기본셋팅,시작년도)
$year = (!$yg) ? (!$el) ? date("Y") : substr($el,0,4) : $yg;
$month = (!$mg) ? (!$el) ? date("m") : substr($el,4,2) : $mg;
$day = (!$dg) ? (!$el) ? date("d") : substr($el,6,2) : $dg;
if($yp) {
$rtn = "\n\n";
}
if($mp) {
$rtn .= "\n\n";
}
if($dp){
$rtn .= "\n\n";
}
return $rtn;
}
function get_excel_content($db,$table,$SQL)
{
$result = mysql_db_query($db, "SELECT * FROM $table $SQL");
print "\r\n";
print "\r\n";
for($j = 0; $j < mysql_num_fields($result); $j++) {
print "| ".mysql_field_name($result,$j)." | \r\n";
}
print "
\r\n";
while ($row = mysql_fetch_row($result)) {
print "\r\n";
for($j = 0; $j < mysql_num_fields($result); $j++) {
print "| ".stripslashes($row[$j])." | \r\n";
}
print "
\r\n";
}
print "
\r\n";
print "