Esempio n. 1
0
<?php

include 'configuration.php';
require '../admin/coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: ../admin/login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
    // Log the activity
    $action = new activity();
    $action->track_activity($userID, $action->editing_article, $_SESSION['title']);
}
// print_r($_SESSION);
// print_r($_SESSION['article_imgs']);
unset($_SESSION['article_imgs']);
$db = new database();
// get the checked item of the article..
if (isset($_POST['checkitem'][0]) && $_POST['checkitem'][0] != '') {
    $articleID = $_POST['checkitem'][0];
    $_SESSION['articleID'] = $articleID;
}
switch ($_SESSION['stageID']) {
    case 1:
        $set_template = "../templates/edit_article2.tpl.php";
        break;
    case 2:
        // editing
Esempio n. 2
0
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
$msgID = $_GET['messageID'];
// saved the messageID
$_SESSION['msgID'] = $msgID;
$msg = new messages();
// read his message
$resultdata = $msg->read_message($userID, $msgID);
// saved the msg subject
$_SESSION['title'] = $resultdata[0]->subject;
$_SESSION['message_subject'] = $resultdata[0]->subject;
// just the same from $_SESSION['title']
// saved message body
$_SESSION['message_body'] = $resultdata[0]->message;
// set the message as read
$msg->set_readmessage($userID, $msgID);
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->viewing_msg, 'Viewing the message ' . $_SESSION['title']);
$from = getUser_info($resultdata[0]->userID_from, 'fullname');
$from_userID = getUser_info($resultdata[0]->userID_from, 'userID');
$_SESSION['$from_userID'] = $from_userID;
$author = getUser_info($resultdata[0]->receiverID, 'fullname');
$tpl = new template_parser('../templates/view_private_message_detail2.tpl.php');
$tags = array('{FROM}' => $from, '{POSTED}' => friendlyDate($resultdata[0]->date_time), '{SUBJECT}' => $resultdata[0]->subject, '{AUTHOR}' => $author, '{MESSAGE}' => $resultdata[0]->message, '{SITENAME}' => 'CMS Adminss', '{HEADER}' => ' ', '{TOPNAV}' => 'top_menu.php', '{SIDENAV}' => 'user_menu2.php', '{FOOTER}' => 'footer.php');
$tpl->parse_template($tags);
print $tpl->display();
Esempio n. 3
0
include 'configuration.php';
require 'coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
//print_r($_POST);
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->creating_msg, '-');
$db = new database();
/**
 * If the user clik the delete message..
 */
if (isset($_POST['delete'])) {
    header('location: delete_message.php');
}
/**
 * Populate all the content users into an array..
 */
