Esempio n. 1
0
         break;
     case 'unavail':
         $greeting = Aastra_get_label('Unavailable Greeting', $language);
         break;
     case 'busy':
         $greeting = Aastra_get_label('Busy Greeting', $language);
         break;
     case 'temp':
         $greeting = Aastra_get_label('Temporary Greeting', $language);
         break;
 }
 # Graphic supported
 if (Aastra_is_pixmap_graphics_supported()) {
     # Display image
     require_once 'AastraIPPhoneImageScreen.class.php';
     $object = new AastraIPPhoneImageScreen();
     $object->setDestroyOnExit();
     if (Aastra_is_lockincall_supported()) {
         $object->setLockinCall();
     } else {
         $object->setLockin();
     }
     $object->setallowDTMF();
     require_once 'AastraIPPhoneSPImage.class.php';
     $SPimage = new AastraIPPhoneSPImage();
     # Title
     $SPimage->setText(sprintf(Aastra_get_label('Mailbox %s', $language), $user), 1, 'right', 0);
     # Bitmap on the left
     if ($cause == 'record') {
         $SPimage->setBitmap('recording', 3, 1);
         $SPimage->setText(Aastra_get_label('Recording...', $language), 3, 'left', 4);
Esempio n. 2
0
 $birthYear = substr($bdate, 6, 4);
 # check date for validity, display error message if invalid
 if (!@checkDate($birthMonth, $birthDay, $birthYear)) {
     # Display error message
     $object = new AastraIPPhoneTextScreen();
     $object->setTitle(Aastra_get_label('Invalid Birth Date', $language));
     $object->setText(Aastra_get_label('Please enter a valid Birth Date.', $language));
 } else {
     # calculate the number of days this person is alive
     $daysGone = abs(gregorianToJD($birthMonth, $birthDay, $birthYear) - gregorianToJD(date("m"), date("d"), date("Y")));
     # Get the results
     $array = getResults();
     # Test if graphics are supported
     if (Aastra_is_pixmap_graphics_supported()) {
         # create image and object
         $object = new AastraIPPhoneImageScreen();
         $GDImage = new AastraIPPhoneGDImage();
         # specify diagram parameters (these are global)
         $diagramWidth = 144;
         $diagramHeight = 32;
         $daysToShow = 28;
         # calculate start date for diagram and start drawing
         $nrSecondsPerDay = 60 * 60 * 24;
         $diagramDate = time() - $daysToShow / 2 * $nrSecondsPerDay + $nrSecondsPerDay;
         for ($i = 1; $i < $daysToShow; $i++) {
             $thisDate = getDate($diagramDate);
             $xCoord = $diagramWidth / $daysToShow * $i;
             $GDImage->line($xCoord, $diagramHeight - 2, $xCoord, $diagramHeight, 1);
             $diagramDate += $nrSecondsPerDay;
         }
         # draw rectangle around diagram (marks its boundaries)