#!/usr/bin/php
<?php 
include 'config.php';
include 'sqlreporter.php';
//Setup Email Subject
$subject = 'Daily Import';
//Color is the color report table, it can be set to be grey, green or blue
$color = 'blue';
//Add a message to the header of the report
$header = '<p><H2>Daily Import Summary</H2></p><p><b>Purpose:</b>. The numbers below represent a summary of imported appointments that have been scheduled today.</p>';
//Add a message to the footer of the report, you can use plain text or html.
$footer = '<p><strong>Disclaimer: </strong>This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.</p>';
//The Database Query to Run - Recommend Testing in SQL / PHPMYADMIN / Other tool beforehand to ensure syntax is correct
$query = 'SELECT `name` AS Provider, COUNT(*) AS Appointments, DATE_FORMAT(import_date,"%c/%d") AS DATE
FROM auto_import INNER JOIN accounts ON auto_import.Branch = accounts.id WHERE DATE(import_date) = CURDATE() GROUP BY Branch ORDER BY `name` ASC';
//Generate the report (Do not change)
$report = generateReport($query, $header, $footer, $color);
//Setup Email Recipient (Who are we sending the report to)
$recipient1 = '*****@*****.**';
$recipient2 = '*****@*****.**';
$recipient3 = '*****@*****.**';
$recipient4 = '*****@*****.**';
//Send the report (if you uncomment out recipients above then ensure you uncomment the corresponding html_email below
html_email($recipient1, $subject, $report);
html_email($recipient2, $subject, $report);
html_email($recipient3, $subject, $report);
html_email($recipient4, $subject, $report);
Esempio n. 2
0
<?php

include "./pdo.php";
$db_file = "./restaurant.sqlite3";
PDO_Connect("sqlite:{$db_file}");
if (isset($_POST['action'])) {
    switch ($_POST['action']) {
        case 'report':
            generateReport();
            break;
    }
}
function generateReport()
{
    $dateFrom = $_POST['fromDate'];
    $dateTo = $_POST['toDate'];
    $dateFrom = substr($dateFrom, 4, 11);
    $dateTo = substr($dateTo, 4, 11);
    /*
     * var_dump($dateFrom); if("Aug 14 2015" == $dateFrom ){ echo "14th Aug"; }else { echo "fail"; } echo $dateFrom ."</br>" . $dateTo;
     */
    // Mon Sep 14 2015 00:57:14 GMT+0530 (India Standard Time)
    // Mon Sep 14 2015 00:57:14 GMT+0530 (India Standard Time)
    $mydate = getdate(date("U"));
    // echo "$mydate[weekday], $mydate[month] $mydate[mday], $mydate[year]";
    // "Aug 23 2015";
    // $date = $mydate[mday]."-".substr( $mydate[month],0,3 ) ."-".$mydate[year];
    // $date = substr( $mydate['month'],0,3 )." ".$mydate['mday']." ".$mydate['year'];
    // echo "[12, 11, 15, 56 ,54, 45]";
    // $dateFrom = "Sep 10 2015" ;//$date ;//"Aug 23 2015";
    // $dateTo = $date ;//"Aug 30 2015";
Esempio n. 3
0
function viewReport($id, $year)
{
    $query = "SELECT report_type,report_name FROM ref_lab_report\n            WHERE report_id='{$id}'";
    $result = selQuery($query);
    $row = mysqli_fetch_assoc($result);
    ?>
<!-- <div class="tab-content pn br-n"> -->
  <div class="col-md-12" align="right">
    <a style="cursor:pointer;" onclick="printDiv('allReport')" title="Print Report"><i class="fa fa-print fa-lg"></i></a>
  </div>
  <div class="col-md-12">
    <hr class="short alt">
  </div>
  <div id="allReport">
    <div class="col-md-12" align="center"><h4><?php 
    echo $row['report_name'];
    ?>
 (<?php 
    echo $year;
    ?>
)</h3></div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-12">
      <div class="panel panel-widget chat-widget">
        <div class="panel-body bg-light dark pn">
          <?php 
    echo generateReport($row['report_type'], $id, $year);
    ?>
        </div>
      </div>
    </div>
  </div>
  <div class="col-md-12">&nbsp;</div>
  <div class="col-md-12"><button class="btn btn-primary" onclick="printDiv('allReport')"><i class="fa fa-print"></i> Print</button></div>
<!-- </div> -->
<?php 
}
Esempio n. 4
0
<?php

/**********************************************************************************
 Sistema e-SIC Livre: sistema de acesso a informação baseado na lei de acesso.
 
 Copyright (C) 2014 Prefeitura Municipal do Natal
 
 Este programa é software livre; você pode redistribuí-lo e/ou
 modificá-lo sob os termos da Licença GPL2.
***********************************************************************************/
include "manutencao.php";
include "../inc/topo.php";
//include "../inc/paginacaoIni.php";
$sql = "select * from sis_param";
if ($_REQUEST['imprimir']) {
    generateReport(array("!PATH" => "sis_Param.jasper", "@sql" => $sql, "@usuario" => $_SESSION['usuario'], "@titulo" => "Relatório de Parametros"));
}
$x = iniciaGrid("edita('%Sistema%','%diretorioarquivos%','%urlarquivos%')", null, "novo()");
// Set the query
$x->setQuery("sistema as Sistema, diretorioarquivos, urlarquivos", "sis_param", "sistema");
//$rs = execQueryPag($sql);
?>
<h2>Parametros</h2>
<br>
<!-- FORMULARIO -->
<?php 
include "formulario.php";
?>
<br>
<!-- LISTAGEM -->
<div id="tabelapadrao" align="left"><?php 
Esempio n. 5
0
            if ($row['person_type'] == HR_PROFESSOR || DateModules::CompareDate($row['execute_date'], $equal_payment_system_gdate) < 0) {
                echo '<div class="report_header" style="font-size:medium"><B>اصلاحات احکام کارگزيني</B><br></div>
					<table cellpadding="0" cellspacing="0" class="big_corrective money" style="text-align:center">';
            } else {
                echo '<div class="report_header" style="font-size:medium"><B>اصلاحات احکام کارگزيني</B><br></div>
					<table cellpadding="0" cellspacing="0" class="report money" style="text-align:center">';
            }
            echo $corrective_detail;
            echo "</table>";
        }
        //$fileNames[] = PrintWrit($row, $transcript_no);
        if ($i != $cnt - 1) {
            echo "<div class='pageBreak'></div>";
        }
    }
    return $fileNames;
}
?>
<html dir='rtl'>
	<head>
		<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
		<link rel=stylesheet href="/HumanResources/css/writ.css?v=1">
	</head>
	<body style="margin-top:0">
		<center>
		<? generateReport($transcript_no);?>
		</center>
	</body>
