Example #1
0
    $counter++;
}
$days = cal_days_in_month(CAL_GREGORIAN, date('n', strtotime($month)), $year);
for ($i = 1; $i <= $days; $i++) {
    if ($counter % 7 == 0) {
        $body .= "</tr><tr>";
    }
    $counter++;
    $body .= "<td id={$i}>" . $i . "</td>";
}
//finish rendering calendar
while ($counter % 7 != 0) {
    $body .= "<td class='offset'></td>";
    $counter++;
}
$body .= "</tr></table>";
$body .= <<<HEREDOC
        <script>
            \$(document).ready(main);
            
            function main(){
                \$(td).hover(showPhotos);
            }
            
            function showPhotos(){
                \$(this).css("width", "200%"); //this isn't done yet
            }
        </script>
HEREDOC;
echo generatePage($body);
/***********************************************************************************************************************
 * Main
 */
require 'imscp-lib.php';
$eventManager = iMSCP_Events_Aggregator::getInstance();
$eventManager->dispatch(iMSCP_Events::onAdminScriptStart);
check_login('admin');
if (systemHasCustomers()) {
    if (isset($_GET['user_id'])) {
        $userId = intval($_GET['user_id']);
        $_SESSION['stats_user_id'] = $userId;
    } elseif (isset($_SESSION['admin_stats_user_id'])) {
        redirectTo('reseller_user_statistics_detail.php?user_id=' . $_SESSION['admin_stats_user_id']);
        exit;
    } else {
        showBadRequestErrorPage();
        exit;
    }
    $tpl = new iMSCP_pTemplate();
    $tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'admin/reseller_user_statistics_details.tpl', 'page_message' => 'layout', 'month_list' => 'page', 'year_list' => 'page', 'reseller_user_statistics_detail_block' => 'page', 'traffic_table_item' => 'reseller_user_statistics_detail_block'));
    $tpl->assign(array('TR_PAGE_TITLE' => tohtml(tr("Admin / Statistics / Reseller Statistics / User Statistics / {USERNAME} user statistics")), 'TR_MONTH' => tohtml(tr('Month')), 'TR_YEAR' => tohtml(tr('Year')), 'TR_SHOW' => tohtml(tr('Show'), 'htmlAttr'), 'TR_WEB_TRAFFIC' => tohtml(tr('Web traffic')), 'TR_FTP_TRAFFIC' => tohtml(tr('FTP traffic')), 'TR_SMTP_TRAFFIC' => tohtml(tr('SMTP traffic')), 'TR_POP3_TRAFFIC' => tohtml(tr('POP3/IMAP traffic')), 'TR_ALL_TRAFFIC' => tohtml(tr('All traffic')), 'TR_ALL' => tohtml(tr('All')), 'TR_DAY' => tohtml(tr('Day'))));
    generateNavigation($tpl);
    generatePage($tpl, $userId);
    generatePageMessage($tpl);
    $tpl->parse('LAYOUT_CONTENT', 'page');
    $eventManager->dispatch(iMSCP_Events::onAdminScriptEnd, array('templateEngine' => $tpl));
    $tpl->prnt();
    unsetMessages();
} else {
    showBadRequestErrorPage();
}
Example #3
0
        echo "<td>";
        if ($set['item_1']) {
            for ($i = 1; $i < 18; $i++) {
                if ($itemid = $set['item_' . $i]) {
                    show_item($itemid, 0, 'set');
                }
            }
        } else {
            foreach ($items as $item) {
                show_item($item['entry'], $item['displayid'], 'set');
            }
        }
        if ($item) {
            $classreq = getAllowableClass($item['AllowableClass']);
        } else {
            $classreq = 0;
        }
        if (!$classreq) {
            $classreq = "";
        }
        echo "</td>";
        echo "<td align=center>" . $classreq . "</td>";
        echo "</tr>\n";
    }
    $pageRefrence = $FindRefrence;
    if ($sort) {
        $pageRefrence .= "&sort={$sort}";
    }
    generatePage($number, $page, "<a href=\"{$pageRefrence}&page=%d\">%d </a>", 4);
    echo "</tbody></table>";
}
 */
