forked from jdearaujo/Business-Card-Generator
/
print.php
23 lines (23 loc) · 1.27 KB
/
print.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?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( );
?>