</html>

	
Esempio n. 6
0
                $report .= "<td   class='payment_report_data_custom_noborder' width=10% >" . "&nbsp" . "</td>";
            }
            $report .= "<td   class='payment_report_data_custom_noborder' width=7% >" . "&nbsp;" . "</td>";
        } else {
            $report .= "<td   class='payment_report_data_custom_noborder' width=20% >" . "&nbsp;" . "</td>";
            $report .= "<td   class='payment_report_data_custom_noborder' width=10% >" . "&nbsp;" . "</td>";
            $report .= "<td   class='payment_report_data_custom_noborder' width=10% >" . "&nbsp;" . "</td>";
            $report .= "<td   class='payment_report_data_custom_noborder' width=10% >" . "&nbsp;" . "</td>";
            $report .= "<td   class='payment_report_data_custom_noborder' width=7% >" . "&nbsp;" . "</td>";
        }
        $report .= "</tr>";
    }
    $tags = array('<!--report-->' => $report, '<!--plname-->' => $dt[0]['plname'], '<!--account_no-->' => $dt[0]['account_no'], '<!--staff_id-->' => $dt[0]['staff_id'], '<!--pfname-->' => $dt[0]['pfname'], '<!--name-->' => $dt[0]['name'], '<!--cost_center_title-->' => $dt[0]['cost_center_title'], '<!--month_title-->' => $dt[0]['month_title'], '<!--pay_year-->' => $dt[0]['pay_year'], '<!--total_pay_diffpay-->' => CurrencyModulesclass::toCurrency($pay_sum + $pay_diff_sum), '<!--total_pay-->' => CurrencyModulesclass::toCurrency($pay_sum), '<!--total_diffpay-->' => CurrencyModulesclass::toCurrency($pay_diff_sum), '<!--total_get_diff-->' => CurrencyModulesclass::toCurrency($get_sum + $get_diff_sum), '<!--total_get-->' => CurrencyModulesclass::toCurrency($get_sum), '<!--total_diffget-->' => CurrencyModulesclass::toCurrency($get_diff_sum), '<!--total-->' => CurrencyModulesclass::toCurrency($pay_sum + $pay_diff_sum - $get_sum - $get_diff_sum), '<!--str_total-->' => CurrencyModulesclass::CurrencyToString($pay_sum + $pay_diff_sum - $get_sum - $get_diff_sum), '<!--message-->' => $dt[0]['message']);
    $content = file_get_contents("salary_receipt_print.htm");
    $content = str_replace(array_keys($tags), array_values($tags), $content);
    echo $content;
}
?>
<html dir='rtl'>
	<head>
		<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
		<link rel=stylesheet href="/HumanResources/css/payment.css">
	</head>
	<body style="margin-top:0">
		<center>
		<br><br>
		<? generateReport();?>
		</center>
	</body>
