. */ include_once("./include/include.php"); require_once("./include/SendMailPage.php"); require_once("./include/AjaxResponse.php"); require_once("./include/Popup.php"); define("POPUP_HEIGHT", 370); define("POPUP_WIDTH", 612); if( !isset($_REQUEST['receipt']) ) { header("Bad Request", true, 400); echo "Bad Request"; exit; } $receipt = $_REQUEST['receipt']; if( $_SERVER['REQUEST_METHOD']=="POST" ) { $errorFields = SendMailPage::checkForErrors(); if( count($errorFields)==0 ) { $content = SendMailPage::sendMail($receipt); }else { $content = SendMailPage::getForm($receipt, $errorFields); } $response = new AjaxResponse(false); $response->addRefresh("popup_content", $content); header("Content-type: text/xml; charset=utf-8"); echo $response->createResponse(); } if( $_SERVER['REQUEST_METHOD']=="GET" ) { $content = SendMailPage::getForm($receipt, array()); $popup = new Popup("Send mail", $content); $popup->setHeight(POPUP_HEIGHT)->setWidth(POPUP_WIDTH); echoln($popup->createPopup()); } ?>