Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 701a02e20d2616e965f759a8723141a2 > files > 35

php-pear-Contact_AddressBook-0.5.0-4mdv2010.0.noarch.rpm

<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker */

// Load the Contact_AddressBook.
require_once 'Contact/AddressBook.php';

// Include our records.
include_once 'include/records.php';

if (isset($_POST['submit'])) {
    if (!empty($_POST['format'])) {
        // Create a new instance of Contact_AddressBook object.
        $cab = new Contact_AddressBook;

        if ($_POST['mode'] == 'print') {
            include_once 'include/head.php';
            print '<pre>';

            // Call export to print method.
            $cab->exportToPrint($_POST['format'],
                                $GLOBALS['_Contact_AddressBook_records']);

            print '</pre>';
            include_once 'include/footer.php';
        } else {
            // Call export to file method.
            $cab->exportToFile('addressbook', $_POST['format'],
                               $GLOBALS['_Contact_AddressBook_records']);
        }
    }
}

/*
 * Local variables:
 * mode: php
 * tab-width: 4
 * c-basic-offset: 4
 * c-hanging-comment-ender-p: nil
 * End:
 */
?>