瀏覽代碼

Primera versión correcta del pdf

master
root 8 年之前
父節點
當前提交
c4c85bbb7e
共有 3 個文件被更改,包括 99 次插入34 次删除
  1. +86
    -21
      crear_pdf_o6h.php
  2. +2
    -2
      new_service_webdns.php
  3. +11
    -11
      pdf_o6h.php

+ 86
- 21
crear_pdf_o6h.php 查看文件

@@ -19,7 +19,7 @@ protected $HREF = '';


function WriteHTML($html) function WriteHTML($html)
{ {
// Intérprete de HTML
// Intérprete de HTML
$html = str_replace("\n",' ',$html); $html = str_replace("\n",' ',$html);
$a = preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE); $a = preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE);
foreach($a as $i=>$e) foreach($a as $i=>$e)
@@ -275,17 +275,30 @@ function ShadowCell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false,


//$name = $_POST['name']; //$name = $_POST['name'];
$info = $_POST['pdf_power2']; $info = $_POST['pdf_power2'];
$nombre_bd = $_POST['nombre_bd2'];
$usuario_bd = $_POST['usuario_bd2'];
$pass_bd = $_POST['pass_bd2'];
$nombreDominio = $_POST['dominio_nuevo']; $nombreDominio = $_POST['dominio_nuevo'];
$usuario_ftp = $_POST['usuario_ftp2'];
$pass_ftp = $_POST['pass_ftp2'];

//$nombre_base = $_POST['nombre_bd']; //$nombre_base = $_POST['nombre_bd'];
//$info=$_GET['datos_pdf']; //$info=$_GET['datos_pdf'];
$enlace = '<br><a href="http://www.open6hosting.com">www.open6hosting.com</a>'; $enlace = '<br><a href="http://www.open6hosting.com">www.open6hosting.com</a>';
$enlaceBlog = '<br><a href="http://www.open6hosting.com/blog">Blog</a>';
$enlaceFace = '<br><a href="http://www.facebook.com/open6hosting">Facebook</a>';
$enlaceTwitter = '<br><a href="http://www.twitter.com/Open6Hosting">Twitter</a>';
$enlacePriv = '<br><a href="http://www.open6hosting.com/empresa/legales">Politica de privacidad</a>';
$enlaceAdvertencia = '<br><a href="http://www.open6hosting.com/lopd.html">Advertencia legal</a>';
$enlaceMail = '<br><a href="info@open6hosting.com">info@open6hosting.com</a>';


$hoy = date("d-m-Y H:i:s"); $hoy = date("d-m-Y H:i:s");


//print 'en creacion: ' . $nombre_bd . ' ' . $usuario_bd . ' ' . $pass_bd;
$pdf = new PDFO6H(); $pdf = new PDFO6H();
// Primera página // Primera página
$pdf->AddPage(); $pdf->AddPage();
$pdf->SetFont('Arial','',32);
$pdf->SetFont('Arial','',28);
//$pdf->Write(5,'Para saber qué hay de nuevo en este tutorial, pulse '); //$pdf->Write(5,'Para saber qué hay de nuevo en este tutorial, pulse ');
$pdf->SetFont('','U'); $pdf->SetFont('','U');
//$link = $pdf->AddLink(); //$link = $pdf->AddLink();
@@ -299,48 +312,100 @@ $pdf->SetTextColor(0, 0, 0);
$pdf->AliasNbPages(); $pdf->AliasNbPages();
$pdf->SetMargins($pdf->left, $pdf->top, $pdf->right); $pdf->SetMargins($pdf->left, $pdf->top, $pdf->right);
//$pdf->AddPage(); //$pdf->AddPage();

$pdf->WriteHTML('<br><br><br><br>');
// create table // create table
$columns = array(); $columns = array();
// header col
// header tupla
$col = array(); $col = array();
$col[] = array('text' => '', 'width' => '50', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '255,255,255', 'linewidth' => '0.4', 'linearea' => 'LTBR');
$col[] = array('text' => 'BBDD', 'width' => '50', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => 'B', 'fillcolor' => '135,206,250', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => 'LTBR');
$col[] = array('text' => 'FTP', 'width' => '50', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => 'B', 'fillcolor' => '135,206,250', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => 'LTBR');
$col[] = array('text' => '', 'width' => '10', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '255,255,255', 'linewidth' => '0.0', 'linearea' => '');
$col[] = array('text' => 'BBDD', 'width' => '40', 'height' => '7', 'align' => 'R', 'font_name' => 'Arial', 'font_size' => '15', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => '');
$col[] = array('text' => '', 'width' => '140', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '15', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => '');
$columns[] = $col; $columns[] = $col;
// data col
//color guapo para fondo '135,206,250'
// data tupla 1
$col = array(); $col = array();
$col[] = array('text' => 'Usuario', 'width' => '50', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => 'LTBR');
$col[] = array('text' => 'NUsuario', 'width' => '50', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => 'LTBR');
$col[] = array('text' => 'NUsuarioFTP', 'width' => '50', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => 'LTBR');
$col[] = array('text' => '', 'width' => '10', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => '');
$col[] = array('text' => 'Nombre:', 'width' => '40', 'height' => '7', 'align' => 'R', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => '');
$col[] = array('text' => $nombre_bd, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => '');
$columns[] = $col; $columns[] = $col;