require 'imscp-lib.php';
$eventManager = iMSCP_Events_Aggregator::getInstance();
$eventManager->dispatch(iMSCP_Events::onAdminScriptStart);
check_login('admin');
if (isset($_GET['reseller_id'])) {
    $resellerId = intval($_GET['reseller_id']);
    $_SESSION['stats_reseller_id'] = $resellerId;
} elseif (isset($_SESSION['stats_reseller_id'])) {
    redirectTo('reseller_user_statistics.php?reseller_id=' . $_SESSION['stats_reseller_id']);
    exit;
} else {
    showBadRequestErrorPage();
    exit;
}
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'admin/reseller_user_statistics.tpl', 'page_message' => 'layout', 'reseller_user_statistics_block' => 'page'));
$tpl->assign(array('TR_PAGE_TITLE' => tohtml(tr('Admin / Statistics / Reseller Statistics / User Statistics')), 'TR_USERNAME' => tohtml(tr('User')), 'TR_TRAFF' => tohtml(tr('Traffic usage')), 'TR_DISK' => tohtml(tr('Disk usage')), 'TR_WEB' => tohtml(tr('HTTP traffic')), 'TR_FTP_TRAFF' => tohtml(tr('FTP traffic')), 'TR_SMTP' => tohtml(tr('SMTP traffic')), 'TR_POP3' => tohtml(tr('POP3/IMAP traffic')), 'TR_SUBDOMAIN' => tohtml(tr('Subdomains')), 'TR_ALIAS' => tohtml(tr('Aliases')), 'TR_MAIL' => tohtml(tr('Email accounts')), 'TR_FTP' => tohtml(tr('FTP accounts')), 'TR_SQL_DB' => tohtml(tr('SQL databases')), 'TR_SQL_USER' => tohtml(tr('SQL users')), 'TR_DETAILED_STATS_TOOLTIP' => tohtml(tr('Show detailed statistics for this user'), 'htmlAttr')));
$eventManager->registerListener('onGetJsTranslations', function ($e) {
    /** @var $e \iMSCP_Events_Event */
    $e->getParam('translations')->core['dataTable'] = getDataTablesPluginTranslations(false);
});
generateNavigation($tpl);
generatePage($tpl, $resellerId);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
$eventManager->dispatch(iMSCP_Events::onAdminScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();
Example #5
0
<?php

require_once 'dbaccess.php';
require_once 'dblogin.php';
require_once 'generator.php';
require_once 'headbar.php';
require_once 'thread.php';
$body = "";
$where = "commentid = 0";
$threads = new Thread($where, "desc");
$username = "";
if (isset($_SESSION['username'])) {
    $username = $_SESSION['username'];
}
$body = $threads->displayNewTopics($username);
$page = generatePage($body);
echo $page;
Example #6
0
            $row = "<tr>";
            foreach (array_values($value) as $entry) {
                if ($i == 0) {
                    $registerid = $entry;
                }
                $row .= "<td>{$entry}</td>";
                $i++;
            }
            $row .= "<td align = 'center'><input type='radio' name= 'radio' value='{$registerid}' required>";
            $row .= "</tr>";
            $table .= $row;
        }
        $table .= "</table>";
        $table .= "<p><input type='submit' name='submit' value='Submit'></form>";
        $body .= $table;
        echo generatePage($body, "Selection Page");
    }
}
function array_remove($values_to_remove, $array)
{
    $temp = array();
    foreach ($array as $value) {
        if (!in_array($value, $values_to_remove)) {
            array_push($temp, $value);
        }
    }
    return $temp;
}
function array_add($values_to_add, $array)
{
    $temp = $array;
Example #7
0
function drawPage()
{
    global $credentials;
    $body = "";
    $login = new Credentials("terrapintango.cgpkve9uh8yp.us-east-1.rds.amazonaws.com", $credentials[0], $credentials[1], "tangodb");
    $connector = new SQLConnector($login);
    $connector->connect();
    //print_r($result);
    if (isset($_POST['submit'])) {
        $fields = $_POST['field'];
        $fieldsString = implode(", ", $fields);
        foreach ($fields as $table) {
            if ($table == "ConfirmedRegistrants") {
                $query = "SELECT r.fname, r.lname, r.partnerfname, r.email, c.classes, c.passtype, c.price\n                                                        FROM records r, classes c, confirmation f\n                                                        WHERE r.registerid = c.registerid and r.registerid = f.registerid and\n                                                        f.payment_status = 'Completed'";
            } else {
                $query = "select * from {$table}";
            }
            $result = $connector->retrieve($query);
            $body .= "<h1>" . ucfirst($table) . "</h1>" . drawTable($result);
        }
    } else {
        if (isset($_POST['arbsubmitr'])) {
            $query = $_POST['arbtext'];
            $result = $connector->retrieve($query);
            $body .= "<h1>{$query}</h1>" . drawTable($result);
        } else {
            if (isset($_POST['arbsubmiti'])) {
                $query = $_POST['arbtext'];
                $error = false;
                try {
                    $result = $connector->insert($query);
                } catch (Exception $e) {
                    echo $e->getMessage();
                    $error = true;
                }
                if (!$error) {
                    $body .= "Query successful.";
                }
                $body .= "<p><form action='admin.php' method=POST><input type='submit' value='Back'></form></p>";
            } else {
                if (isset($_POST['classprint'])) {
                    header("Location: classBalanceInfo.php");
                } else {
                    if (isset($_POST['mapping'])) {
                        echo print_class_info();
                    } else {
                        if (isset($_POST['edit'])) {
                            header("Location: editdb.php");
                        } else {
                            $body = <<<BODY
                <h1> Database Access </h1>

                <form action="admin.php" method="post">
                    <p>
                        <strong>Select tables to display</strong><br />
                        <select name="field[]" multiple="multiple">
                            <option value="records">Records</option>
                            <option value="classes">Classes</option>
                            <option value="confirmation">Confirmation</option>
                            <option value="ConfirmedRegistrants">Confirmed registrations</option>
                        </select>
                    </p>
                    <p>
                        <input type="submit" name="submit" value="Display Tables">
                    </p>
                    <p>
                        <input type='text' name='arbtext'>
                    </p>
                    <p>
                        <input type='submit' name='arbsubmitr' value='Submit arbitrary query (Get response)'>
                        <input type='submit' name='arbsubmiti' value='Submit arbitrary query (Do not get response)'>
                    </p>
\t\t\t\t\t<p>
\t\t\t\t\t\t<input type='submit' name='classprint' value='Class Balance Info'>
\t\t\t\t\t</p>
                    <p>
\t\t\t\t\t\t<input type='submit' name='mapping' value='Confirmed Schedules'>
\t\t\t\t\t</p>
                    <p>
\t\t\t\t\t\t<input type='submit' name='edit' value='Edit Classes'>
\t\t\t\t\t</p>
                </form>
BODY;
                        }
                    }
                }
            }
        }
    }
    echo generatePage($body, "Admin Panel");
}
Example #8
0
        set_page_message(tr('Could not create domain alias. An unexpected error occurred.'), 'error');
        return false;
    }
    return true;
}
/***********************************************************************************************************************
 * Main
 */
