File: PHPReportRow.php

package info (click to toggle)
phpreports 0.4.9-2.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 684 kB
  • ctags: 1,426
  • sloc: php: 3,377; xml: 203; makefile: 29; sql: 18; sh: 17; python: 10
file content (85 lines) | stat: -rwxr-xr-x 1,607 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
	class PHPReportRow {
		var $_aCols;	// columns array

		function PHPReportRow() {
			$this->_aCols=Array(); 
		}

		/*
			Add a column in the row
		*/
		function addCol(&$oCol_) {
			array_push($this->_aCols,$oCol_);
		}

		function &getCols() {
			return $this->_aCols;
		}

		/*
			Returns the XML open tag
		*/
		function getXMLOpen() {
			return "<R>";
		}
	
		
		/*
			Returns the XML close tag
		*/
		function getXMLClose() {
			return "</R>";
		}

		/**
			Prints the row (and all the columns inside of it)
			@param tabs - the tabs that must be inserted before this element
			@param row number - this row number
		*/
		function getRowValue($iRow_=0) {
			$sTabs=""; //"\t\t";
			$sStr	= $sTabs.$this->getXMLOpen(); // there was a \n here on the end
			$iSize=sizeof($this->_aCols);	
			$sSep1=""; // \t
			$sSep2=""; // \n
			
			for($i=0;$i<$iSize;$i++) {
				$oCol	 =& $this->_aCols[$i];
				$oVal  = $oCol->getColValue($iRow_);
				$sStr .= $sSep1.$sTabs.$oVal.$sSep2;
			}
			$sStr.= $sTabs.$this->getXMLClose()."\n";
			return $sStr;
		}

		/**
			Returns the row expression
		*/
		function getExpr(){
			$sStr = "";
			$iSize=sizeof($this->_aCols);	
			for($i=0;$i<$iSize;$i++) {
				$oCol	=& $this->_aCols[$i];
				$sStr .= $oCol->getExpr();
			}
			return $sStr;
		}

		function resetOldValue() {
			$iSize=sizeof($this->_aCols);	
			for($i=0;$i<$iSize;$i++) {
				$oCol	=& $this->_aCols[$i];
				$oCol->resetOldValue();	
			}
		}

		function debug() {
			$iSize=sizeof($this->_aCols);
			for($i=0;$i<$iSize;$i++) {
				$oCol =& $this->_aCols[$i];
				$oCol->debug();
			}
		}
	}
?>