$sql = " select * from content_users order by fullname";
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$users = array();
Esempio n. 4
0
require 'coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
if (isset($_SESSION['message'])) {
    $message = $_SESSION['message'];
    unset($_SESSION['message']);
}
$_SESSION['task'] = 'add';
for ($i = 1; $i <= 12; $i++) {
    $optmonth .= '<option value ="' . $i . '">' . date("M", mktime(0, 0, 0, $i, 1, 0)) . '</option>';
}
for ($i = 1; $i <= 31; $i++) {
    $optday .= '<option value ="' . $i . '">' . date("d", mktime(0, 0, 0, 0, $i, 0)) . '</option>';
}
// TODO: bai moi kindly change the year must be DYNAMIC!!
$optyear .= '<option value ="2006">' . date('Y') . '</option>';
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->creating_category, '-');
// ok baby, let start compiling the page now..go! go! go! {mh}
$tpl = new template_parser('../templates/add_new_poll.tpl.php');
$tags = array('{CATEGORY_NAME}' => $category_name, '{CATEGORY_DESC}' => $category_desc, '{SITENAME}' => 'CMS Adminss', '{MESSAGE}' => $message, '{FROM_MONTH}' => $optmonth, '{FROM_DAY}' => $optday, '{FROM_YEAR}' => $optyear, '{TOPNAV}' => 'top_menu.php', '{FOOTER}' => 'footer.php');
$tpl->parse_template($tags);
print $tpl->display();
Esempio n. 5
0
$db = new database();
$clickuserID = $_GET['userID'];
$_SESSION['clickuserID'] = $clickuserID;
$sql = " select * from content_users cu ";
$sql .= " where cu.userID=" . $clickuserID;
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
//print $sql;
$my_profile = array();
while ($row = $db->fetcharray()) {
    $my_profile[] = $row;
}
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->viewing_user_profile, 'Viewing a profile of ' . $my_profile[0]->fullname);
//print_r($my_profile);
$db->freeresult();
$group_name = getGroup_name($my_profile[0]->usertypeID);
$_SESSION['group_name'] = $group_name;
$_SESSION['groupid'] = $my_profile[0]->usertypeID;
if ($my_profile[0]->lastvisitDate > 0) {
    $lastvisitDate = friendlydate($my_profile[0]->lastvisitDate);
} else {
    $lastvisitDate = '0';
}
// ok baby, let start compiling the page now..go! go! go! {mh}
$tpl = new template_parser('../templates/user_profile_manager.tpl.php');
$tags = array('{FULLNAME}' => $my_profile[0]->fullname, '{USERNAME}' => $my_profile[0]->username, '{EMAIL}' => $my_profile[0]->email, '{HOMEADDRESS}' => $my_profile[0]->homeaddress, '{INTERESTS}' => $my_profile[0]->interest, '{CELNO}' => $my_profile[0]->celno, '{PHONENO}' => $my_profile[0]->phoneno, '{LIST_USERTYPEID}' => ' ' . $group_name, '{IS_ENABLED}' => $my_profile[0]->is_enabled, '{REGISTER_DATE}' => friendlydate($my_profile[0]->registerDate), '{LAST_VISIT_DATE}' => $lastvisitDate, '{SITENAME}' => 'CMS Adminss', '{HEADER}' => ' ', '{TOPNAV}' => 'top_menu.php', '{SIDENAV}' => 'user_menu2.php', '{FOOTER}' => 'footer.php');
$tpl->parse_template($tags);
print $tpl->display();
Esempio n. 6
0
        case 'add':
            $message = 'Successfully saved the user profile: ' . $_SESSION['title'];
            break;
    }
    unset($_SESSION['task']);
}
$db = new database();
$sql = " select * from content_users cu ";
$sql .= " where cu.userID=" . $userID;
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
// saved the user profile into an array..
$my_profile = array();
while ($row = $db->fetcharray()) {
    $my_profile[] = $row;
}
$_SESSION['clickuserID'] = $my_profile[0]->userID;
$db->freeresult();
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->viewing_user_profile, $my_profile[0]->username);
// Get the position of this user
$group_name = getGroup_name($my_profile[0]->usertypeID);
// Get his last visit date
$lastvisitDate = $my_profile[0]->lastvisitDate ? friendlyDate($my_profile[0]->lastvisitDate) : '0000-00-00 00:00:00';
// ok baby, let start compiling the page now..go! go! go! {mh}
$tpl = new template_parser('../templates/my_profile.tpl.php');
$tags = array('{FULLNAME}' => $my_profile[0]->fullname, '{USERNAME}' => $my_profile[0]->username, '{EMAIL}' => $my_profile[0]->email, '{HOMEADDRESS}' => $my_profile[0]->homeaddress, '{INTERESTS}' => $my_profile[0]->interest, '{CELNO}' => $my_profile[0]->celno, '{PHONENO}' => $my_profile[0]->phoneno, '{MESSAGE}' => $message, '{LIST_USERTYPEID}' => ' ' . $group_name, '{IS_ENABLED}' => $my_profile[0]->is_enabled, '{REGISTER_DATE}' => friendlydate($my_profile[0]->registerDate), '{LAST_VISIT_DATE}' => $lastvisitDate, '{SITENAME}' => 'CMS Adminss', '{HEADER}' => ' ', '{TOPNAV}' => 'top_menu.php', '{SIDENAV}' => 'user_menu2.php', '{FOOTER}' => 'footer.php');
$tpl->parse_template($tags);
print $tpl->display();
Esempio n. 7
0
<?php

