Esempio n. 1
0
 function launch()
 {
     global $interface;
     global $configArray;
     global $library;
     global $locationSingleton;
     global $timer;
     global $user;
     if ($user) {
         $catalog = new CatalogConnection($configArray['Catalog']['driver']);
         $patron = $catalog->patronLogin($user->cat_username, $user->cat_password);
         $profile = $catalog->getMyProfile($patron);
         if (!PEAR_Singleton::isError($profile)) {
             $interface->assign('profile', $profile);
         }
         if (!isset($_POST['overDriveId']) || !isset($_POST['overDriveFormatId']) || !isset($_POST['loanPeriod'])) {
             header('Location: /');
         } else {
             require_once ROOT_DIR . '/services/EcontentRecord/AJAX.php';
             $_REQUEST['overDriveId'] = $_POST['overDriveId'];
             $_REQUEST['formatId'] = $_POST['loanPeriod'];
             $_REQUEST['lendingPeriod'] = $_POST['overDriveFormatId'];
             $service = new AJAX();
             $status = json_decode($service->CheckoutOverDriveItem());
             if ($status->result) {
                 $msg = 'Your titles were checked out successfully. You may now download the titles from your Account.';
             } else {
                 $msg = $status->message;
             }
             $interface->assign('message', $msg);
             $interface->assign('result', $msg);
             $interface->setPageTitle('OverDrive Loan Period');
             $interface->setTemplate('od-checkedOut.tpl');
         }
         //Var for the IDCLREADER TEMPLATE
         $interface->assign('ButtonBack', false);
         $interface->assign('ButtonHome', true);
         $interface->assign('MobileTitle', 'OverDrive Loan Period');
     } else {
         header('Location: /');
         exit;
     }
     $interface->display('layout.tpl');
 }