<?php

include_once("config.php");
    $patientid = $_GET['patientid'];
    if (isset($_GET['startdate'])){
   	 $startdate= $_GET['startdate'];
    } else {
      $dtarr=getdate();
      $padmon=str_pad($dtarr['mon'],2,"0",STR_PAD_LEFT);
      $padday=str_pad($dtarr['mday'],2,"0",STR_PAD_LEFT);
      $startdate=$dtarr['year'].'-'.$padmon.'-'.$padday;
      
    }

    if (isset($_GET['enddate'])){
   	 $enddate= $_GET['enddate'];
    } else {
      $dtarr=getdate();
      $padmon=str_pad($dtarr['mon'],2,"0",STR_PAD_LEFT);
      $enddate=$dtarr['year'].'-'.$padmon.'-'.date('t');
  
    }
   
    $storeid = $_GET['storeid'];

//echo $patientid;
//echo $storeid;
//echo $startdate;
//echo $enddate;



$template = new marprint_page("template_marprint.html", $patientid, $startdate,$enddate,$storeid);



$template -> go302($template->rx_link);



//$template->show();


?>