include 'configuration.php';
require 'coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
if (isset($_SESSION['message'])) {
    $message = $_SESSION['message'];
    unset($_SESSION['message']);
}
$category_name = $_SESSION['category_name'];
$category_desc = $_SESSION['category_desc'];
$heading = "Category : Edit ";
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->editing_category, 'Editing the category detail of ' . $category_name);
// ok baby, let start compiling the page now..go! go! go! {mh}
$tpl = new template_parser('../templates/edit_category_detail.tpl.php');
$tags = array('{CATEGORY_NAME}' => $category_name, '{CATEGORY_DESC}' => $category_desc, '{SITENAME}' => 'CMS Adminss', '{HEADING}' => $heading, '{TOPNAV}' => 'top_menu.php', '{FOOTER}' => 'footer.php');
$tpl->parse_template($tags);
print $tpl->display();
Esempio n. 8
0
                $action->track_activity($userID, $action->deleting_msg, 'Deleting a message "' . $title . '"');
            } else {
                $delete_err++;
            }
        }
        $_SESSION['task'] = 'delete_some_msgs';
    } else {
        // she checked only 1 message to delete..
        $value = $_POST['cid'][0];
        $sql = "delete from poll_topic ";
        $sql .= " where topic_id = '{$value}' ";
        if (!($result = $db->query($sql))) {
            die('Error:' . $db->error());
        }
        if ($done) {
            // Log the activity
            $action = new activity();
            $action->track_activity($userID, $action->deleting_msg, 'Deleting a message "' . $title . '"');
        } else {
            $delete_err++;
        }
        $_SESSION['task'] = 'delete';
        $_SESSION['title'] = $title;
    }
}
if ($delete_err > 0) {
    $_SESSION['task'] = 'faileddelete';
    header('Location: list_poll_survey.php');
} else {
    header('Location: list_poll_survey.php');
}
Esempio n. 9
0
    // modify the existing quote
    if ($_POST['task'] == 'edit') {
        $result = $q->update_quote($quoteID, $author, $quote);
        if ($result) {
            // Log the activity
            $action = new activity();
            $action->track_activity($userID, $action->saving_quote, 'Saving the quote  ' . $quote);
        }
        $_SESSION['task'] = 'edit';
        $_SESSION['title'] = $quote;
        if ($result) {
            header('location: quote_manager.php');
            exit;
        }
    }
    // add new quote
    if ($_POST['task'] == 'add') {
        $result = $q->add_quote($author, $quote);
        if ($result) {
            // Log the activity
            $action = new activity();
            $action->track_activity($userID, $action->saving_quote, $quote);
        }
        $_SESSION['task'] = 'add';
        $_SESSION['title'] = $quote;
        if ($result) {
            header('location: quote_manager.php');
            exit;
        }
    }
}
Esempio n. 10
0
//print_r($clients);
foreach ($clients as $field => $data) {
    //		echo $data->clientID ;
    if ($data->clientID == $cpimages[0]->banner_clientID) {
        $optclients .= '<option value="' . $data->clientID . '" selected >';
        $optclients .= $data->clientname;
        $optclients .= '</option>';
    } else {
        $optclients .= '<option value="' . $data->clientID . '">';
        $optclients .= $data->clientname;
        $optclients .= '</option>';
    }
}
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->viewing_bannerads, 'Viewing the banner ' . $cpimages[0]->banner_name);
if ($cpimages[0]->banner_imageurl != "") {
    $bannerimg = '<img src="' . makeRelativePath($cpimages[0]->banner_imageurl, 2) . '" name="imagelib" >';
} else {
    $bannerimg = '<img src="images/ads/blank.png" name="imagelib">';
}
if ($cpimages[0]->banner_show) {
    $showbanner .= '<input name="showbanner" type="radio" value="1" checked >Yes';
    $showbanner .= '<input name="showbanner" type="radio" value="0" >No';
} else {
    $showbanner .= '<input name="showbanner" type="radio" value="1" >Yes';
    $showbanner .= '<input name="showbanner" type="radio" value="0" checked >No';
}
/**
 * Create an array of article status for the option lists
*/
Esempio n. 11
0
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
if (isset($_SESSION['message'])) {
    $message = $_SESSION['message'];
    unset($_SESSION['message']);
}
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->creating_client_profile, '--');
unset($_SESSION['clientID']);
unset($_SESSION['clientname']);
unset($_SESSION['contactname']);
unset($_SESSION['username2']);
unset($_SESSION['email']);
unset($_SESSION['phoneno']);
unset($_SESSION['faxno']);
unset($_SESSION['extrainfo']);
unset($_SESSION['address']);
$block .= '<input name="status" type="radio" value="1"checked>Yes';
$block .= '<input name="status" type="radio" value="0" >No';
$date = time();
// ok baby, let start compiling the page now..go! go! go! {mh}
$tpl = new template_parser('../templates/add_new_clients.tpl.php');
$tags = array('{STATUS}' => $block, '{REGISTER_DATE}' => friendlyDate($date), '{MESSAGE}' => $message, '{CLIENTNAME}' => $clientname, '{USERNAME}' => $username2, '{CONTACTNAME}' => $contactname, '{EMAIL}' => $email, '{ADDRESS}' => $address, '{WEBSITE}' => $website1, '{TELNO}' => $phoneno, '{FAXNO}' => $faxno, '{EXTRAINFO}' => $extrainfo, '{SITENAME}' => 'CMS Adminss', '{HEADER}' => ' ', '{TOPNAV}' => 'top_menu.php', '{FOOTER}' => 'footer.php');
Esempio n. 12
0
         $sql .= " where articleID=" . $_SESSION['articleID'];
         $result = $db->query($sql);
         $modified = time();
         $sql = " update article_versions ";
         $sql .= " set article_versions.stageID=" . $stage;
         $sql .= " , article_versions.title = '{$article_title}' ";
         $sql .= " , article_versions.article_body = '{$article_body}' ";
         $sql .= " , article_versions.modified = '{$modified}' ";
         $sql .= " , article_versions.status = '--' ";
         $sql .= " , article_versions.edited_by=" . $_SESSION['userID'];
         $sql .= " where article_versions.articleID=" . $_SESSION['articleID'];
         $result = $db->query($sql);
         if ($result) {
             // Log the activity
             $action = new activity();
             $action->track_activity($userID, $action->saving_article, 'Saving the article ' . $article_title);
             $_SESSION['task'] = 'edit';
             $_SESSION['title'] = $article_title;
             $gotoURL = "../admin/view_article_versions.php?stageID=" . $_SESSION['stageID'];
         }
         break;
     case 4:
     case 5:
     case 6:
         break;
 }
 // END OF switch( $_SESSION['stageID'] )
 // if the writer decided to change the category of the article..
 // then lets update it ok..
 if ($categoryID) {
     $sql = " select * from article_category ac ";
Esempio n. 13
0
require '../admin/coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: ../admin/login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
$imageID = $_GET['imageID'];
$db = new database();
$sql = " select * from stockphotos where imageID= '{$imageID}' ";
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$image = array();
while ($image[] = $db->fetcharray()) {
}
$imagename = $image[0]->image_filename;
$sql = " delete from stockphotos \r\n\t\t where imageID= '{$imageID}' ";
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
//unlink( makeRelativepath($imagename, 4) );
if ($result) {
    // Log the activity
    $action = new activity();
    $action->track_activity($userID, $action->deleting_image, makeRelativepath($imagename, 7));
}
header('location: ' . $_SERVER['HTTP_REFERER']);
Esempio n. 14
0
        $action = new activity();
        $action->track_activity($userID, $action->saving_category, 'Saving the category detail of ' . $category_name);
    }
    $_SESSION['task'] = 'edit';
    $_SESSION['title'] = $category_name;
    if ($result) {
        /*echo '<script>alert("Successfully saved the category.");</script>';	*/
        header('location: category_manager.php');
        exit;
    }
}
// add new category
if ($_POST['task'] == 'add') {
    $sql = " insert into category ( category_name, category_desc)";
    $sql .= " values( '{$category_name}', '{$category_desc}' ) ";
    if (!($result = $db->query($sql))) {
        die('Error:' . $db->error());
    }
    if ($result) {
        // Log the activity
        $action = new activity();
        $action->track_activity($userID, $action->saving_category, $category_name);
    }
    $_SESSION['task'] = 'add';
    $_SESSION['title'] = $category_name;
    if ($result) {
        /*echo '<script>alert("Successfully saved the category.");</script>';*/
        header('location: category_manager.php');
        exit;
    }
}
Esempio n. 15
0
<?php

