Beispiel #1
0
 $pdf->Ln(10);
 $pdf->SetFont('Arial', '', 14);
 $pdf->Cell(70);
 $pdf->SetFont('', 'B', 14);
 $pdf->Cell(50, 11, 'Consommation d\'électricité :', 0, 0, 'C');
 $pdf->Ln(12);
 $pdf->SetFont('', '', 10);
 $nbrelignesmaxPAC = 17;
 if (count($data) > $nbrelignesmaxPAC) {
     for ($key = 0; $key < $nbrelignesmaxPAC; $key++) {
         $datapage1[] = $data[$key];
     }
     for ($key = $nbrelignesmaxPAC; $key < count($data); $key++) {
         $datapage2[] = $data[$key];
     }
     $pdf->FancyTable($header, $datapage1);
     $pdf->AddPage();
     $pdf->Ln(4);
     $pdf->SetFont('', 'B', 14);
     $pdf->Cell(70);
     $pdf->Cell(50, 11, 'Liste du matériel - suite', 0, 0, 'C');
     $pdf->Ln(12);
     $pdf->SetFont('', '', 10);
     $pdf->FancyTable($header, $datapage2);
     $pdf->Ln(4);
 } else {
     $pdf->FancyTable($header, $data);
 }
 $pdf->Ln(10);
 $pdf->SetFont('Arial', '', 12);
 $pdf->Cell(70);
 function printUsers()
 {
     $db = $this->conn;
     $result = mysqli_query($db, "SELECT * FROM system_users WHERE deleted=0");
     $num = 0;
     $pdf = new PDF();
     $pdf->AliasNbPages();
     $pdf->SetFont('Arial', '', 12);
     $data = array();
     while ($row = mysqli_fetch_array($result)) {
         $num++;
         $name = $row['first_name'] . " " . $row['middle_name'] . ' ' . $row['last_name'];
         $appointment = $row['appointment'];
         $email = $row['email'];
         $role = $row['role'];
         $data[] = [$num, $name, $appointment, $email, $role];
     }
     $pdf->AddPage();
     $pdf->FancyTable($data);
     $pdf->Output("../files/List of Users.pdf");
 }
        } while ($row = mysqli_fetch_array($result));
    }
}
//fin de la definicion de la clase extendida de fpdf
//----------------------------------------------------
//conexion a la base de datos
require_once '../../lib/config.php';
// $conn = mysqli_connect("localhost","root","");
// mysqli_select_db("prally", $conn);
$result = mysqli_query($conn, "SELECT codigo, nombre, materia, telefono from maestros");
//devuelve true si se pudo hacer la consulta, y falso en caso contrario
//si hay registros insertados
if (mysqli_num_rows($result)) {
    $pdf = new PDF('L', 'mm', 'Letter');
    //Titulos de las columnas
    $encabezados = array(utf8_decode('Código'), 'Nombre', 'Materia', utf8_decode('Teléfono'));
    $pdf->SetFont('Arial', '', 12);
    $pdf->AddPage();
    $pdf->Write(10, 'Listado de los Profesores del Rally', '');
    $pdf->Ln();
    $pdf->FancyTable($encabezados, $result);
    //dibuja la tabla con la funcion FancyTable
    //<img src="../../images/participantes/$row['foto']" width='50px' height='60px'/>
    $pdf->Output();
} else {
    echo "¡ La base de datos está vacia !";
}
// }else {
// echo "Est&aacutes accediendo a una p&aacutegina restringida, para ver su contenido debes estar registrado.<br />
// <a href='../../login/acceso.php'>Ingresar</a>";
// }
 function downloadpdf($getid = "")
 {
     require 'fpdf/pdf.php';
     $filter["fillter"] = "";
     if ($getid) {
         $filter["fillter"] = $getid;
         $data['fillter'] = $getid;
     } else {
         $data['fillter'] = "";
         $filter["fillter"] = "";
     }
     $pdf = new PDF();
     $pdf->mytitle('Master list');
     $results = $this->masterlist_model->GetAllrecords($filter);
     $regions_arr = $this->masterlist_model->GetAllRegion();
     // Column headings
     $header = array('S.No', 'Profile Title', 'Date of Birth', 'Profession', 'User Kind', 'Region', 'Affiliate', 'Status');
     // Data loading
     $data = array();
     $i = 1;
     $stas = array('1' => 'AVAILABLE', '2' => 'PENDING', '3' => 'READY', '4' => 'USED');
     foreach ($results as $key => $objRow) {
         $regions_arr;
         $strregion = "";
         $tmpcounter = 1;
         if (!empty($objRow['region_id'])) {
             $tmp_arr = explode(",", $objRow['region_id']);
             $tmpcount = count($tmp_arr);
             if (!empty($tmp_arr)) {
                 foreach ($tmp_arr as $key => $value) {
                     if ($tmpcounter < $tmpcount) {
                         $str = ",";
                     } else {
                         $str = " ";
                     }
                     $strregion .= $regions_arr[$value] . $str;
                     $tmpcounter++;
                 }
             }
         }
         if (!empty($objRow["status"])) {
             $status = $objRow["status"];
         } else {
             $status = "";
         }
         if (!empty($objRow["title"])) {
             $title = $objRow["title"];
         } else {
             $title = "-";
         }
         if (!empty($objRow["kind"])) {
             $kind = $objRow["kind"];
         } else {
             $kind = "-";
         }
         if (!empty($objRow["username"])) {
             $username = stripslashes($objRow["username"]);
         } else {
             $username = "******";
         }
         if (!empty($objRow["dob"])) {
             $dob = $objRow["dob"];
         } else {
             $dob = "-";
         }
         if (!empty($objRow["category"])) {
             $category_s = $objRow["category"];
         } else {
             $category_s = "-";
         }
         $stasget = $stas[$status] ? $stas[$status] : "";
         $data[] = array($i, $title, $dob, $category_s, $kind, $strregion, $username, $stasget);
         $i++;
     }
     $pdf->SetFont('Arial', '', 10);
     $pdf->AddPage();
     //echo '<pre>';print_r($data);exit;
     $pdf->FancyTable($header, $data);
     ob_end_clean();
     // $pdf->Output();
     $pdf->Output('masterlist' . time() . '.pdf', 'D');
     /*    
          $stas = array('1'=>'AVAILABLE','2'=>'PENDING','3' => 'READY','4'=> 'USED');
         	$header = array('S.No', 'Profile Title', 'User Kind', 'Region','Affiliate','Status');
     	// Data loading
     $data[] =  array(1,"Title","Kind","Region,data","username",$stas[1]);
     $pdf = new PDF();
     $pdf->AliasNbPages();
     $pdf->AddPage();
     $pdf->SetFont('Times','',12);
     $pdf->FancyTable($header,$data);
     ob_end_clean();
     $pdf->Output('masterlist'.time().'.pdf', 'D');
         
         exit;   
     */
 }
