include "../TSLIB/TSLIB_COMMON_FUNCTIONS.php";
include "../TSLIB/TSLIB_CONNECTION.php";
$currentdate = date("Y-m-d");
//CURRENT DATE
//$currentdate=date("Y-m-d",strtotime("-1 days"));//yesterday DATE
$select_admin = "SELECT * FROM VW_ACCESS_RIGHTS_TERMINATE_LOGINID WHERE URC_DATA='ADMIN'";
$select_sadmin = "SELECT * FROM VW_ACCESS_RIGHTS_TERMINATE_LOGINID WHERE URC_DATA='SUPER ADMIN'";
$admin_rs = mysqli_query($con, $select_admin);
$sadmin_rs = mysqli_query($con, $select_sadmin);
$select_template = "SELECT * FROM EMAIL_TEMPLATE_DETAILS WHERE ET_ID=15";
$select_template_rs = mysqli_query($con, $select_template);
if ($row = mysqli_fetch_array($select_template_rs)) {
    $mail_subject = $row["ETD_EMAIL_SUBJECT"];
    $body = $row["ETD_EMAIL_BODY"];
}
$mail_subject = get_displayname();
if ($row = mysqli_fetch_array($admin_rs)) {
    $admin = $row["ULD_LOGINID"];
    //get admin
}
if ($row = mysqli_fetch_array($sadmin_rs)) {
    $sadmin = $row["ULD_LOGINID"];
    //get super admin
}
$admin_name = substr($admin, 0, strpos($admin, '.'));
$sadmin_name = substr($sadmin, 0, strpos($sadmin, '.'));
$spladminname = $admin_name . '/' . $sadmin_name;
$spladminname = strtoupper($spladminname);
$sub = str_replace("[SADMIN]", "{$spladminname}", $body);
$mail_subject = str_replace("[DATE]", date("d/m/Y"), $mail_subject);
$message = '<html><body>' . '<br>' . '<h> ' . $sub . '</h>' . '<br>' . '<br>' . '<table border=1  width=470 ><thead  bgcolor=#6495ed style=color:white><tr  align="center"  height=2px ><td width=260><b>EMPLOYEE NAME</b></td><td width=200><b>REPORT DATE</b></td></tr></thead>';
Exemplo n.º 2
0
include "../TSLIB/TSLIB_CONNECTION.php";
include "../TSLIB/TSLIB_GET_USERSTAMP.php";
$USERSTAMP = $UserStamp;
$currentdate = date("Y-m-d", strtotime("-1 days"));
//yesterday DATE
$select_admin = "SELECT * FROM VW_ACCESS_RIGHTS_TERMINATE_LOGINID WHERE URC_DATA='ADMIN'";
$select_sadmin = "SELECT * FROM VW_ACCESS_RIGHTS_TERMINATE_LOGINID WHERE URC_DATA='SUPER ADMIN'";
$admin_rs = mysqli_query($con, $select_admin);
$sadmin_rs = mysqli_query($con, $select_sadmin);
$select_template = "SELECT * FROM EMAIL_TEMPLATE_DETAILS WHERE ET_ID=4";
$select_template_rs = mysqli_query($con, $select_template);
if ($row = mysqli_fetch_array($select_template_rs)) {
    $mail_subject = $row["ETD_EMAIL_SUBJECT"];
    $body = $row["ETD_EMAIL_BODY"];
}
$get_displayname = get_displayname();
if ($row = mysqli_fetch_array($admin_rs)) {
    $admin = $row["ULD_LOGINID"];
    //get admin
}
if ($row = mysqli_fetch_array($sadmin_rs)) {
    $sadmin = $row["ULD_LOGINID"];
    //get super admin
}
$admin_name = substr($admin, 0, strpos($admin, '.'));
$sadmin_name = substr($sadmin, 0, strpos($sadmin, '.'));
$spladminname = $admin_name . '/' . $sadmin_name;
$spladminname = strtoupper($spladminname);
$sub = str_replace("[SADMIN]", "{$spladminname}", $body);
$sub = str_replace("[DATE]", date("d-m-Y", strtotime("-1 days")), $sub);
$result = $con->query("CALL SP_TS_REPORT_MAIL('{$USERSTAMP}',@TEMP_TABLE)");
Exemplo n.º 3
0
$announced_date = get_date("Y-m-j", $row[memory_value2]);
$announced_mes = $row[memory_value3] ? replace_text($row[memory_value3]) : "--------------------";
opmain_body("{$lang['RO_Mes']}", 150);
echo "<TABLE width=\"100%\" height=\"100%\" align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n\t<TBODY>\n\t\t<TR class=\"topic_title5\">\n\t\t\t<TD width=\"100%\" height=\"25\" vAlign=\"top\"></TD>\n\t\t</TR>\n\t\t<TR class=\"topic_title6\" height=\"100%\">\n\t\t\t<TD class=\"title_face4\" vAlign=\"top\">\n\t\t\t\t<div class=\"poststyle\">{$announced_mes}</div>\n\t\t\t</TD>\n\t\t</TR>\n\t\t<TR class=\"topic_title5\">\n\t\t\t<TD width=\"100%\" vAlign=\"top\" align=\"right\">\n\t\t\t\t<B>{$lang['Announced']} <U>{$row['memory_value1']}</U>, {$lang['Date']}: {$announced_date}</B>\n\t\t\t</TD>\n\t\t</TR>\n\t<TBODY>\n</TABLE>\n<script type='text/javascript'>\n\tvar max_width = " . $CONFIG_max_img_width . ";\n\tvar max_height = " . $CONFIG_max_img_height . ";\n\tvar total_img_resize = " . $CP[images_num] . ";\n\twindow.onload=resize_img;\n</script>\n";
clmain_body();
include_once "news.php";
if ($CONFIG_show_last_topic_reply) {
    echo "<BR>\n";
    opmain_body("{$lang['Last_TRP']}");
    echo "<TABLE width=\"100%\" height=\"100%\" align=\"center\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\n\t<TBODY>\n";
    $query = "SELECT us.display_name, t.* FROM {$CONFIG_sql_cpdbname}.board_topic t\n\t\tLEFT JOIN {$CONFIG_sql_cpdbname}.user_profile us ON (us.user_id=t.topic_lastreply_name)\n\tORDER by t.topic_last_action_date DESC LIMIT " . mysql_res($CONFIG_show_last_topic_reply_per) . "";
    $sql->result = $sql->execute_query($query, 'main.php');
    $sql->total_query++;
    if ($sql->count_rows() > 0) {
        while ($row = $sql->fetch_row()) {
            $topic_lastreply_name = get_displayname($row[display_name], $row[topic_lastreply_name]);
            $topic_lastreply_name = $topic_lastreply_name == $lang[Guest] ? $lang[Guest] : "<a href=\"index.php?showuser="******"\">{$topic_lastreply_name}</a>";
            $topic_start_date = get_date("M j y, H:i:s A", $row[topic_start_date]);
            if ($trcolor2 != 'topic_title4') {
                $trcolor2 = 'topic_title4';
            } else {
                $trcolor2 = 'topic_title3';
            }
            echo "\t\t<TR class=\"{$trcolor2}\" height=\"20\">\n\t\t\t<TD align=\"center\" width=\"5%\"><img src=\"theme/{$STORED['THEME']}/images/f_norm.gif\"></TD>\n\t\t\t<TD width=\"70%\">\n\t\t\t\t&nbsp;&nbsp;<a href=\"index.php?showtopic={$row['topic_id']}&view=getnewpost\" title=\"This topic was started: {$topic_start_date}\">{$row['topic_name']}</a>\n\t\t\t</TD>\n\t\t\t<TD width=\"25%\" align=\"left\">\n\t\t\t\t&nbsp;&nbsp;<a href=\"index.php?showtopic={$row['topic_id']}&view=getnewpost\">{$lang['Last_Post']}</a>: " . $topic_lastreply_name . "\n\t\t\t</TD>\n\t\t</TR>\n";
        }
    } else {
        echo "\t\t<TR class=\"topic_title5\" height=\"20\"><TD></TD></TR>\n\t\t<TR class=\"topic_title4\" height=\"20\">\n\t\t\t<TD align=\"center\">\n\t\t\t\t<B>{$lang['Topic_nf']}</B>\n\t\t\t</TD>\n\t\t</TR>\n";
    }
    echo "\t<TBODY>\n</TABLE>\n";
    clmain_body();
}
Exemplo n.º 4
0
     $sql->result = $sql->execute_query($query, 'forum.php');
     $sql->total_query++;
     $mrow = $sql->fetch_row();
     $query = "SELECT user_id, display_name, user_last_login FROM {$CONFIG_sql_cpdbname}.user_profile WHERE user_online =\"1\" ORDER by user_last_login DESC";
     $sql->result = $sql->execute_query($query, 'forum.php');
     $sql->total_query++;
     $member_online = $sql->count_rows();
     $guest_online = $user_online - $member_online;
     if ($guest_online < 0) {
         $guest_online = '0';
     }
     $mdate = get_date("M j y, H:i A", $mrow[memory_value2]);
     $i = "";
     while ($urow = $sql->fetch_row()) {
         //$username = get_username($urow[user_id]);
         $username = get_displayname($urow[display_name], $urow[user_id]);
         $user_last_login = get_date("H:i A", $urow[user_last_login]);
         $color = checkprivilege_action($urow[user_id], g_color);
         $members_online = "{$members_online}" . $i . "<a href=\"index.php?showuser="******"\" title=\"{$user_last_login}\"><font color=\"{$color}\">{$username}</font></a>";
         $i = ", ";
     }
     $FR_Stat_1 = sprintf("{$lang['FR_Stat_1']}", $user_online);
     $FR_Stat_2 = sprintf("\n\t\t\t\t{$lang['FR_Stat_2']}<BR>\n\t\t\t\t{$lang['FR_Stat_3']}<BR>\n\t\t\t\t{$lang['FR_Stat_4']}<BR>\n\t\t\t\t{$lang['FR_Stat_5']}", $total_post, $total_registered, "<a href=\"index.php?showuser="******"\">{$last_registered_name}</a>", $mrow[memory_value1], $mdate);
     opmain_body("{$lang['FR_Stat']}");
     echo "<TABLE width=\"100%\" cellspacing=\"1\" cellpadding=\"5\" align=\"center\" class=\"emptytable3\">\n\t<TBODY>\n\t\t<TR class=\"topic_title5\">\n\t\t\t<TD colspan=\"2\"><div class=\"title_face\">{$FR_Stat_1}</div></TD>\n\t\t</TR>\n\t\t<TR class=\"topic_title4\">\n\t\t\t<TD rowspan=\"2\" width=\"6%\" align=\"center\"><img src=\"theme/{$STORED['THEME']}/images/user.gif\" alt=\"Active Users\"></TD>\n\t\t\t<TD width=\"94%\"><B>{$guest_online}</B> {$lang['Guests']}, <B>{$member_online}</B> {$lang['Members']}</TD>\n\t\t</TR>\n\t\t<TR class=\"topic_title4\">\n\t\t\t<TD>" . $members_online . "&nbsp;</TD>\n\t\t</TR>\n\t\t<TR class=\"topic_title5\">\n\t\t\t<TD colspan=\"2\"><div class=\"title_face\">{$lang['FR_Stat']}</div></TD>\n\t\t</TR>\n\t\t<TR class=\"topic_title4\">\n\t\t\t<TD align=\"center\"><img src=\"theme/{$STORED['THEME']}/images/stats.gif\" alt=\"Forum Stats\"></TD>\n\t\t\t<TD>{$FR_Stat_2}\n\t\t\t</TD>\n\t\t</TR>\t\t\n\t</TBODY>\n</TABLE>\n";
     clmain_body();
 } else {
     opmain_body("CP Message");
     echo "<TABLE width=\"100%\" cellspacing=\"1\" cellpadding=\"5\" align=\"center\" class=\"emptytable3\">\n\t<TBODY>\n\t\t<TR height=\"27\" class=\"title_bar2\">\n\t\t\t<TD><div class=\"title_face\">CP Message</div></TD>\n\t\t</TR>\n\t\t<TR class=\"topic_title7\">\n\t\t\t<TD align=\"center\"><B>{$lang['No_Category']}</B></TD>\n\t\t</TR>\n\t</TBODY>\n</TABLE>\n";
     clmain_body();
 }
