"); } function kstrcut($content,$length){ $hcount=0; //Àӽà º¯¼öÀÔ´Ï´Ù. for($j=0;$j<$length;$j++){ $cut=ord(substr($content,$j,1)); if(($cut & 0x80)==128){ $hcount++; } } if(strlen($content)>$length){ $mod=$hcount%2; if($mod==0){ $content=substr($content,0,$length); $summary=$content."..."; } else{ $length=$length+1; $content=substr($content,0,$length); $summary=$content."..."; } }else { $summary=$content; } return $summary; } function footer_html() { print("

"); } function MyDiffDate($srcDate) { $str_temp_date = date("Y m d"); $array_today = explode(" ", $str_temp_date); $to_day = (int)$array_today[2]; $to_mon = (int)$array_today[1]; $to_year = (int)$array_today[0]; $src_year = (int)substr($srcDate, 0, strpos($srcDate, "³â")); $src_mon = (int)substr($srcDate, strpos($srcDate, "³â")+2, 2); $src_day = (int)substr($srcDate, strpos($srcDate, "¿ù")+2, 2); $m_days[0] = 31; $m_days[1] = 28; $m_days[2] = 31; $m_days[3] = 30; $m_days[4] = 31; $m_days[5] = 30; $m_days[6] = 31; $m_days[7] = 31; $m_days[8] = 30; $m_days[9] = 31; $m_days[10] = 30; $m_days[11] = 31; //À±³â È®ÀÎ if( $src_mon == 2 ) { if(( $to_year % 4 ) == 0 && ( $to_year % 100 ) != 0 || ($to_year % 400) != 0 ) $m_days[1] = 29; if(( $to_year % 4 ) == 0 && ( $to_year % 100 ) == 0 && ($to_year % 400) == 0 ) $m_days[1] = 29; } if ($to_year == $src_year) { if($to_mon == $src_mon) $ret = ($to_day - $src_day); else if( ($to_mon - $src_mon) == 1 ) $ret = ($m_days[$to_mon - 2] + $to_day - $src_day); else $ret = $m_days[$to_mon - 2] + $to_day; } else { if ( ($src_mon - $to_mon) == 11 ) /* -> ¿©±âºÎÅÍ Ãß°¡»ðÀÓ */ $ret = ($m_days[$to_mon - 1] + $to_day - $src_day); else $ret = $m_days[$to_mon - 1] + $to_day;/* -> ¿©±â±îÁö »ðÀÔ */ } if($ret < 0) return 365; else return $ret; } function Ora_Count($conn) { global $db; $query = "select count(sn) from notice where db = '$db'"; $stmt=OCIparse($conn, $query); OCIExecute($stmt); OciFetchinto($stmt, &$fetch_record); $rowcount = $fetch_record[0]; OciFreeStatement($stmt); return $rowcount; } function listNotice($conn) { global $PHP_SELF; $query = "select sn, title, url, cdate from notice where db = 'notice' order by sn desc"; $stmt=OCIparse($conn, $query); OCIExecute($stmt); $count = 0; //while(OciFetchinto($stmt, &$fetch_record) and $count < COUNT) { print(" 2006³âµµ ¹®¿¹ÁøÈï±â±Ý»ç¾÷ Áö¿ø½Åû¾È³» ³×ƼÁðÀÌ ¾Ë¾Æ¾ß ÇÒ ÀúÀÛ±Ç »ó½Ä "); while(OciFetchinto($stmt, &$fetch_record) and $count < 7) { $count++; $sn = $fetch_record[0]; $title = $fetch_record[1]; //ora_getcolumn($handle, 1); $title = kstrcut($title, 36); $Url = $fetch_record[2]; //ora_getcolumn($handle, 2); $cdate = $fetch_record[3]; //ora_getcolumn($handle, 3); if(MyDiffDate($cdate) < 3) $bulb = ""; else $bulb = ""; $cdate = substr($cdate, strpos($cdate, "³â") + 2); $cdate = str_replace("¿ù", "/", $cdate); $cdate = str_replace("ÀÏ", "", $cdate); if(empty($url)) print(" [$cdate] $title $bulb "); else print(" [$cdate] $title $bulb "); } OciFreeStatement($stmt); } function listBodo($conn) { global $PHP_SELF; $query = "select sn, title, url, cdate from notice where db = 'bodo' order by sn desc"; $stmt=OCIparse($conn, $query); OCIExecute($stmt); $count = 0; //while(OciFetchinto($stmt, &$fetch_record) and $count < COUNT) { while(OciFetchinto($stmt, &$fetch_record) and $count < 3) { $count++; $sn = $fetch_record[0]; //ora_getcolumn($handle, 0); $title = $fetch_record[1]; //ora_getcolumn($handle, 1); $title = kstrcut($title, 36); $Url = $fetch_record[2]; //ora_getcolumn($handle, 2); $cdate = $fetch_record[3]; //ora_getcolumn($handle, 3); if(MyDiffDate($cdate) < 3) $bulb = ""; else $bulb = ""; $cdate = substr($cdate, strpos($cdate, "³â") + 2); $cdate = str_replace("¿ù", "/", $cdate); $cdate = str_replace("ÀÏ", "", $cdate); if(empty($url)) print(" [$cdate] $title $bulb "); else print(" [$cdate] $title $bulb "); } OciFreeStatement($stmt); } function listSchedule($conn) { global $PHP_SELF; $query = "select sn, title, url, cdate from notice where db = 'schedule' order by sn desc"; $stmt=OCIparse($conn, $query); OCIExecute($stmt); $count = 0; //while(OciFetchinto($stmt, &$fetch_record) and $count < COUNT) { while(OciFetchinto($stmt, &$fetch_record) and $count < 3) { $count++; $sn = $fetch_record[0]; //ora_getcolumn($handle, 0); $title = $fetch_record[1]; //ora_getcolumn($handle, 1); $title = kstrcut($title, 36); $Url = $fetch_record[2]; //ora_getcolumn($handle, 2); $cdate = $fetch_record[3]; //ora_getcolumn($handle, 3); if(MyDiffDate($cdate) < 3) $bulb = ""; else $bulb = ""; $cdate = substr($cdate, strpos($cdate, "³â") + 2); $cdate = str_replace("¿ù", "/", $cdate); $cdate = str_replace("ÀÏ", "", $cdate); if(empty($url)) print(" [$cdate] $title $bulb "); else print(" [$cdate] $title $bulb "); } OciFreeStatement($stmt); } function viewNotice($conn) { global $PHP_SELF, $db, $sn, $flag; $maxrow = Ora_Count($conn); $query = "select visit from notice where db = '$db' and sn = $sn"; $stmt = OCIparse($conn, $query); OCIExecute($stmt); OciFetchinto($stmt, &$fetch_record); $visit = (int)$fetch_record[0]; //ora_getcolumn($handle, 0); $visit++; $query = "update notice set visit = $visit where db = '$db' and sn = $sn"; $stmt = OCIparse($conn, $query); OCIExecute($stmt); $query = "select sn, writer, team, title, url, content, visit, cdate from notice where db = '$db' and sn = $sn"; $stmt = OCIparse($conn, $query); OCIExecute($stmt); OciFetchinto($stmt, &$fetch_record); $sn = $fetch_record[0]; $writer = $fetch_record[1]; $team = $fetch_record[2]; $title = $fetch_record[3]; $url = $fetch_record[4]; $content = $fetch_record[5]; $visit = $fetch_record[6]; $cdate = $fetch_record[7]; if(empty($url)) { printf(""); echo ("