Beispiel #5
0
    _getCFDI('Receptor');
    _getCFDI('Domicilio');
    _getConceptos();
    _getCFDI('Impuestos');
    _getCFDI('Traslado');
    _getTFD('TimbreFiscalDigital');
    $data['version'] = getpath("//@Version");
    if (is_array($data['version'])) {
        $data['version'] = $data['version'][0];
    }
    $data['version'] = trim($data['version']);
    if (is_array($data['version'])) {
        $data['version'] = $data['version'][0];
    }
    $data['sellocfd'] = getpath("//@selloCFD");
    $data['sellosat'] = getpath("//@selloSAT");
    $data['no_cert_sat'] = getpath("//@noCertificadoSAT");
}
$i = 0;
foreach ($data['Concepto'] as $key => $val) {
    $d = 0;
    foreach ($val as $k => $v) {
        $header[$d] = $k;
        $d++;
        $body[$i][$k] = $v;
    }
    $i++;
}
$pdf = new PDF('P', 'mm', 'Letter');
$pdf->FancyTable($header, $data['Concepto']);
$pdf->Output();
Beispiel #6
0
            $this->Cell($w[2], 4, $row['size'], 'LRT' . $B, 0, 'L', $fill);
            $this->Cell($w[3], 4, $row['color'], 'LRT' . $B, 0, 'L', $fill);
            $this->Cell($w[4], 4, $row['description'], 'LRT' . $B, 0, 'L', $fill);
            $this->Cell($w[5], 4, $row['checked_out_to'], 'LRT' . $B, 0, 'L', $fill);
            $this->Cell($w[6], 4, $row['item_condition'], 'LRT' . $B, 0, 'L', $fill);
            $this->Cell($w[7], 4, $row['usable'], 'LRT' . $B, 0, 'L', $fill);
            $this->Cell($w[8], 4, $row['note'], 'LRT' . $B, 0, 'L', $fill);
            $this->Ln();
            $rows_printed++;
            $rows_this_page++;
            if ($rows_this_page >= 60) {
                break;
            }
        }
        $this->Cell(array_sum($w), 0, '', 'T');
        return $rows_printed;
    }
}
$pdf = new PDF();
$pdf->SetMargins(4, 5, 4);
//Column titles
$header = $_SESSION['inv_headers'];
//Data loading
$data = $_SESSION['inv_array'];
$pdf->SetFont('Arial', '', 12);
$rows_printed = 0;
while ($rows_printed < count($data)) {
    $pdf->AddPage();
    $rows_printed = $pdf->FancyTable($header, $data, $rows_printed);
}
$pdf->Output();
    $pdf->Cell(80, 8, $shipping->address2, 0, 1);
}
$pdf->Cell(80, 8, $shipping->city . ' ' . $shipping->state . ' ' . $shipping->zip, 0, 1);
$pdf->Ln(20);
if ($order_id != '' && $order_id != false) {
    $pdf->Cell(60, 8, 'Order: MCH' . $order_id, 0, 0);
} else {
    $pdf->Cell(60, 8, 'Order Number Not Available', 0, 0);
}
$pdf->Cell(60, 8, 'Date of order: ' . format::format_date($order->date_created), 0, 1);
$pdf->Cell(60, 8, 'Requested Delivery Date: ' . format::format_date($order->order_delivery_date), 0, 2);
$pdf->Ln(15);
$order_products = Basket::getBasketContentForOrder($id);
$order_subtotal = 0;
$shipping = $order->shipping_total;
//$tax = $order->tax;
$string = '';
foreach ($order_products as $product) {
    $pr = Product::getProductById($product->product_id);
    $order_subtotal += $product->subtotal;
    $string .= $pr->name . ';' . $product->qty . ';' . $pr->price . ';' . $product->subtotal . "\r\n";
}
$myFile = '/tmp/file.txt';
$fh = fopen($myFile, 'w');
fwrite($fh, $string);
fclose($fh);
$data = $pdf->LoadData($myFile);
unlink($myFile);
$table_header = array('Quantity', 'Product');
$pdf->FancyTable($table_header, $data);
$pdf->Output();
Beispiel #8
0
        //         $ww=$w[4];
        //         else
        //         $ww=$w[$key1+1];
        //          $this->Cell($ww,6,utf8_decode($value),'LR',0,'L',$fill);
        //     }
        //       if($key==$inicial+17)
        //            break;
        //     $this->Ln();
        //    $fill = !$fill;
        // }
        // // Línea de cierre
        // $this->Cell(array_sum($w),1,'','T');
    }
}
$pdf = new PDF('L', 'mm', 'A4');
// Títulos de las columnas
$header = ['header' => array('REQUERIMIENTO ' . $this->R . ' %', 'PRUEBA ' . $this->P . ' %', 'ENTREVISTAS ' . $this->E . ' %')];
// Carga de datos
$inicial = 0;
$headerData = $this->data['Concurso'];
$pdf->headerData = $headerData;
for ($i = 1; $i <= 1; $i++) {
    $pdf->AddPage();
    $pdf->Header1($headerData);
    $pdf->SetFont('Arial', 'B', 9);
    $pdf->FancyTable($header, $this->colMO);
    $pdf->AliasNbPages();
    $inicial += 17;
}
$pdf->Output();
//Alcansan 18
            }
            if (mysql_num_rows($cancha2) > 0) {
                $turno2 = mysql_result($cancha2, 0, 0);
            }
            if (mysql_num_rows($cancha3) > 0) {
                $turno3 = mysql_result($cancha3, 0, 0);
            }
            $this->Cell($w[0], 6, $i . ":00", 'LR', 0, 'C', $fill);
            $this->Cell($w[1], 6, $turno1, 'LR', 0, 'L', $fill);
            $this->Cell($w[2], 6, $turno2, 'LR', 0, 'L', $fill);
            $this->Cell($w[3], 6, $turno3, 'LR', 0, 'L', $fill);
            $this->Ln();
            $fill = !$fill;
        }
        // Línea de cierre
        $this->Cell(array_sum($w), 0, '', 'T');
    }
}
$pdf = new PDF();
$pdf->SetFont('Arial', '', 10);
// Títulos de las columnas
$header = array("Hora", "Cancha 1( -15 min)", "Cancha 2( 0 min)", "Cancha 3( 15 min)");
// Carga de datos
$data = $resPrimerUltimoTurno;
$pdf->AddPage();
$pdf->FancyTable($header, $data, $serviciosTurnos, $fecha);
$nombreTurno = "Turno-" . $fecha . ".pdf";
$pdf->Output($nombreTurno, 'D');
?>

