linea21-modules
[ class tree: linea21-modules ] [ index: linea21-modules ] [ all elements ]

Source for file timeline-xml.php

Documentation is available at timeline-xml.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage project
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10. include_once('../config/define.php');
  11. include_once("./".SQL.".inc.php");
  12.  
  13. header('Content-type: application/xml; charset='.CHARSET);
  14. $req_list_projects=SQL_getProjectsList(0, 999, '');
  15. $items=$sql_object->DBSelect($req_list_projects);
  16.  
  17.  
  18.  
  19. $sxe = simplexml_load_string("<?xml version=\"1.0\" encoding=\"".CHARSET."\" ?><data></data>");
  20.  
  21. foreach($items as $item){
  22.  
  23.   $s_date = date_rfc2822($item['project_begin_date_display']);
  24.   $es_date = date_rfc2822($item['project_estimated_date_display']);
  25.   $e_date = date_rfc2822($item['project_end_date_display']);
  26.  
  27.  
  28.   if($s_date != false) {
  29.  
  30.     $child = $sxe->addChild('event', formatText($item['project_description'], '2FILE'));
  31.     $child->addAttribute('start', $s_date);
  32.  
  33.  
  34.     if($e_date != false)  {
  35.       $child->addAttribute('end', $e_date);
  36.       $child->addAttribute('color', '#0a0');
  37.       $child->addAttribute('durationEvent', 'true');
  38.     } else {
  39.       if($es_date != false) {
  40.         $child->addAttribute('end', $es_date);
  41.         $child->addAttribute('color', 'orange');
  42.         $child->addAttribute('durationEvent', 'true');
  43.       } else {
  44.         $child->addAttribute('color', '#FC2916');
  45.         $child->addAttribute('icon', '../templates/admin/default/images/timeline-red.png');
  46.       }
  47.     }
  48.     $child->addAttribute('title', $item['complete_project_name']);
  49.     $child->addAttribute('caption', $item['complete_project_name']);
  50.     //$child->addAttribute('classname', 'hot_event');
  51.  
  52.     $child->addAttribute('link', '../admin/?rub=project&todo=det&id='.$item['project_id']);
  53.   }
  54. }
  55.  
  56. echo $sxe->asXML();
  57.  
  58. ?>

Documentation generated on Thu, 20 Mar 2014 16:49:37 +0100 by phpDocumentor 1.4.1