This commit is contained in:
biosvos
2026-08-07 17:38:18 +09:00
commit 873193a243
9613 changed files with 2755992 additions and 0 deletions
@@ -0,0 +1,67 @@
<?php
require_once("../status/inc/session.php");
?>
<script language="JavaScript">
<!--
function changeVisual()
{
fr = document.frm;
if(fr.chk.value == 0) {
fr.chk.value = 1;
info.style.display="block";
} else {
fr.chk.value = 0;
info.style.display="none";
}
}
function check_admin_pop()
{
window.open("../status/check_admin.html", "_box", "width=200, height=100, scrollbars=yes");
}
function disk_check()
{
window.open("../status/check_storage_report.html","_box", 'height=' + screen.height + ',width=' + screen.width + 'fullscreen=yes, scrollbars=yes');
}
//-->
</script>
<table border="0" align="center" width="1050">
<tr>
<td>
<a href="javascript:check_admin_pop();"><img src="img/bt_rc_admin.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:changeVisual();"><img src="img/bt_contact.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:disk_check();"><img src="img/bt_storage_amount.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
</td>
<td align="right" class="PR40"><img src="img/Dot.gif"><a href="inc/logout_process.html"><img src="img/BtnLogout.gif" border="0" width="36" height="9"></a></td>
</tr>
</table>
<?php
$monitor_member = array( "Á¤±â¿í(¼Ö¹Ú½º)"=>"010-9496-4373"
);
?>
<div id="info" style="DISPLAY:none;">
<table border="1" cellspacing="1" width="530" align="center">
<tr align="center">
<td><b> Priority </b></td>
<td><b> Name </b></td>
<td><b> Emergency Phone NO. </b> </td>
</tr>
<?
$i = 0;
while(list($key, $value) = each($monitor_member))
{
$i++;
echo"<tr align=\"center\" align=\"center\">\n";
echo" <td><b> ".$i.". </b></td>\n";
echo" <td><b> ".$key." </b></td>\n";
echo" <td><b> ".$value." </b></td>\n";
echo"</tr>\n";
}
?>
</table>
</div>
@@ -0,0 +1,64 @@
<?php
require_once("../status/inc/session.php");
?>
<script language="JavaScript">
<!--
function changeVisual()
{
fr = document.frm;
if(fr.chk.value == 0) {
fr.chk.value = 1;
info.style.display="block";
} else {
fr.chk.value = 0;
info.style.display="none";
}
}
function check_admin_pop()
{
window.open("../status/check_admin.html", "_box", "width=200, height=100, scrollbar=yes");
}
//-->
</script>
<table border="0" align="center" width="1050">
<tr>
<td>
<a href="javascript:check_admin_pop();"><img src="img/bt_rc_admin.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:changeVisual();"><img src="img/bt_contact.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
</td>
<td align="right" class="PR40"><img src="img/Dot.gif"><a href="inc/logout_process.html"><img src="img/BtnLogout.gif" border="0" width="36" height="9"></a></td>
</tr>
</table>
<?php
$monitor_member = array("기술지원팀"=>"031-788-0191",
"강명균"=>"016-574-5625",
"홍성업"=>"011-9733-1231",
"신동호"=>"017-713-4785",
"이재영"=>"016-560-2290",
"김태일"=>"010-9600-2211",
"김석환"=>"010-4714-1749",
"이현준(KT)"=>"010-9837-5010");
?>
<div id="info" style="DISPLAY:none;">
<table border="1" cellspacing="1" width="530" align="center">
<tr align="center">
<td><b> Priority </b></td>
<td><b> Name </b></td>
<td><b> Emergency Phone NO. </b> </td>
</tr>
<?
$i = 0;
while(list($key, $value) = each($monitor_member))
{
$i++;
echo"<tr align=\"center\" align=\"center\">\n";
echo" <td><b> ".$i.". </b></td>\n";
echo" <td><b> ".$key." </b></td>\n";
echo" <td><b> ".$value." </b></td>\n";
echo"</tr>\n";
}
?>
</table>
</div>
@@ -0,0 +1,76 @@
<?php
require_once("../status/inc/session.php");
?>
<script language="JavaScript">
<!--
function changeVisual()
{
fr = document.frm;
if(fr.chk.value == 0) {
fr.chk.value = 1;
info.style.display="block";
} else {
fr.chk.value = 0;
info.style.display="none";
}
}
function check_admin_pop()
{
window.open("../status/check_admin.html", "_box", "width=200, height=100, scrollbar=yes");
}
//-->
</script>
<table border="0" align="center" width="1050">
<tr>
<td>
<a href="javascript:check_admin_pop();"><img src="img/bt_rc_admin.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:changeVisual();"><img src="img/bt_contact.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
</td>
<td align="right" class="PR40"><img src="img/Dot.gif"><a href="inc/logout_process.html"><img src="img/BtnLogout.gif" border="0" width="36" height="9"></a></td>
</tr>
</table>
<?php
/*
$monitor_member = array("기술지원팀"=>"031-788-0191",
"강명균"=>"016-574-5625",
"홍성업"=>"011-9733-1231",
"신동호"=>"017-713-4785",
"이재영"=>"016-560-2290",
"김태일"=>"010-9600-2211",
"김석환"=>"010-4714-1749",
"이현준(KT)"=>"010-9837-5010");
*/
$monitor_member = array("ICS 운영팀"=>"031-781-0344",
"홍성업"=>"010-8733-1231",
"신동호"=>"010-3783-4785",
"김해중"=>"010-9288-2464",
"정기욱"=>"010-9496-4373",
"모민규(KT)"=>"010-2833-0015",
"조병희(KT)"=>"010-2739-6496");
?>
<div id="info" style="DISPLAY:none;">
<table border="1" cellspacing="1" width="530" align="center">
<tr align="center">
<td><b> Priority </b></td>
<td><b> Name </b></td>
<td><b> Emergency Phone NO. </b> </td>
</tr>
<?
$i = 0;
while(list($key, $value) = each($monitor_member))
{
$i++;
echo"<tr align=\"center\" align=\"center\">\n";
echo" <td><b> ".$i.". </b></td>\n";
echo" <td><b> ".$key." </b></td>\n";
echo" <td><b> ".$value." </b></td>\n";
echo"</tr>\n";
}
?>
</table>
</div>
@@ -0,0 +1,86 @@
<?php
require_once("../status/inc/session.php");
?>
<script language="JavaScript">
<!--
function changeVisual()
{
fr = document.frm;
if(fr.chk.value == 0) {
fr.chk.value = 1;
info.style.display="block";
} else {
fr.chk.value = 0;
info.style.display="none";
}
}
function check_admin_pop()
{
window.open("../status/check_admin.html", "_box", "width=200, height=100, scrollbar=yes");
}
function disk_check()
{
window.open("http://www.ktsystemhosting.com:8080/disk_check/output.html",
"_box", "width=800, height=600, scrollbar=yes");
}
//-->
</script>
<table border="0" align="center" width="1050">
<tr>
<td>
<a href="javascript:check_admin_pop();"><img src="img/bt_rc_admin.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:changeVisual();"><img src="img/bt_contact.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:disk_check();"><img src="img/bt_storage_amount.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
</td>
<td align="right" class="PR40"><img src="img/Dot.gif"><a href="inc/logout_process.html"><img src="img/BtnLogout.gif" border="0" width="36" height="9"></a></td>
</tr>
</table>
<?php
/*
$monitor_member = array("기술지원팀"=>"031-788-0191",
"강명균"=>"016-574-5625",
"홍성업"=>"011-9733-1231",
"신동호"=>"017-713-4785",
"이재영"=>"016-560-2290",
"김태일"=>"010-9600-2211",
"김석환"=>"010-4714-1749",
"이현준(KT)"=>"010-9837-5010");
*/
$monitor_member = array("ICS 운영팀"=>"031-781-0344",
"홍성업"=>"010-8733-1231",
"신동호"=>"010-3783-4785",
"김해중"=>"010-9288-2464",
"정기욱"=>"010-9496-4373",
"모민규(KT)"=>"010-2833-0015",
"김정진(KT)"=>"010-6811-8901",
"장지민(KT)"=>"010-7300-0358",
"박성모(KT)"=>"010-6737-7337"
);
?>
<div id="info" style="DISPLAY:none;">
<table border="1" cellspacing="1" width="530" align="center">
<tr align="center">
<td><b> Priority </b></td>
<td><b> Name </b></td>
<td><b> Emergency Phone NO. </b> </td>
</tr>
<?
$i = 0;
while(list($key, $value) = each($monitor_member))
{
$i++;
echo"<tr align=\"center\" align=\"center\">\n";
echo" <td><b> ".$i.". </b></td>\n";
echo" <td><b> ".$key." </b></td>\n";
echo" <td><b> ".$value." </b></td>\n";
echo"</tr>\n";
}
?>
</table>
</div>
@@ -0,0 +1,84 @@
<?php
require_once("../status/inc/session.php");
?>
<script language="JavaScript">
<!--
function changeVisual()
{
fr = document.frm;
if(fr.chk.value == 0) {
fr.chk.value = 1;
info.style.display="block";
} else {
fr.chk.value = 0;
info.style.display="none";
}
}
function check_admin_pop()
{
window.open("../status/check_admin.html", "_box", "width=200, height=100, scrollbar=yes");
}
function disk_check()
{
window.open("http://www.ktsystemhosting.com:8080/disk_check/output.html",
"_box", "width=800, height=600, scrollbar=yes");
}
//-->
</script>
<table border="0" align="center" width="1050">
<tr>
<td>
<a href="javascript:check_admin_pop();"><img src="img/bt_rc_admin.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:changeVisual();"><img src="img/bt_contact.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:disk_check();"><img src="img/bt_storage_amount.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
</td>
<td align="right" class="PR40"><img src="img/Dot.gif"><a href="inc/logout_process.html"><img src="img/BtnLogout.gif" border="0" width="36" height="9"></a></td>
</tr>
</table>
<?php
/*
$monitor_member = array("기술지원팀"=>"031-788-0191",
"강명균"=>"016-574-5625",
"홍성업"=>"011-9733-1231",
"신동호"=>"017-713-4785",
"이재영"=>"016-560-2290",
"김태일"=>"010-9600-2211",
"김석환"=>"010-4714-1749",
"이현준(KT)"=>"010-9837-5010");
*/
$monitor_member = array("ICS 운영팀"=>"031-781-0344",
"홍성업"=>"010-8733-1231",
"김정진(KT)"=>"010-6811-8901",
"장지민(KT)"=>"010-7300-0358",
"박성모(KT)"=>"010-6737-7337",
"유희곤"=>"018-554-0424"
);
?>
<div id="info" style="DISPLAY:none;">
<table border="1" cellspacing="1" width="530" align="center">
<tr align="center">
<td><b> Priority </b></td>
<td><b> Name </b></td>
<td><b> Emergency Phone NO. </b> </td>
</tr>
<?
$i = 0;
while(list($key, $value) = each($monitor_member))
{
$i++;
echo"<tr align=\"center\" align=\"center\">\n";
echo" <td><b> ".$i.". </b></td>\n";
echo" <td><b> ".$key." </b></td>\n";
echo" <td><b> ".$value." </b></td>\n";
echo"</tr>\n";
}
?>
</table>
</div>
@@ -0,0 +1,68 @@
<?php
require_once("../status/inc/session.php");
?>
<script language="JavaScript">
<!--
function changeVisual()
{
fr = document.frm;
if(fr.chk.value == 0) {
fr.chk.value = 1;
info.style.display="block";
} else {
fr.chk.value = 0;
info.style.display="none";
}
}
function check_admin_pop()
{
window.open("../status/check_admin.html", "_box", "width=200, height=100, scrollbars=yes");
}
function disk_check()
{
window.open("../status/check_storage_report.html","_box", 'height=' + screen.height + ',width=' + screen.width + 'fullscreen=yes, scrollbars=yes');
}
//-->
</script>
<table border="0" align="center" width="1050">
<tr>
<td>
<a href="javascript:check_admin_pop();"><img src="img/bt_rc_admin.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:changeVisual();"><img src="img/bt_contact.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:disk_check();"><img src="img/bt_storage_amount.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
</td>
<td align="right" class="PR40"><img src="img/Dot.gif"><a href="inc/logout_process.html"><img src="img/BtnLogout.gif" border="0" width="36" height="9"></a></td>
</tr>
</table>
<?php
$monitor_member = array("CDN ¿î¿µÆÀ"=>"031-781-0344",
"Á¤±â¿í(¼Ö¹Ú½º)"=>"010-9496-4373"
);
?>
<div id="info" style="DISPLAY:none;">
<table border="1" cellspacing="1" width="530" align="center">
<tr align="center">
<td><b> Priority </b></td>
<td><b> Name </b></td>
<td><b> Emergency Phone NO. </b> </td>
</tr>
<?
$i = 0;
while(list($key, $value) = each($monitor_member))
{
$i++;
echo"<tr align=\"center\" align=\"center\">\n";
echo" <td><b> ".$i.". </b></td>\n";
echo" <td><b> ".$key." </b></td>\n";
echo" <td><b> ".$value." </b></td>\n";
echo"</tr>\n";
}
?>
</table>
</div>
@@ -0,0 +1,64 @@
<?php
require_once("../status/inc/session.php");
?>
<script language="JavaScript">
<!--
function changeVisual()
{
fr = document.frm;
if(fr.chk.value == 0) {
fr.chk.value = 1;
info.style.display="block";
} else {
fr.chk.value = 0;
info.style.display="none";
}
}
function check_admin_pop()
{
window.open("../status/check_admin.html", "_box", "width=200, height=100, scrollbar=yes");
}
//-->
</script>
<table border="0" align="center" width="1050">
<tr>
<td>
<a href="javascript:check_admin_pop();"><img src="img/bt_rc_admin.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:changeVisual();"><img src="img/bt_contact.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
</td>
<td align="right" class="PR40"><img src="img/Dot.gif"><a href="inc/logout_process.html"><img src="img/BtnLogout.gif" border="0" width="36" height="9"></a></td>
</tr>
</table>
<?php
$monitor_member = array("기술지원팀"=>"031-788-0191",
"강명균"=>"016-574-5625",
"홍성업"=>"011-9733-1231",
"신동호"=>"017-713-4785",
"이재영"=>"016-560-2290",
"김태일"=>"010-9600-2211",
"김석환"=>"010-4714-1749",
"이현준(KT)"=>"010-9837-5010");
?>
<div id="info" style="DISPLAY:none;">
<table border="1" cellspacing="1" width="530" align="center">
<tr align="center">
<td><b> Priority </b></td>
<td><b> Name </b></td>
<td><b> Emergency Phone NO. </b> </td>
</tr>
<?
$i = 0;
while(list($key, $value) = each($monitor_member))
{
$i++;
echo"<tr align=\"center\" align=\"center\">\n";
echo" <td><b> ".$i.". </b></td>\n";
echo" <td><b> ".$key." </b></td>\n";
echo" <td><b> ".$value." </b></td>\n";
echo"</tr>\n";
}
?>
</table>
</div>
@@ -0,0 +1,64 @@
<?php
require_once("../status/inc/session.php");
?>
<script language="JavaScript">
<!--
function changeVisual()
{
fr = document.frm;
if(fr.chk.value == 0) {
fr.chk.value = 1;
info.style.display="block";
} else {
fr.chk.value = 0;
info.style.display="none";
}
}
function check_admin_pop()
{
window.open("../status/check_admin.html", "_box", "width=200, height=100, scrollbar=yes");
}
//-->
</script>
<table border="0" align="center" width="1050">
<tr>
<td>
<a href="javascript:check_admin_pop();"><img src="img/bt_rc_admin.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:changeVisual();"><img src="img/bt_contact.gif" border="0"></a>&nbsp;&nbsp;&nbsp;
</td>
<td align="right" class="PR40"><img src="img/Dot.gif"><a href="inc/logout_process.html"><img src="img/BtnLogout.gif" border="0" width="36" height="9"></a></td>
</tr>
</table>
<?php
$monitor_member = array("기술지원팀"=>"031-788-0191",
"강명균"=>"016-574-5625",
"홍성업"=>"011-9733-1231",
"신동호"=>"017-713-4785",
"이재영"=>"016-560-2290",
"김태일"=>"010-9600-2211",
"김석환"=>"010-4714-1749",
"이현준(KT)"=>"010-9837-5010");
?>
<div id="info" style="DISPLAY:none;">
<table border="1" cellspacing="1" width="530" align="center">
<tr align="center">
<td><b> Priority </b></td>
<td><b> Name </b></td>
<td><b> Emergency Phone NO. </b> </td>
</tr>
<?
$i = 0;
while(list($key, $value) = each($monitor_member))
{
$i++;
echo"<tr align=\"center\" align=\"center\">\n";
echo" <td><b> ".$i.". </b></td>\n";
echo" <td><b> ".$key." </b></td>\n";
echo" <td><b> ".$value." </b></td>\n";
echo"</tr>\n";
}
?>
</table>
</div>
@@ -0,0 +1,57 @@
<?php
require_once("../status/inc/session.php");
?>
<script language="JavaScript">
<!--
function changeVisual()
{
fr = document.frm;
if(fr.chk.value == 0) {
fr.chk.value = 1;
info.style.display="block";
} else {
fr.chk.value = 0;
info.style.display="none";
}
}
//-->
</script>
<table border="0" align="center" width="1050">
<tr>
<td>
<a href="javascript:changeVisual();"><img src="img/bt_contact.gif" border="0"></a>
</td>
<td align="right" class="PR40"><img src="img/Dot.gif"><a href="inc/logout_process.html"><img src="img/BtnLogout.gif" border="0" width="36" height="9"></a></td>
</tr>
</table>
<?php
$monitor_member = array(
"ICS 운영팀"=>"031-781-0344",
"김정진(KT)"=>"010-6811-8901",
"배연욱(KT)"=>"010-9593-1774",
"정기욱(솔박스)"=>"010-9496-4373"
);
?>
<div id="info" style="DISPLAY:none;">
<table border="1" cellspacing="1" width="530" align="center">
<tr align="center">
<td><b> Priority </b></td>
<td><b> Name </b></td>
<td><b> Emergency Phone NO. </b> </td>
</tr>
<?
$i = 0;
while(list($key, $value) = each($monitor_member))
{
$i++;
echo"<tr align=\"center\" align=\"center\">\n";
echo" <td><b> ".$i.". </b></td>\n";
echo" <td><b> ".$key." </b></td>\n";
echo" <td><b> ".$value." </b></td>\n";
echo"</tr>\n";
}
?>
</table>
</div>
@@ -0,0 +1,57 @@
<?php
require_once("../status/inc/session.php");
?>
<script language="JavaScript">
<!--
function changeVisual()
{
fr = document.frm;
if(fr.chk.value == 0) {
fr.chk.value = 1;
info.style.display="block";
} else {
fr.chk.value = 0;
info.style.display="none";
}
}
//-->
</script>
<table border="0" align="center" width="1050">
<tr>
<td>
<a href="javascript:changeVisual();"><img src="img/bt_contact.gif" border="0"></a>
</td>
<td align="right" class="PR40"><img src="img/Dot.gif"><a href="inc/logout_process.html"><img src="img/BtnLogout.gif" border="0" width="36" height="9"></a></td>
</tr>
</table>
<?php
$monitor_member = array("기술지원팀"=>"031-788-0191",
"강명균"=>"016-574-5625",
"홍성업"=>"011-9733-1231",
"신동호"=>"017-713-4785",
"이재영"=>"016-560-2290",
"이현준(KT)"=>"010-9837-5010");
?>
<div id="info" style="DISPLAY:none;">
<table border="1" cellspacing="1" width="530" align="center">
<tr align="center">
<td><b> Priority </b></td>
<td><b> Name </b></td>
<td><b> Emergency Phone NO. </b> </td>
</tr>
<?
$i = 0;
while(list($key, $value) = each($monitor_member))
{
$i++;
echo"<tr align=\"center\" align=\"center\">\n";
echo" <td><b> ".$i.". </b></td>\n";
echo" <td><b> ".$key." </b></td>\n";
echo" <td><b> ".$value." </b></td>\n";
echo"</tr>\n";
}
?>
</table>
</div>
@@ -0,0 +1,141 @@
<?php
define('SQL_ASSOC', MYSQL_ASSOC);
define('SQL_NUM', MYSQL_NUM);
define('SQL_BOTH', MYSQL_BOTH);
define('CRLF', "\r\n");
class dbconnect
{
var $showError;
var $dbc;
var $bConnect; // add invalidate
var $bQueryrun; // add invalidate
function dbconnect($host, $user, $pass, $base, $file = '', $line = 0)
{
if($pass != ""){
if(!$this->dbc = mysql_connect($host, $user, $pass))
{
$error = 'Cannot connect to MySQL server. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
$this->bConnect= false;
//die($error);
return false;
}
}else{
if(!$this->dbc = mysql_connect($host, $user))
{
$error = 'Cannot connect to MySQL server. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
//die($error);
//FIXME: return? die?
$this->bConnect= false;
return false;
}
}
if(!@mysql_query("USE ".$base, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
$this->bConnect= false;
//die($error);
}else
$this->bConnect= true;
$this->showError = true;
return $this->bConnect;
}
function query($query, $file = '', $line = 0)
{
if(!$result = @mysql_query($query, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
if($this->showError)
{
echo $error;
$this->bQueryrun = false;
return new dbcResult($result);
}
}
else
$this->bQueryrun = true;
return new dbcResult($result);
}
function query_bool($query, $file = '', $line = 0)
{
if(!$result = @mysql_query($query, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
if($this->showError)
{
echo $error;
}
}
return ($result?true:false);
}
function insert_id()
{
$id = $this->firstCell("SELECT LAST_INSERT_ID() as id");
return $id;
}
function fetch_array($query, $type = SQL_BOTH)
{
$result = $this->query($query);
return $result->fetch_array($type);
}
function first_cell($query)
{
$result = $this->query($query);
$row = $result->fetch_array(SQL_NUM);
return $row[0];
}
function change_base($base, $file = '', $line = 0)
{
if(!$result = @mysql_query('USE '.$base, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
if($this->showError)
{
echo $error;
}
}
return ($result?true:false);
}
function close()
{
@mysql_close($this->dbc);
unset($this);
}
}
class dbcResult
{
function dbcResult($result)
{
$this->result = $result;
}
function fetch_array($type = SQL_BOTH)
{
return @mysql_fetch_array($this->result, $type);
}
function first_cell()
{
$row = @mysql_fetch_row($this->result);
return $row[0];
}
function num_rows()
{
return @mysql_num_rows($this->result);
}
}
?>
@@ -0,0 +1,122 @@
<?php
define('SQL_ASSOC', MYSQL_ASSOC);
define('SQL_NUM', MYSQL_NUM);
define('SQL_BOTH', MYSQL_BOTH);
define('CRLF', "\r\n");
class dbconnect
{
var $showError;
var $dbc;
function dbconnect($host, $user, $pass, $base, $file = '', $line = 0)
{
//echo $host." ".$user." ".$pass;
//[ string $server = ini_get("mysql.default_host")
//[, string $username = ini_get("mysql.default_user")
//[, string $password = ini_get("mysql.default_password") [, bool $new_link = false [, int $client_flags = 0 ]]
//]
//]
//]
//if(!$this->dbc = mysql_connect($host, $user, $pass))
if(!$this->dbc = mysql_connect($host, $user))
{
$error = 'Cannot connect to MySQL server. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
die($error);
}
if(!@mysql_query("USE ".$base, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
die($error);
}
$this->showError = true;
}
function query($query, $file = '', $line = 0)
{
if(!$result = @mysql_query($query, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
if($this->showError)
{
echo $error;
}
}
return new dbcResult($result);
}
function query_bool($query, $file = '', $line = 0)
{
if(!$result = @mysql_query($query, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
if($this->showError)
{
echo $error;
}
}
return ($result?true:false);
}
function insert_id()
{
$id = $this->firstCell("SELECT LAST_INSERT_ID() as id");
return $id;
}
function fetch_array($query, $type = SQL_BOTH)
{
$result = $this->query($query);
return $result->fetch_array($type);
}
function first_cell($query)
{
$result = $this->query($query);
$row = $result->fetch_array(SQL_NUM);
return $row[0];
}
function change_base($base, $file = '', $line = 0)
{
if(!$result = @mysql_query('USE '.$base, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
if($this->showError)
{
echo $error;
}
}
return ($result?true:false);
}
function close()
{
@mysql_close($this->dbc);
unset($this);
}
}
class dbcResult
{
function dbcResult($result)
{
$this->result = $result;
}
function fetch_array($type = SQL_BOTH)
{
return @mysql_fetch_array($this->result, $type);
}
function first_cell()
{
$row = @mysql_fetch_row($this->result);
return $row[0];
}
function num_rows()
{
return @mysql_num_rows($this->result);
}
}
?>
@@ -0,0 +1,141 @@
<?php
define('SQL_ASSOC', MYSQL_ASSOC);
define('SQL_NUM', MYSQL_NUM);
define('SQL_BOTH', MYSQL_BOTH);
define('CRLF', "\r\n");
class dbconnect
{
var $showError;
var $dbc;
var $bConnect; // add invalidate
var $bQueryrun; // add invalidate
function dbconnect($host, $user, $pass, $base, $file = '', $line = 0)
{
if($pass != ""){
if(!$this->dbc = mysql_connect($host, $user, $pass))
{
$error = 'Cannot connect to MySQL server. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
$this->bConnect= false;
//die($error);
return false;
}
}else{
if(!$this->dbc = mysql_connect($host, $user))
{
$error = 'Cannot connect to MySQL server. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
//die($error);
//FIXME: return? die?
$this->bConnect= false;
return false;
}
}
if(!@mysql_query("USE ".$base, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
$this->bConnect= false;
//die($error);
}else
$this->bConnect= true;
$this->showError = true;
return $this->bConnect;
}
function query($query, $file = '', $line = 0)
{
if(!$result = @mysql_query($query, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
if($this->showError)
{
echo $error;
$this->bQueryrun = false;
return new dbcResult($result);
}
}
else
$this->bQueryrun = true;
return new dbcResult($result);
}
function query_bool($query, $file = '', $line = 0)
{
if(!$result = @mysql_query($query, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
if($this->showError)
{
echo $error;
}
}
return ($result?true:false);
}
function insert_id()
{
$id = $this->firstCell("SELECT LAST_INSERT_ID() as id");
return $id;
}
function fetch_array($query, $type = SQL_BOTH)
{
$result = $this->query($query);
return $result->fetch_array($type);
}
function first_cell($query)
{
$result = $this->query($query);
$row = $result->fetch_array(SQL_NUM);
return $row[0];
}
function change_base($base, $file = '', $line = 0)
{
if(!$result = @mysql_query('USE '.$base, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
if($this->showError)
{
echo $error;
}
}
return ($result?true:false);
}
function close()
{
@mysql_close($this->dbc);
unset($this);
}
}
class dbcResult
{
function dbcResult($result)
{
$this->result = $result;
}
function fetch_array($type = SQL_BOTH)
{
return @mysql_fetch_array($this->result, $type);
}
function first_cell()
{
$row = @mysql_fetch_row($this->result);
return $row[0];
}
function num_rows()
{
return @mysql_num_rows($this->result);
}
}
?>
@@ -0,0 +1,140 @@
<?php
define('SQL_ASSOC', MYSQL_ASSOC);
define('SQL_NUM', MYSQL_NUM);
define('SQL_BOTH', MYSQL_BOTH);
define('CRLF', "\r\n");
class dbconnect
{
var $showError;
var $dbc;
var $bConnect; // add invalidate
var $bQueryrun; // add invalidate
function dbconnect($host, $user, $pass, $base, $file = '', $line = 0)
{
if($pass != ""){
if(!$this->dbc = mysql_connect($host, $user, $pass))
{
$error = 'Cannot connect to MySQL server. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
$this->bConnect= false;
//die($error);
return false;
}else
$this->bConnect= true;
}else{
if(!$this->dbc = mysql_connect($host, $user))
{
$error = 'Cannot connect to MySQL server. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
//die($error);
//FIXME: return? die?
$this->bConnect= false;
}else
$this->bConnect= true;
}
if(!@mysql_query("USE ".$base, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
$this->bConnect= false;
//die($error);
}else
$this->bConnect= true;
$this->showError = true;
return
}
function query($query, $file = '', $line = 0)
{
if(!$result = @mysql_query($query, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
if($this->showError)
{
echo $error;
$this->bQueryrun = false;
}
}
else
$this->bQueryrun = true;
return new dbcResult($result);
}
function query_bool($query, $file = '', $line = 0)
{
if(!$result = @mysql_query($query, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
if($this->showError)
{
echo $error;
}
}
return ($result?true:false);
}
function insert_id()
{
$id = $this->firstCell("SELECT LAST_INSERT_ID() as id");
return $id;
}
function fetch_array($query, $type = SQL_BOTH)
{
$result = $this->query($query);
return $result->fetch_array($type);
}
function first_cell($query)
{
$result = $this->query($query);
$row = $result->fetch_array(SQL_NUM);
return $row[0];
}
function change_base($base, $file = '', $line = 0)
{
if(!$result = @mysql_query('USE '.$base, $this->dbc))
{
$error = 'Error <b>'.mysql_error($this->dbc).'</b> in query <b>'.$query.'</b>. In file '.$file.' in line '.$line.'. Date: '.date('Y-m-d H:i:s').'<br />'.CRLF;
if($this->showError)
{
echo $error;
}
}
return ($result?true:false);
}
function close()
{
@mysql_close($this->dbc);
unset($this);
}
}
class dbcResult
{
function dbcResult($result)
{
$this->result = $result;
}
function fetch_array($type = SQL_BOTH)
{
return @mysql_fetch_array($this->result, $type);
}
function first_cell()
{
$row = @mysql_fetch_row($this->result);
return $row[0];
}
function num_rows()
{
return @mysql_num_rows($this->result);
}
}
?>
@@ -0,0 +1,371 @@
<?php
class DB_Sql {
var $Host = "127.0.0.1";
var $Database = "syshost";
var $Port = "5432";
var $User = "syshost";
var $Password = "alfkzmf!?{}";
var $Link_ID = 0;
var $Query_ID = 0;
var $Record = array();
var $Row = 0;
var $Seq_Table = "db_sequence";
var $Errno = 0;
var $Error = "";
var $Debug = 0;
var $Auto_Free = 0; # Set this to 1 for automatic pg_freeresult on
# last record.
var $PConnect = 0; ## Set to 1 to use persistent database connections
function ifadd($add, $me) {
if("" != $add) return " ".$me.$add;
}
/* public: constructor */
function DB_Sql($query = "") {
$this->query($query);
}
function querySafe($string) {
$string = str_replace("'", "\'", $string);
$string = str_replace("\\", "\\\\", $string);
return $string;
}
function connect() {
if ( 0 == $this->Link_ID ) {
$cstr = "dbname=".$this->Database.
$this->ifadd($this->Host, "host=").
$this->ifadd($this->Port, "port=").
$this->ifadd($this->User, "user=").
$this->ifadd($this->Password, "password=");
if(!$this->PConnect) {
$this->Link_ID = pg_connect($cstr);
} else {
$this->Link_ID = pg_pconnect($cstr);
}
if (!$this->Link_ID) {
$this->halt("connect() failed.");
}
}
}
function close() {
pg_close($this->Link_ID);
}
function query($Query_String) {
/* No empty queries, please, since PHP4 chokes on them. */
if ($Query_String == "")
/* The empty query string is passed on from the constructor,
* when calling the class without a query, e.g. in situations
* like these: '$db = new DB_Sql_Subclass;'
*/
return 0;
$this->connect();
if ($this->Debug)
printf("<br>Debug: query = %s<br>\n", $Query_String);
$this->Query_ID = pg_Exec($this->Link_ID, $Query_String);
$this->Row = 0;
$this->Error = pg_ErrorMessage($this->Link_ID);
$this->Errno = ($this->Error == "")?0:1;
if (!$this->Query_ID) {
$this->halt("Invalid SQL: ".$Query_String);
}
return $this->Query_ID;
}
function beginTrans() {
return $this->query("begin");
}
function commitTrans() {
return $this->query("commit");
}
function rollbackTrans() {
return $this->query("rollback");
}
function next_record() {
$this->Record = @pg_fetch_array($this->Query_ID, $this->Row++);
$this->Error = pg_ErrorMessage($this->Link_ID);
$this->Errno = ($this->Error == "")?0:1;
$stat = is_array($this->Record);
if (!$stat && $this->Auto_Free) {
pg_freeresult($this->Query_ID);
$this->Query_ID = 0;
}
return $stat;
}
function seek($pos) {
$this->Row = $pos;
}
function lock($table, $mode = "write") {
if ($mode == "write") {
$result = pg_Exec($this->Link_ID, "lock table $table");
} else {
$result = 1;
}
return $result;
}
function unlock() {
return pg_Exec($this->Link_ID, "commit");
}
/* public: sequence numbers */
function nextid($seq_name) {
$this->connect();
if ($this->lock($this->Seq_Table)) {
/* get sequence number (locked) and increment */
$q = sprintf("select nextid from %s where seq_name = '%s'",
$this->Seq_Table,
$seq_name);
$id = @pg_Exec($this->Link_ID, $q);
$res = @pg_Fetch_Array($id, 0);
/* No current value, make one */
if (!is_array($res)) {
$currentid = 0;
$q = sprintf("insert into %s values('%s', %s)",
$this->Seq_Table,
$seq_name,
$currentid);
$id = @pg_Exec($this->Link_ID, $q);
} else {
$currentid = $res["nextid"];
}
$nextid = $currentid + 1;
$q = sprintf("update %s set nextid = '%s' where seq_name = '%s'",
$this->Seq_Table,
$nextid,
$seq_name);
$id = @pg_Exec($this->Link_ID, $q);
$this->unlock();
} else {
$this->halt("cannot lock ".$this->Seq_Table." - has it been created?");
return 0;
}
return $nextid;
}
function metadata($table="") {
$count = 0;
$id = 0;
$res = array();
if ($table) {
$this->connect();
$id = pg_exec($this->Link_ID, "select * from $table");
if ($id < 0) {
$this->Error = pg_ErrorMessage($id);
$this->Errno = 1;
$this->halt("Metadata query failed.");
}
} else {
$id = $this->Query_ID;
if (!$id) {
$this->halt("No query specified.");
}
}
$count = pg_NumFields($id);
for ($i=0; $i<$count; $i++) {
$res[$i]["table"] = $table;
$res[$i]["name"] = pg_FieldName ($id, $i);
$res[$i]["type"] = pg_FieldType ($id, $i);
$res[$i]["len"] = pg_FieldSize ($id, $i);
$res[$i]["flags"] = "";
}
if ($table) {
pg_FreeResult($id);
}
return $res;
}
function affected_rows() {
return pg_cmdtuples($this->Query_ID);
}
function num_rows() {
return pg_numrows($this->Query_ID);
}
function num_fields() {
return pg_numfields($this->Query_ID);
}
function nf() {
return $this->num_rows();
}
function np() {
print $this->num_rows();
}
function tf($Name) {
return $this->Record[$Name];
}
function f($Name) {
if($this->Record[$Name] == "")
{
return;
//return "&nbsp;";
}
else
{
return trim($this->Record[$Name]);
//return $this->Record[$Name];
}
}
function p($Name) {
print $this->Record[$Name];
}
function halt($msg) {
printf("</td></tr></table><b>Database error:</b> %s<br>\n", $msg);
printf("<b>PostgreSQL Error</b>: %s (%s)<br>\n",
$this->Errno,
$this->Error);
die("Session halted.");
}
function table_names() {
$this->query("select relname from pg_class where relkind = 'r' and not relname like 'pg_%'");
$i=0;
while ($this->next_record())
{
$return[$i]["table_name"]= $this->f(0);
$return[$i]["tablespace_name"]=$this->Database;
$return[$i]["database"]=$this->Database;
$i++;
}
return $return;
}
}
function _query_string($method)
{
$params = $_SERVER['QUERY_STRING'];
if( $method = "POST" )
{
if( getenv("REQUEST_METHOD") == "POST" )
{
$params = "$HTTP_POST_VARS";
$params = str_replace("+", "%20", $params);
}
}
return $params;
}
function param_remove($params, $key)
{
$str = split("&", $params);
$str_cnt = sizeof($str);
for( $i=0; $i < $str_cnt; $i++ )
{
$sub_str = split("=", $str[$i]);
if( $sub_str[0] != $key )
{
$qstring .= $str[$i]. "&";
}
}
if( $qstring != "" )
{
$qstring = substr($qstring, 0, strlen($qstring)-1);
}
return $qstring;
}
function sub_page_navigate( $page, $pagecnt, $preimg, $nextimg, $params )
{
$blocknum = (integer)(($page - 1) / 10) + 1;
$spage = ($blocknum-1) * 10 + 1;
$epage = $blocknum * 10;
if( $epage > $pagecnt)
{
$epage = $pagecnt;
}
$cur_url = $_SERVER['PHP_SELF'];
if($params != "") $params = "&".$params;
if($spage > 10) //' ÀÌÀü 10°³
{
if($preimg == "")
{
printf("<a href='".$cur_url."?page=".($spage-10).$params.">¢¸</a>&nbsp;");
}else
{
printf("<a href=".$cur_url."?page=".($spage-10).$params.">".$preimg."</a>&nbsp;");
}
}else
{
if($preimg == "")
{
printf("¢¸&nbsp;");
}else
{
printf($preimg."&nbsp;");
}
}
for($i = $spage; $i <= $epage; $i++)
{
if($i == $page)
{
printf("&nbsp;<b>".$i."</b>&nbsp;");
}else
{
printf("&nbsp;<a href=".$cur_url."?page=".$i.$params.">".$i."</a>&nbsp;");
}
}
if($epage < $pagecnt)
{
if($nextimg == "")
{
printf("&nbsp;<a href=".$cur_url."?page=".($epage+1).$params.">¢º</a>");
}else
{
printf("&nbsp;<a href=".$cur_url."?page=".($epage+1).$params.">".$nextimg."</a>");
}
}else
{
if($nextimg == "")
{
printf("&nbsp;¢º");
}else
{
printf("&nbsp;".$nextimg);
}
}
}
?>
@@ -0,0 +1,371 @@
<?php
class DB_Sql {
var $Host = "127.0.0.1";
var $Database = "syshost";
var $Port = "5432";
var $User = "syshost";
var $Password = "alfkzmf!?{}";
var $Link_ID = 0;
var $Query_ID = 0;
var $Record = array();
var $Row = 0;
var $Seq_Table = "db_sequence";
var $Errno = 0;
var $Error = "";
var $Debug = 0;
var $Auto_Free = 0; # Set this to 1 for automatic pg_freeresult on
# last record.
var $PConnect = 0; ## Set to 1 to use persistent database connections
function ifadd($add, $me) {
if("" != $add) return " ".$me.$add;
}
/* public: constructor */
function DB_Sql($query = "") {
$this->query($query);
}
function querySafe($string) {
$string = str_replace("'", "\'", $string);
$string = str_replace("\\", "\\\\", $string);
return $string;
}
function connect() {
if ( 0 == $this->Link_ID ) {
$cstr = "dbname=".$this->Database.
$this->ifadd($this->Host, "host=").
$this->ifadd($this->Port, "port=").
$this->ifadd($this->User, "user=").
$this->ifadd($this->Password, "password=");
if(!$this->PConnect) {
$this->Link_ID = pg_connect($cstr);
} else {
$this->Link_ID = pg_pconnect($cstr);
}
if (!$this->Link_ID) {
$this->halt("connect() failed.");
}
}
}
function close() {
pg_close($this->Link_ID);
}
function query($Query_String) {
/* No empty queries, please, since PHP4 chokes on them. */
if ($Query_String == "")
/* The empty query string is passed on from the constructor,
* when calling the class without a query, e.g. in situations
* like these: '$db = new DB_Sql_Subclass;'
*/
return 0;
$this->connect();
if ($this->Debug)
printf("<br>Debug: query = %s<br>\n", $Query_String);
$this->Query_ID = pg_Exec($this->Link_ID, $Query_String);
$this->Row = 0;
$this->Error = pg_ErrorMessage($this->Link_ID);
$this->Errno = ($this->Error == "")?0:1;
if (!$this->Query_ID) {
$this->halt("Invalid SQL: ".$Query_String);
}
return $this->Query_ID;
}
function beginTrans() {
return $this->query("begin");
}
function commitTrans() {
return $this->query("commit");
}
function rollbackTrans() {
return $this->query("rollback");
}
function next_record() {
$this->Record = @pg_fetch_array($this->Query_ID, $this->Row++);
$this->Error = pg_ErrorMessage($this->Link_ID);
$this->Errno = ($this->Error == "")?0:1;
$stat = is_array($this->Record);
if (!$stat && $this->Auto_Free) {
pg_freeresult($this->Query_ID);
$this->Query_ID = 0;
}
return $stat;
}
function seek($pos) {
$this->Row = $pos;
}
function lock($table, $mode = "write") {
if ($mode == "write") {
$result = pg_Exec($this->Link_ID, "lock table $table");
} else {
$result = 1;
}
return $result;
}
function unlock() {
return pg_Exec($this->Link_ID, "commit");
}
/* public: sequence numbers */
function nextid($seq_name) {
$this->connect();
if ($this->lock($this->Seq_Table)) {
/* get sequence number (locked) and increment */
$q = sprintf("select nextid from %s where seq_name = '%s'",
$this->Seq_Table,
$seq_name);
$id = @pg_Exec($this->Link_ID, $q);
$res = @pg_Fetch_Array($id, 0);
/* No current value, make one */
if (!is_array($res)) {
$currentid = 0;
$q = sprintf("insert into %s values('%s', %s)",
$this->Seq_Table,
$seq_name,
$currentid);
$id = @pg_Exec($this->Link_ID, $q);
} else {
$currentid = $res["nextid"];
}
$nextid = $currentid + 1;
$q = sprintf("update %s set nextid = '%s' where seq_name = '%s'",
$this->Seq_Table,
$nextid,
$seq_name);
$id = @pg_Exec($this->Link_ID, $q);
$this->unlock();
} else {
$this->halt("cannot lock ".$this->Seq_Table." - has it been created?");
return 0;
}
return $nextid;
}
function metadata($table="") {
$count = 0;
$id = 0;
$res = array();
if ($table) {
$this->connect();
$id = pg_exec($this->Link_ID, "select * from $table");
if ($id < 0) {
$this->Error = pg_ErrorMessage($id);
$this->Errno = 1;
$this->halt("Metadata query failed.");
}
} else {
$id = $this->Query_ID;
if (!$id) {
$this->halt("No query specified.");
}
}
$count = pg_NumFields($id);
for ($i=0; $i<$count; $i++) {
$res[$i]["table"] = $table;
$res[$i]["name"] = pg_FieldName ($id, $i);
$res[$i]["type"] = pg_FieldType ($id, $i);
$res[$i]["len"] = pg_FieldSize ($id, $i);
$res[$i]["flags"] = "";
}
if ($table) {
pg_FreeResult($id);
}
return $res;
}
function affected_rows() {
return pg_cmdtuples($this->Query_ID);
}
function num_rows() {
return pg_numrows($this->Query_ID);
}
function num_fields() {
return pg_numfields($this->Query_ID);
}
function nf() {
return $this->num_rows();
}
function np() {
print $this->num_rows();
}
function tf($Name) {
return $this->Record[$Name];
}
function f($Name) {
if($this->Record[$Name] == "")
{
return;
//return "&nbsp;";
}
else
{
return trim($this->Record[$Name]);
//return $this->Record[$Name];
}
}
function p($Name) {
print $this->Record[$Name];
}
function halt($msg) {
printf("</td></tr></table><b>Database error:</b> %s<br>\n", $msg);
printf("<b>PostgreSQL Error</b>: %s (%s)<br>\n",
$this->Errno,
$this->Error);
die("Session halted.");
}
function table_names() {
$this->query("select relname from pg_class where relkind = 'r' and not relname like 'pg_%'");
$i=0;
while ($this->next_record())
{
$return[$i]["table_name"]= $this->f(0);
$return[$i]["tablespace_name"]=$this->Database;
$return[$i]["database"]=$this->Database;
$i++;
}
return $return;
}
}
function _query_string($method)
{
$params = $_SERVER['QUERY_STRING'];
if( $method = "POST" )
{
if( getenv("REQUEST_METHOD") == "POST" )
{
$params = "$HTTP_POST_VARS";
$params = str_replace("+", "%20", $params);
}
}
return $params;
}
function param_remove($params, $key)
{
$str = split("&", $params);
$str_cnt = sizeof($str);
for( $i=0; $i < $str_cnt; $i++ )
{
$sub_str = split("=", $str[$i]);
if( $sub_str[0] != $key )
{
$qstring .= $str[$i]. "&";
}
}
if( $qstring != "" )
{
$qstring = substr($qstring, 0, strlen($qstring)-1);
}
return $qstring;
}
function sub_page_navigate( $page, $pagecnt, $preimg, $nextimg, $params )
{
$blocknum = (integer)(($page - 1) / 10) + 1;
$spage = ($blocknum-1) * 10 + 1;
$epage = $blocknum * 10;
if( $epage > $pagecnt)
{
$epage = $pagecnt;
}
$cur_url = $_SERVER['PHP_SELF'];
if($params != "") $params = "&".$params;
if($spage > 10) //' ÀÌÀü 10°³
{
if($preimg == "")
{
printf("<a href='".$cur_url."?page=".($spage-10).$params.">¢¸</a>&nbsp;");
}else
{
printf("<a href=".$cur_url."?page=".($spage-10).$params.">".$preimg."</a>&nbsp;");
}
}else
{
if($preimg == "")
{
printf("¢¸&nbsp;");
}else
{
printf($preimg."&nbsp;");
}
}
for($i = $spage; $i <= $epage; $i++)
{
if($i == $page)
{
printf("&nbsp;<b>".$i."</b>&nbsp;");
}else
{
printf("&nbsp;<a href=".$cur_url."?page=".$i.$params.">".$i."</a>&nbsp;");
}
}
if($epage < $pagecnt)
{
if($nextimg == "")
{
printf("&nbsp;<a href=".$cur_url."?page=".($epage+1).$params.">¢º</a>");
}else
{
printf("&nbsp;<a href=".$cur_url."?page=".($epage+1).$params.">".$nextimg."</a>");
}
}else
{
if($nextimg == "")
{
printf("&nbsp;¢º");
}else
{
printf("&nbsp;".$nextimg);
}
}
}
?>
@@ -0,0 +1,594 @@
<?
function htmlBody($content)
{
if($content != "") {
sleep(5);
$body = "<table border=\"1\" width=\"800\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-size:9pt;\">";
$body .= " <tr>";
$body .= " <td align=\"center\"><b>Problem</b></td>";
$body .= " <td align=\"center\"><b>Last Change</b></td>";
$body .= " <td align=\"center\"><b>Logical Location</b></td>";
$body .= " <td align=\"center\"><b>Logical Size</b></td>";
$body .= " <td align=\"center\"><b>Physical Location</b></td>";
$body .= " <td align=\"center\"><b>Physical Size</b></td>";
$body .= " </tr>";
$res = explode("\n", $content);
$tot = count($res);
for($i=0; $i < $tot; $i++) {
$res2 = explode("::", trim(str_replace("|", "<br>",$res[$i])));
$body .= " <tr>";
for ($j = 0; $j < 6; $j++) {
$body .= " <td align=\"center\">".trim($res2[$j]);
$body .= " </td>";
}
$body .= " </tr>";
}
$body .= "</table>";
} else {
$body = "Fail to detail log!!";
}
echo $body;
return $body;
}
class Smtp {
var $host;
var $fp;
var $self;
var $lastmsg;
var $parts;
var $error;
var $debug;
var $charset;
var $ctype;
function Smtp($host="self") {
if($host == "self") $this->self = true;
else $this->host = $host;
$this->parts = array();
$this->error = array();
$$this->debug = 0;
$this->charset = "euc-kr";
$this->ctype = "text/html";
}
// 디버그 모드 : 1
function debug($n=1) {
$this->debug = $n;
}
// smtp 통신을 한다.
function dialogue($code, $cmd) {
fputs($this->fp, $cmd."\r\n");
$line = fgets($this->fp, 1024);
ereg("^([0-9]+).(.*)$", $line, &$data);
$this->lastmsg = $data[0];
if($this->debug) {
echo htmlspecialchars($cmd)."<br>".$this->lastmsg."<br>";
flush();
}
if($data[1] != $code) return false;
return true;
}
// smptp 서버에 접속을 한다.
function smtp_connect($host) {
if($this->debug) {
echo "SMTP($host) Connecting...<br>";
flush();
}
if(!$host) $host = $this->host;
if(!$this->fp = fsockopen($host, 25, $errno, $errstr, 10)) {
$this->lastmsg = "SMTP($host) 서버접속에 실패했습니다.[$errno:$errstr]";
return false;
}
$line = fgets($this->fp, 1024);
ereg("^([0-9]+).(.*)$", $line, &$data);
$this->lastmsg = $data[0];
if($data[1] != "220") return false;
if($this->debug) {
echo $this->lastmsg."<br>";
flush();
}
$this->dialogue(250, "HELO phpmail");
return true;
}
// stmp 서버와의 접속을 끊는다.
function smtp_close() {
$this->dialogue(221, "QUIT");
fclose($this->fp);
return true;
}
// 메시지를 보낸다.
function smtp_send($email, $from, $data) {
if(!$mail_from = $this->get_email($from)) return false;
if(!$rcpt_to = $this->get_email($email)) return false;
if(!$this->dialogue(250, "MAIL FROM: $mail_from"))
$this->error[] = $email.":MAIL FROM 실패($this->lastmsg)";
if(!$this->dialogue(250, "RCPT TO: $rcpt_to"))
$this->error[] = $email.":RCPT TO 실패($this->lastmsg)";
$this->dialogue(354, "DATA");
$mime = "Message-ID: <".$this->get_message_id().">\r\n";
$mime .= "From: $from\r\n";
$mime .= "To: $email\r\n";
fputs($this->fp, $mime);
fputs($this->fp, $data);
$this->dialogue(250, ".");
}
// Message ID 를 얻는다.
function get_message_id() {
$id = date("YmdHis",time());
mt_srand((float) microtime() * 1000000);
$randval = mt_rand();
$id .= $randval."@phpmail";
return $id;
}
// Boundary 값을 얻는다.
function get_boundary() {
$uniqchr = uniqid(time());
$one = strtoupper($uniqchr[0]);
$two = strtoupper(substr($uniqchr,0,8));
$three = strtoupper(substr(strrev($uniqchr),0,8));
return "----=_NextPart_000_000${one}_${two}.${three}";
}
// 첨부파일이 있을 경우 이 함수를 이용해 파일을 첨부한다.
function attach($message, $name="", $ctype="application/octet-stream") {
$this->parts[] = array ("ctype" => $ctype, "message" => $message, "name" => $name);
}
// Multipart 메시지를 생성시킨다.
function build_message($part) {
$msg .= "Content-Type: ".$part['ctype'];
if($part['name']) $msg .= "; name=\"".$part['name']."\"";
$msg .= "\r\nContent-Transfer-Encoding: base64\r\n";
$msg .= "Content-Disposition: attachment; filename=\"".$part['name']."\"\r\n\r\n";
$msg .= chunk_split(base64_encode($part['message']));
return $msg;
}
// SMTP에 보낼 DATA를 생성시킨다.
function build_data($subject, $body) {
$boundary = $this->get_boundary();
$mime .= "Subject: $subject\r\n";
$mime .= "Date: ".date ("D, j M Y H:i:s T",time())."\r\n";
$mime .= "MIME-Version: 1.0\r\n";
$mime .= "Content-Type: multipart/mixed; boundary=\"".$boundary."\"\r\n\r\n".
"This is a multi-part message in MIME format.\r\n\r\n";
$mime .= "--".$boundary."\r\n".
"Content-Type: ".$this->ctype."; charset=\"".$this->charset."\"\r\n".
"Content-Transfer-Encoding: base64\r\n\r\n".
chunk_split(base64_encode($body)).
"\r\n\r\n--".$boundary;
$max = count($this->parts);
for($i=0; $i<$max; $i++) {
$mime .= "\r\n".$this->build_message($this->parts[$i])."\r\n\r\n--".$boundary;
}
$mime .= "--\r\n";
return $mime;
}
// MX 값을 찾는다.
function get_mx_server($email) {
if(!ereg("([\._0-9a-zA-Z-]+)@([0-9a-zA-Z-]+\.[a-zA-Z\.]+)", $email, $reg)) return false;
getmxrr($reg[2], $host);
if(!$host) $host[0] = $reg[2];
return $host;
}
// 이메일의 형식이 맞는지 체크한다.
function get_email($email) {
if(!ereg("([\._0-9a-zA-Z-]+)@([0-9a-zA-Z-]+\.[a-zA-Z\.]+)", $email, $reg)) return false;
return "<".$reg[0].">";
}
// 메일을 전송한다.
function send($to, $from, $subject, $body) {
if(!is_array($to)) $to = split("[,;]",$to);
if($this->self) {
$data = $this->build_data($subject, $body);
foreach($to as $email) {
if($host = $this->get_mx_server($email)) {
$flag = false; $i = 0;
while($flag == false) {
if($host[$i]) {
$flag = $this->smtp_connect($host[$i]);
$i++;
echo "-----------> $i";
} else break;
}
if($flag) {
$this->smtp_send($email, $from, $data);
$this->smtp_close();
} else {
$this->error[] = $email.":SMTP 접속실패";
}
} else {
$this->error[] = $email.":형식이 잘못됨";
}
}
} else {
if(!$this->smtp_connect($this->host)) {
$this->error[] = "$this->host SMTP 접속실패";
return false;
}
$data = $this->build_data($subject, $body);
foreach($to as $email) $this->smtp_send($email, $from, $data);
$this->smtp_close();
}
}
}
/*-----------------------------------------사용법--------------------------------------------*/
/*
$mail = new Smtp("mail.solutionbox.co.kr");
//$mail->debug();
$mail->send("mirshead@solutionbox.co.kr", "mirshead@solutionbox.co.kr", "이 메일은 정상입니다.", "정상적인 메일이니 삭제하지 마십시오.");
*/
/*-----------------------------------------사용법--------------------------------------------*/
class mime
{
protected $mime_version = "1.0";
protected $mime_content_type = "text/plain";
protected $mime_charset = "ks_c_5601-1987";
protected $mime_encoding = "base64";
protected $mime_boundary = null;
protected $mime_xmailer = null;
public function __construct()
{
}
public function set_content_type($content_type = null)
{
$this->mime_content_type = $content_type != null ? $content_type : "text/html";
}
public function set_charset($charset = null)
{
$this->mime_charset = $charset != null ? $charset : "euc_kr";
}
public function set_boundary($boundary = null)
{
$this->mime_boundary = $boundary ? $boundary : null;
}
public function set_encoding($encoding = null)
{
$this->mime_encoding = $encoding != null ? $encoding : "base64";
}
public function set_xmailer($xmailer = null)
{
$this->mime_xmailer = $xmailer != null ? $xmailer : $_SERVER['HTTP_USER_AGENT'];
}
public function __destruct()
{
}
}
class sendmail extends mime
{
protected $smtp_server = null;
protected $smtp_port = 0;
protected $smtp_timeout = 0;
protected $smtp_socketopen = 0;
protected $smtp_status = false;
protected $smtp_CRLF = "\r\n";
protected $smtp_attachfile_name = null;
protected $smtp_attachfile_size = 0;
protected $smtp_attachfile_type = null;
protected $smtp_cmd_status = array();
protected $mail_from = null;
protected $mail_to = null;
protected $mail_subject = null;
protected $mail_priority = 3;
protected $mail_notification = 0;
protected $mail_body = null;
public function __construct($server = null, $port = 0, $timeout = 0)
{
$this->smtp_server = ($server != null) ? $server : "localhost";
$this->smtp_port = ($port != 0) ? $port : 25;
$this->smtp_timeout = ($timeout != 0) ? $timeout : 30;
}
public function encoding($str)
{
return "=?ks_c_5601-1987?B?" . base64_encode($str) . "?=";
}
private function _mail_env ($to, $from, $subject, $body, $priority = 3, $notification = 0)
{
$this->mail_from = $from;
$this->mail_to = $to;
$this->mail_subject = $subject;
$this->mail_body = $body;
$this->mail_priority = $priority;
$this->mail_notification = $notification;
}
private function _smtp_base_header()
{
$this->_smtp_cmd("From: $this->mail_from");
$this->_smtp_cmd("To: $this->mail_to");
$this->_smtp_cmd("Subject: $this->mail_subject");
$this->_smtp_cmd("MIME-Version: $this->mime_version");
$this->_smtp_cmd("X-Priority: $this->mail_priority");
$this->_smtp_cmd("X-Mailer: $this->mime_xmailer");
}
private function _smtp_base_content()
{
$this->_smtp_cmd("Content-Type: $this->mime_content_type; charset=\"$this->mime_charset\"");
$this->_smtp_cmd("Content-Transfer-Encoding: $this->mime_encoding");
}
private function _smtp_multipart_content($attach = false)
{
if($attach)
{
$this->_smtp_cmd("Content-Type: multipart/mixed; boundary=\"$this->mime_boundary\"");
} else {
$this->_smtp_cmd("Content-Type: multipart/alternative; boundary=\"$this->mime_boundary\"");
}
$this->_smtp_cmd("$this->smtp_CRLF");
$this->_smtp_cmd("This is a multi-part message in MIME format.");
}
private function _smtp_attachfile_content()
{
$this->_smtp_cmd("Content-Type: $this->smtp_attachfile_type");
$this->_smtp_cmd("Content-Transfer-Encoding: $this->mime_encoding");
$this->_smtp_cmd("Content-Disposition: attachment; filename=\"$this->smtp_attachfile_name\"");
}
private function _smtp_start_boundary()
{
$this->_smtp_cmd("$this->smtp_CRLF");
$this->_smtp_cmd("--$this->mime_boundary");
}
private function _smtp_end_boundary()
{
$this->_smtp_cmd("--$this->mime_boundary--");
}
public function open()
{
$this->smtp_socketopen = @fsockopen($this->smtp_server, $this->smtp_port, $errno, $errstr, $this->smtp_timeout);
if($this->_smtp_code($this->_receive()) != 220)
{
throw new Exception("..... ... . .....");
}
else
{
$this->smtp_status = true;
}
return $this->smtp_status;
}
private function _smtp_helo()
{
$this->_smtp_cmd("HELO $this->smtp_server");
if($this->_smtp_code($this->_receive()) == 250)
{
return true;
}
return false;
}
private function _smtp_mailfrom($from)
{
$this->_smtp_cmd("MAIL FROM: $this->mail_from");
if($this->_smtp_code($this->_receive()) == 250)
{
return true;
}
return false;
}
private function _smtp_rcptto($to)
{
$this->_smtp_cmd("RCPT TO: $this->mail_to");
if($this->_smtp_code($this->_receive()) == 250)
{
return true;
}
return false;
}
private function _smtp_data()
{
$this->_smtp_cmd("DATA");
if($this->_smtp_code($this->_receive()) == 354)
{
return true;
}
return false;
}
private function _smtp_end()
{
$this->_smtp_cmd(".");
if($this->_smtp_code($this->_receive()) == 250)
{
return true;
}
return false;
}
private function _smtp_quit()
{
$this->_smtp_cmd("QUIT");
if($this->_smtp_code($this->_receive()) == 221)
{
return true;
}
return false;
}
public function close()
{
if(@fclose($this->smtp_socketopen) == false)
{
throw new Exception(".. ..... ...... .....");
}
return true;
}
private function _smtp_send($files = null)
{
$this->mime_boundary = "======" . uniqid(rand()) . "/$_SERVER[SERVER_NAME]";
$mail_body = nl2br(stripslashes($this->mail_body));
if($this->mime_encoding == "base64")
{
$mail_body = chunk_split(base64_encode($mail_body));
}
$this->smtp_cmd_status[] = $this->_smtp_helo();
$this->smtp_cmd_status[] = $this->_smtp_mailfrom($this->mail_from);
$this->smtp_cmd_status[] = $this->_smtp_rcptto($this->mail_to);
$this->smtp_cmd_status[] = $this->_smtp_data();
$this->_smtp_base_header();
if(is_array($files))
{
$this->_smtp_multipart_content(true);
$this->_smtp_start_boundary();
$this->_smtp_base_content();
$this->_smtp_cmd("$this->smtp_CRLF");
$this->_smtp_cmd($mail_body);
$this->_smtp_cmd("$this->smtp_CRLF");
for($i = 0; $i < sizeof($files); $i++)
{
if(is_uploaded_file($files[tmp_name][$i]))
{
$this->smtp_attachfile_name = $this->_check_empty($files[name][$i]);
$this->smtp_attachfile_size = $files[size][$i];
$this->smtp_attachfile_type = $files[type][$i];
$attachfile_handle = @fopen($files[tmp_name][$i], "r");
$attachfile_body = @fread($attachfile_handle, $files[size][$i]);
if($this->mime_encoding == "base64")
{
$attachfile_body = chunk_split(base64_encode($attachfile_body));
}
$this->_smtp_start_boundary();
$this->_smtp_attachfile_content();
$this->_smtp_cmd("$this->smtp_CRLF");
$this->_smtp_cmd($attachfile_body);
$this->_smtp_cmd("$this->smtp_CRLF");
@fclose($attachfile_handle);
}
}
} else {
$this->_smtp_multipart_content(false);
$this->mime_content_type = "text/plain";
$this->_smtp_start_boundary();
$this->_smtp_base_content();
$this->_smtp_cmd("$this->smtp_CRLF");
$this->_smtp_cmd($mail_body);
$this->_smtp_cmd("$this->smtp_CRLF");
$this->mime_content_type = "text/html";
$this->_smtp_start_boundary();
$this->_smtp_base_content();
$this->_smtp_cmd("$this->smtp_CRLF");
$this->_smtp_cmd($mail_body);
$this->_smtp_cmd("$this->smtp_CRLF");
}
$this->_smtp_end_boundary();
$this->smtp_cmd_status[] = $this->_smtp_end();
$this->smtp_cmd_status[] = $this->_smtp_quit();
foreach($this->smtp_cmd_status as $key => $value)
{
if($value == false)
{
return false;
break;
}
}
return true;
}
private function _smtp_cmd($str)
{
@fputs($this->smtp_socketopen, $str . $this->smtp_CRLF);
}
private function _smtp_code($str)
{
return substr($str, 0, 3);
}
private function _receive()
{
return @fgets($this->smtp_socketopen, 1024);
}
private function _check_empty($filename)
{
return preg_replace("/ /i", "_", $filename);
}
public function send($to, $from, $subject, $text, $priority = 3, $files = null)
{
$this->set_xmailer($_SERVER[HTTP_USER_AGENT]);
$this->set_content_type("text/html");
$this->set_charset("euc_kr");
$this->set_encoding("base64");
$this->_mail_env($to, $from, $this->encoding($subject), $text, $priority);
if($this->_smtp_send($files) == false)
{
throw new Exception("Error");
}
}
public function __destruct()
{
}
};
?>