$pdf->SetFont('Arial', '', 7);
$pdf->Cell(80, 5, 'Alma Mater Wear GbR | Donnersbergerstrasse 8 | 80624 Muenchen', '', 0, 'L', false);
$pdf->SetFont('Arial', '', 10);
$pdf->SetXY(20, 60);
$pdf->Cell(80, 5, iconv('UTF-8', 'windows-1252', $user->gender) . " " . iconv('UTF-8', 'windows-1252', $user->firstname) . " " . iconv('UTF-8', 'windows-1252', $user->lastname), '', 0, 'L', false);
$pdf->SetXY(20, 65);
$pdf->Cell(80, 5, iconv('UTF-8', 'windows-1252', $user->street), '', 0, 'L', false);
$pdf->SetXY(20, 70);
$pdf->Cell(80, 5, iconv('UTF-8', 'windows-1252', $user->ort), 0, 'L', false);
//Rechnungsdaten
$pdf->SetFont('Arial', '', 7);
$pdf->SetXY(125, 130);
$pdf->Cell(30, 5, 'Rechnungsdatum:', '', 0, 'R', false);
$pdf->SetXY(155, 130);
$pdf->Cell(30, 5, date("d.m.Y"), '', 0, 'L', false);
$pdf->SetXY(125, 135);
$pdf->Cell(30, 5, 'Rechnungsnummer.:', '', 0, 'R', false);
$pdf->SetXY(155, 135);
$pdf->Cell(30, 5, $bestellnr . "-" . $y, '', 0, 'L', false);
$pdf->SetFont('Arial', '', 10);
//Tabelle mit Bestelldetails
$pdf->SetXY(20, 130);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(30, 5, 'Rechnung', '', 0, 'L', false);
$pdf->SetFont('Arial', '', 10);
$pdf->SetXY(20, 150);
$pdf->FancyTable($header, $data, $subtotal, $discount, $price);
$pdf->SetFont('Arial', 'I', 8);
$pdf->Cell(100, 5, iconv("UTF-8", "ISO-8859-1", 'Sofern nicht anders angegeben, entspricht  das Liefer-/Leistungsdatum dem Rechnungsdatum.'), '', 2, 'L', false);
$pdf->Cell(100, 5, iconv("UTF-8", "ISO-8859-1", 'Gemäß §19 UStG wird keine Umsatzsteuer berechnet.'), '', 2, 'L', false);
$pdf->Output("../invoices/" . $bestellnr . "-" . $y . ".pdf", 'F');
Beispiel #11
0
        // Línea de cierre
        $this->Cell(array_sum($w), 1, '', 'T');
    }
}
$pdf = new PDF('L', 'mm', 'A4');
// Títulos de las columnas
$header = ['header' => array('No.', 'NOMBRES', 'MERITO', 'OPOSICION', 'TOTAL'), 'meritos' => $this->data['meritos'], 'oposicion' => $this->data['oposicion']];
$numcolumM = count($this->data['meritos']);
$numcolumO = count($this->data['oposicion']);
$Cmo = array($numcolumM, $numcolumO);
// Carga de datos
$data = $this->data['AspirantesROW'];
$npages = ceil(count($data) / 18);
$inicial = 0;
$headerData = $this->data['Concurso'];
$pdf->headerData = $headerData;
for ($i = 1; $i <= $npages; $i++) {
    $pdf->AddPage();
    $pdf->Header1($headerData);
    $pdf->SetFont('Arial', 'B', 9);
    $pdf->FancyTable($header, $data, $Cmo, $inicial);
    $pdf->AliasNbPages();
    $inicial += 17;
}
$pdf->Output();
//Alcansan 18
?>



        $this->SetTextColor(255);
        $this->SetDrawColor(0, 0, 0);
        $this->SetLineWidth(0.3);
        $this->SetFont('', 'B');
        // En-tête
        $w = array(38, 20, 20, 20, 20, 60);
        for ($j = 0; $j < count($data); $j++) {
            $this->SetX(15);
            for ($i = 0; $i < count($w); $i++) {
                $this->Cell($w[$i], 11, $data[$j][$i], 1, 0, 'C', true);
            }
            $this->Ln();
            // Restauration des couleurs et de la police
            $this->SetX(15);
            $this->SetFillColor(224, 235, 255);
            $this->SetTextColor(0);
            $this->SetFont('');
        }
        // Trait de terminaison
        $this->MultiCell(array_sum($w), 0, '', 'T');
    }
}
$pdf = new PDF('P', 'mm', 'A4');
// Titres des colonnes
//$header = array('Collaborateurs', 'JW', 'ABS', 'CP','RTT','MAL.','SS','WE','Nb.TR','GSM','PEE','13eme mois','Commission','Avance','Prime','Commentaires');
// Chargement des données
$data = json_decode(utf8_decode($_POST['tab_tr']));
$pdf->SetFont('Courier', '', 11);
$pdf->AddPage();
$pdf->FancyTable($data);
$pdf->Output();
Beispiel #13
0
}
$pdf->Cell(60, 8, 'Payment Method: ' . $order->payment_method, 0, 1);
$pdf->Cell(60, 8, 'Shipping Method: ' . $order->shipping_method, 0, 1);
//$pdf->Cell(60,8, 'Discounts: '. $order->discounts ,0,1);
//$pdf->MultiCell(180,8, 'Discounts: '. $order->discounts ,0,'L',false);
if ($order->comment) {
    //$pdf->Cell(60,8, 'Comment: '. $order->comment ,0,0);
    $comment = str_replace(',', ",\n", $order->comment);
    $pdf->MultiCell(180, 8, 'Comment: ' . $comment, 0, 'L', false);
}
$pdf->Ln(15);
$order_products = Basket::getBasketContentForOrder($id);
$order_subtotal = 0;
$shipping = $order->shipping_total;
$total = $order->order_total;
$string = '';
foreach ($order_products as $product) {
    $pr = Product::getProductById($product->product_id);
    $order_subtotal += $product->subtotal;
    $basket = ORM::factory('orders_basket', $product->id);
    $string .= $pr->name . ';' . $product->qty . ';' . ($basket->rate ? $basket->rate : $basket->packaging_rate) . ';' . $product->subtotal . "\r\n";
}
$myFile = '/tmp/file.txt';
$fh = fopen($myFile, 'w');
fwrite($fh, $string);
fclose($fh);
$data = $pdf->LoadData($myFile);
unlink($myFile);
$table_header = array('Product', 'Quantity', 'Unit Price', 'Total');
$pdf->FancyTable($table_header, $data, $order_subtotal, $shipping, $total);
$pdf->Output();
        $this->SetDrawColor(200, 200, 200);
        $this->SetLineWidth(0.1);
        $this->SetTextColor(0);
        $this->SetFont('Arial', '', 9);
        //Data
        $fill = 0;
        $B = 'B';
        foreach ($data as $row) {
            $this->Cell($w[0], 6, $row[0], 'LR' . $B, 0, 'L', $fill);
            $this->Cell($w[1], 6, $row[1], 'LR' . $B, 0, 'L', $fill);
            $this->Cell($w[2], 6, $row[2], 'LR' . $B, 0, 'L', $fill);
            $this->Cell($w[3], 6, $row[3], 'LR' . $B, 0, 'L', $fill);
            $this->Cell($w[4], 6, $row[4], 'LR' . $B, 0, 'L', $fill);
            $this->Cell($w[5], 6, $row[5], 'LR' . $B, 0, 'L', $fill);
            $this->Ln();
            //$fill=!$fill;
            //if($B == 'B') $B = '';
            //else $B = 'B';
        }
        $this->Cell(array_sum($w), 0, '', 'T');
    }
}
$pdf = new PDF();
//Column titles
$header = $_SESSION['pg_header'];
//Data loading
$data = $_SESSION['pg_array'];
$pdf->SetFont('Arial', '', 12);
$pdf->AddPage();
$pdf->FancyTable($header, $data, $_SESSION['pg_crewmember_name']);
$pdf->Output();
        $this->SetFont('Arial', '', '11');
        // Data table
        $fill = false;
        $j = 1;
        foreach ($data as $row) {
            $this->Cell($w[0], 1, $j, 'L', 0, 'C', $fill);
            $this->Cell($w[1], 1, $row[0], '', 0, 'L', $fill);
            $this->Cell($w[2], 1, $row[1], 'R', 0, 'L', $fill);
            $this->Cell($w[3], 1, $row[2], 'R', 0, 'L', $fill);
            $this->Cell($w[4], 1, $row[3], 'R', 0, 'L', $fill);
            $this->Cell($w[5], 1, $row[4], 'R', 0, 'L', $fill);
            $this->Cell($w[6], 1, $row[5], 'R', 0, 'C', $fill);
            $this->Ln();
            $fill = !$fill;
            $j++;
        }
        // Closing line
        $this->Cell(array_sum($w), 0, '', '');
    }
}
$pdf = new PDF('L', 'cm', 'A4');
//ukuran kertas
// Nama Kolom Heading
$header = array('No', 'Kode Sponsor', 'Nama Sponsor');
// Data loading
$query = "select kode_sponsor,nama_sponsor";
$data = $pdf->LoadDataFromSQL($query);
$pdf->SetFont('Arial', '', 9);
$pdf->AddPage();
$pdf->FancyTable($header, $data);
$pdf->Output();
Beispiel #16
0
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->SetFont('verdana', '', 9);
$pdf->Cell(50, 5, "Clientes a los que se les pagara comisiones (Linea Directa): ", 0);
$pdf->Ln();
if ($data["usuariosEnLineaActiva"]) {
    $header = array('Usuario', 'Activacion de', 'Comision Linear', 'Comision Directa', 'Total');
    foreach ($data["usuariosEnLineaActiva"] as $key => $user) {
        $row[$key][0] = $key . " Id: " . $user["userId"] . " Nombre: " . $user["username"];
        $row[$key][1] = $user["pago"]["cantidad"];
        $row[$key][2] = $user["comision"];
        $row[$key][3] = $user["comisionesDirectas"];
        $row[$key][4] = $user["totalComision"];
    }
    $pdf->FancyTable($header, $row);
}
unset($row);
$pdf->Ln();
$pdf->SetFont('verdana', '', 9);
$pdf->Cell(50, 5, "Clientes a los que se les pagara comisiones directas (Linea Inactiva): ", 0);
$pdf->Ln();
if ($data["usuariosEnLineaInactiva"]) {
    $header = array('Usuario', 'Activacion de', 'Comision Linear', 'Comision Directa', 'Total');
    foreach ($data["usuariosEnLineaInactiva"] as $key => $user) {
        $row[$key][0] = $key . " Id: " . $user["userId"] . " Nombre: " . $user["username"];
        $row[$key][1] = $user["pago"]["cantidad"];
        $row[$key][2] = $user["comision"];
        $row[$key][3] = $user["comisionesDirectas"];
        $row[$key][4] = $user["totalComision"];
    }
Beispiel #17
0
}

	
$pdf->ln(8);
$fuel = ceil($fuel);
$dollar = "$";

