PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Brad Pineau  >  PHP Pwinty  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: An example of typical class usage.
Class: PHP Pwinty
Order photo print services using the Pwinty API
Author: By
Last change:
Date: 9 years ago
Size: 997 bytes


Class file image Download
$pwinty = new PHPPwinty();

// create the order
$order = $pwinty->createOrder("John Doe", "123 Evergreen Terrace", "", "Beverly Hills", "CA", "90210", "United States", "Photos by Picisto");

// add some photos
$photo1 = $pwinty->addPhoto($order, "4x6", "", "1", "ShrinkToFit");
$photo2 = $pwinty->addPhoto($order, "6x6", "", "4", "ShrinkToFit");
$photo3 = $pwinty->addPhoto($order, "5x7", "", "3", "ShrinkToFit");

// add a document
$document = $pwinty->addDocument($order, "invoice.pdf");

// add a sticker
$document = $pwinty->addSticker($order, "sticker.jpg");

// view the order, make sure it's all there
$order_details = $pwinty->getOrder($order);

// submit the order
$pwinty->updateOrderStatus($order, "Submitted");

For more information send a message to info at phpclasses dot org.