Esempio n. 1
0
function StoreAsPRC($title, $rawData)
{
    // echo "<h1>$title</h1>\n<pre>$rawData\n</pre>\n"; return;
    global $SavedPDB, $UncompressedDoc, $TargetType, $CompressWarningDisplayed;
    $fileName = preg_replace('/[^-a-zA-Z_0-9]/', '_', $title);
    if (!isset($SavedPDB) || !is_array($SavedPDB)) {
        $SavedPDB = array();
        session_register('SavedPDB');
    }
    $SavedInfo['Title'] = $title;
    $SavedInfo['Type'] = $TargetType;
    $SavedInfo['Time'] = time();
    if ($TargetType == 'DOC') {
        if (isset($UncompressedDoc) && $UncompressedDoc) {
            $prc = new PalmDoc($title, false);
        } else {
            $prc = new PalmDoc($title);
        }
        $prc->AddDocText($rawData);
        if (!isset($CompressWarningDisplayed)) {
            $WarningTime = '';
            if (count($prc->Records) > 5) {
                $WarningTime = 'a bit';
            }
            if (count($prc->Records) > 10) {
                $WarningTime = 'a while';
            }
            if (count($prc->Records) > 15) {
                $WarningTime = 'a long time';
            }
            if (count($prc->Records) > 25) {
                $WarningTime = 'a very long time';
            }
            if (count($prc->Records) > 40) {
                $WarningTime = 'enough time to write a poem';
            }
            if (count($prc->Records) > 60) {
                $WarningTime = 'enough time for you learn a new hobby';
            }
            if (count($prc->Records) > 100) {
                $WarningTime = 'so long that PHP will likely time out and ' . 'kill this conversion';
            }
            if ($WarningTime != '') {
                ShowStatus("Compressing the DOC.\nThis could take " . $WarningTime . '.');
            }
            $CompressWarningDisplayed = true;
        }
    } elseif ($TargetType == 'SmallBASIC') {
        $prc = new PalmSmallBASIC($title);
        $result = $prc->ConvertFromText($rawData);
        if (is_array($result)) {
            ShowError('Error converting the file.  The section "' . $result[1] . '" is too big.  It must be broken into ' . 'multiple sections for the conversion to work.');
            return;
        }
    }
    ob_start();
    $prc->WriteToStdout();
    $prc = ob_get_contents();
    ob_end_clean();
    $SavedInfo['Data'] = $prc;
    $key = $fileName;
    $num = 1;
    while (isset($SavedPDB[$key])) {
        $num++;
        $key = $fileName . '-' . $num;
    }
    $SavedPDB[$key] = $SavedInfo;
}
Esempio n. 2
0
                if (!RegisterCustomerPayDoc($obj, $pdo)) {
                    $error = true;
                }
            }
            if ($error) {
                print_r(ExceptionHandler::PopAllExceptions());
                $pdo->rollBack();
                $result .= "<br> عملیات پرداخت قسط در نرم افزار صندوق به درستی ثبت نگردید. " . "<br> جهت اعمال آن با صندوق تماس بگیرید.";
            } else {
                $pdo->commit();
            }
        } else {
            ShowStatus($totalAmount);
        }
    } else {
        $result = ShowStatus($_REQUEST["resultCode"]) . "<br>";
        if (isset($_REQUEST['referenceId'])) {
            $result .= '<p align=center><font face=tahoma size=3>';
            $result .= 'کد پیگیری:' . $_REQUEST['referenceId'];
            $result .= '</font></p>';
        }
    }
}
?>
<html>
	<head>
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>	
		<style>
			body{
				font-family: tahoma;
				font-size: 12px;