PageRenderTime 27ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/Library/Kumbia/Generator/GeneratorReport/Format/Doc.php

http://kumbia-enterprise.googlecode.com/
PHP | 83 lines | 44 code | 7 blank | 32 comment | 6 complexity | 535a6247756197ace51c436b0dd8106c MD5 | raw file
  1. <?php
  2. /**
  3. * Kumbia Enterprise Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the New BSD License that is bundled
  8. * with this package in the file docs/LICENSE.txt.
  9. *
  10. * If you did not receive a copy of the license and are unable to
  11. * obtain it through the world-wide-web, please send an email
  12. * to license@loudertechnology.com so we can send you a copy immediately.
  13. *
  14. * @category Kumbia
  15. * @package Generator
  16. * @subpackage GeneratorReport
  17. * @copyright Copyright (c) 2008-2009 Louder Technology COL. (http://www.loudertechnology.com)
  18. * @copyright Copyright (c) 2005-2008 Andres Felipe Gutierrez (gutierrezandresfelipe at gmail.com)
  19. * @license New BSD License
  20. * @version $Id: Doc.php 82 2009-09-13 21:06:31Z gutierrezandresfelipe $
  21. */
  22. /**
  23. * DocGenerator
  24. *
  25. * Generador de Reportes en Word
  26. *
  27. * @category Kumbia
  28. * @package Generator
  29. * @subpackage GeneratorReport
  30. * @copyright Copyright (c) 2008-2009 Louder Technology COL. (http://www.loudertechnology.com)
  31. * @copyright Copyright (c) 2005-2008 Andres Felipe Gutierrez (gutierrezandresfelipe at gmail.com)
  32. * @license New BSD License
  33. */
  34. function doc(){
  35. $config = CoreConfig::readAppConfig();
  36. $active_app = Router::getApplication();
  37. $file = md5(uniqid());
  38. $content = "
  39. <html>
  40. <head>
  41. <title>REPORTE DE ".strtoupper($title)."</title>
  42. </head>
  43. <body bgcolor='white'>
  44. <div style='font-size:20px;font-family:Verdana;color:#000000'>".strtoupper($config->application->name)."</div>\n
  45. <div style='font-size:18px;font-family:Verdana;color:#000000'>REPORTE DE ".strtoupper($title)."</div>\n
  46. <div style='font-size:18px;font-family:Verdana;color:#000000'>{$_SESSION['fecsis']}</div>\n
  47. <br/>
  48. <table cellspacing='0' border=1 style='border:1px solid #969696'>
  49. ";
  50. $content.= "<tr bgcolor='#F2F2F2'>\n";
  51. $numberHeaders = count($headerArray);
  52. for($i=0;$i<$numberHeaders;++$i){
  53. $content.= "<th style='font-family:Verdana;font-size:12px'>".$headerArray[$i]."</th>\n";
  54. }
  55. $content.= "</tr>\n";
  56. $l = 5;
  57. foreach($result as $row){
  58. $content.= "<tr bgcolor='white'>\n";
  59. $numberColumns = count($row);
  60. for($i=0;$i<$numberColumns;++$i){
  61. if(is_numeric($row[$i])){
  62. $content.= "<td style='font-family:Verdana;font-size:12px' align='center'>{$row[$i]}</td>";
  63. } else {
  64. $content.= "<td style='font-family:Verdana;font-size:12px'>{$row[$i]}&nbsp;</td>";
  65. }
  66. }
  67. $content.= "</tr>\n";
  68. ++$l;
  69. }
  70. file_put_contents("public/temp/$file.doc", $content);
  71. if(isset($raw_output)){
  72. echo "<script type='text/javascript'> window.open('".Core::getInstancePath()."temp/".$file.".doc', null); </script>";
  73. } else {
  74. Generator::formsPrint("<script type='text/javascript'> window.open('".Core::getInstancePath()."temp/".$file.".doc', null); </script>");
  75. }
  76. }