require_once 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptStart);
check_login('user');
customerHasFeature('domain_aliases') or showBadRequestErrorPage();
$mainDmnProps = get_domain_default_props($_SESSION['user_id']);
$domainAliasesCount = get_domain_running_als_cnt($mainDmnProps['domain_id']);
if ($mainDmnProps['domain_alias_limit'] != 0 && $domainAliasesCount >= $mainDmnProps['domain_alias_limit']) {
    set_page_message(tr('You have reached the maximum number of domain aliasses allowed by your subscription.'), 'warning');
    redirectTo('domains_manage.php');
}
if (!empty($_POST) && addDomainAlias()) {
    redirectTo('domains_manage.php');
}
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'client/alias_add.tpl', 'page_message' => 'layout', 'shared_mount_point_domain' => 'page'));
$tpl->assign(array('TR_PAGE_TITLE' => tr('Client / Domains / Add Domain Alias'), 'TR_DOMAIN_ALIAS' => tr('Domain alias'), 'TR_DOMAIN_ALIAS_NAME' => tr('Domain alias name'), 'TR_DOMAIN_ALIAS_NAME_TOOLTIP' => tr("You must omit 'www'. It will be added automatically."), 'TR_SHARED_MOUNT_POINT' => tr('Shared mount point'), 'TR_SHARED_MOUNT_POINT_TOOLTIP' => tr('Allows to share the mount point of another domain.'), 'TR_URL_FORWARDING' => tr('URL forwarding'), 'TR_URL_FORWARDING_TOOLTIP' => tr('Allows to forward any request made to this domain alias to a specific URL. Be aware that when this option is in use, no Web folder is created for the domain alias.'), 'TR_FORWARD_TO_URL' => tr('Forward to URL'), 'TR_YES' => tr('Yes'), 'TR_NO' => tr('No'), 'TR_HTTP' => 'http://', 'TR_HTTPS' => 'https://', 'TR_FTP' => 'ftp://', 'TR_ADD' => tr('Add'), 'TR_CANCEL' => tr('Cancel')));
generateNavigation($tpl);
generatePage($tpl);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();
Example #9
0
function createWebsite($siteid)
{
    $db = Database::obtain();
    $sql = "SELECT * FROM " . TABLE_WEBSITES . "\n\t\t\t\t\tWHERE `id` =" . $siteid . "";
    $websitedata = $db->query_first($sql);
    $website_template = $websitedata['website_template'];
    $website_folder = 'content/' . $siteid;
    $template_dir = 'templates/' . $website_template . '/';
    cleanWebsiteDir($website_folder);
    createDir($website_folder);
    createWebsiteCopyTheme($template_dir, $website_folder);
    $menu = getMenu($siteid);
    foreach ($menu as $id => $page) {
        if ($id == '0') {
            $filename = 'index.html';
        } else {
            if (isContactPage($page['pageid'])) {
                $filename = strtolower(underscoreAdd($page['title'])) . '.php';
            } else {
                $filename = strtolower(underscoreAdd($page['title'])) . '.html';
            }
        }
        $pageid = $page['pageid'];
        $contents = generatePage($siteid, $pageid);
        fileSave($website_folder . '/' . $filename, $contents);
    }
}
Example #10
0
 */
