home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / calendar-2010-08-23.tar.gz / calendar-2010-08-23.tar / calendar / includes / todo.php < prev   
PHP Script  |  2003-10-12  |  4KB  |  136 lines

  1. <?php 
  2.  
  3. define('BASE', '../');
  4. include (BASE.'functions/init.inc.php');
  5. include (BASE.'functions/date_functions.php');
  6.  
  7. // Unserialize the array so that we can use it.
  8. $vtodo_array = unserialize(base64_decode($HTTP_GET_VARS['vtodo_array']));
  9.  
  10. // Set the variables from the array
  11. if (isset($vtodo_array['vtodo_text']) && ($vtodo_array['vtodo_text'] !== '') ) {
  12.     $vtodo_text = $vtodo_array['vtodo_text'];
  13. } else {
  14.     $vtodo_text = '';
  15. }
  16.  
  17. if (isset($vtodo_array['description']) && ($vtodo_array['description'] !== '') ) {
  18.     $description = $vtodo_array['description'];
  19. } else {
  20.     $description = '';
  21. }
  22.  
  23. if (isset($vtodo_array['completed_date']) && ($vtodo_array['completed_date'] !== '') ) {
  24.     $completed_date = localizeDate ($dateFormat_day, strtotime($vtodo_array['completed_date']));
  25. }
  26.  
  27. if (isset($vtodo_array['status']) && ($vtodo_array['status'] !== '') ) {
  28.     $status = $vtodo_array['status'];
  29. }
  30. if ((!isset($status) || $status == "COMPLETED") && isset($completed_date)) {
  31.     $status = "$completed_date_lang $completed_date";
  32. } else if ($status == "COMPLETED") {
  33.     $status = $completed_lang;
  34. } else {
  35.     $status = $unfinished_lang;
  36. }
  37.  
  38. if (isset($vtodo_array['cal']) && ($vtodo_array['cal'] !== '') ) {
  39.     $calendar_name = $vtodo_array['cal'];
  40. } else {
  41.     $calendar_name = '';
  42. }
  43.  
  44. if (isset($vtodo_array['start_date']) && ($vtodo_array['start_date'] !== '') ) {
  45.     $start_date = localizeDate ($dateFormat_day, strtotime($vtodo_array['start_date']));
  46. }
  47.  
  48. if (isset($vtodo_array['due_date']) && ($vtodo_array['due_date'] !== '') && strtotime($vtodo_array['due_date']) != strtotime("+1 year", strtotime($start_date))) {
  49.     $due_date = localizeDate ($dateFormat_day, strtotime($vtodo_array['due_date']));
  50. } else {
  51.     $due_date = '';
  52. }
  53.  
  54. if (isset($vtodo_array['priority']) && ($vtodo_array['priority'] !== '')) {
  55.     $priority = $vtodo_array['priority'];
  56.  
  57.     if ($priority >= 1 && $priority <= 4) {
  58.         $priority = $priority_high_lang;
  59.     } else if ($priority == 5) {
  60.         $priority = $priority_medium_lang;
  61.     } else if ($priority >= 6 && $priority <= 9) {
  62.         $priority = $priority_low_lang;
  63.     } else {
  64.         $priority = $priority_none_lang;
  65.     }
  66. } else {
  67.     $priority = $priority_none_lang;
  68. }
  69.  
  70. ?>
  71. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  72.         "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
  73. <html>
  74. <head>
  75.     <meta http-equiv="content-type" content="text/html;charset=UTF-8">
  76.     <title><?php echo $calendar_name; ?></title>
  77.     <link rel="stylesheet" type="text/css" href="<?php echo BASE."styles/$style_sheet/default.css"; ?>">
  78. </head>
  79. <body bgcolor="#eeeeee"><center>
  80. <table border="0" width="430" cellspacing="0" cellpadding="0" class="calborder">
  81.     <tr>
  82.         <td align="left" valign="top" width="1%" class="sideback"><img src="../images/spacer.gif" width="1" height="20" alt=" "></td>
  83.         <td align="center" width="98%" class="sideback"><font class="G10BOLD"><?php echo "$calendar_name $calendar_lang"; ?></font></td>
  84.         <td align="right" valign="top" width="1%" class="sideback"></td>
  85.     </tr>
  86.     <tr>
  87.         <td colspan="3"><img src="../images/spacer.gif" width="1" height="6" alt=" "></td>
  88.     </tr>
  89.     <tr>
  90.         <td colspan="3">  
  91.                <table width="100%" border="0" cellspacing="0" cellpadding="0">
  92.                 <tr>
  93.                      <td width="1%"><img src="../images/spacer.gif" width="6" height="1" alt=" "></td>
  94.                       <td align="left" colspan="2" class="V12"><?php echo ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'<a target="_new" href="\0">\0</a>',$vtodo_text).'<br /><br />'; ?></td>
  95.                 </tr>
  96.                 
  97.                 <?php if ($description) { ?>    
  98.                     <tr>
  99.                      <td width="1%"><img src="../images/spacer.gif" width="6" height="1" alt=" "></td>
  100.                      <td align="left" colspan="2" class="V12">
  101.                      <?php echo ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", '<a target="_new" href="\0">\0</a>', $description); ?></td>
  102.                     </tr>
  103.                 <?php } ?>
  104.  
  105.                 <?php if ($status) { ?>
  106.                 <tr>
  107.                      <td></td>
  108.                       <td align="left" colspan="2" class="V12"><?php echo "$status_lang $status"; ?></td>
  109.                 </tr>
  110.                 <?php } ?>
  111.  
  112.                 <tr>
  113.                      <td></td>
  114.                       <td align="left" colspan="2" class="V12"><?php echo "$priority_lang $priority"; ?></td>
  115.                 </tr>
  116.  
  117.                 <tr>
  118.                      <td></td>
  119.                       <td align="left" colspan="2" class="V12"><?php echo "$created_lang $start_date"; ?></td>
  120.                 </tr>
  121.  
  122.                 <?php if ($due_date) { ?>
  123.                 <tr>
  124.                      <td></td>
  125.                       <td align="left" colspan="2" class="V12"><?php echo "$due_lang $due_date"; ?></td>
  126.                 </tr>
  127.                 <?php } ?>
  128.                 
  129.        </table>
  130.    </td>
  131.     </tr>
  132. </table> 
  133. </center>
  134. </body>
  135. </html>
  136.