Esempio n. 1
0
 /**
  * Load gpx file into SimpleXMLElement and create Activity object.
  */
 public function algorithm($file_name)
 {
     $xml = simplexml_load_file($file_name);
     //$Sport = (isset($xml->trk->type) ? (string) $xml->trk->type : "running");
     //$class = "\activity_" . \strtolower( $Sport );
     $aktywnosc = new \activity();
     $aktywnosc->setValues($xml, "GPX");
     return $aktywnosc;
 }
Esempio n. 2
0
 /**
  * Load tcx file into SimpleXMLElement and create Activity object.
  */
 public function algorithm($file_name)
 {
     $xml = simplexml_load_file($file_name);
     //	foreach($xml->Activities->Activity[0]->attributes() as $attr => $value)
     //		if(\strtolower($attr) === "sport") $this->Sport = (string) $value;
     //	$class = "\activity_" . \strtolower( $this->Sport );
     $aktywnosc = new \activity();
     $aktywnosc->setValues($xml->Activities->Activity[0], "TCX");
     return $aktywnosc;
 }
Esempio n. 3
0
	/**
	* Static function to save content likes and dislikes in the database.
	* TODO: Resource intensive, needs to be optimized.
	* @param integer $cid Content ID of the liked/disliked content.
	* @param integer $uid User ID who liked/disliked content.
	* @param integer $like User Preference (1:Like | -1:Dislike)
	* @return integer Like ID identifying the User, Content and Preference (like/dislike)
	*/
	public static function like($cid,$uid,$like)
	{
		activity::removelike($cid,$uid);
		$sql="Insert into content_like(cl_cid,cl_uid,cl_value) values('".$cid."','".$uid."','".$like."') returning cl_id";
		$likeid=pg_fetch_result(dbquery($sql),0,0);
		if($likeid)
		{
			if($like==1)
				$sql="Update content set cn_likes=cn_likes+1 where cn_id=$cid";
			else if($like==-1)
				$sql="Update content set cn_dislikes=cn_dislikes+1 where cn_id=$cid";
			dbquery($sql);
		}
		return $likeid;
	}
Esempio n. 4
0
 public function has_activities($parents_id, $column_name1, $comparison1, $value1, $delimiter = '', $column_name2 = '', $comparison2 = '', $value2 = '')
 {
     $database = $_SESSION['database'];
     $tariffs_listing = '';
     if (tep_not_null($parents_id)) {
         $tariffs_query = $database->query("select tariffs_id from " . TABLE_TARIFFS . " where employees_roles_id in (" . $parents_id . ")");
         while ($tariffs_result = $database->fetch_array($tariffs_query)) {
             if (tep_not_null($tariffs_listing)) {
                 $tariffs_listing .= ',';
             }
             $tariffs_listing .= '' . $tariffs_result['tariffs_id'];
         }
     } else {
         $tariffs_listing = $this->id;
     }
     $activity = new activity();
     return $activity->get_activities($tariffs_listing, $column_name1, $comparison1, $value1, $delimiter, $column_name2, $comparison2, $value2);
 }
Esempio n. 5
0
 public function _activityadd()
 {
     $Activity = new activity();
     $Activity->_add($_SESSION["USERID"], $_POST['activityname'], $_POST['activitydescription'], 0, $_SESSION["TEAMID"]);
 }
Esempio n. 6
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. 7
0
<?php

require "../admin/db.php";
require "../src/secure.php";
$reportObj = new activity();
$report = $reportObj->getUserReport($_SESSION['user_id']);
$sumArray = array();
foreach ($report as $k => $subArray) {
    foreach ($subArray as $id => $value) {
        $sumArray[$id] += $value;
    }
}
function thousandsCurrencyFormat($num)
{
    $x = round($num);
    $x_number_format = number_format($x);
    $x_array = explode(',', $x_number_format);
    $x_parts = array('k', 'm', 'b', 't');
    $x_count_parts = count($x_array) - 1;
    $x_display = $x;
    $x_display = $x_array[0] . ((int) $x_array[1][0] !== 0 ? '.' . $x_array[1][0] : '');
    $x_display .= $x_parts[$x_count_parts - 1];
    return $x_display;
}
function properize($string)
{
    return $string . '&rsquo;' . ($string[strlen($string) - 1] != 's' ? 's' : '');
}
$ActCount = count($report);
?>
<!DOCTYPE html>
Esempio n. 8
0
$_SESSION['article_body'] = $view_article_detail[0]->article_body;
$_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";
Esempio n. 9
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;
}
                                        }
                                        // Reload the timesheet object in order to
                                        // update the activity listing below
                                        $_SESSION['timesheet'] = new timesheet(0, $_SESSION['employee']->id, $_POST['period'], true, $_POST['sort_order']);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
$_POST['error_level_history'] = $error_level;
$_POST['previous_activity_amount'] = activity::format('amount', $_POST['activity_amount']);
?>
  <!-- activity_entry //-->
  <table border="0" cellspacing="0" cellpadding="2">
    <tr>
      <td valign="top">
        <table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td><?php 
require DIR_WS_INCLUDES . 'calendar.php';
?>
</td>
          </tr>
          <tr>
            <td><?php 
echo tep_draw_separator('pixel_trans.gif', '100%', '10');
Esempio n. 11
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. 12
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. 13
0
<?php

