Пример #1
0
<?php

/**
 * This page should handle all of the print requests.
 *
 * @package Business-Card-Generator
 */
global $http, $html, $app;
if (!defined('ROOT')) {
    define('ROOT', dirname(__FILE__));
}
require_once ROOT . '/m.inc.php';
tryDef('CURRENT_PAGE_NAME', false);
if (!isset($html)) {
    $html = new html();
}
tryReq('app.inc.php');
if (!isset($app)) {
    $app = new App();
}
// print requests can now be handled.
$html->code('<!doctype html><html><head><meta charset="uft-8"><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">' . "<link href='http://fonts.googleapis.com/css?family=" . GOOGLE_FONTS . "' rel='stylesheet' type='text/css'>" . '<style type="text/css">');
$html->code('#front,#back{width: 200mm;height: 257mm;page-break-before:always}#front div,#back div{margin:2mm;height:51mm;width:89mm;-moz-border-radius:5px;-o-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}#front div p,#back p{font-family:\'Lato\', sans-serif;font-size:15px;margin:0;padding:0;line-height:100%;letter-spacing:0');
$html->code('</style></head><body><div id="front">');
$app->card($_GET, 1, 10, true);
$html->code('</div><div id="back">');
$app->card($_GET, 2, 10, true);
$html->code('</div><script type="text/javascript">javascript:window.print()</script></body></html>');
$html->dump();
Пример #2
0
<?php

/**
 * This page should handle all of the AJAX requests.
 *
 * @package Business-Card-Generator
 */
global $http, $html, $app;
if (!defined('ROOT')) {
    define('ROOT', dirname(__FILE__));
}
require_once ROOT . '/m.inc.php';
tryDef('CURRENT_PAGE_NAME', false);
tryReq('app.inc.php');
if (!isset($app)) {
    $app = new App();
}
if (!isset($html)) {
    $html = new html();
}
// AJAX requests can now be handled.
$app->card($_GET, $_GET['side'], 1, false);