Search the Community
Showing results for tags 'reports'.
-
Hey all I was wondering what are my options for generating a report? I developed the database and the table in myphpadmin and I was wondering what were the common tools to gernate reports that only pull specific info from the form data? My boss wants reports that also show what images a user uplaods, I'm a bit confused about how to go about doing this since I just started out and am a Junior Dev. I figured report generations were handled through Access and whatever admins have access to the databases. I did try to find some tutorials so I can run through them, but everything I find is suggesting actual management programs and report generating programs. I'll be setting this up over the weekend it looks like. And I would to learn this and grow. Thank you for your time.
-
Hi I have a problem to send php page with data to printer directly. Below code is working fine but only print issue. Pls help me Html page <style type="text/css"></style> <?php include '../templete/header.php'; ?> <Script Language="javascript"> function change_action() { var frm_obj=document.getElementById("frm"); frm_obj.action="data.php"; } </Script> <table class="tbl_table" align="center"> <form action="" method="POST" id="frm" > <tr> <td class="td_title" colspan="2"><strong>Outstanding Balance Report</strong></td> </tr> <tr> <td class="td_class_right">Until:</td> <td><input class="textdesign" type="text" id="datepicker1" name="datefrom" /></td> </tr> <tr> <td class="td_button" colspan="2"> <input class="buttondesign" type="submit" value="Search" name="search" onclick="change_action()"> <input class="buttondesign" type="submit" value="print" name="print" onclick="change_action()"> </td> </tr> </form> </table> data.php <?php include_once '../inc/connection.inc.php'; ?> <?php if (isset($_POST['search']) && $_POST['search'] != "" ) { $datefrom=$_POST["datefrom"]; $s = $dbh->prepare("EXECUTE usp_OutStanding_Balance ?"); $s->bindParam(1, $datefrom, PDO::PARAM_STR); $stmt = $s->execute(); $stmt = $dbh->query("SELECT * FROM vw_OutStanding_Balance ORDER BY MVName"); $stmt->setFetchMode(PDO::FETCH_ASSOC); include 'view.html.php'; } ?> <?php if (isset($_POST['print']) && $_POST['print'] != "" ) { $datefrom=$_POST["datefrom"]; $s = $dbh->prepare("EXECUTE usp_OutStanding_Balance ?"); $s->bindParam(1, $datefrom, PDO::PARAM_STR); $stmt = $s->execute(); $stmt = $dbh->query("SELECT * FROM vw_OutStanding_Balance ORDER BY MVName"); $stmt->setFetchMode(PDO::FETCH_ASSOC); include 'print.html.php'; } ?> print.html.php <?php include '../templete/print_head.php'; ?> <?php $groupby = ''; $displaySubTotal = FALSE; $subTotal = 0; $grandTotal = 0; $sub_debit=0; // maideen $grn_debit=0; // maideen $sub_credit=0; // maideen $grn_credit=0; // maideen $sub_bal=0; // maideen $grn_bal=0; // maideen ?> <div class="title">Outstanding Report</div> <table width="100%" align="center" cellpadding="4" cellspacing="1" class=tbl_table"> <tr><td colspan="6"><hr /></td></tr> <tr> <td class="tdempty"></td> <td class="tbl_header">MV CODE</td> <td class="tbl_header">MV NAME</td> <td class="tbl_header_right">DEBIT</td> <td class="tbl_header_right">CREDIT</td> <td class="tbl_header_right">BALANCE</td> <td class="tdempty"></td> </tr> <tr><td colspan="6"><hr /></td></tr> <?php if(isset($stmt)) { while($row = $stmt->fetch()): if($groupby!=$row['MVName']): if($displaySubTotal): ?> <?php $grn_debit += $sub_debit; $sub_debit=0; $grn_credit += $sub_credit; $sub_credit=0; $grn_bal += $sub_bal; $sub_bal=0; else: $displaySubTotal = TRUE; endif; $groupby = $row['MVName']; endif; ?> <tr> <td class="tdempty"></td> <td class="tbl_content"><?php echo $row['MVcode'];?></td> <td class="tbl_content"><?php echo $row['MVName'];?></td> <td class="tbl_content_right"><?php echo number_format($row['Debit'],2) ;?></td> <td class="tbl_content_right"><?php echo number_format($row['Credit'],2) ;?></td> <td class="tbl_content_right"><?php echo number_format($row['Balance'],2) ;?></td> <td class="tdempty"></td> </td> <?php $sub_debit += $row['Debit']; $sub_credit += $row['Credit']; $sub_bal += $row['Balance']; endwhile; $grn_debit += $sub_debit; $grn_credit += $sub_credit; $grn_bal += $sub_bal; ?> <tr><td colspan="6"><hr /></td></tr> <tr> <td colspan="2"> <td class="tbl_subtotal_left"><b>Grand Total</b></td> <td class="tbl_subtotal_right"><b><?php echo number_format($grn_debit,2); ?></b></td> <td class="tbl_subtotal_right"><b><?php echo number_format($grn_credit,2); ?></b></td> <td class="tbl_subtotal_right"><b><?php echo number_format($grn_bal,2); ?></b></td> </tr> <tr><td colspan="6"><hr /></td></tr> <?php }?> </table> <?php unset($dbh); unset($stmt); ?> Pls help me if anybody knows. I need once click the print button, system should send data to printer Regards Maideen
-
hi. I need to generate the ageing report like Code Name 30days 60days 90days 120days 0001 abc 500.85 675.90 100.78 56.90 0002 def 123.00 0.00 21.00 67.09 My code is below. But Nothing is appear. Pls if anyone knows pls help me connection.inc.php <?php try { $hostname = "server"; //host $dbname = "database"; //db name $username = "user"; // username like 'sa' $pw = "password"; // password for the user $dbh = new PDO ("mssql:host=$hostname;dbname=$dbname","$username","$pw"); } catch (PDOException $e) { echo "not connected " . $e->getMessage() . "\n"; file_put_contents('PDOErrors.txt', $e->getMessage(), FILE_APPEND); exit; } ?> index.php <?php include_once '../inc/connection.inc.php'; include 'searchform.html.php'; ?> <?php /* if (isset($_POST['datefrom']) && $_POST['datefrom'] != "" ) { $datefrom = $_POST["datefrom"]; $stmt = $dbh->query("SELECT Code,Name, SUM(CASE WHEN DocDate >= '$datefrom' - 30 THEN Balance ELSE 0 END) AS d30, SUM(CASE WHEN DocDate BETWEEN '$datefrom' - 60 AND '$datefrom' - 31 THEN Balance ELSE 0 END) AS d60, SUM(CASE WHEN DocDate < '$datefrom' - 60 THEN Balance ELSE 0 END) AS above61, SUM(Balance) AS total_outstanding FROM AgeingReport GROUP BY Code"); $stmt->setFetchMode(PDO::FETCH_ASSOC); } include 'view.html.php'; exit(); */ ?> <?php if (isset($_POST['datefrom']) && $_POST['datefrom'] != "" ) { $datefrom = $_POST["datefrom"]; $stmt=$dbh->prepare(" SELECT Code, Name, DATEDIFF('$datefrom', DocDate) AS days_past_due, SUM(IF(days_past_due = 0, Balance, 0) As curent), SUM(IF(days_past_due BETWEEN 1 AND 30, Balance, 0) As d30), SUM(IF(days_past_due BETWEEN 31 AND 60, Balance, 0) As d60), SUM(IF(days_past_due BETWEEN 61 AND 90, Balance, 0) As d90), SUM(IF(days_past_due > 90, Balance, 0) As d90above) FROM AgeingReport GROUP BY Code"); $stmt->setFetchMode(PDO::FETCH_ASSOC); } include 'view.html.php'; exit(); ?> searchform.html.php <?php include '../templete/header.php'; ?> <div> <h6>Ageing Report</h6> </div> <form action="" method="post"> <table class="tdtable" id="tdtable"> <tr> <td>As on:</td> <td><input type="text" id="datepicker1" name="datefrom" /></td> </tr> </table> <div> <input type="submit" value="Search"> </div> </form> view.html.php <?php //include '../templete/header.php'; ?> <table width="100%" align="center" cellpadding="4" cellspacing="1" class=tbl_table"> <tr> <td class="tbl_header">MV CODE</td> <td class="tbl_header">MV NAME</td> <td class="tbl_header">Current</td> <td class="tbl_header">30-days</td> <td class="tbl_header">60-days</td> <td class="tbl_header">90-days</td> <td class="tbl_header">90-days above</td> </tr> <?php if(isset($stmt)) { while($row = $stmt->fetch()) {?> <tr> <td class="tbl_content"><?php echo $row['Code'];?></td> <td class="tbl_content"><?php echo $row['Name'];?></td> <td class="tbl_content"><?php echo $row['SONo'];?></td> <td class="tbl_content_right"><?php echo number_format(current,2) ;?></td> <td class="tbl_content_right"><?php echo number_format(d30,2) ;?></td> <td class="tbl_content_right"><?php echo number_format(d60,2) ;?></td> <td class="tbl_content_right"><?php echo number_format(d90,2) ;?></td> <td class="tbl_content_right"><?php echo number_format(d90above,2) ;?></td> <!-- <td> <a href="view?=<?php echo $row['SVCode'];?>">View</a> | <a href="edit?=<?php echo $row['SVCode'];?>">Edit</a> | <a href="delete?=<?php echo $row['SVCode'];?>">Delete</a> </td> --> </tr> <?php //$balamt+=$row['BalAmt']; // $balqty+=$row['BalQty']; // $rtnqty+=$row['RTNQty']; // $qty+=$row['Qty']; }}?> <tr><td colspan="9"><hr /></tr> <tr> <!-- <td></td> <td></td> <td></td> <td></td> <td></td> <td class="tbl_content_total"> <?php echo number_format($qty);?></td> <td class="tbl_content_total"> <?php echo number_format($rtnqty);?></td> <td class="tbl_content_total"> <?php echo number_format($balqty);?></td> <td class="tbl_content_total"> <?php echo number_format($balamt,2);?></td> --> </tr> </table> <?php unset($dbh); unset($stmt); ?> <?php include '../templete/footer.php'; ?> Pls help me maideen