. * * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. * */ /** * Jrml - Jrml class * @package workflow.engine.ProcessMaker * @author Maborak * @copyright 2008 COLOSA */ class Jrml { public $rows; public $sql; private $data; /** * This function is the constructor of the class Jrml * @param array $data * @return void */ function __construct($data=array()) { $this->data = $data; $this->sql = $data['sql']; $this->rows = $this->get_rows($data['type']); $this->md = $this->get_md(); } /** * This function is for get rows * @param array $a * @return array */ private function get_rows($a) { $b=array(); foreach ($a as $key=>$value){ $b[]=$key; } return $b; } public function get_md() { } /** * This function is for get the header * @return string */ public function get_header() { $xml="sql}]]>"; foreach ($this->data['type'] as $key=>$value) { $xml.=""; } $xml.=""; $xml.=' <band height="58"> <line> <reportElement x="0" y="8" width="555" height="1"/> </line> <line> <reportElement positionType="FixRelativeToBottom" x="0" y="51" width="555" height="1"/> </line> <staticText> <reportElement x="65" y="13" width="424" height="35"/> <textElement textAlignment="Center"> <font size="26" isBold="true"/> </textElement> <text><![CDATA['.$this->data['title'].']]></text> </staticText> </band> '; return $xml; } /** * This function is for get a column of the header * @return string */ public function get_column_header() { $xml=""; $w = (int)($this->data['columnWidth']/sizeof($this->rows)); $i=0; foreach ($this->data['type'] as $key=>$value) { $xml.=" "; $i=$i+$w; } $xml.=" "; return $xml; } /** * This function is for get the detail * @return string */ public function get_detail() { $xml=''; $w = (int)($this->data['columnWidth']/sizeof($this->rows)); $i=0; foreach ($this->data['type'] as $key=>$value) { $xml.=""; $i=$i+$w; } $xml.=''; return $xml; } /** * This function is for get the footer * @return string */ public function get_footer() { $xml=' '; return $xml; } /** * This function is for export * @return string */ public function export() { $xml=' '; $xml.=$this->get_header(); $xml.=$this->get_column_header(); $xml.=$this->get_detail(); $xml.=$this->get_footer(); $xml.=''; return $xml; } }