コード例 #1
0
ファイル: getOrderId.php プロジェクト: letmefly/tools_script
mysql_select_db("pay_verify_db", $mysql_connect);
$msg['verify_state'] = 'FAIL';
$msg['transaction_id'] = 'NOTHING';
$sql = "INSERT INTO op_order_info (CLIENT_ID, GAME_NAME, SDK_PAY_TYPE, TIME_STAMP, VERIFY_STATE, TRANSACTION_ID)\nVALUES\n('{$msg['client_id']}','{$msg['game_name']}','{$msg['sdk_pay_type']}','{$msg['time_stamp']}', '{$msg['verify_state']}', '{$msg['transaction_id']}')";
if (!mysql_query($sql)) {
    //die('Error: ' . mysql_error());
    //error_log("db query failed" ."\r\n", 3, "/nfsroot/html_onefigure/app/debug.info");
    print_r("db query failed\r\n");
    exit;
}
//Now insert one order to DB, and get orderId
$orderId = mysql_insert_id();
/*
// test modify ordrinfo
$sql = "UPDATE op_order_info SET VERIFY_STATE='SUCCESS', TRANSACTION_ID='12344354556576' WHERE ORDER_ID='3'";
if (!mysql_query($sql))
{
  //die('Error: ' . mysql_error());
	error_log("db query failed" ."\r\n", 3, "/nfsroot/html_onefigure/debug.info");
	exit();
}
*/
mysql_close($mysql_connect);
$retMsg = array();
$retMsg['order_id'] = $orderId;
$retMsg['time_stamp'] = date('Y-m-d H:i:s');
$retMd5 = calc_md5($retMsg);
$retMsg['sign'] = $retMd5;
print_r(json_encode($retMsg));
//print_r($orderId);
//var_dump($msg);
コード例 #2
0
ファイル: do_upload.php プロジェクト: ko3st/zermelo-web
    }
    if (!mdb2_single_val("SELECT rooster_id FROM roosters WHERE basis_id = {$basis_id} AND file_id = {$file_id} AND wijz_id = {$wijz_id}")) {
        $wijz_id++;
        mdb2_exec("INSERT INTO roosters ( week_id, file_id, basis_id, wijz_id, timestamp ) VALUES ( {$week_id}, {$file_id}, {$basis_id}, {$wijz_id}, %i )", time());
        logit($md5 . ' week=' . $week . ' basis_id=' . $basis_id . ' wijz_id=' . $wijz_id);
    } else {
        fatal_error('deze wijzigigen hebben we al op deze week bij het meest recente basisrooster dat geldt voor deze week');
    }
} else {
    if ($_POST['type'] == 'basis' && preg_match('/_(\\d+).udmz$/', $filename, $matches)) {
        $version = $matches[1];
        //logit('ontv basis '.$year_start.'/'.$year_end.' versie '.$version);
        if (mdb2_single_val("SELECT rooster_id FROM roosters WHERE week_id = %i", $_POST['week_id']) && isset($_POST['overwrite']) && $_POST['overwrite'] != 'true') {
            fatal_error("er staat al een basisrooster in deze week, vink de checkbox aan als je wilt overschrijven");
        }
        $md5 = calc_md5($_FILES['uploadedfile']['tmp_name']);
        $file_id = get_file_id($md5, 1, 1);
        $week = mdb2_single_val("SELECT week FROM weken WHERE week_id = %i", $_POST['week_id']);
        if (!$file_id) {
            $file_id = get_file_id($md5, 1, 0);
            if ($file_id) {
                logit('dit basisrooster kennen we al, maar de import is eerder mis gegaan');
            } else {
                mdb2_exec("INSERT INTO files ( file_name, file_md5, file_time, file_type, file_status, file_version ) VALUES ( '%q', '{$md5}', %i, 1, 0, {$version} )", $filename, time());
                $file_id = get_file_id($md5, 1, 0);
            }
            $new_filename = move_upload('basis', $md5, $week);
            import_basisrooster($file_id, $new_filename);
            $status = mdb2_single_val("SELECT file_status FROM files WHERE file_id = {$file_id}");
            if (!$status) {
                fatal_error('de import is fout gegaan, we kunnen dit rooster niet publiceren :(, mail snelr@ovc.nl');