first draft, only one (main) page
This commit is contained in:
70
index.php
Normal file
70
index.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Wedding Project
|
||||
http://git.lutran.fr/wedding.git
|
||||
Copyright (C) 2014 François Lutran
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see http://www.gnu.org/licenses
|
||||
*/
|
||||
|
||||
//Start buffering
|
||||
ob_start();
|
||||
require_once 'classmanagement.php';
|
||||
$oClassManagement = new ClassManagement('resume');
|
||||
ToolBox::cleanPost($_POST);
|
||||
ToolBox::cleanPost($_GET);
|
||||
ToolBox::cleanPost($_REQUEST);
|
||||
|
||||
//Add server name
|
||||
$sAppPath = 'http://'.str_replace('http://', '', $_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME']));
|
||||
$_GET['serv_name'] = $sAppPath.(substr($sAppPath, -1)!='/'?'/':'');
|
||||
|
||||
//Available variables
|
||||
$sAction = isset($_GET['a'])?$_GET['a']:'';
|
||||
$sPage = isset($_GET['p'])?$_GET['p']:'index';
|
||||
$sLang = isset($_GET['l'])?$_GET['l']:(isset($_COOKIE['l'])?$_COOKIE['l']:'');
|
||||
$sSerial = isset($_GET['s'])?$_GET['s']:'';
|
||||
$sName = isset($_POST['name'])?$_POST['name']:'';
|
||||
$sEmail = isset($_POST['email'])?$_POST['email']:'';
|
||||
$sSubject = isset($_POST['subject'])?$_POST['subject']:'';
|
||||
$sMsg = isset($_POST['message'])?$_POST['message']:'';
|
||||
|
||||
//Initiate main class
|
||||
$oResume = new Resume($oClassManagement, $sLang);
|
||||
|
||||
//Check requested action
|
||||
switch($sAction)
|
||||
{
|
||||
case 'javascript':
|
||||
$sResult = $oResume->getJavascript();
|
||||
break;
|
||||
case 'pic':
|
||||
$sResult = $oResume->getPic($sSerial);
|
||||
break;
|
||||
case 'mail':
|
||||
$sResult = $oResume->sendEmail($sName, $sEmail, $sSubject, $sMsg);
|
||||
break;
|
||||
default:
|
||||
$sResult = $oResume->getPage($sPage);
|
||||
break;
|
||||
}
|
||||
|
||||
//Log and clean buffer
|
||||
$sDebug = ob_get_clean();
|
||||
if(Settings::DEBUG && $sDebug!='') dlog($sDebug, true);
|
||||
|
||||
echo $sResult;
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user