Á¦ ¸ñ : $title

µî·ÏÀÏ : $cdate

Á¶È¸¼ö : $visit

 

"); $content = str_replace("\n","
", "$content"); echo ("$content

 

"); OciFreeStatement($stmt); } else { OciFreeStatement($stmt); echo ""; echo ""; echo ""; echo ""; echo ""; } } function allList($conn) { global $PHP_SELF, $db, $page; $query = "select sn, title, url, cdate, visit from notice where db = '$db' order by sn desc"; $stmt=OCIparse($conn, $query); OCIExecute($stmt); $row = Ora_Count($conn); $maxrow = $row; $maxrow_tmp = $maxrow; if(empty($page)) $lpage = 0; else $lpage = $page; $skip = DISPLAY * $lpage; for($count = 0; $count < $skip; $count++) OCIfetch($stmt); $count = 0; $maxrow = $maxrow - $skip; $remote_ip = getenv("REMOTE_ADDR"); header_html(); print("
"); $row = Ora_Count($conn); $maxrow = $row; $maxrow_tmp = $maxrow; if(empty($page)) $lpage = 0; else $lpage = $page; $skip = DISPLAY * $lpage; $query = "select sn, title, url, cdate, visit from notice where db = '$db' order by sn desc"; $stmt=OCIparse($conn, $query); OCIExecute($stmt); for($count = 0; $count < $skip; $count++) OCIfetch($stmt); $count = 0; $maxrow = $maxrow - $skip; $remote_ip = getenv("REMOTE_ADDR"); while ($maxrow > 0 && $count < DISPLAY && OciFetchinto($stmt, &$fetch_record)) { $sn = $fetch_record[0]; //ora_getcolumn($handle, 0); $title = $fetch_record[1]; //ora_getcolumn($handle, 1); $url = $fetch_record[2]; //ora_getcolumn($handle, 2); $cdate = $fetch_record[3]; //ora_getcolumn($handle, 3); $visit = $fetch_record[4]; //ora_getcolumn($handle, 4); if(MyDiffDate($cdate) < 3) $bulb = ""; else $bulb = ""; $cdate = str_replace("³â", "/", $cdate); $cdate = str_replace("¿ù", "/", $cdate); $cdate = str_replace("ÀÏ", "", $cdate); echo(" "); $count++; $maxrow--; } OciFreeStatement($stmt); echo("
$sn
   
