KumbiaPHP  beta2
Framework PHP
 Todo Estructuras de Datos Namespaces Archivos Funciones Variables Páginas
doc.php
Ir a la documentación de este archivo.
1 <?php
23 function doc($result, $sumArray, $title, $weighArray, $headerArray){
24 
25  $config = Config::read('config');
26  $active_app = Router::get_application();
27  $file = md5(uniqid());
28 
29  $content = "
30 <html>
31  <head>
32  <title>REPORTE DE ".strtoupper($title)."</title>
33  </head>
34  <body bgcolor='white'>
35  <div style='font-size:20px;font-family:Verdana;color:#000000'>".strtoupper($config->$active_app->name)."</div>\n
36  <div style='font-size:18px;font-family:Verdana;color:#000000'>REPORTE DE ".strtoupper($title)."</div>\n
37  <div style='font-size:18px;font-family:Verdana;color:#000000'>".date("Y-m-d")."</div>\n
38  <br/>
39  <table cellspacing='0' border=1 style='border:1px solid #969696'>
40  ";
41  $content.= "<tr bgcolor='#F2F2F2'>\n";
42  for($i=0;$i<=count($headerArray)-1;$i++){
43  $content.= "<th style='font-family:Verdana;font-size:12px'>".$headerArray[$i]."</th>\n";
44  }
45  $content.= "</tr>\n";
46 
47  $l = 5;
48  foreach($result as $row){
49  $content.= "<tr bgcolor='white'>\n";
50  for($i=0;$i<=count($row)-1;$i++){
51  if(is_numeric($row[$i])){
52  $content.= "<td style='font-family:Verdana;font-size:12px' align='center'>{$row[$i]}</td>";
53  } else {
54  $content.= "<td style='font-family:Verdana;font-size:12px'>{$row[$i]}&nbsp;</td>";
55  }
56  }
57  $content.= "</tr>\n";
58  $l++;
59  }
60 
61  file_put_contents("public/temp/$file.doc", $content);
62  if(isset($raw_output)){
63  print "<script type='text/javascript'> window.open('".KUMBIA_PATH."temp/".$file.".doc', null); </script>";
64  } else {
65  Generator::forms_print("<script type='text/javascript'> window.open('".KUMBIA_PATH."temp/".$file.".doc', null); </script>");
66  }
67 
68 }
69 
70 ?>