Changeset 731
- Timestamp:
- 01/08/10 10:43:14 (2 years ago)
- Location:
- trunk/phpbms/modules/mailchimp/report
- Files:
-
- 1 removed
- 1 modified
-
basic_mc.php (deleted)
-
client_mailchimp_export.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/modules/mailchimp/report/client_mailchimp_export.php
r704 r731 37 37 +-------------------------------------------------------------------------+ 38 38 */ 39 40 require("../../../include/session.php");41 42 class MCReport {39 if(!class_exists("phpbmsReport")) 40 include("../../../report/report_class.php"); 41 42 class MCReport extends phpbmsReport{ 43 43 44 44 var $selectcolumns; … … 47 47 var $reportOutput = ""; 48 48 49 function MCReport($db,$variables = NULL){ 50 $this->db = $db; 49 function MCReport($db, $reportUUID, $tabledefUUID, $variables = NULL){ 50 51 parent::phpbmsReport($db, $reportUUID, $tabledefUUID); 51 52 52 53 //next we do the columns … … 61 62 62 63 63 if($variables){ 64 //$tempArray = explode("::", $variables["columns"]); 65 $tempArray = json_decode($variables["columns"], true); 66 67 foreach($tempArray as $id) 68 $this->selectcolumns[] = $this->columns[$id]; 69 $this->selectcolumns = array_reverse($this->selectcolumns); 70 71 $this->selecttable = "`clients`"; 72 73 $this->whereclause = $_SESSION["printing"]["whereclause"]; 74 if($this->whereclause=="") $this->whereclause="WHERE clients.id != -1"; 75 76 if($this->whereclause!="") $this->whereclause=" WHERE (".substr($this->whereclause,6).") "; 77 }// endif 64 $this->selecttable = "`clients`"; 78 65 79 66 }//end method 80 67 68 69 function processFromPost($variables){ 70 71 $tempArray = json_decode($variables["columns"], true); 72 73 foreach($tempArray as $id) 74 $this->selectcolumns[] = $this->columns[$id]; 75 $this->selectcolumns = array_reverse($this->selectcolumns); 76 77 78 }//end function processFromPost 79 80 81 function processFromSettings(){ 82 83 foreach($this->settings as $key=>$value) 84 if(strpos($key, "column") === 0) 85 $this->selectcolumns[substr($key,6)-1] = $this->columns[$value]; 86 87 ksort($this->selectcolumns); 88 $this->selectcolumns = array_reverse($this->selectcolumns); 89 90 }//end function processFromSettings 81 91 82 92 function addColumn($name, $field, $format = NULL){ … … 91 101 92 102 function generate(){ 103 104 $this->whereClause = $_SESSION["printing"]["whereclause"]; 105 if($this->whereClause=="") 106 $this->whereclause="WHERE clients.id != -1"; 107 108 if($this->whereClause!="") 109 $this->whereClause = " WHERE (".substr($this->whereClause,6).") "; 93 110 94 111 $querystatement = "SELECT "; … … 234 251 }//endclass 235 252 236 // Processing =================================================================================================================== 237 if(!isset($dontProcess)){ 253 254 /** 255 * PROCESSING 256 * ============================================================================= 257 */ 258 if(!isset($noOutput)){ 259 260 require("../../../include/session.php"); 261 262 checkForReportArguments(); 263 264 $report = new MCReport($db, $_GET["rid"], $_GET["tid"]); 265 238 266 if(isset($_POST["columns"])){ 239 $myreport= new MCReport($db,$_POST); 240 $myreport->generate(); 241 $myreport->output(); 267 268 $report->processFromPost($_POST); 269 $report->generate(); 270 $report->output(); 271 272 } elseif(isset($report->settings["column1"])) { 273 274 $report->processFromSettings(); 275 $report->generate(); 276 $report->output(); 277 242 278 } else { 243 //$myreport = new MCReport($db); 244 //$myreport->showSelectScreen(); 245 } 246 }?> 279 280 $report->showSelectScreen(); 281 282 }//endif 283 284 }//endif 285 286 /** 287 * When adding a new report record, the add/edit needs to know what the class 288 * name is so that it can instantiate it, and grab it's default settings. 289 */ 290 if(isset($addingReportRecord)) 291 $reportClass = "MCReport"; 292 ?>