- Timestamp:
- 01/01/10 23:10:02 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/modules/mailchimp/report/client_mailchimp_export.php
r703 r704 49 49 function MCReport($db,$variables = NULL){ 50 50 $this->db = $db; 51 51 52 52 //next we do the columns 53 53 $this->addColumn("Email","`email`");//0 … … 56 56 $this->addColumn("Company","`company`");//3 57 57 $this->addColumn("Uuid","`uuid`");//4 58 58 59 59 $this->addColumn("Type","`type`");//5 60 60 $this->addColumn("Id","`id`");//6 61 61 62 62 63 63 if($variables){ … … 68 68 $this->selectcolumns[] = $this->columns[$id]; 69 69 $this->selectcolumns = array_reverse($this->selectcolumns); 70 70 71 71 $this->selecttable = "`clients`"; 72 72 … … 76 76 if($this->whereclause!="") $this->whereclause=" WHERE (".substr($this->whereclause,6).") "; 77 77 }// endif 78 78 79 79 }//end method 80 80 … … 88 88 $this->columns[] = $temp; 89 89 }//end method 90 91 90 91 92 92 function generate(){ 93 93 94 94 $querystatement = "SELECT "; 95 95 foreach($this->selectcolumns as $thecolumn) … … 97 97 $querystatement = substr($querystatement, 0, -1); 98 98 $querystatement .= " FROM ".$this->selecttable.$this->whereclause; 99 99 100 100 $queryresult = $this->db->query($querystatement); 101 101 102 102 $num_fields = $this->db->numFields($queryresult); 103 103 104 104 for($i=0;$i<$num_fields;$i++) 105 105 $this->reportOutput .= ",".$this->db->fieldName($queryresult, $i); … … 123 123 $this->reportOutput = substr($this->reportOutput, 0, strlen($this->reportOutput)-1); 124 124 } 125 126 125 126 127 127 function output(){ 128 128 129 129 header("Content-type: text/plain"); 130 130 header('Content-Disposition: attachment; filename="clients_mailchimp_export.csv"'); 131 131 132 132 echo $this->reportOutput; 133 133 134 134 }//end function --output-- 135 135 136 136 137 137 function showOptions($what){ … … 164 164 <div class="bodyline"> 165 165 <h1>Invoice Total Options</h1> 166 <form id="GroupForm" action="<?php echo $_SERVER["PHP_SELF"]?>" method="post" name="GroupForm">166 <form id="GroupForm" action="<?php echo htmlentities($_SERVER["PHP_SELF"])?>" method="post" name="GroupForm"> 167 167 168 168 <fieldset>