<?php

session_start();
define("CONST_FILE_PATH", "../includes/constants.php");
include '../classes/WebPage.php';
//Set up page as a web page
$thisPage = new WebPage();
//Create new instance of webPage class
$dbObj = new Database();
//Instantiate database
$coursBrochObj = new CourseBrochure($dbObj);
// Create an object of CourseBrochure class
$errorArr = array();
//Array of errors
$oldDocument = "";
$newDocument = "";
$coursBrochDoc = "";
if (!isset($_SESSION['ITCLoggedInAdmin']) || !isset($_SESSION["ITCadminEmail"])) {
    $json = array("status" => 0, "msg" => "You are not logged in.");
    echo json_encode($json);
} else {
    if (filter_input(INPUT_POST, "addNewBrochure") != NULL && filter_input(INPUT_POST, "addNewBrochure") == "addNewBrochure") {
        $postVars = array('name', 'document');
        // Form fields names
        //Validate the POST variables and add up to error message if empty
        foreach ($postVars as $postVar) {
            switch ($postVar) {
                case 'document':
                    $coursBrochObj->{$postVar} = basename($_FILES["document"]["name"]) ? rand(100000, 1000000) . "_" . strtolower(str_replace(" ", "_", filter_input(INPUT_POST, 'name'))) . "." . pathinfo(basename($_FILES["document"]["name"]), PATHINFO_EXTENSION) : "";
                    $coursBrochDoc = $coursBrochObj->{$postVar};
                    if ($coursBrochObj->{$postVar} == "") {
Ejemplo n.º 2
0
?>
">Our Clients</a><br /> We have trained individually and collectively employees of over 300 diverse businesses, spanning all sectors of the Nigerian economy since 2003</p> </div>
                                                    </div>
                                                    </div>
                                                </div><div class="column-1_3 sc_column_item sc_column_item_2 even" style="text-align:center;"><a href="<?php 
echo MEDIA_FILES_PATH1 . 'brochure/' . CourseBrochure::getCurrent($dbObj);
?>
" class="sc_icon icon-attach-1 sc_icon_shape_round sc_icon_bg_menu menu_dark_color" style="font-size:5em; line-height: 1.2em;"></a>
                                                    <div class="sc_section" style="margin-top:1em !important;font-weight:400;">
                                                        <div class="wpb_text_column wpb_content_element ">
                                                            <div class="wpb_wrapper">
                                                                <p><a class="menu_color" href="<?php 
echo MEDIA_FILES_PATH1 . 'brochure/' . CourseBrochure::getCurrent($dbObj);
?>
">Download Our <?php 
echo CourseBrochure::getName($dbObj);
?>
</a><br /> Download our comprehensive brochure to view all our courses we offer at your convenience round the year and its free.</p>

                                                            </div>
                                                        </div>
                                                    </div>
                                                </div><div class="column-1_3 sc_column_item sc_column_item_3 odd" style="text-align:center;">
                                                    <a href="<?php 
echo SITE_URL . 'about/';
?>
" class="sc_icon icon-world-2 sc_icon_shape_round sc_icon_bg_menu menu_dark_color" style="font-size:5em; line-height: 1.2em;"></a>
                                                    <div class="sc_section" style="margin-top:1em !important;font-weight:400;">
                                                        <div class="wpb_text_column wpb_content_element ">
                                                        <div class="wpb_wrapper">
                                                            <p><a class="menu_color" href="<?php 
Ejemplo n.º 3
0
                                                        <div class="wpb_wrapper">    	
                                                            <div id="un-icon-box-1" class="media un-icon-box dark dark-div wpb_left-to-right wpb_animate_when_almost_visible" data-delay=0.25>
                                                                <div class="text-center">
                                                                <div class="un-icon">
                                                                    <i class="fa fa-<?php 
    echo Setting::getValue($dbObj, $siteWidgetItem . $siteWidgetParams[0]) ? trim(stripcslashes(strip_tags(Setting::getValue($dbObj, $siteWidgetItem . $siteWidgetParams[0])))) : '';
    ?>
"></i>
                                                                </div>
                                                                </div>
                                                                <div class="media-body text-center">
                                                                    <?php 
    if ($siteWidgetItem == 'HOMEPAGE_DOWNLOAD_BROCHURE') {
        ?>
                                                                    <h4 class="media-heading"><a href="<?php 
        echo MEDIA_FILES_PATH1 . 'brochure/' . CourseBrochure::getCurrent($dbObj);
        ?>
" ><?php 
        echo Setting::getValue($dbObj, $siteWidgetItem . $siteWidgetParams[1]) ? trim(stripcslashes(strip_tags(Setting::getValue($dbObj, $siteWidgetItem . $siteWidgetParams[1])))) : '';
        ?>
</a></h4>
                                                                    <?php 
    } else {
        ?>
                                                                    <h4 class="media-heading"><a href="<?php 
        echo Setting::getValue($dbObj, $siteWidgetItem . $siteWidgetParams[3]) ? trim(stripcslashes(strip_tags(Setting::getValue($dbObj, $siteWidgetItem . $siteWidgetParams[3])))) : '';
        ?>
" ><?php 
        echo Setting::getValue($dbObj, $siteWidgetItem . $siteWidgetParams[1]) ? trim(stripcslashes(strip_tags(Setting::getValue($dbObj, $siteWidgetItem . $siteWidgetParams[1])))) : '';
        ?>
</a></h4>
 public function CourseBrochure($dbObj, $tableName = 'course_brochure')
 {
     self::$dbObj = $dbObj;
     self::$tableName = $tableName;
 }