Exemplo n.º 5
0
         }
     } else {
         echo "\t\t\t\t\t\t<TR height=\"27\" class=\"topic_title4\">\n\t\t\t\t\t\t\t<TD colspan=\"7\" align=\"center\">\n\t\t\t\t\t\t\t\t<B>Pinned topic(s) not found in this forum.</B>\n\t\t\t\t\t\t\t</TD>\n\t\t\t\t\t\t</TR>\n";
     }
 }
 echo "\t\t\t\t\t\t<TR class=\"topic_title3\">\n\t\t\t\t\t\t\t<TD></TD>\n\t\t\t\t\t\t\t<TD></TD>\n\t\t\t\t\t\t\t<TD colspan=\"5\">\n\t\t\t\t\t\t\t\t<font class=\"title_face2\"><B>{$lang['FR_Topic']}</B></font>\n\t\t\t\t\t\t\t</TD>\n\t\t\t\t\t\t</TR>\n";
 if ($sql->count_rows()) {
     while ($row = $sql->fetch_row()) {
         $query = "SELECT COUNT(*) FROM {$CONFIG_sql_cpdbname}.poll WHERE topic_id =\"" . mysql_res($row['topic_id']) . "\"";
         $sql->result2 = $sql->execute_query($query, 'showforum.php');
         if ($sql->result($sql->result2)) {
             $IS_POLL = 1;
         } else {
             $IS_POLL = 0;
         }
         $topic_starter = get_displayname($row[display_name], $row[topic_starter]);
         $topic_lastreply_name = get_username($row[topic_lastreply_name]);
         if ($row[closed_mode] == '0') {
             if ($IS_POLL) {
                 if ($CP[time] - $row[topic_last_action_date] <= 3600) {
                     $status_topic = "<img src=\"theme/{$STORED['THEME']}/images/f_poll.gif\">";
                 } else {
                     $status_topic = "<img src=\"theme/{$STORED['THEME']}/images/f_poll_no.gif\">";
                 }
             } else {
                 if ($row[topic_replying] >= '20') {
                     if ($CP[time] - $row[topic_last_action_date] <= 3600) {
                         $status_topic = "<img src=\"theme/{$STORED['THEME']}/images/f_hot.gif\">";
                     } else {
                         $status_topic = "<img src=\"theme/{$STORED['THEME']}/images/f_hot_no.gif\">";
                     }
Exemplo n.º 6
0
        $rows = $sql->fetch_row();
        if (!$sql->count_rows() > 0) {
            $display = $lang[login_wrong];
        } else {
            if ($POST_LG_USER == "s1" || $POST_LG_USER == "s2" || $POST_LG_USER == "s3" || $POST_LG_USER == "s4" || $POST_LG_USER == "s5") {
                $display = $lang[login_wrong];
            } else {
                $pass = checkmd5($CONFIG_md5_support ? 0 : 1, $rows[user_pass]);
                if ($CONFIG_save_type == 1) {
                    $_SESSION["loginname"] = md5($rows[account_id]);
                    $_SESSION["loginpass"] = $pass;
                } else {
                    CP_setCookie("loginname", md5($rows['account_id']));
                    CP_setCookie("loginpass", $pass);
                }
                $display = sprintf($lang[login_right], get_displayname($rows['display_name']));
            }
        }
    } else {
        $display = $lang[login_wrong];
    }
}
if ($GET_act == "logout") {
    if ($CONFIG_save_type == 1) {
        session_unregister(loginname);
        session_unregister(loginpass);
    } else {
        CP_removeCookie("loginname");
        CP_removeCookie("loginpass");
    }
    $display = "{$lang['logout']}";