require_once 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptStart);
check_login('user');
customerHasFeature('php_editor') or showBadRequestErrorPage();
$phpini = iMSCP_PHPini::getInstance();
$phpini->loadResellerPermissions($_SESSION['user_created_by']);
// Load reseller PHP permissions
$phpini->loadClientPermissions($_SESSION['user_id']);
// Load client PHP permissions
$config = iMSCP_Registry::get('config');
$confDir = $config['CONF_DIR'];
if ($config['HTTPD_SERVER'] == 'apache_fcgid' || $config['HTTPD_SERVER'] == 'apache_itk') {
    $srvConfig = new iMSCP_Config_Handler_File("{$confDir}/apache/apache.data");
    $configLevel = $srvConfig['INI_LEVEL'];
} else {
    $srvConfig = new iMSCP_Config_Handler_File("{$confDir}/php-fpm/phpfpm.data");
    $configLevel = $srvConfig['PHP_FPM_POOLS_LEVEL'];
}
if (!empty($_POST)) {
    updatePhpConfig($phpini, $configLevel);
}
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'client/phpini.tpl', 'page_message' => 'layout', 'domain_list_block' => 'page', 'domain_name_block' => 'domain_list_block', 'allow_url_fopen_block' => 'page', 'display_errors_block' => 'page', 'disable_functions_block' => 'page', 'mail_function_block' => 'disable_functions_block', 'disable_exec_block' => 'page', 'error_reporting_block' => 'page'));
$tpl->assign(array('TR_PAGE_TITLE' => tohtml(tr('Client / Domains / PHP Settings'), 'htmlAttr'), 'TR_MENU_PHPINI' => tohtml(tr('PHP Editor')), 'TR_DOMAIN' => tohtml(tr('Domain')), 'TR_DOMAIN_TOOLTIP' => tohtml(tr('Domain for which PHP Editor must act.'), 'htmlAttr'), 'TR_UPDATE' => tohtml(tr('Update'), 'htmlAttr'), 'TR_CANCEL' => tohtml(tr('Cancel'))));
generateNavigation($tpl);
generatePage($tpl, $phpini, $config, $configLevel);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
Example #11
0
<?php

