<?php
	eequire_once ($_SERVER['DOCUMENT_ROOT']."/inc/mysql.inc");
	require_once ($_SERVER['DOCUMENT_ROOT']."/inc/pgsql.inc");

	$id = $_GET['id'];
	$msg = $_GET['msg'];
	$passwd ="5emffld)";

	if ($id != "SILVER")
		die;

    if($sid != "" && $msg != "")
    {
        $dbConnPgSql = new DB_Sql;
        $strSqlpg  = "SELECT group_seq ";
        $strSqlpg .= "FROM t_group ";
        $strSqlpg .= "WHERE group_id = '".$sid."' AND deleted_yn = 'N'";

        $dbConnPgSql->query($strSqlpg);
        if($dbConnPgSql->nf() != 0)
        {
            $tmpSqlmy = "";
			$tmpSqlpg = "";
			//$dbConnMySql = new dbconnect('211.39.134.240', 'sms', '', 'sms', __FILE__, __LINE__);
			//$dbConnMySql = new dbconnect('host ', 'user`', 'pass', 'db_name', __FILE__, __LINE__);
			$dbConnMySql = new dbconnect('222.122.18.22', 'sms', '$passwd', 'sms', __FILE__, __LINE__);

			while($dbConnPgSql->next_record())
			{
				$cellphone = $dbConnPgSql->f("member_cellphone");
				$cli_ip = $_SERVER['REMOTE_ADDR'];
				//$tmpSqlmy  = "INSERT INTO sms_msg (phone, callback, reqdate, msg,etc1 )  ";
				//$tmpSqlmy .= "VALUES ( '$cellphone', '', sysdate(), '$msg', '$cli_ip')";
				$tmpSqlmy  = "INSERT INTO SDK_SMS_SEND ( USER_ID, SCHEDULE_TYPE, SUBJECT, NOW_DATE,SEND_DATE, CALLBACK, DEST_COUNT, DEST_INFO, SMS_MSG) ";
				$tmpSqlmy .= "VALUES ('ktics1', 0,'ktics1',DATE_FORMAT(now(),'%Y%m%d%H%i%s'),DATE_FORMAT(now(),'%Y%m%d%H%i%s'),'$cellphone',1,'ktics1^$cellphone','$msg');

				$dbConnMySql->query($tmpSqlmy,__FILE__, __LINE__);  
				$tmpSqlpg .= "INSERT INTO t_sms_log (group_seq, sms_id, sms_cellphone, sms_message, reg_datetime, update_datetime) ";
				$tmpSqlpg .= "VALUES (".$group_seq.", 'SH_".$sid."', '".$cellphone."', '".$msg."', now(), now()); ";
			}
			$dbConnPgSql->query($tmpSqlpg);
		}
	}
}
}
?>	
