Example #1
0
    }');
    if ($pass->checkError($error) == true) {
        exit('An error occured: ' . $error);
    }
    // add files to the PKPass package
    $pass->addFile('../images/icon.png');
    $pass->addFile('../images/icon@2x.png');
    $pass->addFile('../images/logo.png');
    if ($pass->checkError($error) == true) {
        exit('An error occured: ' . $error);
    }
    //If you pass true, the class will output the zip into the browser.
    $result = $pass->create(true);
    if ($result == false) {
        // Create and output the PKPass
        echo $pass->getError();
    }
} else {
    // User lands here, there are no $_POST variables set
    ?>
	<html>
		<head>
			<title>Flight pass creator - PHP class demo</title>
			
			<!-- Reusing some CSS from another project of mine -->
			<link href="http://www.lifeschool.nl/static/css" rel="stylesheet" type="text/css" />
			<meta name="viewport" content="width=320; user-scalable=no" />
			<style>
				.header { color: white; background-color: #6699cc; padding-top: 30px; padding-bottom: 30px; margin-bottom: 32px; text-align: center; }
				.logo { width: 64px; height: 64px; margin-bottom: 20px; }
				.title { color: white; font-size: 22px; text-shadow: 1px 1px 1px rgba(0,0,0,0.5); font-weight: bold; display: block; text-align: center; }
Example #2
0
    },
    "barcode": {
        "format": "PKBarcodeFormatPDF417",
        "message": "' . $id . '",
        "messageEncoding": "iso-8859-1",
        "altText": "' . $id . '"
    }
    }');
    // add files to the PKPass package
    $pass->addFile('icon.png');
    $pass->addFile('*****@*****.**');
    $pass->addFile('logo.png');
    $pass->addFile('background.png', 'strip.png');
    if (!$pass->create(true)) {
        // Create and output the PKPass
        echo 'Error: ' . $pass->getError();
    }
    exit;
} else {
    // User lands here, there are no $_POST variables set
    ?>
	<html>
	<head>
		<title>Starbucks pass creator - PHP class demo</title>

		<!-- Reusing some CSS from another project of mine -->
		<link href="http://www.lifeschool.nl/static/bootstrap.css" rel="stylesheet" type="text/css" />
		<meta name="viewport" content="width=320; user-scalable=no" />
		<style>
		.header { background-color: #CCC; padding-top: 30px; padding-bottom: 30px; margin-bottom: 32px; text-align: center; }
		.logo { width: 84px; height: 84px; margin-bottom: 20px; }