require_once "support.php";
$imgname = $_GET['img'];
$caption = $_GET['caption'];
$tags = $_GET['tags'];
$user = $_GET['user'];
echo "<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>";
$body = "<div><a href='main.php'> <img src='img/CalendAppLogo.png' width='256' height='73' alt='CalendApp' id='logo'> </a></div>\n            <h1>Image</h1>\n            <img src='{$imgname}' alt='{$imgname}' style='max-height:600px' class='image'><br />\n            <div id='info'>By {$user}<br />\n            Caption: {$caption}<br />\n            Tags: {$tags}<br />\n            \n            <form action='main.php' method='post'><input type='submit' value='Return to main page'></form>\n            </div>";
$body .= <<<HEREDOC
        <script>
            \$(document).ready(main);
            
            function main(){
                \$("img").click(function(){
                    if (\$(this).css("max-height") !== "900px") {
                        \$(this).css("max-height", "900px");
                    } else {
                        \$(this).css("max-height", "600px");    
                    }
                });
            }
        </script>
HEREDOC;
echo generatePage($body, "View Image", "<link rel='stylesheet' href='imgshow.css' type='text/css' />");
echo "<a href=\"?auction=Blackwater\" style=\"Text-decoration: none; color:gold;\">&nbsp;{$lang['Blackwater']}&nbsp;</a>";
echo "<img src=\"images/gold.gif\">";
echo "</td></tr>";
if ($rows) {
    echo "<tr><td colspan=4 class=head>{$number} {$lang['items']}</td></tr>";
    echo "<tr>";
    echo "<th width=1px></th>";
    echo "<th width=50%>" . $lang['auction_seller'] . "</th>";
    echo "<th width=25%>" . $lang['auction_cost'] . "</th>";
    echo "<th width=25%>" . $lang['auction_bye'] . "</th>";
    echo "</tr>\n";
    foreach ($rows as $auc_data) {
        $item_data = explode(' ', $auc_data['data']);
        echo "<tr>";
        echo "<td>";
        show_item_by_data($item_data, 'auction');
        echo "</td>";
        if ($auc_data['itemowner'] == 0) {
            echo "<td align=center><font color=#ff0000>" . $lang['auctionbot'] . "</font></td>";
        } else {
            echo "<td><a href=?player={$auc_data['itemowner']}>" . getCharacterName($auc_data['itemowner']) . "</a></td>";
        }
        echo "<td align=center>" . money($auc_data['startbid']) . "</td>";
        echo "<td align=center>" . money($auc_data['buyoutprice']) . "</td>";
        echo "</tr>\n";
    }
    generatePage($number, $page, "<a href=\"?auction={$type}&page=%d\">%d </a>", 4);
} else {
    echo "<tr><td colspan=4 align=center>{$lang['empty']}</td></tr>";
}
echo "</tbody></table>";
        $allOtherOut = $all[7] - ($all[1] + $all[3] + $all[5]);
        $tpl->assign(array('WEB_IN_ALL' => tohtml(bytesHuman($all[0])), 'WEB_OUT_ALL' => tohtml(bytesHuman($all[1])), 'SMTP_IN_ALL' => tohtml(bytesHuman($all[2])), 'SMTP_OUT_ALL' => tohtml(bytesHuman($all[3])), 'POP_IN_ALL' => tohtml(bytesHuman($all[4])), 'POP_OUT_ALL' => tohtml(bytesHuman($all[5])), 'OTHER_IN_ALL' => tohtml(bytesHuman($allOtherIn)), 'OTHER_OUT_ALL' => tohtml(bytesHuman($allOtherOut)), 'ALL_IN_ALL' => tohtml(bytesHuman($all[6])), 'ALL_OUT_ALL' => tohtml(bytesHuman($all[7])), 'ALL_ALL' => tohtml(bytesHuman($all[6] + $all[7]))));
    } else {
        set_page_message(tr('No statistics found for the given period. Try another period.'), 'static_info');
        $tpl->assign('DAY_SERVER_STATISTICS_BLOCK', '');
    }
}
/***********************************************************************************************************************
 * Main
 */
