Changeset 60
- Timestamp:
- 11/21/05 19:38:49
- Files:
-
- trunk/fpdf/fpdf.php (modified) (previous)
- trunk/fpdf/mem_image.php (added)
- trunk/include/common_functions.php (modified) (1 diff)
- trunk/index.php (modified) (1 diff)
- trunk/install/createtables.sql (modified) (1 diff)
- trunk/install/files.sql (added)
- trunk/install/installxml.php (modified) (1 diff)
- trunk/install/updatev0.61.sql (modified) (1 diff)
- trunk/install/updatexml.php (modified) (1 diff)
- trunk/modules/base/files_addedit.php (modified) (2 diffs)
- trunk/modules/base/include/adminsettings_include.php (modified) (1 diff)
- trunk/modules/base/include/files_addedit_include.php (modified) (4 diffs)
- trunk/modules/base/report/notes_summary.php (modified) (1 diff)
- trunk/modules/bms/report/clients_folderlabels.php (modified) (1 diff)
- trunk/modules/bms/report/clients_mailinglabels.php (modified) (1 diff)
- trunk/modules/bms/report/clients_notesummary.php (modified) (2 diffs)
- trunk/modules/bms/report/clients_shippinglabels.php (modified) (1 diff)
- trunk/modules/bms/report/invoices_pdfinvoice.php (modified) (5 diffs)
- trunk/modules/bms/report/invoices_pdfpackinglist.php (modified) (5 diffs)
- trunk/modules/bms/report/invoices_pdfquote.php (modified) (5 diffs)
- trunk/modules/bms/report/invoices_pdfworkorder.php (modified) (4 diffs)
- trunk/modules/bms/report/invoices_shippinglabels.php (modified) (1 diff)
- trunk/print.php (modified) (3 diffs)
- trunk/report/general_export.php (modified) (1 diff)
- trunk/report/general_labels.php (modified) (1 diff)
- trunk/report/general_tableprint.php (modified) (1 diff)
- trunk/servefile.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/include/common_functions.php
r51 r60 64 64 <td width="100%" class="tabbottoms"> </td></tr></table> 65 65 <?php 66 }67 68 // Clean our temp PDF report files69 //====================================================================70 function clean_pdf_reports($dir,$sectime=3600)71 {72 //Delete temporary files73 $t=time();74 $h=opendir($dir);75 while($file=readdir($h))76 {77 if(substr($file,0,3)=='tmp' and substr($file,-4)=='.pdf')78 {79 $path=$dir.'/'.$file;80 if($t-filemtime($path)>$sectime)81 @unlink($path);82 }83 }84 closedir($h);85 66 } 86 67 trunk/index.php
r51 r60 49 49 $result = mysql_query("UPDATE users set modifieddate=modifieddate, lastlogin=Now() where id = ".$_SESSION["userinfo"]["id"],$dblink); 50 50 if (!$result)die ("update users query failed:".mysql_error($dblink)); 51 52 //anytime anyone logs in, clean temp PDF files older than an hour 53 include("include/common_functions.php"); 54 clean_pdf_reports("report/"); 55 51 56 52 header("Location: ".$_SESSION["default_load_page"]); 57 53 trunk/install/createtables.sql
r58 r60 118 118 `editfile` varchar(128) default NULL, 119 119 `displayname` varchar(64) default NULL, 120 `id` int(11) NOT NULL auto_increment default 1000,120 `id` int(11) NOT NULL auto_increment default '1000', 121 121 `maintable` varchar(64) NOT NULL default '', 122 122 `createdby` int(11) NOT NULL default '0', trunk/install/installxml.php
r57 r60 169 169 $thereturn.=importData("users"); 170 170 $thereturn.=importData("settings"); 171 $thereturn.=importData("files"); 171 172 $thereturn.="\nDone Importing Data\n===========================\n"; 172 173 trunk/install/updatev0.61.sql
r58 r60 5 5 6 6 ALTER TABLE tabledefs CHANGE defaultwhereclause defaultwhereclause varchar(255); 7 ALTER TABLE tabledefs CHANGE `id` `id` int(11) NOT NULL auto_increment default '1000'; 7 8 8 9 UPDATE tabledefs SET defaultwhereclause="notes.type='EV' AND notes.createdby = {{$_SESSION['userinfo']['id']}} AND ((notes.startdate = year(notes.startdate)=year(curdate()) and week(notes.startdate)=week(curdate())) OR notes.`repeat`=1)" WHERE id=24; trunk/install/updatexml.php
r57 r60 258 258 $thereturn.="Moved non-mysql settings to new settings table.\n"; 259 259 260 $filename="../../logo.png"; 261 if (function_exists('file_get_contents')) { 262 $file = addslashes(file_get_contents($filename)); 263 } else { 264 // If using PHP < 4.3.0 use the following: 265 $file = addslashes(fread(fopen($filename, 'r'), filesize($filename))); 266 } 267 $querystatement="INSERT INTO files (id,name,servename,type,accesslevel,file,createdby,creationdate,modifiedby) 268 VALUES (1,\"Printed Logo\",\"logo.png\",\"image/png\",90,\"".$file."\"2,Now(),2)"; 269 $queryresult=mysql_query($querystatement,$dblink); 270 if(!$queryresult) 271 $thereturn.="Error moving logo to database.\n"; 272 else 273 $thereturn.="Moved logo to database.\n"; 274 275 260 276 $thereturn.="Update to 0.61 Finished\n\n"; 261 277 $currentVersion="0.61"; trunk/modules/base/files_addedit.php
r58 r60 97 97 <?PHP field_text("name",$therecord["name"],1,"Name cannot be blank.","",Array("size"=>"32","maxlength"=>"64","style"=>"width:98%","class"=>"important","tabindex"=>"5")); ?> 98 98 </label> 99 <label for=" name" class="important">99 <label for="servename" class="important"> 100 100 serve name<br /> 101 <?PHP field_text(" name",$therecord["name"],1,"Name cannot be blank.","",Array("size"=>"40","maxlength"=>"64","style"=>"","class"=>"important","tabindex"=>"5")); ?>101 <?PHP field_text("servename",$therecord["servename"],1,"Serve name cannot be blank.","",Array("size"=>"40","maxlength"=>"64","style"=>"","class"=>"important","tabindex"=>"5")); ?> 102 102 </label> 103 103 <div class="small" style="padding-top:6px;padding-bottom:6px;"><em> … … 113 113 <input type="text" id="type" name="type" value="<?php echo htmlQuotes($therecord["type"])?>" size="40" maxlength="100" readonly="true" class="uneditable" style="" /> 114 114 </label> 115 <div><button type="button" class="Buttons" >view file</button></div>115 <div><button type="button" class="Buttons" onClick="document.location='../../servefile.php?i=<?php echo $therecord["id"]?>'">view file</button></div> 116 116 <?php } ?> 117 117 <label for="upload"> trunk/modules/base/include/adminsettings_include.php
r57 r60 74 74 // deal with logo graphic. 75 75 if(isset($files["printedlogo"])) 76 if($files["printedlogo"]["type"]=="image/png") 77 copy($files["printedlogo"]["tmp_name"],$_SERVER["DOCUMENT_ROOT"].$_SESSION["app_path"]."report/logo.png"); 76 if($files["printedlogo"]["type"]=="image/png"){ 77 if (function_exists('file_get_contents')) { 78 $file = addslashes(file_get_contents($_FILES['upload']['tmp_name'])); 79 } else { 80 // If using PHP < 4.3.0 use the following: 81 $file = addslashes(fread(fopen($_FILES['upload']['tmp_name'], 'r'), filesize($_FILES['thumbnailupload']['tmp_name']))); 82 } 83 $querystatement="UPDATE files SET file=\"".$file."\" WHERE id=1"; 84 $queryresult=mysql_query($querystatement,$dblink); 85 if(!$queryresult) reportError(300,"Error Uploading Graphic File"); 86 } 87 } 78 88 79 89 return true; trunk/modules/base/include/files_addedit_include.php
r58 r60 50 50 51 51 $querystatement="SELECT 52 id,name,serv name,type,accesslevel,ISNULL(file) as nofile,52 id,name,servename,type,accesslevel,ISNULL(file) as nofile, 53 53 54 54 createdby, creationdate, … … 91 91 92 92 $querystatement.="name=\"".$variables["name"]."\", "; 93 $querystatement.="type=\"".$variables["type"]."\", "; 94 $querystatement.="tabledefid=".$variables["tabledefid"].", "; 95 $querystatement.="reportfile=\"".$variables["reportfile"]."\", "; 96 $querystatement.="description=\"".$variables["description"]."\", "; 97 $querystatement.="displayorder=".$variables["displayorder"].", "; 93 $querystatement.="servename=\"".$variables["servename"]."\", "; 98 94 $querystatement.="accesslevel=".$variables["accesslevel"].", "; 95 if($_FILES['upload']["name"]){ 96 if (function_exists('file_get_contents')) { 97 $file = addslashes(file_get_contents($_FILES['upload']['tmp_name'])); 98 } else { 99 // If using PHP < 4.3.0 use the following: 100 $file = addslashes(fread(fopen($_FILES['upload']['tmp_name'], 'r'), filesize($_FILES['thumbnailupload']['tmp_name']))); 101 } 102 $querystatement.="type=\"".$_FILES['upload']['type']."\", "; 103 $querystatement.="file=\"".$file."\", "; 104 } 99 105 100 106 //==== Almost all records should have this ========= … … 111 117 global $dblink; 112 118 119 if(!$_FILES['upload']["name"]) 120 return -1; 121 122 if (function_exists('file_get_contents')) { 123 $file = addslashes(file_get_contents($_FILES['upload']['tmp_name'])); 124 } else { 125 // If using PHP < 4.3.0 use the following: 126 $file = addslashes(fread(fopen($_FILES['upload']['tmp_name'], 'r'), filesize($_FILES['thumbnailupload']['tmp_name']))); 127 } 128 113 129 $querystatement="INSERT INTO files "; 114 130 115 $querystatement.="(name, type,tabledefid,reportfile,description,displayorder,accesslevel131 $querystatement.="(name,servename,accesslevel,type,file, 116 132 createdby,creationdate,modifiedby) VALUES ("; 117 133 118 134 $querystatement.="\"".$variables["name"]."\", "; 119 $querystatement.="\"".$variables["type"]."\", "; 120 $querystatement.=$variables["tabledefid"].", "; 121 $querystatement.="\"".$variables["reportfile"]."\", "; 122 $querystatement.="\"".$variables["description"]."\", "; 123 $querystatement.=$variables["displayorder"].", "; 135 $querystatement.="\"".$variables["servename"]."\", "; 124 136 $querystatement.=$variables["accesslevel"].", "; 137 $querystatement.="\"".$_FILES['upload']['type']."\", "; 138 $querystatement.="\"".$file."\", "; 125 139 126 140 //==== Almost all records should have this ========= … … 128 142 $querystatement.="Now(), "; 129 143 $querystatement.=$userid.")"; 130 144 131 145 $queryresult = mysql_query($querystatement,$dblink); 132 146 if(!$queryresult) reportError(300,"Insert Failed: ".mysql_error($dblink)." -- ".$querystatement); trunk/modules/base/report/notes_summary.php
r10 r60 68 68 }// end fetch_array while loop 69 69 70 if($border_debug==1){ 71 $pdf->Output(); 72 } 73 else { 74 //write the frickin thing! Need to write to a temp file and then you know... 75 chdir("../../../report"); 76 $file=basename(tempnam(getcwd(),'tmp')); 77 rename($file,$file.'.pdf'); 78 $file.='.pdf'; 79 80 // write to file and then output 81 $pdf->Output($file); 82 echo "<HTML><SCRIPT>document.location='../../../report/".$file."';</SCRIPT></HTML>"; 83 } 70 $pdf->Output(); 71 exit(); 84 72 ?> trunk/modules/bms/report/clients_folderlabels.php
r51 r60 70 70 } 71 71 72 session_cache_limiter('private'); 72 73 require_once("../../../include/session.php"); 73 74 require_once("../../../fpdf/fpdf.php"); trunk/modules/bms/report/clients_mailinglabels.php
r51 r60 75 75 } 76 76 77 require_once("../../../include/session.php"); 77 session_cache_limiter('private'); 78 s require_once("../../../include/session.php"); 78 79 require_once("../../../fpdf/fpdf.php"); 79 80 require("../../../report/general_labels.php"); trunk/modules/bms/report/clients_notesummary.php
r51 r60 36 36 */ 37 37 38 session_cache_limiter('private'); 38 39 require("../../../include/session.php"); 39 40 //turn debug borders on to troubleshoot PDF creation (1 or 0) … … 139 140 } 140 141 141 if($border_debug==1){ 142 $pdf->Output(); 143 } 144 else { 145 //write the frickin thing! Need to write to a temp file and then you know... 146 chdir("../../../report"); 147 $file=basename(tempnam(getcwd(),'tmp')); 148 rename($file,$file.'.pdf'); 149 $file.='.pdf'; 150 151 // write to file and then output 152 $pdf->Output($file); 153 echo "<HTML><SCRIPT>document.location='../../../report/".$file."';</SCRIPT></HTML>"; 154 } 142 $pdf->Output(); 143 exit(); 155 144 ?> trunk/modules/bms/report/clients_shippinglabels.php
r51 r60 76 76 } 77 77 78 session_cache_limiter('private'); 78 79 require_once("../../../include/session.php"); 79 80 require_once("../../../fpdf/fpdf.php"); trunk/modules/bms/report/invoices_pdfinvoice.php
r51 r60 35 35 +-------------------------------------------------------------------------+ 36 36 */ 37 38 require ("../../../include/session.php");39 require ("../../../include/common_functions.php");37 session_cache_limiter('private'); 38 require_once("../../../include/session.php"); 39 require_once("../../../include/common_functions.php"); 40 40 //turn debug borders on to troubleshoot PDF creation (1 or 0) 41 41 $border_debug=0; … … 47 47 $sortorder=" ORDER BY invoices.id"; 48 48 49 require("../../../fpdf/fpdf.php"); 49 require_once("../../../fpdf/fpdf.php"); 50 require_once("../../../fpdf/mem_image.php"); 50 51 51 52 //Generate the invoice Query … … 79 80 80 81 //define the documents and margins 81 $pdf=new FPDF("P","in","Letter");82 $pdf=new MEM_IMAGE("P","in","Letter"); 82 83 $pdf->SetMargins($leftmargin,$topmargin,$rightmargin); 83 84 $pdf->Open(); … … 98 99 $cname=$_SESSION["company_name"]; 99 100 $caddress=$_SESSION["company_address"]."\n".$_SESSION["company_csz"]."\n".$_SESSION["company_phone"]; 100 $pdf->Image("../../../report/logo.png",$leftmargin,$topmargin,$tempwidth); 101 102 103 // Image from DB, so we need to retieve it and then add it to pdf 104 // through the extended memImage function (instead of the image function, that wants a file, not data) 105 $querystatement="SELECT file FROM files WHERE id=1"; 106 $pictureresult=mysql_query($querystatement,$dblink); 107 if(!$pictureresult) reportError(300,"Error Retrieving Logo Graphic"); 108 $thepicture=mysql_fetch_array($pictureresult); 109 110 $pdf->MemImage($thepicture["file"],$leftmargin,$topmargin,$tempwidth); 101 111 102 112 //next company name … … 330 340 331 341 }// end fetch_array while loop 332 333 334 if($border_debug==1){ 335 $pdf->Output(); 336 } 337 else { 338 //write the frickin thing! Need to write to a temp file and then you know... 339 chdir("../../../report"); 340 $file=basename(tempnam(getcwd(),'tmp')); 341 chmod($file,0664); 342 rename($file,$file.'.pdf'); 343 $file.='.pdf'; 344 345 // write to file and then output 346 $pdf->Output($file); 347 echo "<HTML><SCRIPT>document.location='../../../report/".$file."';</SCRIPT></HTML>"; 348 } 342 343 $pdf->Output(); 344 exit(); 345 349 346 ?> trunk/modules/bms/report/invoices_pdfpackinglist.php
r51 r60 35 35 +-------------------------------------------------------------------------+ 36 36 */ 37 38 require ("../../../include/session.php");39 require ("../../../include/common_functions.php");37 session_cache_limiter('private'); 38 require_once("../../../include/session.php"); 39 require_once("../../../include/common_functions.php"); 40 40 //turn debug borders on to troubleshoot PDF creation (1 or 0) 41 41 $border_debug=0; … … 47 47 48 48 require("../../../fpdf/fpdf.php"); 49 require_once("../../../fpdf/mem_image.php"); 49 50 50 51 //Generate the invoice Query … … 78 79 79 80 //define the documents and margins 80 $pdf=new FPDF("P","in","Letter");81 $pdf=new MEM_IMAGE("P","in","Letter"); 81 82 $pdf->SetMargins($leftmargin,$topmargin,$rightmargin); 82 83 $pdf->Open(); … … 97 98 $cname=$_SESSION["company_name"]; 98 99 $caddress=$_SESSION["company_address"]."\n".$_SESSION["company_csz"]."\n".$_SESSION["company_phone"]; 99 $pdf->Image("../../../report/logo.png",$leftmargin,$topmargin,$tempwidth); 100 101 // Image from DB, so we need to retieve it and then add it to pdf 102 // through the extended memImage function (instead of the image function, that wants a file, not data) 103 $querystatement="SELECT file FROM files WHERE id=1"; 104 $pictureresult=mysql_query($querystatement,$dblink); 105 if(!$pictureresult) reportError(300,"Error Retrieving Logo Graphic"); 106 $thepicture=mysql_fetch_array($pictureresult); 107 108 $pdf->MemImage($thepicture["file"],$leftmargin,$topmargin,$tempwidth); 100 109 101 110 //next company name … … 287 296 }// end fetch_array while loop 288 297 289 if($border_debug==1){ 290 $pdf->Output(); 291 } 292 else { 293 //write the frickin thing! Need to write to a temp file and then you know... 294 chdir("../../../report"); 295 $file=basename(tempnam(getcwd(),'tmp')); 296 chmod($file,0664); 297 rename($file,$file.'.pdf'); 298 $file.='.pdf'; 299 300 // write to file and then output 301 $pdf->Output($file); 302 echo "<HTML><SCRIPT>document.location='../../../report/".$file."';</SCRIPT></HTML>"; 303 } 298 $pdf->Output(); 299 exit(); 300 304 301 ?> trunk/modules/bms/report/invoices_pdfquote.php
r51 r60 35 35 +-------------------------------------------------------------------------+ 36 36 */ 37 38 require ("../../../include/session.php");39 require ("../../../include/common_functions.php");37 session_cache_limiter('private'); 38 require_once("../../../include/session.php"); 39 require_once("../../../include/common_functions.php"); 40 40 //turn debug borders on to troubleshoot PDF creation (1 or 0) 41 41 $border_debug=0; … … 47 47 48 48 require("../../../fpdf/fpdf.php"); 49 require_once("../../../fpdf/mem_image.php"); 49 50 50 51 //Generate the invoice Query … … 78 79 79 80 //define the documents and margins 80 $pdf=new FPDF("P","in","Letter");81 $pdf=new MEM_IMAGE("P","in","Letter"); 81 82 $pdf->SetMargins($leftmargin,$topmargin,$rightmargin); 82 83 $pdf->Open(); … … 97 98 $cname=$_SESSION["company_name"]; 98 99 $caddress=$_SESSION["company_address"]."\n".$_SESSION["company_csz"]."\n".$_SESSION["company_phone"]; 99 $pdf->Image("../../../report/logo.png",$leftmargin,$topmargin,$tempwidth); 100 101 // Image from DB, so we need to retieve it and then add it to pdf 102 // through the extended memImage function (instead of the image function, that wants a file, not data) 103 $querystatement="SELECT file FROM files WHERE id=1"; 104 $pictureresult=mysql_query($querystatement,$dblink); 105 if(!$pictureresult) reportError(300,"Error Retrieving Logo Graphic"); 106 $thepicture=mysql_fetch_array($pictureresult); 107 108 $pdf->MemImage($thepicture["file"],$leftmargin,$topmargin,$tempwidth); 100 109 101 110 //next company name … … 325 334 326 335 327 if($border_debug==1){ 328 $pdf->Output(); 329 } 330 else { 331 //write the frickin thing! Need to write to a temp file and then you know... 332 chdir("../../../report"); 333 $file=basename(tempnam(getcwd(),'tmp')); 334 chmod($file,0664); 335 rename($file,$file.'.pdf'); 336 $file.='.pdf'; 337 338 // write to file and then output 339 $pdf->Output($file); 340 echo "<HTML><SCRIPT>document.location='../../../report/".$file."';</SCRIPT></HTML>"; 341 } 336 $pdf->Output(); 337 exit(); 338 342 339 ?> trunk/modules/bms/report/invoices_pdfworkorder.php
r51 r60 35 35 +-------------------------------------------------------------------------+ 36 36 */ 37 38 require ("../../../include/session.php");39 require ("../../../include/common_functions.php");37 session_cache_limiter('private'); 38 require_once("../../../include/session.php"); 39 require_once("../../../include/common_functions.php"); 40 40 //turn debug borders on to troubleshoot PDF creation (1 or 0) 41 41 $border_debug=0; 42 42 43 43 require("../../../fpdf/fpdf.php"); 44 require_once("../../../fpdf/mem_image.php"); 44 45 45 46 if($_SESSION["printing"]["sortorder"]) … … 78 79 79 80 //define the documents and margins 80 $pdf=new FPDF("P","in","Letter");81 $pdf=new MEM_IMAGE("P","in","Letter"); 81 82 $pdf->SetMargins($leftmargin,$topmargin,$rightmargin); 82 83 $pdf->Open(); … … 97 98 $cname=$_SESSION["company_name"]; 98 99 $caddress=$_SESSION["company_address"]."\n".$_SESSION["company_csz"]."\n".$_SESSION["company_phone"]; 99 $pdf->Image("../../../report/logo.png",$leftmargin,$topmargin,$tempwidth); 100 101 // Image from DB, so we need to retieve it and then add it to pdf 102 // through the extended memImage function (instead of the image function, that wants a file, not data) 103 $querystatement="SELECT file FROM files WHERE id=1"; 104 $pictureresult=mysql_query($querystatement,$dblink); 105 if(!$pictureresult) reportError(300,"Error Retrieving Logo Graphic"); 106 $thepicture=mysql_fetch_array($pictureresult); 107 108 $pdf->MemImage($thepicture["file"],$leftmargin,$topmargin,$tempwidth); 100 109 101 110 //next company name … … 366 375 }// end fetch_array while loop 367 376 368 if($border_debug==1){ 369 $pdf->Output(); 370 } 371 else { 372 //write the frickin thing! Need to write to a temp file and then you know... 373 chdir("../../../report"); 374 $file=basename(tempnam(getcwd(),'tmp')); 375 chmod($file,0664); 376 rename($file,$file.'.pdf'); 377 $file.='.pdf'; 378 379 // write to file and then output 380 $pdf->Output($file); 381 echo "<HTML><SCRIPT>document.location='../../../report/".$file."';</SCRIPT></HTML>"; 382 } 377 $pdf->Output(); 378 exit(); 379 383 380 ?> trunk/modules/bms/report/invoices_shippinglabels.php
r51 r60 75 75 } 76 76 77 session_cache_limiter('private'); 77 78 require_once("../../../include/session.php"); 78 79 require_once("../../../fpdf/fpdf.php"); trunk/print.php
r51 r60 105 105 for($i=0;$i<count($_POST["choosereport"]);$i++){ 106 106 if($_POST["choosereport"][$i]){ 107 $querystatement="SELECT reportfile from reports where id=".$_POST["choosereport"][$i].";";107 $querystatement="SELECT reportfile,type from reports where id=".$_POST["choosereport"][$i].";"; 108 108 $queryresult=mysql_query($querystatement,$dblink); 109 109 if(!$queryresult) reportError(100,"Could not Retreive Report Information"); 110 110 $reportrecord=mysql_fetch_array($queryresult); 111 $fakeExtForIE=""; 112 if($reportrecord["type"]=="PDF Report") 113 $fakeExtForIE="&ext=.pdf"; 111 114 //javascript open each report in new window 112 $tablePrinter->openwindows.="window.open('".$_SESSION["app_path"].$reportrecord["reportfile"]."?t abledefid=".urlencode($tablePrinter->tableid)."','print".$i."');\n";115 $tablePrinter->openwindows.="window.open('".$_SESSION["app_path"].$reportrecord["reportfile"]."?tid=".urlencode($tablePrinter->tableid).$fakeExtForIE."','print".$i."');\n"; 113 116 } 114 117 } … … 135 138 </head> 136 139 <body> 137 <?PHP if($tablePrinter->openwindows) echo "\n".$tablePrinter->openwindows; ?>138 140 <div class="bodyline" style="width:550px;margin-top:2px;"> 139 141 <h1><?php echo $pageTitle ?><a name="top"></a></h1> … … 236 238 <div style="margin:0px;padding:0px;width:550px;"><?php include("footer.php")?></div> 237 239 </body> 238 </html> 240 </html><?PHP if($tablePrinter->openwindows) echo "\n".$tablePrinter->openwindows; ?> trunk/report/general_export.php
r51 r60 47 47 header('Content-Disposition: attachment; filename="export.txt"'); 48 48 49 $querystatement="SELECT maintable FROM tabledefs WHERE id=".$_GET["t abledefid"];49 $querystatement="SELECT maintable FROM tabledefs WHERE id=".$_GET["tid"]; 50 50 $thequery=mysql_query($querystatement,$dblink); 51 51 if(!$thequery) reportError(100,"Could not retrieve table information"); trunk/report/general_labels.php
r51 r60 111 111 $rowcount++; 112 112 }// end fetch_array while loop 113 114 115 if($border_debug==1){ 116 $pdf->Output(); 117 } 118 else { 119 //write the frickin thing! Need to write to a temp file and then you know... 120 chdir("../../../report"); 121 $file=basename(tempnam(getcwd(),'tmp')); 122 chmod($file,0664); 123 rename($file,$file.'.pdf'); 124 $file.='.pdf'; 125 126 // write to file and then output 127 $pdf->Output($file); 128 echo "<HTML><SCRIPT>document.location='../../../report/".$file."';</SCRIPT></HTML>"; 129 } 113 114 $pdf->Output(); 115 exit(); 130 116 } else { 131 117 ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> trunk/report/general_tableprint.php
r51 r60 45 45 require("../include/session.php"); 46 46 47 $querystatement="SELECT maintable,displayname FROM tabledefs WHERE id=".$_GET["t abledefid"];47 $querystatement="SELECT maintable,displayname FROM tabledefs WHERE id=".$_GET["tid"]; 48 48 $thequery=mysql_query($querystatement,$dblink); 49 49 if(!$thequery) reportError(100,"Could not retrieve table information");