$pdf->AddPage(); // remove this to show in cont page.

$pdf->SetFont('Helvetica','B',10);
$settel2 = $_SESSION['startdate']." to ".$_SESSION['todate'];
$pdf->SetX(65);
$pdf->Write(5,"Your invoice details from ".$settel2."");
$pdf->ln(8);

$pdf->FancyTable($header,$result_array);

	if($pdf->GetY() >= 242.00125){
	
	$pdf->AddPage();
	$pdf->FancyTable1($head_valur,$caption,$increasewidth,"bottom");
	}else
	{
		
	$pdf->FancyTable1($head_valur,$caption,$increasewidth,"bottom");
	$pdf->SetTextColor(0,0,0);
	}
 
$save = "Bill ID 1.pdf";

if(isset($_POST["sendas"]) && $_POST["sendas"]=="mail") {
$pdf = new PDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 10);
//$ASU_ID='1208604216';
$sql1 = "SELECT * from Form_data_gumel.somss where ASU_ID='{$ASU_ID}'";
$retval = mysqli_query($conn, $sql1);
//print_r(mysql_field_name($result,0));
//$finfo = mysqli_fetch_field_direct($retval, 1);
//print_r($f_info);
// Column names
//$header = "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'Form_data_gumel.form'";
//$retcol = mysqli_query($conn,$column);
//$header = array('Country', 'Capital', 'Area (sq km)', 'Pop. (thousands)');
//$header1 = array('Country', 'Capital', 'Area (sq km)', 'Pop. (thousands)');
//$print_r($STUDENT_MAIL);
$pdf->FancyTable($retval);
//$VALUE=mysqli_fetch_array($retval, MYSQL_ASSOC);
//$pdf->Output();
//print_r($VALUE['Student_Mail']);
//$to =$VALUE['Student_Mail'];
$subject = "Final Approved Form";
// a random hash will be necessary to send mixed content
$separator = md5(time());
// carriage return type (we use a PHP end of line constant)
$eol = PHP_EOL;
// attachment name
$filename = "StudentFormApproved.pdf";
// encode data (puts attachment in proper format)
$pdfdoc = $pdf->Output("", "S");
$attachment = chunk_split(base64_encode($pdfdoc));
// main header