$cdate
$visit
"); } footer_html(); } // MAIN ------------------------------ $flag = $HTTP_COOKIE_VARS["oracle_admin_flag"]; $conn = OCIlogon("linet","linet","wwwnew"); include("/usr/local/apache/htdocs/sorry.php"); if( $action == "" ) { setcookie( "oracle_admin_flag" ); header_html(); print("
"); $cpage = (int)($page / 10) * 10; $maxrow = $maxrow_tmp; $hyperlink = "$PHP_SELF?db=$db&action=allList"; if($cpage > 0) printf("[1] - ", $cpage-1); for($i = $cpage; $i < ($cpage+10) && $maxrow > ($i * DISPLAY); $i++) { if($i != $lpage) printf("[%s]", $i+1); else printf("[%s]", $i+1); } if($maxrow > ($i * DISPLAY)) { printf(" - ", $i); printf("[%s]", (int)($maxrow / DISPLAY), (int)($maxrow / DISPLAY)+1); } $remote_ip = substr(getenv("REMOTE_ADDR"), 0, 10); if( $remote_ip == "210.95.205" || getenv("REMOTE_ADDR") == JCLEE) { print("
"); // °øÁö»çÇ× listNotice($conn); print("
 
"); $remote_ip = substr(getenv("REMOTE_ADDR"), 0, 10); //******************¾ð·Ð¼ÓÀÇ ¹®¿¹ÁøÈï¿ø ·¹À̾î*********** print("
"); print(" "); // listSchedule($conn); print(""); $remote_ip = substr(getenv("REMOTE_ADDR"), 0, 10); print("
"); //******************Àü½Ã.°ø¿¬ ·¹À̾î*********** print("
"); listSchedule($conn); // listBodo($conn); print("
"); $remote_ip = substr(getenv("REMOTE_ADDR"), 0, 10); if( $remote_ip == "210.95.205" ) { print("  "); } print("
"); echo(" "); // footer_html(); } else if( $action == "viewNotice" ) viewNotice($conn); else if( $action == "allList" ) allList($conn); OCIlogoff($conn); ?>
2001.7.6.18:00 ÀÌÈÄ ¹æ¹®ÀÚ : $main_count[main]
"; */ mysql_free_result($res); mysql_close($sock); } ?>