<?php

include_once("config.php");






if (isset($_GET['rxnums'])) {

	$rxord2 = $_GET['rxnums'];
	$telephone = $_GET['telephone'];
    $note=$_GET['note'];
    $storetelephone = $_GET['storetelephone']; 
    $pdel = $_GET['pdel']; 
    $email = $_GET['email']; 

} else {
	$rxnums=$_POST['rxnums'];
       $rxcheck1=$_POST['rxc1'];
       $rxcheck2=$_POST['rxc2'];
       $rxcheck3=$_POST['rxc3'];
       $rxcheck4=$_POST['rxc4'];
       $rxcheck5=$_POST['rxc5'];
       $rxcheck6=$_POST['rxc6'];
	$telephone = $_POST['telephone'];
       $rxord=array();
        if ($rxcheck1=="Yes") {
           if (strlen($rxnums[0])>0) {
              $rxord[0]=$rxnums[0];
           }
        }       

        if ($rxcheck2=="Yes") {
           if (strlen($rxnums[1])>0) {
              $rxord[1]=$rxnums[1];
           }
        }       

        if ($rxcheck3=="Yes") {
           if (strlen($rxnums[2])>0) {
              $rxord[2]=$rxnums[2];
           }
        }       

        if ($rxcheck4=="Yes") {
           if (strlen($rxnums[3])>0) {
              $rxord[3]=$rxnums[3];
           }
        }       

        if ($rxcheck5=="Yes") {
           if (strlen($rxnums[4])>0) {
              $rxord[4]=$rxnums[4];
           }
        }       

        if ($rxcheck6=="Yes") {
           if (strlen($rxnums[5])>0) {
              $rxord[5]=$rxnums[5];
           }
        }       

        $rxord2=implode(",", $rxord);


    $note=$_POST['note'];
    $storetelephone = $_POST['storetelephone'];
    $pdel = $_POST['pdel'];
    $email = $_POST['email'];

}





$check=array($rxnums,$telephone,$note,$storetelephone, $pdel,$email);
$go=validatehack($check);
if ($go==1) {

	$template = new orderrefillsbynumber_page("template_orderrefillsbynumber.html", $rxord2, $telephone,$note, $storetelephone, $pdel, $email);
	if ($template->error) {
 		 echo $template->error;
	} else {
		$template->show();
	}
} 
else
{
 echo 'Unauthorized Access';   
}

?>