. */ define("ROOTPATH", "./"); define("POPUP_HEIGHT", 370); define("POPUP_WIDTH", 612); require_once(ROOTPATH . "include/include.php"); $layout = new Layout(); $layout->init(); require_once(ROOTPATH . "include/classes/SendMailPage.php"); require_once(ROOTPATH . "include/classes/AjaxResponse.php"); require_once(ROOTPATH . "include/classes/Popup.php"); $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); echo $popup->createPopup(); } ?>