= 0; $i--) { if(ord($str[$i]) <= 127) break; $j++; } $str = ($j % 2) ? substr($str, 0, strlen($str) - 1) : $str; $str .= "..."; //문자열 자르고나서 뒤에 붙이는거예요. return $str; } # 새소식, 칭찬합시다, 채용정보, 입찰정보 - 건강 및 언론보도 DB 연결 프로그램 시작 $min=1; $hour=2; $mday=3; $mon=4; $year=5; list ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()); if ($min < 10) {$min = "0$min";} if ($hour < 10) {$hour = "0$hour";} $month = ($mon + 1); if ($month < 10) {$month = "0$month";} if ($mday < 10) {$mday = "0$mday";} $year = $year + 1900; $today = "$year.$month.$mday $hour:$min"; list ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()-180*24*3600); if ($min < 10) {$min = "0$min";} if ($hour < 10) {$hour = "0$hour";} $month = ($mon + 1); if ($month < 10) {$month = "0$month";} if ($mday < 10) {$mday = "0$mday";} $year = $year + 1900; $lastdate_180 = "$year.$month.$mday $hour:$min"; list ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()-7*24*3600); if ($min < 10) {$min = "0$min";} if ($hour < 10) {$hour = "0$hour";} $month = ($mon + 1); if ($month < 10) {$month = "0$month";} if ($mday < 10) {$mday = "0$mday";} $year = $year + 1900; $lastdate_7 = "$year.$month.$mday $hour:$min"; list ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()-3*24*3600); if ($min < 10) {$min = "0$min";} if ($hour < 10) {$hour = "0$hour";} $month = ($mon + 1); if ($month < 10) {$month = "0$month";} if ($mday < 10) {$mday = "0$mday";} $year = $year + 1900; $lastdate_3 = "$year.$month.$mday $hour:$min"; list ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()-2*24*3600); if ($min < 10) {$min = "0$min";} if ($hour < 10) {$hour = "0$hour";} $month = ($mon + 1); if ($month < 10) {$month = "0$month";} if ($mday < 10) {$mday = "0$mday";} $year = $year + 1900; $lastdate_2 = "$year.$month.$mday $hour:$min"; list ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()-1*24*3600); if ($min < 10) {$min = "0$min";} if ($hour < 10) {$hour = "0$hour";} $month = ($mon + 1); if ($month < 10) {$month = "0$month";} if ($mday < 10) {$mday = "0$mday";} $year = $year + 1900; $lastdate_1 = "$year.$month.$mday $hour:$min"; $ORA_USER = "khmc"; $ORA_PASSWD = "Kyunghee!1971"; $DB="(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.100)(PORT = 1521))) (CONNECT_DATA=(SID = KHMCWDB)))"; $connect= OCILogon("$ORA_USER","$ORA_PASSWD",$DB); $sql_1 = "select num, title, rdate, mother from (select * from cboardb order by num desc) where rownum <= 5"; $cursor_1 = OCIParse($connect, $sql_1); OCIExecute($cursor_1); $nrows_1 = OCIFetchStatement($cursor_1, $results_1); # 새소식 OCIFreecursor($cursor_1); $cursor_1 = OCIParse($connect, $sql_1); OCIExecute($cursor_1); $row[] = ''; $total_row = 5 - $total_row; # 새소식 while ( $total_row ){ OCIFetchInto($cursor_1, &$row); $rdate = substr ($row[2], 0, 10); $tempstring = CurString($row[1],34); if ($row[2] < $lastdate_2) { print ""; } else { print ""; } $total_row--; } ?>
"; print "
"; if ($row[3] <> "0") { print "[답변]"; } print "$tempstring[$rdate]
"; print "
"; if ($row[3] <> "0") { print "[답변]"; } print "$tempstring[$rdate]