</html>
	
Esempio n. 7
0
$config = array('sourceExcel' => __DIR__ . '/xlsx/template.xlsx', 'outputExcel' => __DIR__ . '/xlsx/%d.xlsx', 'outputPdf' => __DIR__ . '/pdf/%d.pdf', 'cloudConvertApiKeys' => array('XIU_E1PbC4IfV3g__voYH2cDEEAE3ESKUoRXOhhIN2N9uiwcyqyCTx9or-Tk5VxOAm3X3HU-9A3wA7aYfwYcPg', 'FlPpDn4efRcAucXYUXFzk0a33O5WNfVHd1A-bB4_IUTUtIlJJP7tJML2_HTBGGkzRZQglK1YzfcImQoDPZYXUA', 'qhr3LzW1LoMcxf1PL0QYLta8Isb3XfiEMSgyBod6_sldj01Abg6TeULnqemWeHfmr5coFubSZUOKVjSB-kHjsg'));
ini_set('error_log', __DIR__ . '/error.log');
ini_set('log_errors', true);
ini_set('display_errors', false);
error_reporting(E_ALL);
$isAjaxRequest = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest';
require __DIR__ . '/vendor/autoload.php';
$action = filter_input(INPUT_POST, 'action');
$answer = array('status' => false);
if ('getReport' === $action) {
    try {
        $variantNo = filter_input(INPUT_POST, 'variantNo', FILTER_VALIDATE_INT, array('options' => array('min_range' => 21, 'max_range' => 45)));
        if (!$variantNo) {
            throw new RequestException('Не вказано номер варіанту');
        }
        $answer['link'] = generateReport($variantNo);
        $answer['status'] = true;
    } catch (RequestException $e) {
        $answer['error'] = $e->getMessage();
    } catch (Exception $e) {
        error_log($e->getMessage() . PHP_EOL . $e->getTraceAsString());
        $answer['error'] = 'Внутрішня помилка серверу';
    }
    if (!$isAjaxRequest) {
        header('Location: ' . $answer['link'], true, 301);
        exit;
    }
}
if ($isAjaxRequest) {
    header('Content-Type:application/json;charset=utf-8');
    echo json_encode($answer);
Esempio n. 8
0
    //$footer = '<p><strong>Note: </strong>This is an optional report footer, ideally used for a report legend and/or signature.</p>';
    $footer = '';
    $summary_query = 'select description AS "Description", risk_category AS "Risk Category", start_date AS "Portfolio Start Date", starting_capital AS "Starting Capital" from liveportfolio_account where portfolio_id = ' . $pid;
    $summary_report = generateReport($summary_query, $summary_header, $footer, $color);
    $performance_header = '<b>Current Performance</b>';
    $performance_query = 'select liveportfolio_value(' . $pid . ') AS "Current Value", (liveportfolio_value(' . $pid . ') - starting_capital) AS "Current Dollar Return", round((liveportfolio_value(' . $pid . ') - starting_capital)*100/starting_capital, 2) AS "Current Pct Return" from liveportfolio_account where portfolio_id = ' . $pid;
    $performance_report = generateReport($performance_query, $performance_header, $footer, $color);
    $sell_header = '<b>Submitted Sell Orders</b>';
    $sell_query = 'select a.symbol AS "Symbol", a.shares AS "Shares", b.close AS "Today Close", b.daily_change AS "Today Change", b.pct_change AS "Today Pct Change", c.cost_basis AS "Cost Basis", round(b.close-c.cost_basis, 2) AS "Profit" from order_queue a, quotes b, liveportfolio c where a.portfolio_id = ' . $pid . ' and a.portfolio_id = c.portfolio_id and a.order_type like "%SELL%" and a.symbol=b.symbol and b.symbol = c.symbol and b.trade_date = "' . $today . '"';
    $sell_report = generateReport($sell_query, $sell_header, $footer, $color);
    $buy_header = '<b>Submitted Buy Orders</b>';
    $buy_query = 'select a.symbol AS "Symbol", a.shares AS "Shares", b.close AS "Today Close", b.daily_change AS "Today Change", b.pct_change AS "Today Pct Change" from order_queue a, quotes b where a.portfolio_id = ' . $pid . ' and a.order_type like "%BUY%" and a.symbol=b.symbol and b.trade_date = "' . $today . '"';
    $buy_report = generateReport($buy_query, $buy_header, $footer, $color);
    $holding_header = '<b>Current Holdings</b>';
    $holding_query = 'select a.symbol AS "Symbol", a.shares AS "Shares", a.cost_basis AS "Cost Basis", b.close AS "Current Price", round((b.close-a.cost_basis)*100/b.close, 2) AS "Profit %", b.daily_change as "Daily Change", b.pct_change as "Daily % Change" from liveportfolio a, quotes b where portfolio_id = ' . $pid . ' and a.symbol = b.symbol and b.trade_date = "' . $today . '" order by 5 asc';
    $holding_report = generateReport($holding_query, $holding_header, $footer, $color);
    $history_header = '<p><b>Historical Portfolio Returns</b></p>';
    $history_performance_query = 'select a.portfolio_id as "PID", a.trade_date as "Date", b.description AS "Description", b.risk_category as "Risk Category", a.return_dollar as "Dollar Returns", a.return_pct as "Pct Returns", round(a.portfolio_value, 2) as "Portfolio Value" from liveportfolio_hist_performance a, liveportfolio_account b where a.portfolio_id = ' . $pid . ' and b.status = "A" and a.portfolio_id = b.portfolio_id order by PID, DATE desc';
    #$hist_report = generateReport($history_performance_query, $history_header, $footer, $color);
    $finalReport .= $summary_report . $poerformance_report . $sell_report . $buy_report . $holding_report . $hist_report;
}
$html_live_monitor = '<p></p><p><b><a href="http://www.lucasmia.com/StockValuation/algo/live_monitor.html">Click Here</a> to see the historical performance for all live portfolios </b></p>';
$finalReport .= $html_live_monitor;
//Setup Email Recipient (Who are we sending the report to)
$recipient1 = '*****@*****.**';
//$recipient1 = '*****@*****.**';
$recipient2 = '*****@*****.**';
//$recipient2 = '*****@*****.**';
//$recipient3 = '*****@*****.**';
//Send the report (if you uncomment out recipients above then ensure you uncomment the corresponding html_email below
html_email($recipient1, $subject, $finalReport);
Esempio n. 9
0
 function generateReport($cNet, $sParentPath, $iLevel = 0, $iSubnet = 1)
 {
     global $iSubnetCount;
     global $iBranchCount;
     // Create a level path string for this subnet (unless its the base branch/global address)
     $sPath = "";
     if ($iLevel > 0) {
         if ($sParentPath != "") {
             $sPath = $sParentPath . "." . $iSubnet;
         } else {
             $sPath = $sParentPath . $iSubnet;
         }
     }
     // Generate a indentation string (for readability)
     $sIndent = "";
     for ($i = 0; $i < $iLevel + 1; $i++) {
         $sIndent .= "\t";
     }
     // If this network has subnets move down till we hit the bottom
     if ($cNet->getSubnets()) {
         // Create the hidden container (use when this branch is collapsed)
         print "<div id=\"divBranch" . $iBranchCount . "0\">";
         print $sPath . $sIndent . "<a herf=\"#\" onclick=\"toggleBranch(" . $iBranchCount . ", 1)\">+</a> ";
         print $cNet->getAddress()->toStr() . "/" . $cNet->getPrefix() . "\n";
         print "</div>";
         // Create the content container (use when this branch is expanded)
         print "<div id=\"divBranch" . $iBranchCount . "1\" style=\"display:none;\">";
         print $sPath . $sIndent . "<a herf=\"#\" onclick=\"toggleBranch(" . $iBranchCount . ", 0)\">-</a> ";
         print $cNet->getAddress()->toStr() . "/" . $cNet->getPrefix() . "\n";
         $iBranchCount++;
         // Generate a report for all subnets (next level down)
         generateReport($cNet->getSubnets(), $sPath, $iLevel + 1);
         // End the content branch
         print "</div>";
         // Generate a report for any peers
         $iSubnetCount++;
         if ($cNet->getNext()) {
             generateReport($cNet->getNext(), $sParentPath, $iLevel, $iSubnet + 1);
         }
     } else {
         // This must be the bottom of the tree, generate a report for all peers
         for ($cNets = $cNet; $cNets; $cNets = $cNets->getNext()) {
             // Create a level path string for this subnet
             $sPath = "";
             if ($sParentPath != "") {
                 $sPath = $sParentPath . "." . $iSubnet;
             } else {
                 $sPath = $sParentPath . $iSubnet;
             }
             // Print the network details
             $sAddress = $cNets->getAddress()->toStr();
             print $sPath . $sIndent . $cNets->getAddress()->toStr() . "/" . $cNets->getPrefix() . "\n";
             $iSubnetCount++;
             $iSubnet++;
         }
     }
     return;
 }