[Weberp-svn] SF.net SVN: weberp:[4222] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-01-09 19:35:20
|
Revision: 4222 http://weberp.svn.sourceforge.net/weberp/?rev=4222&view=rev Author: tim_schofield Date: 2011-01-09 19:35:13 +0000 (Sun, 09 Jan 2011) Log Message: ----------- Correct the quotes in the sql literals Modified Paths: -------------- trunk/includes/GetConfig.php trunk/includes/GetPaymentMethods.php trunk/includes/MiscFunctions.php trunk/reportwriter/WriteForm.inc trunk/reportwriter/WriteReport.inc Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2011-01-09 19:26:30 UTC (rev 4221) +++ trunk/includes/GetConfig.php 2011-01-09 19:35:13 UTC (rev 4222) @@ -5,7 +5,7 @@ if(isset($ForceConfigReload) and $ForceConfigReload==TRUE OR !isset($_SESSION['CompanyDefaultsLoaded'])) { global $db; // It is global, we may not be. - $sql = 'SELECT confname, confvalue FROM config'; + $sql = "SELECT confname, confvalue FROM config"; $ErrMsg = _('Could not get the configuration parameters from the database because'); $ConfigResult = DB_query($sql,$db,$ErrMsg); while( $myrow = DB_fetch_row($ConfigResult) ) { @@ -23,7 +23,7 @@ /*Load the pagesecurity settings from the database */ if (DB_table_exists('pagesecurity', $db)) { - $sql='SELECT script, security FROM pagesecurity'; + $sql="SELECT script, security FROM pagesecurity"; $ErrMsg = _('Could not get the page security details from the database because'); $result=DB_query($sql, $db); @@ -41,7 +41,7 @@ /* Also reads all the company data set up in the company record and returns an array */ - $sql= 'SELECT coyname, + $sql= "SELECT coyname, gstno, regoffice1, regoffice2, @@ -66,7 +66,7 @@ gllink_creditors, gllink_stock FROM companies - WHERE coycode=1'; + WHERE coycode=1"; $ErrMsg = _('An error occurred accessing the database to retrieve the company information'); $ReadCoyResult = DB_query($sql,$db,$ErrMsg); @@ -80,7 +80,7 @@ } /*Now read in smtp email settings - not needed in a properly set up server environment - but helps for those who can't control their server .. I think! */ - $sql='SELECT id, + $sql="SELECT id, host, port, heloaddress, @@ -88,7 +88,7 @@ password, timeout, auth - FROM emailsettings'; + FROM emailsettings"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); Modified: trunk/includes/GetPaymentMethods.php =================================================================== --- trunk/includes/GetPaymentMethods.php 2011-01-09 19:26:30 UTC (rev 4221) +++ trunk/includes/GetPaymentMethods.php 2011-01-09 19:35:13 UTC (rev 4222) @@ -4,11 +4,11 @@ $PaytTypes = array(); $ReceiptTypes = array(); -$sql = 'SELECT paymentname, - paymenttype, - receipttype - FROM paymentmethods - ORDER by paymentname'; +$sql = "SELECT paymentname, + paymenttype, + receipttype + FROM paymentmethods + ORDER by paymentname"; $PMResult = DB_query($sql,$db); while( $PMrow = DB_fetch_array($PMResult) ) { if ($PMrow['paymenttype']==1) Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-01-09 19:26:30 UTC (rev 4221) +++ trunk/includes/MiscFunctions.php 2011-01-09 19:35:13 UTC (rev 4222) @@ -234,14 +234,14 @@ }//wikiLink function DecimalPlaces($currcode, $db) { - $sql='SELECT decimalplaces FROM currencies WHERE currabrev="'.$currcode.'"'; + $sql="SELECT decimalplaces FROM currencies WHERE currabrev='".$currcode."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); return $myrow['decimalplaces']; } function StockDecimalPlaces($StockID, $db) { - $sql='SELECT decimalplaces FROM stockmaster WHERE stockid="'.$StockID.'"'; + $sql="SELECT decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); return $myrow['decimalplaces']; Modified: trunk/reportwriter/WriteForm.inc =================================================================== --- trunk/reportwriter/WriteForm.inc 2011-01-09 19:26:30 UTC (rev 4221) +++ trunk/reportwriter/WriteForm.inc 2011-01-09 19:35:13 UTC (rev 4222) @@ -31,7 +31,7 @@ $this->SetFont('Helvetica'); $this->SetDrawColor(128,0,0); $this->SetLineWidth(.35); // 1 point - + if ($_SESSION['Language']=='zh_CN'){ $this->AddBig5Font(); } elseif ($_SESSION['Language']=='ja_JP'){ @@ -46,25 +46,25 @@ $i=0; // set sequence to pull data fields should be sorted by seqnum foreach ($FieldListings as $SingleObject) { switch ($SingleObject['params']['index']) { - case "Data": + case "Data": $SingleObject['params']['TextField'] = $FieldValues[$i]; // fill the data to display $i++; // increment to the next field - case "TBlk": // same operation as page number - case "Text": - case "CDta": - case "CBlk": - case "PgNum": - $this->FormText($SingleObject['params']); + case "TBlk": // same operation as page number + case "Text": + case "CDta": + case "CBlk": + case "PgNum": + $this->FormText($SingleObject['params']); break; - case "Img": - $this->FormImage($SingleObject['params']); + case "Img": + $this->FormImage($SingleObject['params']); break; - case "Line": - $this->FormLine($SingleObject['params']); + case "Line": + $this->FormLine($SingleObject['params']); break; - case "Rect": - $this->FormRect($SingleObject['params']); + case "Rect": + $this->FormRect($SingleObject['params']); break; default: // do nothing @@ -116,7 +116,7 @@ } elseif ($Params['LineType']=='3') { // Custom $XEnd = $Params['LineXEnd']; $YEnd = $Params['LineYEnd']; - } + } $this->Line($Params['LineXStrt'],$Params['LineYStrt'],$XEnd,$YEnd); } @@ -126,7 +126,7 @@ if ($Params['Line']=='0') { // No Border $this->SetDrawColor(255); $this->SetLineWidth(0); - } else { + } else { $DrawFill = 'D'; if ($Params['Line']=='2') $RGB=$Params['BrdrRed'].':'.$Params['BrdrGreen'].':'.$Params['BrdrBlue']; else $RGB=$Params['BrdrColor']; @@ -156,7 +156,7 @@ $this->SetTextColor($FC[0],$FC[1],$FC[2]); if ($Params['Line']=='0') { // No Border $Border = '0'; - } else { + } else { $Border = '1'; if ($Params['Line']=='2') $RGB=$Params['BrdrRed'].':'.$Params['BrdrGreen'].':'.$Params['BrdrBlue']; else $RGB=$Params['BrdrColor']; @@ -166,7 +166,7 @@ } if ($Params['Fill']=='0') { // No Fill $Fill = '0'; - } else { + } else { $Fill = '1'; if ($Params['Fill']=='2') $RGB=$Params['FillRed'].':'.$Params['FillGreen'].':'.$Params['FillBlue']; else $RGB=$Params['FillColor']; @@ -206,8 +206,8 @@ } $this->SetLeftMargin($Params['LineXStrt']); $this->SetXY($Params['LineXStrt'], $this->y0); - // Fill with Fill color if it's time - if ($FillThisRow AND $Params['Fill']) $this->SetFillColor($FC[0],$FC[1],$FC[2]); + // Fill with Fill color if it's time + if ($FillThisRow AND $Params['Fill']) $this->SetFillColor($FC[0],$FC[1],$FC[2]); else $this->SetFillColor(255); $this->Cell($Params['BoxWidth'],$MaxBoxY-$this->y0,'',0,0,'L',1); // fill in the data @@ -232,7 +232,7 @@ $CellHeight = ($Params['Seq'][$Col]['FontSize']+RowSpace)*0.35; // if ($trunc) $value=$this->TruncData($value, $Params['Seq'][$Col]['TblColWidth']); if ($Heading) { // center the heading - $FA='C'; + $FA='C'; } else { $FA=$Params['Seq'][$Col]['FontAlign']; if (isset($Params['Seq'][$Col]['Processing'])) $value = $this->ProcessData($value, $Params['Seq'][$Col]['Processing']); @@ -303,11 +303,11 @@ global $FieldListings, $FieldValues; // first fetch all the fields we need to display $FieldListings = ''; - $sql = "SELECT seqnum, params FROM ".DBRptFields." + $sql = "SELECT seqnum, params FROM ".DBRptFields." WHERE reportid=".$ReportID." AND entrytype='fieldlist' AND visible=1 ORDER BY seqnum"; $Result=DB_query($sql,$db,'','',false,true); - while ($FieldValues = DB_fetch_assoc($Result)) { + while ($FieldValues = DB_fetch_assoc($Result)) { $FieldValues['params'] = unserialize($FieldValues['params']); $FieldListings[] = $FieldValues; } @@ -323,7 +323,7 @@ foreach ($FieldListings as $OneField) { // check for a data field and build sql field list if ($OneField['params']['index']=='Data') { // then it's data field make sure it's not empty if ($OneField['params']['DataField']<>'') { - $strField .= $OneField['params']['DataField'].', '; + $strField .= $OneField['params']['DataField'].', '; } else { // the field is empty, bad news, error and exit $usrMsg['message'] = RPT_EMPTYFIELD.$OneField['seqnum']; $usrMsg['level'] = 'error'; @@ -332,7 +332,7 @@ } } // strip the extra comma, space and continue - $strField = substr($strField,0,-2); + $strField = substr($strField,0,-2); // fetch date filter info $df = $Prefs['DateListings']['fieldname']; @@ -341,15 +341,15 @@ $ThisMonth = substr($Today,5,2); $ThisYear = substr($Today,0,4); // find total number of days in this month - if ($ThisMonth=='04' OR $ThisMonth=='06' OR $ThisMonth=='09' OR $ThisMonth=='11') { - $TotalDays=30; - } elseif ($ThisMonth=='02' AND date('L')) { - $TotalDays=29; + if ($ThisMonth=='04' OR $ThisMonth=='06' OR $ThisMonth=='09' OR $ThisMonth=='11') { + $TotalDays=30; + } elseif ($ThisMonth=='02' AND date('L')) { + $TotalDays=29; } // Leap year - elseif ($ThisMonth=='02' AND !date('L')) { - $TotalDays=28; - } else { - $TotalDays=31; + elseif ($ThisMonth=='02' AND !date('L')) { + $TotalDays=28; + } else { + $TotalDays=31; } // Calculate date range $DateArray=explode(':',$Prefs['DateListings']['params']); @@ -388,8 +388,8 @@ case "h": // RPT_GROUP_QUARTER $QtrStrt = intval(($ThisMonth-1)/3)*3+1; $QtrEnd = intval(($ThisMonth-1)/3)*3+3; - if ($QtrEnd==4 OR $QtrEnd==6 OR $QtrEnd==9 OR $QtrEnd==11) { - $TotalDays=30; + if ($QtrEnd==4 OR $QtrEnd==6 OR $QtrEnd==9 OR $QtrEnd==11) { + $TotalDays=30; } $qs = date('Y-m-d', mktime(0,0,0, $QtrStrt, 1, $ThisYear)); $qe = date('Y-m-d', mktime(0,0,0, $QtrEnd, $TotalDays, $ThisYear)); @@ -412,7 +412,7 @@ // Fetch the Criteria $strCrit = ''; - if (is_array($Prefs['CritListings'])) while ($FieldValues = array_shift($Prefs['CritListings'])) { + if (is_array($Prefs['CritListings'])) while ($FieldValues = array_shift($Prefs['CritListings'])) { $Params = explode(':',$FieldValues['params']); switch ($Params[1]) { case RPT_RANGE: @@ -440,7 +440,7 @@ case RPT_UNPRINTED: if (strlen($strCrit)>0) $strCrit .= ' AND '; $strCrit .= $FieldValues['fieldname'].'=0'; - break; + break; case RPT_STOCK: // TBD field to compare so default to nothing case RPT_ASSEMBLY: // TBD field to compare so default to nothing case RPT_ALL: // sql default anyway @@ -464,9 +464,9 @@ // We now have the sql, find out how many groups in the query (to determine the number of forms) $PageBreakField = $Prefs['GroupListings'][0]['fieldname']; - $sql = 'SELECT '.$PageBreakField.' FROM '.$sqlTable; + $sql = "SELECT ".$PageBreakField." FROM ".$sqlTable; if ($sqlCrit) $sql .=' WHERE '.$sqlCrit; - $sql .=' GROUP BY '.$PageBreakField; + $sql .=" GROUP BY ".$PageBreakField; // execute sql to see if we have data $Result=DB_query($sql,$db,'','',false,true); if (DB_num_rows($Result)==0) { @@ -482,7 +482,7 @@ foreach ($FieldListings as $OneField) { // check for a data field and build sql field list if ($OneField['params']['index']=='CDta') { // then it's data field make sure it's not empty if ($OneField['params']['DataField']<>'') { - $strTxtBlk .= $OneField['params']['DataField'].', '; + $strTxtBlk .= $OneField['params']['DataField'].', '; } else { // the field is empty, bad news, error and exit $usrMsg['message'] = RPT_EMPTYFIELD.$OneField['seqnum']; $usrMsg['level'] = 'error'; @@ -491,7 +491,7 @@ } } if ($strTxtBlk<>'') { // then we have data, fill in TextField value with data - $strTxtBlk = substr($strTxtBlk,0,-2); + $strTxtBlk = substr($strTxtBlk,0,-2); $sql = "SELECT ".$strTxtBlk." FROM ".CompanyDataBase." LIMIT 1;"; $Result=DB_query($sql,$db,'','',false,true); $CoyData = DB_fetch_row($Result); @@ -512,8 +512,8 @@ return $usrMsg; } $strTxtBlk=''; // Build the fieldlist - foreach ($SingleObject['params']['Seq'] as $OneField) $strTxtBlk .= $OneField['TblField'].', '; - $strTxtBlk = substr($strTxtBlk,0,-2); + foreach ($SingleObject['params']['Seq'] as $OneField) $strTxtBlk .= $OneField['TblField'].', '; + $strTxtBlk = substr($strTxtBlk,0,-2); $sql = "SELECT ".$strTxtBlk." FROM ".CompanyDataBase." LIMIT 1;"; $Result=DB_query($sql,$db,'','',false,true); $TxtBlkValues = DB_fetch_row($Result); @@ -540,8 +540,8 @@ return $usrMsg; } $strTxtBlk=''; // Build the fieldlist - foreach ($SingleObject['params']['Seq'] as $OneField) $strTxtBlk .= $OneField['TblField'].', '; - $strTxtBlk = substr($strTxtBlk,0,-2); + foreach ($SingleObject['params']['Seq'] as $OneField) $strTxtBlk .= $OneField['TblField'].', '; + $strTxtBlk = substr($strTxtBlk,0,-2); $sql = "SELECT ".$strTxtBlk.$TrailingSQL; $Result=DB_query($sql,$db,'','',false,true); $TxtBlkValues = DB_fetch_row($Result); @@ -554,7 +554,7 @@ $pdf->AddPage(); // Pre-load all total fields with 'Continued' label for multipage foreach ($FieldListings as $key=>$SingleObject) { - if ($SingleObject['params']['index']=='Ttl') + if ($SingleObject['params']['index']=='Ttl') $FieldListings[$key]['params']['TextField'] = 'Continued'; } // Send the table Modified: trunk/reportwriter/WriteReport.inc =================================================================== --- trunk/reportwriter/WriteReport.inc 2011-01-09 19:26:30 UTC (rev 4221) +++ trunk/reportwriter/WriteReport.inc 2011-01-09 19:35:13 UTC (rev 4222) @@ -6,7 +6,7 @@ var $y0; // current y position var $x0; // current x position var $pageY; // y value of bottom of page less bottom margin - + function PDF() { global $Prefs; $PaperSize = explode(':',$Prefs['papersize']); @@ -18,14 +18,14 @@ } $this->SetMargins($Prefs['marginleft'], $Prefs['margintop'], $Prefs['marginright']); $this->SetAutoPageBreak(0, $Prefs['marginbottom']); - + $this->SetDrawColor(128,0,0); $this->SetLineWidth(.35); // 1 point $this->AliasNbPages(); $this->AddPage(); - + } - + function Header() { global $Prefs, $Heading, $Seq; define(RowSpace,2); // define separation between the heading rows @@ -67,14 +67,14 @@ // Fetch the column break array foreach ($Seq as $Temp) { if ($Temp['break']) { - $ColBreak[] = true; + $ColBreak[] = true; } else { $ColBreak[] = false; } } // See if we need to truncate the data if ($Prefs['TruncListings']['params']=='1') { - $trunc=true; + $trunc=true; } else { $trunc=false; } @@ -91,7 +91,7 @@ $value=$this->TruncData($value, $Prefs['col'.$col.'width']); } $this->MultiCell($CellXPos[$col]-$CellXPos[$col-1],$CellHeight,$value); - if ($ColBreak[$key]) { + if ($ColBreak[$key]) { $col++; $LastY = $this->y0; } else $LastY = $this->GetY(); @@ -104,7 +104,7 @@ $this->Cell(0,$maxY-$this->y0,' ','B'); $this->y0=$maxY+0.35; } - + function SubTitle($Title) { global $Prefs; // substitutes a command string with current information @@ -112,7 +112,7 @@ $Title=preg_replace('/%reportname%/', $Prefs['reportname'], $Title); return $Title; } - + function Footer() { //Position at 1.5 cm from bottom $this->SetY(-15); @@ -121,10 +121,10 @@ //Page number $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); } - + function ReportTable($Data) { global $Prefs, $Seq; - + $FillColor = array(224, 235, 255); $this->SetFillColor($FillColor[0],$FillColor[1],$FillColor[2]); $Colors = explode(':',$Prefs['datafontcolor']); @@ -143,7 +143,7 @@ } // See if we need to truncate the data if ($Prefs['TruncListings']['params']=='1') { - $trunc=true; + $trunc=true; } else { $trunc=false; } @@ -185,15 +185,15 @@ // now fall into the 'd' case to show the data case "d": // data element default: - // figure out if a border needs to be drawn for total separation + // figure out if a border needs to be drawn for total separation // and fill color (draws an empty box over the row just written with the fill color) $brdr = 0; if ($NeedTop=='Yes') { - $brdr='T'; + $brdr='T'; $fill=false; // set so first data after total will not be filled $NeedTop='No'; } elseif ($NeedTop=='Next') { - $brdr='LR'; + $brdr='LR'; $NeedTop='Yes'; } // Draw a fill box @@ -223,7 +223,7 @@ // truncate data if necessary if ($trunc) $value=$this->TruncData($value, $Prefs['col'.$col.'width']); $this->MultiCell($CellXPos[$col]-$CellXPos[$col-1],$CellHeight,$value,0); - if ($ColBreak[$key]) { + if ($ColBreak[$key]) { $col++; $LastY = $this->y0; } else $LastY = $this->GetY(); @@ -244,7 +244,7 @@ $this->SetFillColor(255); $this->Cell(0,$this->pageY-$this->y0,'','T',0,'L',1); } - + function TruncData($strData, $ColWidth) { $percent=0.90; //percent to truncate from max to account for proportional spacing $CurWidth = $this->GetStringWidth($strData); @@ -257,7 +257,7 @@ } return $strData; } - + function Stream($FileName) { $this->Output($FileName,'D'); } @@ -267,8 +267,8 @@ function BuildSQL($Prefs) { //fetch the listing fields (must have at least one) to build select field $strField = ''; - if (is_array($Prefs['FieldListings'])) while ($FieldValues = array_shift($Prefs['FieldListings'])) { - if ($FieldValues['visible']) $strField .= $FieldValues['fieldname'].', '; + if (is_array($Prefs['FieldListings'])) while ($FieldValues = array_shift($Prefs['FieldListings'])) { + if ($FieldValues['visible']) $strField .= $FieldValues['fieldname'].', '; } // check for at least one field selected to show if (!$strField) { // No fields are checked to show, that's bad @@ -281,16 +281,16 @@ $Prefs['filterdesc'] = RPT_RPTFILTER; // Initialize the filter display string //fetch the groupings and build first level of SORT BY string (for sub totals) $strGroup = ''; - if (is_array($Prefs['GroupListings'])) while ($FieldValues = array_shift($Prefs['GroupListings'])) { + if (is_array($Prefs['GroupListings'])) while ($FieldValues = array_shift($Prefs['GroupListings'])) { if ($FieldValues['params']=='1') { // then it's the group by field match - $strGroup .= $FieldValues['fieldname']; + $strGroup .= $FieldValues['fieldname']; $Prefs['filterdesc'] .= ' '.RPT_GROUPBY.' '.$FieldValues['displaydesc'].';'; break; } } // fetch the sort order and add to group by string to finish ORDER BY string $strSort = $strGroup; - if (is_array($Prefs['SortListings'])) while ($FieldValues = array_shift($Prefs['SortListings'])) { + if (is_array($Prefs['SortListings'])) while ($FieldValues = array_shift($Prefs['SortListings'])) { if ($FieldValues['params']=='1') { // then it's the sort by field match if ($strSort=='') $strSort=$FieldValues['fieldname']; else $strSort.=', '.$FieldValues['fieldname']; $Prefs['filterdesc'] .= ' '.RPT_SORTBY.' '.$FieldValues['displaydesc'].';'; @@ -328,7 +328,7 @@ $d .= $df."<='".FormatDateForSQL($DateArray[2])."'"; $fildesc .= ' '.RPT_TO.' '.$DateArray[1]; } - $fildesc .= ';'; + $fildesc .= ';'; break; case "c": // RPT_GROUP_TODAY $d = $df."='".$Today."'"; @@ -397,7 +397,7 @@ // Fetch the Criteria $strCrit = ''; $filCrit = ''; - if (is_array($Prefs['CritListings'])) while ($FieldValues = array_shift($Prefs['CritListings'])) { + if (is_array($Prefs['CritListings'])) while ($FieldValues = array_shift($Prefs['CritListings'])) { $Params = explode(':',$FieldValues['params']); switch ($Params[1]) { case RPT_RANGE: @@ -433,7 +433,7 @@ $strCrit .= $FieldValues['fieldname'].'=0'; if (strlen($filCrit)>0) $filCrit .= ' AND '; $filCrit .= $FieldValues['displaydesc'].'='.$Params[1]; - break; + break; case RPT_STOCK: // TBD field to compare so default to nothing case RPT_ASSEMBLY: // TBD field to compare so default to nothing case RPT_ALL: // sql default anyway @@ -447,7 +447,7 @@ if ($Prefs['table3']) $strTable .= ' INNER JOIN '.$Prefs['table3']. ' ON '.$Prefs['table3criteria']; if ($Prefs['table4']) $strTable .= ' INNER JOIN '.$Prefs['table4']. ' ON '.$Prefs['table4criteria']; // Build query string and execute - $sql = 'SELECT '.$strField.' FROM '.$strTable; + $sql = "SELECT ".$strField." FROM ".$strTable; if ($strCrit AND $strDate) $sql .= ' WHERE '.$strDate.' AND '.$strCrit; if (!$strCrit AND $strDate) $sql .= ' WHERE '.$strDate; if ($strCrit AND !$strDate) $sql .= ' WHERE '.$strCrit; @@ -503,7 +503,7 @@ $GrpWorking = $myrow[$GrpField]; // set to new grouping value } $OutputArray[$RowCnt][0] = 'd'; // let the display class know its a data element - foreach($Seq as $key=>$TableCtl) { // + foreach($Seq as $key=>$TableCtl) { // // insert data into output array and set to next column $OutputArray[$RowCnt][$ColCnt] = $myrow[$key]; $ColCnt++; @@ -527,7 +527,7 @@ } // see if we have a total to send $ShowTotals = false; - foreach($Seq as $TotalCtl) if ($TotalCtl['total']=='1') $ShowTotals = true; + foreach($Seq as $TotalCtl) if ($TotalCtl['total']=='1') $ShowTotals = true; if ($ShowTotals) { $OutputArray[$RowCnt][0] = 'r:'.$Prefs['reportname']; foreach($Seq as $TotalCtl) { @@ -577,7 +577,7 @@ header('Expires: '.date('r', time()+60*60)); header('Last-Modified: '.date('r', time())); print $CSVOutput; - exit(); + exit(); } function GeneratePDFFile($Data, $Prefs) { @@ -586,14 +586,14 @@ $pdfcode = $pdf->output(); $len = strlen($pdfcode); $ReportName = ReplaceNonAllowedCharacters($Prefs['reportname']) .'.pdf'; - + header('Content-type: application/pdf'); header('Content-Length: ' . $len); header('Content-Disposition: inline; filename="' . $ReportName . '"'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); - + $pdf->Stream($ReportName); exit(); // needs to be here to properly render the pdf file. } @@ -603,9 +603,9 @@ $DodgyCharactersArray = array('"',' ', '&',"'"); $ContainsDodgyCharacters = true; while ($ContainsDodgyCharacters == true){ - + $ContainsDodgyCharacters = false; //assume all dodgy characters are replaced on the last pass - + foreach ($DodgyCharactersArray as $DodgyCharacter){ if (strpos($String,$DodgyCharacter,0)){ $StrPointer = strpos($String,$DodgyCharacter,0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |