Beispiel #1
0
<?php

include 'g_common.inc';
include 'g_rootch_root.inc';
include 'g_rootchTOP.inc';
include 'g_mag.inc';
$plink = mylink();
$client = $_SESSION['RootClient'];
?>
<html>
<head>
<title>ECPAY - 追回明細資料庫</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<style type="text/css">
<!--
BODY { font-size: 10pt }
TABLE { border: 1pt black solid }
TH { border-bottom: 1pt blue solid;
     font-size: 9pt;
     color: #FFFFFF; background: #2222EE }
TD { font-size: 9pt }
TR.failed { background: #FDAED7 }
TR.succeeded { background: #DDDDDD }
TR.cancelled { background: #DDDDDD; text-decoration: line-through }
TR.sum { background: #CDFBCD }
TR.close { background: #999999 }
.tiny { font-size: 9pt }
-->
/*
	每 6 分鐘檢查 in 10.0.4.7
	每 6 分鐘檢查, 前1小時的交易資料, 若最後 5 筆若失敗, 則發Line群 Allpay TECH 警示
	2014.06.20 by raleigh
	2014.06.30 更改DB連線寫法 by raleigh
	2014.11.08 增加富邦
	2014.11.10 增加分期
	2014.11.13 不判斷 A01 與玉山回應 G0 不再特別處理
*/
include_once "db_link.php";
include_once "comm_func.php";
$DBHOST = DB_HOST42;
//同步DB
$plink = checkdblink($DBHOST);
if ($plink) {
    $result = mylink($plink);
    $BankTitel = array('9' => '新聯信', '10' => '新聯信(分期)', '18' => '台新', '19' => '台新(分期)', '26' => '美國運通', '27' => '玉山', '28' => '玉山(分期)', '33' => '中信新', '35' => '萬泰', '35' => '萬泰(分期)', '37' => '富邦', '38' => '富邦(分期)', '41' => '新光', '42' => '新光(分期)', '43' => '永豐', '44' => '永豐(分期)');
    //前1小時
    $MKtime = mktime(date("H") - 1, date("i"), date("s"), date("m"), date("d"), date("Y"));
    $OneHourAgo = date("YmdHis", $MKtime);
    //檢查各銀行別
    foreach ($BankTitel as $key => $value) {
        //echo "Key: $key; Value: $value <br>\n";
        $err_count = 0;
        //記錄連續錯誤筆數
        $flag = 0;
        //SELECT sr, recode, remsg FROM `o_auth` where bank = 18 and procdt >= '20140407140115' ORDER BY `o_auth`.`sr`  DESC limit 5
        $str = "SELECT sr, recode, remsg, dt FROM `o_auth` where bank = {$key} and procdt >= '{$OneHourAgo}' and recode != 'A01' and auth != '777777' ORDER BY `o_auth`.`sr`";
        $q = @mysql_query($str, $plink);
        while ($arr = @mysql_fetch_array($q)) {
            if ($arr[remsg] == '已授權') {
Beispiel #3
0
*/
$logtable = "schedule";
$setdate = date("Ymd");
$settime = "0120";
$subject = "allPay標上每筆銀行費率";
$period = "daily";
$result = 0;
$result_note = "";
$t1 = microtime(true);
$start_time = date("YmdHis");
include_once "db_link.php";
include_once "comm_func.php";
$DBHOST = DB_HOST;
//主DB
$plink = checkdblink($DBHOST);
mylink($plink);
//銀行費定義也同步記錄在 PayWeb allpay_com.php 中 2014.07.8 by raleigh
include_once "percen_mak_bank.inc";
//取出小特店的GID
$strGID = "SELECT client FROM o_user WHERE sps=4 and stop=0 ";
$Gid = @mysql_query($strGID, $plink);
while ($G = @mysql_fetch_array($Gid)) {
    $GID_arr[] = $G[client];
}
//清除測試資料
$strD = "delete from o_auth where client=3 ";
@mysql_query($strD, $plink);
//二天前
$MKtime = mktime(date("H"), date("i"), date("s"), date("m"), date("d") - 2, date("Y"));
$dtymd_2ch = date("Ymd", $MKtime);
//日期
Beispiel #4
0
function DBLog($logtable, $subject, $arr)
{
    $DBHOST = DB_HOST42;
    //主DB
    $plink = checkdblink($DBHOST);
    mylink($plink, LOGDB_NAME);
    foreach ($arr as $Qval => $value) {
        $arr[$Qval] = mysql_real_escape_string($arr[$Qval]);
    }
    //schedule排程記錄的Table schedule
    if ($logtable == "schedule") {
        //己執行過的就不要再動 result=0 未執行 1 成功 2 失敗
        $str = "SELECT serial FROM schedule WHERE result=0 and setdate='" . $arr['setdate'] . "' and settime='" . $arr['settime'] . "' ";
        $res = @mysql_query($str, $plink);
        if (list($serial) = @mysql_fetch_array($res)) {
            $update_str = "UPDATE schedule SET result='" . $arr['result'] . "', result_note='" . $arr['result_note'] . "', running='" . $arr['running'] . "', start_time='" . $arr['start_time'] . "', end_time='" . $arr['end_time'] . "', update_time = '" . date('YmdHis') . "' WHERE serial = " . $serial . " limit 1 ";
            @mysql_query($update_str, $plink);
        } else {
            //沒找到就Insert
            $insert_str = "INSERT INTO `schedule` (`setdate`, `settime`, `subject`, `period`, `result`, `result_note`, `running`, `insert_time`, `start_time`, `end_time`, `update_time`) VALUES ('" . $arr['setdate'] . "', '" . $arr['settime'] . "', '" . mysql_real_escape_string($subject) . "', '" . $arr['period'] . "', '" . $arr['result'] . "', '" . $arr['result_note'] . "', '" . $arr['running'] . "', '" . date('YmdHis') . "', '" . $arr['start_time'] . "', '" . $arr['end_time'] . "', '" . date('YmdHis') . "')";
            @mysql_query($insert_str, $plink);
        }
    }
    //排程記錄的Table schedule
    if ($logtable == "monitor") {
        $insert_str = "INSERT INTO `monitor` (`setdate`, `settime`, `subject`, `period`, `result`, `result_note`, `result_num`, `running`, `insert_time`, `start_time`, `end_time`, `update_time`) VALUES ('" . $arr['setdate'] . "', '" . $arr['settime'] . "', '" . mysql_real_escape_string($subject) . "', '" . $arr['period'] . "', '" . $arr['result'] . "', '" . $arr['result_note'] . "', '" . $arr['result_num'] . "', '" . $arr['running'] . "', '" . date('YmdHis') . "', '" . $arr['start_time'] . "', '" . $arr['end_time'] . "', '" . date('YmdHis') . "')";
        $res = @mysql_query($insert_str, $plink);
    }
    //Line執行記錄
    if ($logtable == "exec_line") {
        $insert_str = "INSERT INTO `exec_line` (`line_group`, `msg`, `hostname`, `filename`, `line_server`, `running`, `insert_time`, `start_time`, `end_time`) VALUES ('" . $arr['line_group'] . "', '" . $arr['msg'] . "', '" . $arr['hostname'] . "', '" . $arr['filename'] . "', '" . $arr['line_server'] . "', '" . $arr['running'] . "', '" . date('YmdHis') . "', '" . $arr['start_time'] . "', '" . $arr['end_time'] . "')";
        @mysql_query($insert_str, $plink);
    }
    @mysql_close($plink);
}
Beispiel #5
0
    exit;
}
$argv[5] = strtolower($argv[5]);
if ($argv[5] != 'big5' && $argv[5] != 'utf-8' && $argv[5] != 'utf8') {
    echo "參數錯誤(3)! \r\n";
    exit;
}
if (!is_numeric($argv[6]) && $argv[6] != 'null') {
    echo "參數錯誤(4)! \r\n";
    exit;
}
$DBHOST = DB_HOST42;
//Slave DB
$plink = checkdblink($DBHOST);
if ($plink) {
    $result = mylink($plink, LOGDB_NAME);
    foreach ($argv as $Qval => $value) {
        $argv[$Qval] = mysql_real_escape_string($argv[$Qval]);
    }
    $bank = $argv[1];
    $authsr = $argv[2];
    //SR單號
    $bk_posturl = $argv[3];
    //傳送連結
    $bk_posturl = base64_decode($bk_posturl);
    $relog = $argv[4];
    //Post Data
    $relog = base64_decode($relog);
    $LG = $argv[5];
    $allsn = $argv[6];
    if ($allsn == "null") {
 *   ReferenceNo=000024640512,
 *   ResponseCode=000,
 *   ResponseMsg=APPROVED048718,
 *   TransMode=0,
 *   RtnCode=1,
 *   RtnMsg=OK
 *
 */
$t1 = microtime(true);
$start_time = date("YmdHis");
$filename = "form_ssl_result.php";
$flagUpdateOKyet = 0;
//判斷是否重覆收到
set_time_limit(60);
include 'g_common.inc';
$databaseLink = mylink();
@write_log("form_ssl_result_request", "富邦 新光 國泰世華 永豐授權回傳結果 (" . $uip . ")", $_REQUEST);
/*
if( substr($uip, 0, 10) != '210.61.215' && $uip != '211.23.128.211' ){
	$title = "富邦新光國泰授權回傳結果-來自不受信任的IP(".$uip.")";
	$RTlogo = str_replace("\r\n", "<br>", $rootmemo);
	$msg = "確認IP這筆交易是否為真, 再更新狀態<br>".$RTlogo;
	$msg .= "<hr size=1>於 pay-web 執行的 from_ssl_result.php 執行時間 ".number_format(microtime(true)-$t1, 3)." 秒<br>".date("Y/m/d H:i:s");
	exec_mail(2, $title, $msg, 'form_ssl_result');
	echo 'error_stop'; 
	exit; 
}
*/
if (!$MerchantTradeNo) {
    $title = "富邦新光國泰授權回傳結果-回傳為空(" . $uip . ")";
    $RTlogo = str_replace("\r\n", "<br>", $rootmemo);
            }
            // end if
        }
        // end foreach
        if ($link1 != "") {
            return $link1;
        }
    }
}
$query = $_GET["file"];
if ($query) {
    $queryArr = explode(',', $query);
    $link = $queryArr[0];
    $image = $queryArr[1];
}
if (strpos($image, "web3.protv.ro") !== false) {
    $video = mylink($link);
    print $video;
} elseif (strpos($image, "assets.sport.ro") !== false) {
    $link1 = str_replace("thumb2_", "", $image);
    $link1 = str_replace("thumb1_", "", $image);
    $link1 = str_replace(".jpg", ".flv", $link1);
    $link1 = str_replace("-", "_", $link1);
    $AgetHeaders = @get_headers($link1);
    if (preg_match("|200|", $AgetHeaders[0])) {
        print $link1;
    } else {
        $video = mylink($link);
        print $video;
    }
}
Beispiel #8
0
set_time_limit(0);
ini_set('memory_limit', '512M');
# 每天 01:00 分執行平帳
include 'mysql.inc';
$sPHP_Name = basename(__FILE__, '.php');
// PHP 名稱
$log_table = 'nec_trace_log';
$log_subject = 'daily_balance';
$self_name = basename(__FILE__);
$log_value = array('file_name' => $self_name, 'send_nec' => '', 'bk_nec' => '', 'msg' => '');
function nbok($a)
{
    $a = $a + 1 - 1;
    return $a;
}
$link = mylink();
# 補關日期確認
if ($sy && $sm && $sd) {
    $bksand = 1;
} else {
    $bksand = '';
}
function spas_nabD($a, $b)
{
    $aa = "%0" . $b . "s";
    $a = sprintf($aa, $a);
    return $a;
}
if ($bksand) {
    if ($CPS != 'jmwang') {
        //密碼不對
Beispiel #9
0
function get_login_user($aa)
{
    $type = 'trade';
    $conn_type = 'NP';
    $my_link = mylink($type, $conn_type);
    $sel_sql = 'SELECT uid FROM ' . TB_MEM;
    $sel_sql .= ' WHERE aa = "' . SenitizMySQL($aa, $my_link) . '"';
    $sel_qry = myquery($sel_sql, $my_link);
    $sel_ary = mysql_fetch_array($sel_qry);
    mysql_free_result($sel_qry);
    $t_user = $sel_ary['uid'];
    mysql_close($my_link);
    return $t_user;
}
//0正式 2在自家目錄正式上傳 1在測試目錄中產生請款檔且不上傳
$logtable = "schedule";
$setdate = date("Ymd");
$settime = "1600";
$subject = "allPay國旅送檔-中信新";
$period = "daily";
$result = 0;
$result_note = "";
$t1 = microtime(true);
$start_time = date("YmdHis");
include_once "db_link.php";
include_once "comm_func.php";
$DBHOST = DB_HOST;
//主DB
$plink = checkdblink($DBHOST);
$res = mylink($plink);
if (!$plink || !$res) {
    $title = $subject . "-DB無法連線";
    $msg = "[" . $DBHOST . "]DB無法連線-" . $subject . " 執行失敗<hr size=1>" . mysql_error($plink) . " 請檢查! by g_Close_china_glu.php";
    $msg .= "<hr size=1>於 Settlement 每日 " . $settime . " 執行的 g_Close_china_glu.php 執行時間 " . number_format(microtime(true) - $t1, 3) . " 秒<br>" . date("Y/m/d H:i:s");
    exec_mail(2, $title, $msg, 'g_Close_china_glu');
    echo $title . "-結束 \r\n";
    exit;
}
if ($TEST_mode >= 1) {
    $File_home_dir = dirname(__FILE__);
} else {
    $File_home_dir = HOME_DIR;
}
$DirUrlTxt = $File_home_dir . '/ctcb/ctcb_glu_out';
$DirUrlTxtBK = $File_home_dir . '/ctcb/ctcb_glu_out_bk';