include 'configuration.php';
require 'coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $username = $_SESSION['username'];
    // Log the activity
    $action = new activity();
    $action->track_activity($userID, $action->loggedin, '--');
}
$x = new online_tracker();
$x->tracker();
$usertypeID = getUser_info($userID, 'usertypeID');
$position = getGroup_name($usertypeID);
$message = ' Welcome ' . $username . '!';
switch ($position) {
    case 'Administrator':
        $message .= ', you logged in as ' . $position . '.';
        $_SESSION['stageID'] = 6;
        break;
    case 'Writer':
        $x = checkUserAccessRights($userID, 2);
        if (!$x) {
            $message .= ' Sorry, the admin restrict you to act as a Writer.';
        } else {
Esempio n. 16
0
$_SESSION['created'] = $view_article_detail[0]->created;
$_SESSION['created_day'] = $view_article_detail[0]->created_day;
$_SESSION['created_month'] = $view_article_detail[0]->created_month;
$_SESSION['created_year'] = $view_article_detail[0]->created_year;
$_SESSION['dateline'] = $view_article_detail[0]->dateline;
$_SESSION['edited_by'] = $view_article_detail[0]->edited_by;
$_SESSION['category'] = getCategory_info($view_article_detail[0]->categoryID, 'category_name');
$writer = getArticle_authors_info($view_article_detail[0]->articleID, 'fullname');
print $writer;
$_SESSION['created_by'] = $writer;
$articlestageID = $view_article_detail[0]->stageID;
$_SESSION['articlestageID'] = $articlestageID;
//print_r($_SESSION);
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->viewing_article, 'Viewing the article ' . addslashes($_SESSION['title']));
// lets get the current article stage
//print_r($_SESSION);
/**
 * Check the article if there is a revision lists..
 * if naa then allow the designated user to revise it :-) ..dah..
 */
$revision_lists_found = checkRevisionLists($articleID, $articlestageID);
if ($revision_lists_found) {
    switch ($articlestageID) {
        case 2:
            // on writing stage
            switch ($_SESSION['stageID']) {
                case 1:
                    $set_template = "../templates/view_article_detail.tpl.php";
                    $link = "preview_article.php?articleID={$articleID}";
Esempio n. 17
0
$sql .= " where cp.clientID=" . intval($clientID);
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$db->fetcharray();
if ($db->getNumRows() > 0) {
    $sql = " update corporate_partners ";
    $sql .= " set clientname = '{$clientname}' , ";
    $sql .= " contactname = '{$contactname}', ";
    $sql .= " username = '******', ";
    if ($password != '') {
        $sql .= " password = '******', ";
    }
    $sql .= " address = '{$address}', ";
    $sql .= " phoneno = '{$phoneno}', ";
    $sql .= " faxno = '{$faxno}', ";
    $sql .= " emailadd = '{$emailadd}', ";
    $sql .= " extrainfo = '{$extrainfo}' ";
    $sql .= " where clientID = '{$clientID}' ";
    $_SESSION['task'] = 'edit';
    $_SESSION['title'] = $clientname;
    if (!($result = $db->query($sql))) {
        die('Error:' . $db->error());
    }
}
if ($result) {
    // Log the activity
    $action = new activity();
    $action->track_activity($userID, $action->saving_client_profile, 'Saving client profile ' . $clientname);
    header('location: client_profile.php');
}
Esempio n. 18
0
require 'coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
// print_r($_POST);
if (isset($_POST['send'])) {
    $to = $_POST['to'];
    $subject = $_POST['subject'];
    $message = $_POST['message'];
    $date_msg_created = time();
    $msg = new messages();
    $result = $msg->sendMessage($_SESSION['userID'], $to, $date_msg_created, 'Unread', $subject, $message);
    if ($result) {
        $_SESSION['task'] = 'sent';
        $_SESSION['title'] = $subject;
        $_SESSION['to'] = $to;
        // Log the activity
        $action = new activity();
        $action->track_activity($userID, $action->sending_msg, 'Sending a message " ' . $_SESSION['title'] . ' " to ' . getUser_info($_SESSION['to'], 'fullname'));
        header('location: view_messages.php');
    }
}
if (isset($_POST['cancel'])) {
    header('location: view_messages.php');
}
Esempio n. 19
0
}
$clientname = $_SESSION['clientname'];
$username = $_SESSION['clientusername'];
$contactname = $_SESSION['contactname'];
$emailadd = $_SESSION['emailadd'];
$address = $_SESSION['address'];
$website1 = $_SESSION['website'];
$phoneno = $_SESSION['phoneno'];
$registerdate = $_SESSION['registerdate'];
$lastvisitdate = $_SESSION['lastvisitdate'];
$faxno = $_SESSION['faxno'];
$extrainfo = $_SESSION['extrainfo'];
$status = $_SESSION['status'];
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->editing_client_profile, 'Editing client profile ' . $_SESSION['clientname']);
if (!$my_profile[0]->is_enabled) {
    $block .= '<input name="status" type="radio" value="1" checked >Yes';
    $block .= '<input name="status" type="radio" value="0" >No';
} else {
    $block .= '<input name="status" type="radio" value="1" >Yes';
    $block .= '<input name="status" type="radio" value="0" checked >No';
}
if ($registerdate) {
    $registerdate = $_SESSION['registerdate'];
} else {
    $registerdate = 0;
}
if ($clients[0]->lastvisitDate > 0) {
    $lastvisitDate = friendlydate($clients[0]->lastvisitDate);
} else {
Esempio n. 20
0
    header('location: banner_ads_manager.php');
    exit;
}
//print_r($_POST);
if (isset($_POST['task'])) {
    switch ($_POST['task']) {
        case 'add':
            $sql = "insert into corporate_partners_imgs ( banner_name, banner_clickURL, \r\n\t\t\t\t\tbanner_clientID, banner_description, banner_type, imptotal, \r\n\t\t\t\t\tbanner_show, imptotal_amount, impamount_paid, impbalance, impchange ) \r\n\t\t\t\t\tvalues( '{$bannername}', '{$clickurl}', '{$clientnames}', '{$desc}', '{$bannersize}' ,\r\n\t\t\t\t\t'{$impressions_purchased}', '{$showbanner}', '{$totalamount}' ,\r\n\t\t\t\t\t'{$amountpaid}', '{$balance}', '{$change}' ) ";
            if (!($result = $db->query($sql))) {
                die('Error:' . $db->error());
            }
            $_SESSION['title'] = $bannername;
            $_SESSION['task'] = 'add';
            // Log the activity
            $action = new activity();
            $action->track_activity($userID, $action->saving_bannerads, $bannername);
            header('location: banner_ads_manager.php');
            break;
        case 'edit':
            $bannerID = $_SESSION['bannerID'];
            $sql = "select * from corporate_partners_imgs where bannerID = '{$bannerID}' ";
            if (!($result = $db->query($sql))) {
                die('Error:' . $db->error());
            }
            $ads = array();
            while ($ads[] = $db->fetcharray()) {
            }
            $oldimptotal = $ads[0]->imptotal;
            $oldbalance = $ads[0]->impbalance;
            if ($db->getnumrows() > 0) {
                $impressions_purchased = $impressions_purchased + $oldimptotal;
Esempio n. 21
0
$default_template_large_preview = $_POST['template_large_preview'];
$default_template_configuration = "template.configuration.php";
// load the default template configuration for writing..chmod must be 2
$fp = fopen($default_template_configuration, w);
if (!$fp) {
    echo "Cannot open file : {$template_configuration}";
    exit;
}
$out = sprintf("<?php\r\n");
fwrite($fp, $out, strlen($out));
$out = sprintf("\$default_template_name =\"%s\";\r\n", $default_template_name);
fwrite($fp, $out, strlen($out));
$out = sprintf("\$default_template_stylesheet =\"%s\";\r\n", $default_template_stylesheet);
fwrite($fp, $out, strlen($out));
$out = sprintf("\$default_template_author =\"%s\";\r\n", $default_template_author);
fwrite($fp, $out, strlen($out));
$out = sprintf("\$default_template_large_preview =\"%s\";\r\n", $default_template_large_preview);
fwrite($fp, $out, strlen($out));
$out = sprintf("\$default_template_thumbnail =\"%s\";\r\n", $default_template_thumbnail);
fwrite($fp, $out, strlen($out));
$out = sprintf("?>");
fwrite($fp, $out, strlen($out));
if ($result) {
}
if (fclose($fp)) {
    // Log the activity
    $action = new activity();
    $action->track_activity($userID, $action->changing_template, 'Selected: ' . $default_template_name);
    header("Location: " . $_SERVER['HTTP_REFERER']);
    return;
}
Esempio n. 22
0
<?php

include 'configuration.php';
require 'coreclass.php';
session_start();
// Log the activity
$action = new activity();
$action->track_activity($_SESSION['userID'], $action->logout, '--');
// log-out the user
$auth = new user_authentication();
$auth->set_User_logout($_SESSION['userID']);
$auth->logout();
header('Location: index.php');
// back to main page
Esempio n. 23
0
<?php

include 'configuration.php';
require 'coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
$quote_message = $_SESSION['quote_message'];
$quote_author = $_SESSION['quote_author'];
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->viewing_quotes, 'Viewing the category detail of ' . $category_name);
// start compiling the page..
$tpl = new template_parser("../templates/edit_quote_detail.tpl.php");
$tags = array('{QUOTE}' => $quote_message, '{AUTHOR}' => $quote_author, '{SITENAME}' => 'CMS Adminss', '{HEADER}' => ' ', '{TOPNAV}' => 'top_menu.php', '{CONTENT}' => $row_data, '{FOOTER}' => 'footer.php');
$tpl->parse_template($tags);
print $tpl->display();
Esempio n. 24
0
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
if (isset($_SESSION['message'])) {
    $message = $_SESSION['message'];
    unset($_SESSION['message']);
}
// 	print_r($_POST);
$db = new database();
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->creating_user, '--');
$sql = " select * from content_usertypes ";
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$group = array();
while ($row = $db->fetcharray()) {
    $group[] = $row;
}
$db->freeresult();
$usertypes = '';
foreach ($group as $field => $value) {
    $usertypes .= '<option value="' . $value->usertypeID . '">';
    $usertypes .= $value->usertype_name;
    $usertypes .= '</option>';
}