// data col
// data tupla 2
$col = array(); $col = array();
$col[] = array('text' => 'Clave', 'width' => '50', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => 'LTBR');
$col[] = array('text' => 'NClave', 'width' => '50', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => 'LTBR');
$col[] = array('text' => 'NClave', 'width' => '50', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => 'LTBR');
$col[] = array('text' => '', 'width' => '10', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => '');
$col[] = array('text' => 'Usuario:', 'width' => '40', 'height' => '7', 'align' => 'R', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => '');
$col[] = array('text' => $usuario_bd, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => '');
$columns[] = $col; $columns[] = $col;

// data tupla 3
$col = array();
$col[] = array('text' => '', 'width' => '10', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => '');
$col[] = array('text' => 'Clave:', 'width' => '40', 'height' => '7', 'align' => 'R', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => '');
$col[] = array('text' => $pass_bd, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => '');
$columns[] = $col;

// Draw Table
$pdf->WriteTable($columns);
$pdf->WriteHTML('<br>'); $pdf->WriteHTML('<br>');
// header tupla 2
$col2 = array();
$col2[] = array('text' => '', 'width' => '10', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '255,255,255', 'linewidth' => '0.0', 'linearea' => '');
$col2[] = array('text' => 'FTP', 'width' => '40', 'height' => '7', 'align' => 'R', 'font_name' => 'Arial', 'font_size' => '15', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => '');
$col2[] = array('text' => '', 'width' => '140', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '15', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => '');
$columns2[] = $col2;

// data tupla 1
$col2 = array();
$col2[] = array('text' => '', 'width' => '10', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => '');
$col2[] = array('text' => 'Usuario:', 'width' => '40', 'height' => '7', 'align' => 'R', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => '');
$col2[] = array('text' => $usuario_ftp, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => '');
$columns2[] = $col2;


// data tupla 2
$col2 = array();
$col2[] = array('text' => '', 'width' => '10', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => '');
$col2[] = array('text' => 'Clave:', 'width' => '40', 'height' => '7', 'align' => 'R', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => '');
$col2[] = array('text' => $pass_ftp, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => '');
$columns2[] = $col2;

$pdf->WriteHTML('<br>');
$pdf->WriteTable($columns2);


// header 3
$col3 = array();
$col3[] = array('text' => '', 'width' => '10', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '255,255,255', 'linewidth' => '0.0', 'linearea' => '');
$col3[] = array('text' => 'Nuevo Dominio:', 'width' => '40', 'height' => '7', 'align' => 'R', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => '');
$col3[] = array('text' => $nombreDominio, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => '');
$columns3[] = $col3;


$pdf->WriteHTML('<br><br>');
// Draw Table // Draw Table
//$pdf->WriteTable($columns);
$pdf->WriteTable($columns3);






//$pdf->AddPage(); //$pdf->AddPage();
$pdf->SetLink($link); $pdf->SetLink($link);
$pdf->Image('imagen/open6-logo.png',10,12,50,0,'','http://www.open6hosting.com'); $pdf->Image('imagen/open6-logo.png',10,12,50,0,'','http://www.open6hosting.com');
$pdf->SetLeftMargin(65);
$pdf->SetFontSize(12);
$pdf->SetLeftMargin(12);
$pdf->SetFontSize(10);
$pdf->WriteHTML('<br><br><br><br><br><br>');


//$pdf->WriteHTML($name); //$pdf->WriteHTML($name);
$pdf->WriteHTML($info);
//$pdf->WriteHTML($info);
$pdf->WriteHTML($enlace); $pdf->WriteHTML($enlace);
$pdf->WriteHTML('<b></b><br>Telf: 951 20 42 88 <br>');
$pdf->WriteHTML('<b></b>Fax: 951 39 09 29');
//$pdf->WriteHTML($enlace);
$pdf->WriteHTML($enlaceBlog);
$pdf->WriteHTML($enlaceFace);
$pdf->WriteHTML($enlaceTwitter);
$pdf->WriteHTML('<br>');
$pdf->WriteHTML($enlacePriv);
$pdf->WriteHTML($enlaceAdvertencia);
//$pdf->WriteHTML($nombre_base); //$pdf->WriteHTML($nombre_base);
$pdf->Output(); $pdf->Output();




+ 2
- 2
new_service_webdns.php 查看文件