require 'imscp-lib.php';
$eventManager = iMSCP_Events_Aggregator::getInstance();
$eventManager->dispatch(iMSCP_Events::onAdminScriptStart);
check_login('admin');
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'admin/server_statistic_day.tpl', 'page_message' => 'layout', 'day_server_statistics_block' => 'page', 'hour_list' => 'day_server_statistics_block'));
if (isset($_GET['month']) && isset($_GET['year']) && isset($_GET['day'])) {
    $year = intval($_GET['year']);
    $month = intval($_GET['month']);
    $day = intval($_GET['day']);
    $tpl->assign(array('TR_PAGE_TITLE' => tohtml(tr('Admin / Statistics / Server Statistics / Day Statistics')), 'TR_MONTH' => tohtml(tr('Month')), 'TR_YEAR' => tohtml(tr('Year')), 'TR_DAY' => tohtml(tr('Day')), 'TR_HOUR' => tohtml(tr('Hour')), 'TR_WEB_IN' => tohtml(tr('Web in')), 'TR_WEB_OUT' => tohtml(tr('Web out')), 'TR_SMTP_IN' => tohtml(tr('SMTP in')), 'TR_SMTP_OUT' => tohtml(tr('SMTP out')), 'TR_POP_IN' => tohtml(tr('POP3/IMAP in')), 'TR_POP_OUT' => tohtml(tr('POP3/IMAP out')), 'TR_OTHER_IN' => tohtml(tr('Other in')), 'TR_OTHER_OUT' => tohtml(tr('Other out')), 'TR_ALL_IN' => tohtml(tr('All in')), 'TR_ALL_OUT' => tohtml(tr('All out')), 'TR_ALL' => tohtml(tr('All')), 'MONTH' => tohtml($month), 'YEAR' => tohtml(date('Y', mktime(0, 0, 0, $month, $day, $year))), 'DAY' => tohtml($day)));
    generateNavigation($tpl);
    generatePage($tpl, $year, $month, $day);
    generatePageMessage($tpl);
    $tpl->parse('LAYOUT_CONTENT', 'page');
    $eventManager->dispatch(iMSCP_Events::onAdminScriptEnd, array('templateEngine' => $tpl));
    $tpl->prnt();
    unsetMessages();
} else {
    showBadRequestErrorPage();
}
Example #14
0
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">Manage Calendar Events</h1>
                        <a href="addEvent.php" class="btn btn-primary"><i class="fa fa-plus"></i> Add Event</a>
                        <p>                            
                            <?php 
