<?php

defined('_VALID') or die(RESTRICTED_ACCESS);
include_once('class.fblogmanager.php');
$fblogmanagerObj = new fblogmanager($configObj);
$action = $_REQUEST['action'];
$configObj->glTplObj->change_path($configObj->currentModulePath . 'html/templates/');
$configObj->glTplObj->set('configObj', $configObj);
$configObj->glTplObj->set('fblogmanagerObj', $fblogmanagerObj);
$configObj->glTplObj->set('fblogmanagerTab', true);
$paramMain = $configObj->AllmoduleAccess[$configObj->ModuleName];
$configObj->glTplObj->set('paramMain', $paramMain);

switch ($action) {
    case 'delete':
        if ($configObj->isAjaxSet) {
            $fblogmanagerObj->is_fblogmanager(96);
        }
        $fblogmanagerObj->loadCount('CountRowsnews');
        break;

    case 'updatereaddata':

        $sql = "UPDATE " . DB_PREFIX . "fblogmanagerleads SET chr_read='Y' where int_glcode=" . $_REQUEST['id'];
        $fblogmanagerObj->configObj->glDbObj->query($sql);
        echo $_REQUEST['id'];
        exit;
        break;

        case 'export':

        $tablename = "sharelog";
        $configObj->glLibraryObj->xlsSQL = $fblogmanagerObj->gettabledataData($tablename);
        $configObj->glLibraryObj->fileheader = "<center>Facebook Log Manager\n</center>";
        $configObj->glLibraryObj->filename = "" . SITE_NAME . "_Facebook_Log_Manager" . date("Y-m-d") . ".xls";
        $configObj->glLibraryObj->dataArray = $allrecordsset;
        $configObj->glLibraryObj->generateXLSfile();
        break;

    

    default:
        if ($_REQUEST['msg']) {
            if ($_REQUEST['msg'] == 'send') {
                $messagebox = $configObj->glLibraryObj->message("Congrats! The Email has been sent successfully.");
                $configObj->glTplObj->set('messagebox', $messagebox);
            }
        }
        $fblogmanagerObj->load_fblogmanager();
        break;
}
?>