/**
 * Processes user login and redirects back to page.
 */
include_once '../functions/class.activity.php';
activity::login($_POST['uname'], $_POST['pass']);
header("Location: " . $_POST['page'] . "?" . $_POST['parameter']);
Esempio n. 14
0
<?php
	/**
	* Accepts Content likes from front end and stores in database.
	*/
	session_start();
	include '../functions/class.activity.php';
	$cid=$_POST['cid'];
	$value=$_POST['value'];
	$uid=$_SESSION['uid'];
	if($uid && $value && $cid){
		activity::like($cid,$uid,$value);
	}
?>
Esempio n. 15
0
if (isset($_POST['cancel'])) {
    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) {
Esempio n. 16
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. 17
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'];
}
$db = new database();
$activity = new activity();
$activities = $activity->lists_all_activity();
/**
 * Populate all the activities into an array..
 */
$opt_activity = '';
foreach ($activities as $field => $data) {
    if ($data->activity == $_SESSION['pactivity']) {
        $opt_activity .= '<option value="' . $data->activity . '" selected >';
        $opt_activity .= $data->activity;
        $opt_activity .= '</option>';
    } else {
        $opt_activity .= '<option value="' . $data->activity . '">';
        $opt_activity .= $data->activity;
        $opt_activity .= '</option>';
    }
}
Esempio n. 18
0
    exit;
}
$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);
Esempio n. 19
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. 20
0
                    $array[$iTotal]["platformImage"] = $platformImage;
                    $array[$iTotal]["streamID"] = $iTotal;
                    $array[$iTotal]["bar"] = $progressBar;
                    $array[$iTotal]["percent"] = $percentComplete;
                    $array[$iTotal]["streamType"] = $string_streamType;
                    $array[$iTotal]["videoCodec"] = $string_videoCodec;
                    $array[$iTotal]["audioCodec"] = $string_audioCodec;
                    $output = $array;
                }
                $iTotal++;
            }
        }
        return $output;
    }
}
$activity = new activity();
if (isset($_GET['xml'])) {
    if ($_GET['xml'] == "sessions") {
        header('Content-Type: application/xml');
        echo "<sessions>";
        foreach ($activity->sessionProgressView("xml") as $val) {
            echo "<session>\n\t\t\t\t\t<alertBar>";
            if ($plexServer->sessions("count") == 1) {
                echo "<string1>" . $plexServer->lang()->index->userCountPre1User . "</string1>";
                echo "<string2>" . $plexServer->lang()->index->userCount1User . "</string2>";
            } else {
                echo "<string1>" . $plexServer->lang()->index->userCountPreUsers . "</string1>";
                echo "<string2>" . $plexServer->lang()->index->userCountUsers . "</string2>";
            }
            echo "<count>" . $plexServer->sessions("count") . "</count>\n\t\t\t\t\t</alertBar>\n\t\t\t\t\t<colums>" . $val['colums'] . "</colums>\n\t\t\t\t\t<url>" . $val['url'] . "</url>\n\t\t\t\t\t<img>" . $val['img'] . "</img>\n\t\t\t\t\t<title>" . $val['title'] . "</title>\n\t\t\t\t\t<user>" . $val['user'] . "</user>\n\t\t\t\t\t<playStatus>" . $val['playStatus'] . "</playStatus>\n\t\t\t\t\t<platformImage>" . $val['platformImage'] . "</platformImage>\n\t\t\t\t\t<streamID>" . $val['streamID'] . "</streamID>\n\t\t\t\t\t<bar>" . $val['bar'] . "</bar>\n\t\t\t\t\t<percent>" . $val['percent'] . "</percent>\n\t\t\t\t\t<streamType>" . $val['streamType'] . "</streamType>\n\t\t\t\t\t<videoCodec>" . $val['videoCodec'] . "</videoCodec>\n\t\t\t\t\t<audioCodec>" . $val['audioCodec'] . "</audioCodec>\n\t\t\t\t</session>";
        }
Esempio n. 21
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. 22
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'];
}
//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());
}
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'];
}
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. 24
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. 25
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. 26
0
<?php
	/**
	* Submits user feedback to the database.
	*/
	session_start();
	include_once '../functions/class.activity.php';
	$uid=0;
	if($_SESSION['uid']){
		$uid=$_SESSION['uid'];
	}
	$res=activity::feedback($_SERVER['REMOTE_ADDR'],$uid,$_POST['type'],$_POST['desc']);
	if($res){
		$status=array();
		$status['status']="Thanks for the feedback.";
		echo json_encode($status);
	}

?>
Esempio n. 27
0
 public function getLatestActivity($h)
 {
     require_once PLUGINS . 'activity/activity.php';
     $activity = new activity();
     $result = $activity->getLatestActivity($h);
     return $result;
 }
Esempio n. 28
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. 29
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. 30
0
 public function get_former_activity_id($employees_id, $selected_date = null)
 {
     if (!tep_not_null($selected_date)) {
         $selected_date = time();
     }
     $former_activity_id = activity::get_former_activity_id($employees_id, $selected_date);
     if ($former_activity_id <= 0) {
         // No activity exists or activity not valid for given employee & date
         $this->former_activity = null;
     } else {
         // Activity exists and is valid for given employee and date
         $this->former_activity = new activity($former_activity_id);
     }
     return $former_activity_id;
 }