include "../../databaseInfo.php";
if (isset($_POST["calendarID"]) && isset($_POST["eventName"])) {
    if (deleteEvent($_POST["calendarID"])) {
        generatePage("success", $_POST["eventName"]);
    } else {
        generatePage("fail", $_POST["eventName"]);
    }
} else {
    generatePage("", "");
}
function deleteEvent($eventID)
{
    try {
        $connection = new PDO("mysql:host=" . DB_HOST_NAME . ";dbname=" . DB_NAME . ";charset=utf8", DB_USER_NAME, DB_PASSWORD);
        // Exceptions fire when occur
        $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        $accountInformationQuery = $connection->query('
                                            DELETE FROM ' . CALENDAR_TABLE . ' 
                                            WHERE CALENDAR_ID = ' . $connection->quote($eventID));
    } catch (PDOException $e) {
        echo "\r\n                                        <div>\r\n                                            Error: " . $e->getMessage() . "</div>";
        return FALSE;
    }
    return TRUE;
Example #15
0
$days = cal_days_in_month(CAL_GREGORIAN, date('n', strtotime($month)), $year);
for ($i = 1; $i <= $days; $i++) {
    if ($counter % 7 == 0) {
        $body .= "</tr><tr>";
    }
    $counter++;
    $body .= "<td><div id={$i}>" . $i . "<br />" . getPics($pics, $i) . "</div></td>";
    //Day added here
}
//finish rendering calendar
while ($counter % 7 != 0) {
    $body .= "<td class='offset'></td>";
    $counter++;
}
$body .= "</tr></table>";
echo generatePage($body, "Calendapp");
function getPics($arr, $dayOfMonth)
{
    if (empty($arr)) {
        //No pictures for this month
        return "";
    }
    $toReturn = "";
    if (!isset($arr['user'])) {
        foreach ($arr as $entry) {
            if (date('j', strtotime($entry['date'])) == $dayOfMonth) {
                $escEntry = htmlspecialchars($entry['id'], ENT_QUOTES);
                $escCaption = htmlspecialchars($entry['caption'], ENT_QUOTES);
                $escTags = htmlspecialchars($entry['tags'], ENT_QUOTES);
                $toReturn .= "<a href='imgshow.php?img=images/{$escEntry}&caption={$escCaption}&tags={$escTags}&user={$entry['user']}'><img src='images/{$entry['id']}' alt='{$entry['id']}' width='40' height='40' class='userPhoto'></a>\n                        <span class='imgtext'>by {$entry['user']} <br /><br />\n                        </span>" . "<br />";
            }
Example #16
0
<?php

require_once 'dblogin.php';
require_once 'dbaccess.php';
require_once 'headbar.php';
require_once 'generator.php';
require_once 'thread.php';
$title = $_GET['title'];
$where = "title = '{$title}'";
$threads = new Thread($where);
if (isset($_SESSION['username'])) {
    $username = $_SESSION['username'];
}
$body = $threads->displayFullThread($username, true);
$page = generatePage($body, $title);
echo $page;
Example #17
0
{
    global $net, $data;
    $data = clone $net[$url];
    $fs = $data->friends;
    $data->friends = array();
    foreach ($fs as $f) {
        $ff = new stdClass();
        $ff->name = $net[$f]->name;
        $ff->url = $net[$f]->url;
        $data->friends[] = $ff;
    }
    $notes = array();
    foreach ($data->wall as $url => $text) {
        $note = new stdClass();
        $note->text = $text;
        $note->name = $net[$url]->name;
        $note->url = $url;
        $notes[] = $note;
    }
    $data->wall = $notes;
    ob_start();
    include './template.php';
    $page = ob_get_contents();
    ob_end_clean();
    return $page;
}
generatePeople(1200);
foreach ($net as $p) {
    file_put_contents("{$p->url}.html", generatePage($p->url));
}
//file_put_contents("index.html", generatePage('index'));
Example #18
0
    $host = "localhost";
    $dbuser = "******";
    $dbpassword = "******";
    $database = "calendapp";
    $table = "users";
    $connector = new SQLConnector(new Credentials($host, $dbuser, $dbpassword, $database));
    $connector->connect();
    $username = trim($_POST["username"]);
    $email = trim($_POST['email']);
    $cryptpw = password_hash($_POST['password'], PASSWORD_DEFAULT);
    $date = date(DATE_ISO8601);
    $sqlQuery = "insert into users values('{$username}', '{$cryptpw}', 'temp', '{$date}', '{$email}')";
    echo $sqlQuery . "<br />";
    if ($connector->insert($sqlQuery)) {
        $_SESSION['loggedIn'] = true;
        //Stay logged in
        $_SESSION['username'] = $username;
        header("Location: main.php");
    }
}
$body = <<<BODY
    <form action="signup.php" method="post">
    Username: <input type="text" name="username" required="required"><br />
    Password: <input type="password" name="password" required="required"><br />
    Email: <input type="email" name="email" required="required"><br />
    <input type="submit" name="submit" value="Sign Up"><br />
    <input type="reset" name="reset" value="Reset">
</form>
BODY;
echo generatePage($body, "Sign Up");
function getPage()
{
    return generatePage();
}