phpBMS

Changeset 673

Show
Ignore:
Timestamp:
11/04/09 12:11:05 (3 years ago)
Author:
nate
Message:
  • Added relevant filenames to pdf reports.
    • Sales order and receipt based pdfs have had the company name of the client and the id of the sales order or receipt added. Multipile sales orders add "multiple" instead.
    • Label pdfs have had a relevant company name added. Multiple clients add "multiple" instead.
    • The note summary pdf has had the note id added. Multiple notes add "multiple" instead.
    • The aritems clientstatement pdf has had a relevant date added.
  • Work was based off of patch in ticket #334.
Location:
trunk/phpbms
Files:
16 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/fpdf/fpdf.php

    r205 r673  
    11631163        } 
    11641164        $mqr=get_magic_quotes_runtime(); 
    1165         set_magic_quotes_runtime(0); 
     1165        @set_magic_quotes_runtime(0); 
    11661166        foreach($this->FontFiles as $file=>$info) 
    11671167        { 
     
    12011201                $this->_out('endobj'); 
    12021202        } 
    1203         set_magic_quotes_runtime($mqr); 
     1203        @set_magic_quotes_runtime($mqr); 
    12041204        foreach($this->fonts as $k=>$font) 
    12051205        { 
  • trunk/phpbms/include/common_functions.php

    r669 r673  
    11241124 
    11251125 
     1126/* 
     1127 * function cleanFilename        
     1128 * @param $string 
     1129 * @return string $string with only alpha-numeric characters, periods (.), 
     1130 * dashes (-), and underscores (_) 
     1131 */ 
     1132 
     1133function cleanFilename($string) { 
     1134         
     1135        $pattern = "/[^\w\d\.\-\_]/"; 
     1136        $string = preg_replace($pattern, "", $string); 
     1137         
     1138        return $string; 
     1139         
     1140}//end function --cleanFilename-- 
     1141 
     1142 
    11261143 
    11271144function htmlFormat($string,$quotes=false){ 
  • trunk/phpbms/modules/base/report/notes_summary.php

    r643 r673  
    8686        $pdf->SetY($topmargin+.43+.1); 
    8787        $pdf->SetLineWidth(.01); 
     88         
     89        $filename = "Notes_Summary"; 
     90         
     91        $thisCount = $db->numRows($thequery); 
    8892        while($therecord=$db->fetchArray($thequery)) { 
     93                 
    8994                $pdf->SetFont("Arial","",9); 
    9095                $pdf->SetX($leftmargin+.125); 
     
    104109                $pdf->Line($leftmargin+.25,$pdf->GetY(),$paperwidth-$rightmargin-.25,$pdf->GetY()); 
    105110                $pdf->SetY($pdf->GetY()+.25); 
     111                 
     112                $thisId = $therecord["id"]; 
     113                 
    106114        }// end fetch_array while loop 
     115         
     116        if($thisCount === 1) 
     117                $filename .= "_".$thisId; 
     118        elseif((int)$thisCount) 
     119                $filename .= "_Multiple"; 
    107120 
    108         $pdf->Output(); 
     121        $filename = cleanFilename($filename); 
     122        $filename .= ".pdf"; 
     123         
     124        $pdf->Output($filename, 'D'); 
    109125        exit(); 
    110126?> 
  • trunk/phpbms/modules/bms/report/aritems_clientstatement.php

    r611 r673  
    481481        function output($to = "screen"){ 
    482482 
    483                 $this->pdf->Output(); 
     483                $filename = 'Client_Statement_'.date('Ymd').'.pdf'; 
     484                $filename = cleanFilename($filename); 
     485                $this->pdf->output($filename, 'D'); 
    484486 
    485487        }//end method 
  • trunk/phpbms/modules/bms/report/clients_folderlabels.php

    r605 r673  
    8787                return $pdf; 
    8888        } 
     89        $filename = 'Folderlabels_Clients'; 
    8990 
    9091        require("report/general_labels.php"); 
  • trunk/phpbms/modules/bms/report/clients_mailinglabels.php

    r605 r673  
    9393                return $pdf; 
    9494        } 
     95        $filename = 'Mailinglabels_Clients'; 
    9596 
    9697        require("../../../report/general_labels.php"); 
  • trunk/phpbms/modules/bms/report/clients_notesummary.php

    r605 r673  
    9191 
    9292        $pdf->SetY($topmargin+.43+.1); 
     93        $filename = "Client_Notes"; 
    9394 
     95        $thisCount = $db->numRows($clientquery); 
    9496        while($clientrecord=$db->fetchArray($clientquery)) { 
     97                 
     98                $theName = $clientRecord["thename"]; 
     99                 
    95100                $querystatement = " 
    96101                        SELECT 
     
    165170        } 
    166171 
    167         $pdf->Output(); 
     172        if($thisCount == 1){ 
     173                if($thename) 
     174                        $filename .= '_'.$thename; 
     175        }elseif($thisCount) 
     176                $filename .= "_Multiple"; 
     177         
     178        $filename = str_replace(" ", "_", $filename); 
     179        $filename = cleanFilename($filename); 
     180        $filename .= ".pdf"; 
     181         
     182        $pdf->Output($filename, "D"); 
    168183        exit(); 
    169184?> 
  • trunk/phpbms/modules/bms/report/clients_shippinglabels.php

    r605 r673  
    9898        } 
    9999 
     100        $filename = 'Shippinglabels_Clients'; 
    100101        require("../../../report/general_labels.php"); 
    101102?> 
  • trunk/phpbms/modules/bms/report/invoices_pdfinvoice.php

    r353 r673  
    4646 
    4747        //set encoding to latin1 (fpdf doesnt like utf8) 
    48         $sqlEncoding = "latin1";         
     48        $sqlEncoding = "latin1"; 
    4949        require_once("../../../include/session.php"); 
    50          
     50 
    5151        include("modules/bms/report/invoices_pdf_class.php"); 
    52          
     52 
    5353        $report = new invoicePDF($db, 'P', 'in', 'Letter'); 
    5454        $report->setupFromPrintScreen(); 
    5555        $report->generate(); 
    56         $report->output(); 
    5756         
     57        $filename = "Invoice"; 
     58        if($report->count === 1){ 
     59                 
     60                if($report->invoicerecord["company"]) 
     61                        $filename .= "_".$report->invoicerecord["company"]; 
     62                 
     63                $filename .= "_".$report->invoicerecord["id"]; 
     64                 
     65        }elseif((int)$report->count) 
     66                $filename .= "_Multiple"; 
     67         
     68        $filename .= ".pdf"; 
     69        $report->output('screen', $filename); 
     70 
    5871}//end if 
    5972 
  • trunk/phpbms/modules/bms/report/invoices_pdfpackinglist.php

    r363 r673  
    3939 
    4040        if(!isset($_SESSION["userinfo"]["id"])){ 
    41          
     41 
    4242                //IE needs caching to be set to private in order to display PDFS 
    4343                session_cache_limiter('private'); 
    44          
     44 
    4545                //set encoding to latin1 (fpdf doesnt like utf8) 
    46                 $sqlEncoding = "latin1";         
     46                $sqlEncoding = "latin1"; 
    4747                require_once("../../../include/session.php"); 
    48          
     48 
    4949        }//end if 
    50          
     50 
    5151        if(!class_exists("invoicePDF")) 
    5252                include("invoices_pdf_class.php"); 
    53          
     53 
    5454        class  packinglistPDF extends invoicePDF{ 
    55          
     55 
    5656                var $title = "Packing List"; 
    5757                var $showShipNameInShipTo = false; 
    58                                  
     58 
    5959                function packinglistPDF($db, $orientation='P', $unit='mm', $format='Letter'){ 
    60          
     60 
    6161                        $this->invoicePDF($db, $orientation, $unit, $format); 
    62                          
    63                 }//end method 
    64          
     62 
     63                }//end method 
     64 
    6565 
    6666                function initialize(){ 
     
    6868 
    6969                        $pdf = &$this->pdf; 
    70                          
     70 
    7171                        $topinfo = array(); 
    7272                        $topinfo[] = new pdfColumn("Order ID", "id", 0.75); 
    7373                        $topinfo[] = new pdfColumn("Order Date", "orderdate", 1, "date"); 
    7474                        $topinfo[] = new pdfColumn("Client PO", "ponumber", 0); 
    75                          
     75 
    7676                        $size = 0; 
    7777                        foreach($topinfo as $column) 
    7878                                $size += $column->size; 
    79                                  
     79 
    8080                        $topinfo[2]->size = $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size; 
    8181 
    82                         $this->topinfo = $topinfo;                       
    83                          
     82                        $this->topinfo = $topinfo; 
     83 
    8484                        $lineitems = array(); 
    8585                        $lineitems[] = new pdfColumn("Product / (Part Number)", "parts", 0); 
     
    8989                        $lineitems[] = new pdfColumn("Qty", "quantity", 0.5, "real","R"); 
    9090                        $lineitems[] = new pdfColumn("Weight Ext.", "extended", 0.75, "real", "R"); 
    91                                                  
     91 
    9292                        $size = 0; 
    9393                        foreach($lineitems as $column) 
    9494                                $size += $column->size; 
    95                                  
     95 
    9696                        $lineitems[0]->size = $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size; 
    97                          
     97 
    9898                        $this->lineitems = $lineitems; 
    99                          
     99 
    100100                        $totalsinfo = array(); 
    101101                        $totalsinfo[] = new pdfColumn("Shipping Method", "shippingname", 0); 
     
    103103                        $totalsinfo[] = new pdfColumn("Total Weight", "totalweight", 1, "real", "R"); 
    104104                        $totalsinfo[] = new pdfColumn("Shipping", "shipping", 1, "currency", "R"); 
    105                                                                          
     105 
    106106                        $size = 0; 
    107107                        foreach($totalsinfo as $column) 
    108108                                $size += $column->size; 
    109                                  
     109 
    110110                        $totalsinfo[0]->size = $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size; 
    111111 
     
    114114                }//end method 
    115115 
    116                          
     116 
    117117                function _addNotes(){ 
    118                  
     118 
    119119                        $pdf = &$this->pdf; 
    120                  
     120 
    121121                        $height = 1; 
    122122                        $nextPos = $pdf->GetY() + $height + 0.125; 
    123                  
     123 
    124124                        $pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height); 
    125125                        $pdf->setStyle("header"); 
    126126                        $pdf->Cell($pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, 0.18, "Special Instructions", 1, 2, "L", 1); 
    127                                                  
     127 
    128128                        $pdf->setStyle("normal"); 
    129129                        $pdf->SetXY($pdf->GetX() + .06125, $pdf->GetY() + .06125); 
    130130                        $pdf->MultiCell($pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - 0.125, 0.18, $this->invoicerecord["specialinstructions"]); 
    131                          
     131 
    132132                        $pdf->SetXY($pdf->leftmargin, $nextPos); 
    133                  
    134                 }//end method 
    135                  
    136                  
     133 
     134                }//end method 
     135 
     136 
    137137                function _getLineItems(){ 
    138                  
     138 
    139139                        $querystatement = " 
    140140                        SELECT 
     
    154154 
    155155                        $queryresult = $this->db->query($querystatement); 
    156                          
     156 
    157157                        //determine estimated total boxes 
    158158                        $this->invoicerecord["estimatedboxes"] = 0; 
    159159                        while($therecord = $this->db->fetchArray($queryresult)){ 
    160                          
     160 
    161161                                if($therecord["isprepackaged"]) 
    162162                                        $this->invoicerecord["estimatedboxes"] += $therecord["quantity"]; 
    163163                                else 
    164164                                        $this->invoicerecord["estimatedboxes"] += $therecord["quantity"] * $therecord["packagesperitem"]; 
    165                                  
     165 
    166166                        }//endwhile 
    167                          
     167 
    168168                        $this->db->seek($queryresult, 0); 
    169                          
     169 
    170170                        return $queryresult; 
    171                  
    172                 }//end method 
    173                  
     171 
     172                }//end method 
     173 
    174174                function _addTotals(){ 
    175175 
    176176                        $pdf = &$this->pdf; 
    177                                                          
     177 
    178178                        $height = .5; 
    179179                        $nextPos = $pdf->GetY() + $height + 0.125; 
    180                  
     180 
    181181                        $pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height); 
    182                          
     182 
    183183                        $pdf->setStyle("header"); 
    184184                        foreach($this->totalsinfo as $column) 
    185185                                $pdf->Cell($column->size, 0.18, $column->title, 1, 0, $column->align, 1); 
    186                          
     186 
    187187                        $pdf->setStyle("normal"); 
    188188                        $pdf->SetFont("Arial", "B", 10); 
    189189                        $pdf->SetXY($pdf->leftmargin, $pdf->GetY() + 0.18 + 0.0625); 
    190                          
     190 
    191191                        foreach($this->totalsinfo as $column){ 
    192                          
     192 
    193193                                if($column->format != "") 
    194194                                        $value = formatVariable($this->invoicerecord[$column->fieldname], $column->format); 
    195195                                else 
    196                                         $value = $this->invoicerecord[$column->fieldname];                               
    197                          
     196                                        $value = $this->invoicerecord[$column->fieldname]; 
     197 
    198198                                $pdf->Cell($column->size, 0.18, $value, $pdf->borderDebug, 0, $column->align); 
    199199 
    200200                        }//end foreach 
    201                                          
     201 
    202202                }//end method 
    203203 
     
    208208        //============================================================================= 
    209209        if(!isset($noOutput)){ 
    210                          
     210 
    211211                $report = new packinglistPDF($db, 'P', 'in', 'Letter'); 
    212                  
     212 
    213213                $report->setupFromPrintScreen(); 
    214214                $report->generate(); 
    215                 $report->output(); 
     215                $filename = "Packing_List"; 
    216216                 
     217                if($report->count === 1){ 
     218                         
     219                        if($report->invoicerecord["company"]) 
     220                                $filename .= "_".$report->invoicerecord["company"]; 
     221                         
     222                        $filename .= "_".$report->invoicerecord["id"]; 
     223                         
     224                }elseif((int)$report->count) 
     225                        $filename .= "_Multiple"; 
     226                 
     227                $report->output('screen', $filename); 
     228 
    217229        }//end if 
    218230?> 
  • trunk/phpbms/modules/bms/report/invoices_pdfquote.php

    r353 r673  
    4343 
    4444        //set encoding to latin1 (fpdf doesnt like utf8) 
    45         $sqlEncoding = "latin1";         
     45        $sqlEncoding = "latin1"; 
    4646        require_once("../../../include/session.php"); 
    4747 
     
    5858 
    5959                $this->invoicePDF($db, $orientation, $unit, $format); 
    60                  
     60 
    6161        }//end method 
    62          
     62 
    6363        function initialize(){ 
    6464                parent::initialize(); 
    65                  
     65 
    6666                unset($this->totalsinfo[5]); 
    67                                  
     67 
    6868        }//end method 
    6969 
     
    7373//============================================================================= 
    7474if(!isset($noOutput)){ 
    75                  
     75 
    7676        $report = new quotePDF($db, 'P', 'in', 'Letter'); 
    7777        $report->showShipNameInShipTo = false; 
    78          
     78 
    7979        $report->setupFromPrintScreen(); 
    8080        $report->generate(); 
    81         $report->output(); 
    8281         
     82        $filename = "Quote"; 
     83        if($report->count === 1){ 
     84                 
     85                if($report->invoicerecord["company"]) 
     86                        $filename .= "_".$report->invoicerecord["company"]; 
     87                 
     88                $filename .= "_".$report->invoicerecord["id"]; 
     89                 
     90        }elseif((int)$report->count) 
     91                $filename .= "_Multiple"; 
     92         
     93        $filename .= ".pdf"; 
     94         
     95        $report->output('screen', $filename); 
     96 
    8397}//end if 
    8498 
  • trunk/phpbms/modules/bms/report/invoices_pdfworkorder.php

    r354 r673  
    3838*/ 
    3939        if(!isset($_SESSION["userinfo"]["id"])){ 
    40          
     40 
    4141                //IE needs caching to be set to private in order to display PDFS 
    4242                session_cache_limiter('private'); 
    4343 
    4444                //set encoding to latin1 (fpdf doesnt like utf8) 
    45                 $sqlEncoding = "latin1";         
     45                $sqlEncoding = "latin1"; 
    4646                require_once("../../../include/session.php"); 
    47          
     47 
    4848        }//end if 
    49          
     49 
    5050        if(!class_exists("invoicePDF")) 
    5151                include("invoices_pdf_class.php"); 
    52          
     52 
    5353        class  workorderPDF extends invoicePDF{ 
    54          
     54 
    5555                var $title = "Work Order"; 
    5656                var $lineitemBoxHeight = 3.75; 
    57                  
     57 
    5858                function workorderPDF($db, $orientation='P', $unit='mm', $format='Letter'){ 
    59          
     59 
    6060                        $this->invoicePDF($db, $orientation, $unit, $format); 
    61                          
     61 
    6262                }//end method 
    63          
    64          
     63 
     64 
    6565                function _addNotes(){ 
    66                  
     66 
    6767                        $pdf = &$this->pdf; 
    68                  
     68 
    6969                        $height = 1; 
    7070                        $nextPos = $pdf->GetY() + $height + 0.125; 
    71                  
     71 
    7272                        $pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height); 
    7373                        $pdf->setStyle("header"); 
    7474                        $pdf->Cell($pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, 0.18, "Special Instructions", 1, 2, "L", 1); 
    75                                                  
     75 
    7676                        $pdf->setStyle("normal"); 
    7777                        $pdf->SetXY($pdf->GetX() + .06125, $pdf->GetY() + .06125); 
    7878                        $pdf->MultiCell($pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - 0.125, 0.18, $this->invoicerecord["specialinstructions"]); 
    79                          
     79 
    8080                        $pdf->SetXY($pdf->leftmargin, $nextPos); 
    81                  
     81 
    8282                }//end method 
    83                  
     83 
    8484                function _addPaymentDetails(){ 
    8585 
     
    9090 
    9191                        switch($this->invoicerecord["paymenttype"]){ 
    92                          
     92 
    9393                                case "draft": 
    9494                                        $columns[0]->size = 1.5; 
     
    102102                                        $columns[] = new pdfColumn("Exp.", "ccexpiration", 1); 
    103103                                        $columns[] = new pdfColumn("Verification/Pin", "ccverification", 1); 
    104                                         break;                                   
    105                          
     104                                        break; 
     105 
    106106                        }//end switch 
    107                                                  
     107 
    108108                        $size = 0; 
    109109                        foreach($columns as $column) 
    110110                                $size += $column->size; 
    111                                                          
     111 
    112112                        $i = count($columns) -1; 
    113                                  
     113 
    114114                        $columns[$i]->size += $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size; 
    115                          
     115 
    116116                        $height = 0.5; 
    117117                        $nextPos = $pdf->GetY() + $height + 0.125; 
    118                  
     118 
    119119                        $pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height); 
    120                          
     120 
    121121                        $pdf->setStyle("header"); 
    122122 
    123123                        foreach($columns as $column) 
    124124                                $pdf->Cell($column->size, 0.18, $column->title, 1, 0, $column->align, 1); 
    125                                  
     125 
    126126                        $pdf->SetXY($pdf->leftmargin, $pdf->GetY() + 0.18 + 0.0625); 
    127                          
     127 
    128128                        $pdf->setStyle("normal"); 
    129129                        $pdf->SetFont("Arial", "B", 10); 
     
    132132 
    133133                }//end method 
    134                  
     134 
    135135        }//end class 
    136136 
     
    139139//============================================================================= 
    140140if(!isset($noOutput)){ 
    141                  
     141 
    142142        $report = new workorderPDF($db, 'P', 'in', 'Letter'); 
    143          
     143 
    144144        $report->setupFromPrintScreen(); 
    145145        $report->generate(); 
    146         $report->output(); 
     146        $filename = 'Work_Order'; 
     147        if($report->count === 1){ 
     148                 
     149                if($report->invoicerecord["company"]) 
     150                        $filename .= "_".$report->invoicerecord["company"]; 
     151                 
     152                $filename .= "_".$report->invoicerecord["id"]; 
     153                 
     154        }elseif((int)$report->count) 
     155                $filename .= "_Multiple"; 
    147156         
     157        $filename .= ".pdf"; 
     158        $report->output('screen', $filename); 
     159 
    148160}//end if 
    149161 
  • trunk/phpbms/modules/bms/report/invoices_pdf_class.php

    r633 r673  
    4646                var $showShipNameInShipTo = true; 
    4747                var $lineitemBoxHeight = 4.25; 
     48                 
     49                /** 
     50                  * $count 
     51                  * @var int The number of invoice records being displayed 
     52                  */ 
     53                var $count; 
    4854 
    4955                function invoicePDF($db, $orientation='P', $unit='mm', $format='Letter'){ 
     
    171177                        $queryresult = $this->db->query($querystatement); 
    172178 
    173                         if($this->db->numRows($queryresult) == 0){ 
    174  
     179                        $this->count = $this->db->numRows($queryresult); 
     180                        if($this->count == 0){ 
     181                                 
    175182                                $this->_showNoRecords(); 
    176183                                exit; 
     
    505512                                products.partnumber 
    506513                        FROM 
    507                                 lineitems LEFT JOIN products ON lineitems.productid = products.id 
     514                                lineitems LEFT JOIN products ON lineitems.productid = products.uuid 
    508515                        WHERE 
    509516                                lineitems.invoiceid ='".((int) $this->invoicerecord["id"])."' 
     
    609616 
    610617                                case "screen": 
    611                                         $this->pdf->Output(); 
     618                                        $userinfo = cleanFilename((string)$userinfo); 
     619                                        $this->pdf->Output($userinfo, 'D'); 
    612620                                        break; 
    613621 
  • trunk/phpbms/modules/bms/report/invoices_shippinglabels.php

    r611 r673  
    111111                return $pdf; 
    112112        } 
    113  
     113        $filename = 'Shippinglabels_invoice'; 
    114114        session_cache_limiter('private'); 
    115115        require_once("../../../include/session.php"); 
  • trunk/phpbms/modules/bms/report/receipts_pdf.php

    r633 r673  
    5353                var $title = "Receipt"; 
    5454                var $lineitemBoxHeight = 4.25; 
     55                /** 
     56                  * $count 
     57                  * @var int The number of invoice records being displayed 
     58                  */ 
     59                var $count; 
    5560 
    5661                function receiptPDF($db, $orientation='P', $unit='mm', $format='Letter'){ 
     
    177182                        $queryresult = $this->db->query($querystatement); 
    178183 
    179                         if($this->db->numRows($queryresult) == 0){ 
     184                         
     185                        $this->count = $this->db->numRows($queryresult); 
     186                        if($this->count == 0){ 
    180187 
    181188                                $this->_showNoRecords(); 
     
    632639 
    633640                                case "screen": 
    634                                         $this->pdf->Output(); 
     641                                        $userinfo = cleanFilename((string)$userinfo); 
     642                                        $this->pdf->Output($userinfo, 'D'); 
    635643                                        break; 
    636644 
     
    703711        $report->setupFromPrintScreen(); 
    704712        $report->generate(); 
    705         $report->output(); 
     713         
     714        $filename = 'Receipts_'; 
     715        if($report->count === 1){ 
     716                 
     717                if($report->invoicerecord["company"]) 
     718                        $filename .= "_".$report->invoicerecord["company"]; 
     719                 
     720                $filename .= "_".$report->invoicerecord["id"]; 
     721                 
     722        }elseif((int)$report->count) 
     723                $filename .= "_Multiple"; 
     724         
     725        $filename .= ".pdf"; 
     726        $report->output('screen', $filename); 
    706727 
    707728}//end if 
  • trunk/phpbms/report/general_labels.php

    r643 r673  
    9797                } 
    9898 
     99                $thisCount = $db->numRows($thequery); 
    99100                while($therecord=$db->fetchArray($thequery)) { 
    100101 
     
    116117                        $they+=$labelheight; 
    117118                        $rowcount++; 
     119                         
     120                        $company = $therecord["company"]; 
     121                         
    118122                }// end fetch_array while loop 
    119123 
    120                 $pdf->Output(); 
     124                if($thisCount === 1){ 
     125                        if($company) 
     126                                $filename .= "_".$company; 
     127                }elseif((int)$thisCount) 
     128                        $filename .= "_Multiple"; 
     129                                 
     130                                 
     131                $filename = cleanFilename($filename); 
     132                $filename .= ".pdf"; 
     133                $pdf->Output($filename, 'D'); 
    121134                exit(); 
    122135        } else { 
     
    139152                <p align="right"> 
    140153                        <input name="command" type="submit" class="Buttons" id="print" value="print" /> 
    141                         <input name="cancel" type="button" class="Buttons" id="cancel" value="canel" onclick="window.close();" /> 
     154                        <input name="cancel" type="button" class="Buttons" id="cancel" value="cancel" onclick="window.close();" /> 
    142155                </p> 
    143156</div> 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.