当前位置: 首页>>代码示例>>PHP>>正文


PHP Logs::write_logfile方法代码示例

本文整理汇总了PHP中Logs::write_logfile方法的典型用法代码示例。如果您正苦于以下问题:PHP Logs::write_logfile方法的具体用法?PHP Logs::write_logfile怎么用?PHP Logs::write_logfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Logs的用法示例。


在下文中一共展示了Logs::write_logfile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Test

}
//$tid=2;
$tt = new Test();
$qa = new Questions();
$records = $qa->get_ques_level($tid);
if (isset($_POST['submit'])) {
    $username = trim($_POST['username']);
    $password = trim($_POST['password']);
    $sid = $username . $password;
    $result = $tt->authenticatetest($sid, $tid);
    if (empty($result)) {
        $message = "The Secret Code of Invigilator/Admin is Incorrect.";
    } else {
        $log = new Logs($_SESSION['owner_id'], $tname);
        // do some logging operations
        //set the parameters to Begintest
        //$ctid=$tt->Begintest($session->owner_id,$tid,$result,$_POST['ql']);
        $_SESSION['first_time'] = "true";
        $ctid = $tt->Begin_test($_SESSION['owner_id'], $tid, $result[0], $_POST['myselect'], $_SESSION['uname']);
        $filename = "Current_test_" . $ctid;
        $log->write_logfile($filename, 'Test Authorised', "For User:{$_SESSION['uname']} By Admin/Invigilator :{$result[1]}.", time());
        $path = "test-pg.php?n=";
        $path .= urlencode($tname);
        $path .= "&c=";
        $path .= $ctid;
        redirect_to($path);
        //echo "<script type='text/javascript' language='javascript'>";
        //echo "submitform();";
        //echo "<//script>";
    }
}
开发者ID:niteshsinha,项目名称:OQM,代码行数:31,代码来源:validatetest.php

示例2: substr

    redirect_to("evaluate.php?n={$name}&c={$ctid}");
}
$test_duration = $_SESSION['test_duration'];
$h = (int) substr($test_duration, 0, 2);
$m = (int) substr($test_duration, strpos($test_duration, ':') + 1, 2);
$s = (int) substr($test_duration, strrpos($test_duration, ':') + 1, 2);
/*echo "TEST_DURATION : ".$test_duration."</br>";
echo "HOUR : ".$h."<br/>";
echo "MIN : ".$m."<br/>";
echo "SEC : ".$s."<br/>";*/
unset($_SESSION['test_duration']);
$tt = new Test();
$tt->Conduct_test('Unanswered', 0, $ctid, 0, 'f', 'false', -1);
$log = new Logs($_SESSION['owner_id'], $tname);
$filename = "Current_test_" . $ctid;
$log->write_logfile($filename, 'Test Started', "User:{$_SESSION['uname']} has started test of duration  :{$test_duration}.", time());
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test Page</title>
<link rel="stylesheet" href="css/style_examinee.css" type="text/css">

	<script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.textshadow.js"></script>
    <script type="text/javascript" src="js/jquery.lwtCountdown-0.9.5.js"></script>
    <link rel="stylesheet" href="css/dark.css" type="text/css">
    <script>$(document).ready(function(){
  if ($.browser.msie) {
	  var sha = {
开发者ID:niteshsinha,项目名称:OQM,代码行数:31,代码来源:test-pg.php

示例3: Logs

<?php

require_once "includes/initialize.php";
$log = new Logs($_SESSION['owner_id'], 'user');
$filename = $_SESSION['user_id'] . "_" . $_SESSION['uname'];
$log->write_logfile($filename, 'Logout', "{$_SESSION['uname']} ({$_SESSION['user_id']}) has logged out.", time());
$session->logout();
redirect_to("login.php");
开发者ID:niteshsinha,项目名称:OQM,代码行数:8,代码来源:logout.php

示例4: trim

        redirect_to("admin/index.php");
    }
}
// Remember to give your form's submit tag a name="submit" attribute!
if (isset($_POST['submit'])) {
    // Form has been submitted.
    $username = trim($_POST['username']);
    $password = trim($_POST['password']);
    // Check database to see if username/password exist.
    $found_user = User::authenticate($username, $password);
    if ($found_user) {
        $session->login($found_user);
        if ($found_user->usertype_id != 1) {
            $log = new Logs($found_user->owner_id, 'user');
            $filename = $found_user->auto_id . "_" . $found_user->username;
            $log->write_logfile($filename, 'Login', "{$found_user->username} ({$found_user->auto_id}) has logged in.", time());
            redirect_to("index.php");
        } else {
            if ($found_user->usertype_id == 1) {
                redirect_to("admin/index.php");
            }
        }
    } else {
        // username/password combo was not found in the database
        $message = "Username/password combination incorrect.";
    }
} else {
    // Form has not been submitted.
    $username = "";
    $password = "";
}
开发者ID:niteshsinha,项目名称:OQM,代码行数:31,代码来源:login.php

示例5: urldecode

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<?php 
require_once "includes/initialize.php";
$ctid = $_GET['c'];
$tname = urldecode($_GET['n']);
$tt = new Test();
$tt->Evaluate_test();
$tt->logarray;
$log = new Logs($_SESSION['owner_id'], $tname);
$filename = "Current_test_" . $ctid;
foreach ($tt->logarray as $val) {
    $log->write_logfile($filename, 'Ques/Ans Log', $val, time());
}
$log->write_logfile($filename, 'Test Ended', "User:{$_SESSION['uname']} has ended the Test.", time());
$log->write_logfile($filename, 'Test Result', "Score : {$tt->score} with Questions Correct : {$tt->ques_correct} , Questions Incorrect : {$tt->ques_incorrect} and Questions Unanswered : {$tt->ques_unans}.", time());
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test Results</title>
<link rel="stylesheet" href="css/style_examinee.css" type="text/css">
	<script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.textshadow.js"></script>
    <script type="text/javascript" src="js/jquery.color.js"></script>
    <script>$(document).ready(function(){
  if ($.browser.msie) {
	  var sha = {
			x      : 0,
			y      : 0,
			radius : 2,
			color  : '#191919',
开发者ID:niteshsinha,项目名称:OQM,代码行数:31,代码来源:evaluate.php


注:本文中的Logs::write_logfile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。