<?php

$zroot = $_SESSION["zdir"];
$zcomp = $_SESSION["comp_" . $dbname];
$getcomp = mysql_query("SELECT * FROM $zroot.`company`")or die(mysql_error());
$comp = mysql_fetch_array($getcomp);
if ($dtype == 1) {
    $rtype = " - Summary";
} elseif ($dtype == 2) {
    $rtype = " - Detail";
} elseif ($dtype == '') {
    $rtype = '';
}
if ($mfdt != '') {
    $mfdt = "From Date - $mfdt";
}if ($mtdt != '') {
    $mtdt = "To Date - $mtdt";
}
$contents.=$comp[name] . "\n";
$contents.=$comp[add1] . $comp[add2] . $comp[add3] . "\n";

$contents.=$formname . "," . $rtype . "," . "Report Date - " . Date("d-m-Y") . "\n";
$contents.=$mfdt . "," . $mtdt . "\n";
?>