@@ -191,11 +191,11 @@ class page_action extends tform_actions {
$eldom = $fields['domain']; $eldom = $fields['domain'];
echo '<form method="post" id="formulario" action="webdns/pdf_o6h.php" target="_blank">'; echo '<form method="post" id="formulario" action="webdns/pdf_o6h.php" target="_blank">';
echo '<input id="pdf_power" name="pdf_power" type="hidden" value="'.$html_resultado.'">'; echo '<input id="pdf_power" name="pdf_power" type="hidden" value="'.$html_resultado.'">';
/*echo '<input id="usuario_bd" name="usuario_bd" type="hidden" value="'.$this->usuario_db_txt.'">';
echo '<input id="nombre_bd" name="nombre_bd" type="hidden" value="'.$this->nombre_db_txt.'">'; echo '<input id="nombre_bd" name="nombre_bd" type="hidden" value="'.$this->nombre_db_txt.'">';
echo '<input id="usuario_bd" name="usuario_bd" type="hidden" value="'.$this->usuario_db_txt.'">';
echo '<input id="pass_bd" name="pass_bd" type="hidden" value="'.$this->pass_db_txt.'">'; echo '<input id="pass_bd" name="pass_bd" type="hidden" value="'.$this->pass_db_txt.'">';
echo '<input id="usuario_ftp" name="usuario_ftp" type="hidden" value="'.$this->usuario_ftp_txt.'">'; echo '<input id="usuario_ftp" name="usuario_ftp" type="hidden" value="'.$this->usuario_ftp_txt.'">';
echo '<input id="pass_ftp" name="pass_ftp" type="hidden" value="'.$this->pass_ftp_txt.'">';*/
echo '<input id="pass_ftp" name="pass_ftp" type="hidden" value="'.$this->pass_ftp_txt.'">';
echo '<input id="dominio_nuevo" name="dominio_nuevo" type="hidden" value="'.$eldom.'">'; echo '<input id="dominio_nuevo" name="dominio_nuevo" type="hidden" value="'.$eldom.'">';
echo '<input type="submit" class="btn btn-default formbutton-success" value="Descargar PDF">'; echo '<input type="submit" class="btn btn-default formbutton-success" value="Descargar PDF">';
/*echo '<button class="btn btn-default formbutton-success" id="dom-edit-submit" type="button" value="'.$html_resultado.'">FueraPdf</button>'; /*echo '<button class="btn btn-default formbutton-success" id="dom-edit-submit" type="button" value="'.$html_resultado.'">FueraPdf</button>';


+ 11
- 11
pdf_o6h.php 查看文件

@@ -1,23 +1,23 @@
<?php <?php


$info = $_POST['pdf_power']; $info = $_POST['pdf_power'];
/*$usuario_bd = $_POST['usuario_bd'];
$nombre_bd = $_POST['nombre_bd']; $nombre_bd = $_POST['nombre_bd'];
$usuario_bd = $_POST['usuario_bd'];
$pass_bd = $_POST['pass_bd']; $pass_bd = $_POST['pass_bd'];
$usuario_ftp = $_POST['usuario_ftp']; $usuario_ftp = $_POST['usuario_ftp'];
$pass_ftp = $_POST['pass_ftp'];*/
$pass_ftp = $_POST['pass_ftp'];
$dominio_nuevo = $_POST['dominio_nuevo']; $dominio_nuevo = $_POST['dominio_nuevo'];




echo '<form method="post" id="formulario" id="fuera" action="crear_pdf_o6h.php">';
echo '<input id="pdf_power2" name="pdf_power2" type="hidden" value="'.$info.'">';
/*echo '<input id="nombre_bd" name="nombre_bd" type="hidden" value="'.$nombre_bd.'">';
echo '<input id="usuario_bd" name="usuario_bd" type="hidden" value="'.$usuario_db.'">';
echo '<input id="nombre_bd" name="nombre_bd" type="hidden" value="'.$this->nombre_db_txt.'">';
echo '<input id="pass_bd" name="pass_bd" type="hidden" value="'.$this->pass_db_txt.'">';
echo '<input id="usuario_ftp" name="usuario_ftp" type="hidden" value="'.$this->usuario_ftp_txt.'">';
echo '<input id="pass_ftp" name="pass_ftp" type="hidden" value="'.$this->pass_ftp_txt.'">';*/
//print $nombre_bd . ' ' . $usuario_bd . ' ' . $pass_bd;
//print $usuario_ftp . ' ' . $pass_ftp;
echo '<form method="post" id="formulario" action="crear_pdf_o6h.php">';
echo '<input id="pdf_power" name="pdf_power2" type="hidden" value="'.$info.'">';
echo '<input id="nombre_bd" name="nombre_bd2" type="hidden" value="'.$nombre_bd.'">';
echo '<input id="usuario_bd" name="usuario_bd2" type="hidden" value="'.$usuario_bd.'">';
echo '<input id="pass_bd" name="pass_bd2" type="hidden" value="'.$pass_bd.'">';
echo '<input id="usuario_ftp" name="usuario_ftp2" type="hidden" value="'.$usuario_ftp.'">';
echo '<input id="pass_ftp" name="pass_ftp2" type="hidden" value="'.$pass_ftp.'">';
echo '<input id="dominio_nuevo" name="dominio_nuevo" type="hidden" value="'.$dominio_nuevo.'">'; echo '<input id="dominio_nuevo" name="dominio_nuevo" type="hidden" value="'.$dominio_nuevo.'">';
echo '</form>'; echo '</form>';




Loading…
取消
儲存