Пример #1
0
                "label": "Gate",
                "value": "F12"
            },
            {
                "key": "date",
                "label": "Departure date",
                "value": "07/11/2012 10:22"
            }

        ],
        "backFields": [
            {
                "key": "passenger-name",
                "label": "Passenger",
                "value": "John Appleseed"
            }
        ],
        "transitType" : "PKTransitTypeAir"
    },
    "barcode": {
        "format": "PKBarcodeFormatQR",
        "message": "Flight-GateF12-ID6643679AH7B",
        "messageEncoding": "iso-8859-1"
    }
}');
// add files to the PKPass package
$pass->addFile('images/icon.png');
$pass->addFile('images/icon@2x.png');
$pass->addFile('images/logo.png');
$pass->create(true);
// Create and output the PKPass
Пример #2
0
        "message": "Flight-Gate' . $gate . '-' . $date . '-' . $passenger . '-' . $destination . '",
        "messageEncoding": "iso-8859-1"
    }
    }');
    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>
Пример #3
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');

    $pass->create(true); // Create and output the PKPass
    exit;
	
}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 { background-color: #CCC; padding-top: 30px; padding-bottom: 30px; margin-bottom: 32px; text-align: center; }
				.logo { width: 84px; height: 84px; margin-bottom: 20px; }
Пример #4
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>
Пример #5
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>