<?php
//productionStoreReport
include("../public/impOpreation.php");

//the global file operation
include_once("../public/config.php");

$do = $_GET['do'];



//check and use the condetion that suite this action
if (empty($do)) {
    
    $fromdate = $_POST['fromdate'];
    $todate = $_POST['todate'];

    $queryString1 = "";
    $searchQuery2 = "";

    if ($fromdate != '' && $todate != '') {
        $queryString1 .= ' and s.sellbilldate   >= "' . $fromdate . ' 00-00-00" and s.sellbilldate  <=  "' . $todate . ' 23-59-59" ';
        $searchQuery2 .= ' and sr.returnsellbilldate   >= "' . $fromdate . ' 00-00-00" and sr.returnsellbilldate  <=  "' . $todate . ' 23-59-59" ';
    }

    R::getAll('SELECT sellbillid,sellbill.sellbillclientid as clientid,sellbill.sellbilltotalbill as parcode,sellbill.sellbillaftertotalbill as note,sellbill.userid
                    ,sellbilldiscount,sellbilldiscounttype,tax
                    FROM sellbill ' . $queryString1 . ' AND conditions = 0');
    
    $smarty->display("header.html");
    $smarty->display("storeSalesReportView/show.html");
    $smarty->display("footer.html");
 
    //here the smarty templates
} 

