<?php

include_once("config.php");

$srefilltitle=$refilltitle;
$srefillnote=$refillnote;
$sdelivery='Y';

if (isset($_GET['sphone'])) {
	$sphone = $_GET['sphone'];
	$sname = $_GET['sname'];

} else {
	$sphone=$_POST['sphone'];
	$sname = $_POST['sname'];
}



if (isset($_GET['srefilltitle'])) {
	$srefilltitle = $_GET['srefilltitle'];
	$srefillnote = $_GET['srefillnote'];

} else {

if (isset($_POST['srefilltitle'])) {

	$srefilltitle=$_POST['srefilltitle'];
	$srefillnote = $_POST['srefillnote'];
}
}

if (isset($_GET['sdelivery'])) {
	$sdelivery = $_GET['sdelivery'];
} else {
  if (isset($_POST['sdelivery'])) {
	$sdelivery=$_POST['sdelivery'];
  }
}

if (isset($_GET['telephone'])) {
	$telephone = $_GET['telephone'];
} else {
  if (isset($_POST['telephone'])) {
	$sdelivery=$_POST['telephone'];
  }
}



if (isset($_GET['rxtoorder'])) {
	$rxtoorder = explode(",",$_GET['rxtoorder']);
} else {
	$rxtoorder = explode(",",$_POST['rxtoorder']);
}





$sphone=str_replace('-','',$sphone);
$sphone=str_replace(' ','',$sphone);
$sphone=str_replace('(','',$sphone);
$sphone=str_replace(')','',$sphone);

$template = new index_page("template_orderpageremind.html");
$template->stphone=$sphone;
$template->stname=$sname;
$template->erefill=$erefill;
$template->advanced=$advanced;
$template->grouplogin=$grouplogin;
$template->storecombo=$storecombo;
$template->refilltitle=$srefilltitle;
$template->refillnote=$srefillnote;
$template->refillmessage=$refillmessage;

if (count($rxtoorder) <6)
{
$rxtoorder= array_pad($rxtoorder, 6, '');
}

$rxcheckarray= array('','','','','','');
for ($x = 0; $x <= 5; $x++) {
   if (strlen($rxtoorder[$x])>0) {
     
      $rxcheckarray[$x]='checked';
   }
}                   
$template->Rxnum1=$rxtoorder[0];
$template->Rxnum2=$rxtoorder[1];
$template->Rxnum3=$rxtoorder[2];
$template->Rxnum4=$rxtoorder[3];
$template->Rxnum5=$rxtoorder[4];
$template->Rxnum6=$rxtoorder[5];

$template->Rxcheck1=$rxcheckarray[0];
$template->Rxcheck2=$rxcheckarray[1];
$template->Rxcheck3=$rxcheckarray[2];
$template->Rxcheck4=$rxcheckarray[3];
$template->Rxcheck5=$rxcheckarray[4];
$template->Rxcheck6=$rxcheckarray[5];





if ($nodelivery[$sphone]=="Y")
{
   $sdelivery="N";
}






if ($overridemessage[$sphone]["refillnote"]!="")
{
$template->refillnote=$overridemessage[$sphone]["refillnote"];

}

if ($overridemessage[$sphone]["refilltitle"]!="")
{
$template->refilltitle=$overridemessage[$sphone]["refilltitle"];

}








if ($sdelivery=='Y') {
$template->delivery=true;
}else{
$template->delivery=false;
}




$template->show();


?>