This document provides instructions and guidelines for completing exam questions. It states that all work must be original and any sources cited must be properly referenced. It provides examples of how to cite lectures, assigned readings, and outside sources. It limits responses to one page single spaced with 12 point font. Finally, it provides three exam questions to answer related to course materials on mass communication and media.
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Caveats and Warnings Make certain that all work is your own work.docx
1. Caveats and Warnings: Make certain that all work is your own
work. You may use lectures, the book, the videos or other
materials, but you will need to cite any information you use that
is not your personal opinion. Cite any sources by simply
referring to the source within parentheses at the point you cite
it. Do not copy material from websites, other papers or other
resources unless it is a short quote with a citation. If you refer
to material from lectures, simply refer to the lecture by number
(e.g., Lecture 2b). If you refer to the book, you can refer to the
page number (e.g., Hanson, pg. 127), or, if from an assigned
video, simply refer to the video (e.g., as in "The Day We
Learned to Think"). If you cite something from outside of class
materials, provide the last name of the author in parentheses,
and provide a full citation at the bottom of the page. So, for an
outside source, it would be: your text (Smith).
and at the bottom of the page, something like:
Smith,
Arnold. http://yahoo.com/news/informationrelevantto1101exam
(Links to an external site.)
You may follow any format style with which you are familiar,
as long as you provide enough information for us to track down
a source if needed.
For each question write no more than a full page length, Single
Spaced, size 12 Times New Roman font.
Course Reading: Mass communication: Living in a media
world (5th edition). Washington, DC: CQ Press
Here are the questions:
1. Early in the class, we said that “communication and society
are inter-dependent.” Explain what the phrase means, then use
an example from lecture, assigned videos, or the book to help
you illustrate that meaning.
Hint: In your answer, you will need to provide a verbal
explanation that explains why this is true. In your example,
make certain that you explain how the example applies. To test
2. how well your example does, see if all of the information you
identified in your verbal explanation is covered by the example.
2. In class we talked about how both newspapers and motion
pictures developed amid serious objections from one or more
segments of society. Compare and contrast the development and
history of motion pictures in regard to regulation. Use
examples to clarify your answer. Describe how the history, to
the present day, of the newspaper and motion picture industries
has been affected by these early differences.
Hint: Make certain you indicate which aspects of society (e.g.,
government, the public, regulatory agencies) were involved in
the regulation of the two media, how they exerted pressures,
and how the pressure was relieved through regulatory
mechanisms or regulatory bodies. Then indicate how regulation
of the two industries has worked since those early days
3. Explain how the Camera Obscura and Magic Lantern led
eventually to the development of the synchronous mass
audience.
Hint: For this answer, first you’ll need to define the terms
related to audiences, then you’ll need to trace the Camera
Obscura and the Magic Lantern history from their invention to
commercial ventures, so that you can explain the audience’s
relationship with the technology, and explain how the audience
formed around these two technologies and their successors to
arrive at the synchronous mass audience.
oexam/admin/admwelcome.php
<?php
error_reporting(0);
8. <!-- end .content --></article>
<!-- end .container --></div>
</body>
</html>
oexam/admin/index.php
<?php
error_reporting(0);
session_start();
include_once '../oesdb.php';
if(isset($_REQUEST['admsubmit']))
{
$result=executeQuery("select * from adminlogin where
admname='".htmlspecialchars($_REQUEST['name'],ENT_QUO
TES)."' and
admpassword='".md5(htmlspecialchars($_REQUEST['password'
],ENT_QUOTES))."'");
9. // $result=mysql_query("select * from adminlogin where
admname='".htmlspecialchars($_REQUEST['name'])."' and
admpassword='".md5(htmlspecialchars($_REQUEST['password'
]))."'");
if(mysql_num_rows($result)>0)
{
$r=mysql_fetch_array($result);
if(strcmp($r['admpassword'],md5(htmlspecialchars($_REQUES
T['password'],ENT_QUOTES)))==0)
{
$_SESSION['admname']=htmlspecialchars_decode($r['admname
'],ENT_QUOTES);
unset($_GLOBALS['message']);
header('Location: admwelcome.php');
}else
{
$_GLOBALS['message']="Check Your user name and
Password.";
12. </header>
<div class="sidebar1">
<ul class="nav">
<li><a href="../index.php" title="Click here to
Register">Home</a></li>
</ul>
<aside>
<p>
This page allows you to login as the admin.
</p>
</aside>
<!-- end .sidebar1 --></div>
<article class="content">
<section>
<h1>Admin Login</h1>
<p>
18. <!-- log out function-->
<li><input type="submit" value="Log out"
name="logout" title="CAREFUL !! Log Out"/></li>
</ul>
<aside>
<p> Use this page to perform administrative duties on results
data.</p>
</aside>
<!-- end .sidebar1 --></div>
<?php } ?>
<article class="content">
<section>
<h1>Manage Results</h1>
<p>
<div id="content">
<?php if(isset($_REQUEST['testid'])) {
19. // Defualt Mode: Displays the Detailed Test Results.
$result=executeQuery("select
t.testname,DATE_FORMAT(t.testfrom,'%d %M %Y') as
fromdate,DATE_FORMAT(t.testto,'%d %M %Y %H:%i:%S') as
todate,sub.subname,IFNULL((select sum(marks) from question
where testid=".$_REQUEST['testid']."),0) as maxmarks from
test as t, subject as sub where sub.subid=t.subid and
t.testid=".$_REQUEST['testid'].";") ;
if(mysql_num_rows($result)!=0) {
$r=mysql_fetch_array($result);
?>
<table class="loginf">
<tr>
<td colspan="2"><h3
style="color:#0000cc;text-align:center;">Test
Summary</h3></td>
</tr>
<tr>
<td colspan="2" ><hr
style="color:#ff0000;border-width:4px;"/></td>
</tr>
24. echo"<h3 style="color:#0000cc;text-
align:center;">Something went wrong. Please logout and Try
again.</h3>";
}
?>
</table>
<?php } else {
// Defualt Mode: Displays the Test Results.
$result=executeQuery("select
t.testid,t.testname,DATE_FORMAT(t.testfrom,'%d %M %Y') as
fromdate,DATE_FORMAT(t.testto,'%d %M %Y %H:%i:%S') as
todate,sub.subname,(select count(stdid) from studenttest where
testid=t.testid) as attemptedstudents from test as t, subject as
sub where sub.subid=t.subid;");
if(mysql_num_rows($result)==0) {
echo "<h3 style="color:#0000cc;text-
align:center;">No Tests Yet...!</h3>";
}
else {
$i=0;
27. session_start();
include_once '../oesdb.php';
if (!isset($_SESSION['admname'])) {
$_GLOBALS['message'] = "Session Timeout.Click here to <a
href="index.php">Log In</a>";
} else if (isset($_REQUEST['logout'])) {
//Log out and redirect login page
unset($_SESSION['admname']);
header('Location: index.php');
} else if (isset($_REQUEST['dashboard'])) {
//redirect to home
header('Location: admwelcome.php');
} else if (isset($_REQUEST['delete'])) {
//delete selected subjects
unset($_REQUEST['delete']);
$hasvar = false;
foreach ($_REQUEST as $variable) {
28. if (is_numeric($variable)) { //some session values are also
passed with request
$hasvar = true;
if ([email protected]("delete from subject where
subid=$variable")) {
if (mysql_errno () == 1451) //Children are dependent
value
$_GLOBALS['message'] = "System will not allow
propagated deletions.<br/><b>Help:</b> If you still want to
delete this subject, manually delete all the records that are
dependent on it first.";
else
$_GLOBALS['message'] = mysql_errno();
}
}
}
if (!isset($_GLOBALS['message']) && $hasvar == true)
$_GLOBALS['message'] = "Selected subjects deleted";
else if (!$hasvar) {
$_GLOBALS['message'] = "Select the subjects to delete.";
29. }
} else if (isset($_REQUEST['savem'])) {
//updating the modified values
if (empty($_REQUEST['subname']) ||
empty($_REQUEST['subdesc'])) {
$_GLOBALS['message'] = "Some fields are empty.No
updates made.";
} else {
$query = "update subject set subname='" .
htmlspecialchars($_REQUEST['subname'], ENT_QUOTES) . "',
subdesc='" . htmlspecialchars($_REQUEST['subdesc'],
ENT_QUOTES) . "'where subid=" . $_REQUEST['subject'] . ";";
if ([email protected]($query))
$_GLOBALS['message'] = mysql_error();
else
$_GLOBALS['message'] = "Subject information
updated.";
}
closedb();
}
else if (isset($_REQUEST['savea'])) {
30. //Add the new subject information to db
$result = executeQuery("select max(subid) as sub from
subject");
$r = mysql_fetch_array($result);
if (is_null($r['sub']))
$newstd = 1;
else
$newstd=$r['sub'] + 1;
$result = executeQuery("select subname as sub from subject
where subname='" . htmlspecialchars($_REQUEST['subname'],
ENT_QUOTES) . "';");
// $_GLOBALS['message']=$newstd;
if (empty($_REQUEST['subname']) ||
empty($_REQUEST['subdesc'])) {
$_GLOBALS['message'] = "Some required fields are
empty";
} else if (mysql_num_rows($result) > 0) {
$_GLOBALS['message'] = "Subject already exists.";
} else {
$query = "insert into subject values($newstd,'" .
31. htmlspecialchars($_REQUEST['subname'], ENT_QUOTES) .
"','" . htmlspecialchars($_REQUEST['subdesc'], ENT_QUOTES)
. "',NULL)";
if ([email protected]($query)) {
if (mysql_errno () == 1062) //duplicate value
$_GLOBALS['message'] = "The subject name
voilates some constraints, try another name.";
else
$_GLOBALS['message'] = mysql_error();
}
else
$_GLOBALS['message'] = "Subject created.";
}
closedb();
}
?>
<html>
<head>
<title>Manage subjects</title>
41. } else if (isset($_REQUEST['logout'])) {
//Log out and redirect login page
unset($_SESSION['admname']);
header('Location: index.php');
} else if (isset($_REQUEST['dashboard'])) {
//redirect to home
header('Location: admwelcome.php');
} else if (isset($_REQUEST['delete'])) {
//deleting the selected teachers records
unset($_REQUEST['delete']);
$hasvar = false;
foreach ($_REQUEST as $variable) {
if (is_numeric($variable)) { //some session values are also
passed with request
$hasvar = true;
if ([email protected]("delete from testconductor where
tcid=$variable")){
42. if (mysql_errno () == 1451) //Children are dependent
value
$_GLOBALS['message'] = "System will not allow
propagated deletions.<br/><b>Help:</b> Delete all records that
are associated with this user first.";
else
$_GLOBALS['message'] = mysql_errno();
}
//
$_GLOBALS['message']=$_GLOBALS['message'].$variable;
}
}
if (!isset($_GLOBALS['message']) && $hasvar == true)
$_GLOBALS['message'] = "Selected teacher/s records
deleted";
else if (!$hasvar) {
$_GLOBALS['message'] = "Select teacher/s records to
delete.";
}
} else if (isset($_REQUEST['savem'])) {
/* * ************************ Step 2 - Case 4
************************ */
44. }
closedb();
}
else if (isset($_REQUEST['savea'])) {
//Add the new test teacher information to the db
$result = executeQuery("select max(tcid) as tc from
testconductor");
$r = mysql_fetch_array($result);
if (is_null($r['tc']))
$newstd = 1;
else
$newstd=$r['tc'] + 1;
$result = executeQuery("select tcname as tc from
testconductor where tcname='" .
htmlspecialchars($_REQUEST['cname'],ENT_QUOTES) . "';");
if (empty($_REQUEST['cname']) ||
empty($_REQUEST['password']) ||
45. empty($_REQUEST['email'])) {
$_GLOBALS['message'] = "Some required fields are
empty";
} else if (mysql_num_rows($result) > 0) {
$_GLOBALS['message'] = "User already exists.";
} else {
$query = "insert into testconductor values($newstd,'" .
htmlspecialchars($_REQUEST['cname'],ENT_QUOTES) .
"',ENCODE('" .
htmlspecialchars($_REQUEST['password'],ENT_QUOTES) .
"','oespass'),'" .
htmlspecialchars($_REQUEST['email'],ENT_QUOTES) . "','" .
htmlspecialchars($_REQUEST['contactno'],ENT_QUOTES) .
"','" . htmlspecialchars($_REQUEST['address'],ENT_QUOTES)
. "','" . htmlspecialchars($_REQUEST['city'],ENT_QUOTES) .
"','" . htmlspecialchars($_REQUEST['pin'],ENT_QUOTES) .
"')";
if ([email protected]($query)) {
if(mysql_errno ()==1062) //duplicate value
$_GLOBALS['message'] = "The teacher name voilates
some constraints, try another name.";
else
$_GLOBALS['message'] = mysql_error();
}
59. unset($_SESSION['admname']);
header('Location: index.php');
} else if (isset($_REQUEST['dashboard'])) {
//redirect to home
header('Location: admwelcome.php');
} else if (isset($_REQUEST['delete'])) {
//deleting the selected tests
unset($_REQUEST['delete']);
$hasvar = false;
foreach ($_REQUEST as $variable) {
if (is_numeric($variable)) { //some session values are also
passed with request
$hasvar = true;
if ([email protected]("delete from test where
testid=$variable")) {
if (mysql_errno () == 1451) //Children are dependent
value
$_GLOBALS['message'] = "System will not allow
propagated deletions.<br/><b>Help:</b> If you still want to
delete this test, manually delete all the records that are
60. associated with this test first.";
else
$_GLOBALS['message'] = mysql_errno();
}
}
}
if (!isset($_GLOBALS['message']) && $hasvar == true)
$_GLOBALS['message'] = "Selected test/s deleted";
else if (!$hasvar) {
$_GLOBALS['message'] = "First select the test/s to
delete.";
}
} else if (isset($_REQUEST['savem'])) {
//update modified values
$fromtime = $_REQUEST['testfrom'] . " " . date("H:i:s");
$totime = $_REQUEST['testto'] . " 23:59:59";
$_GLOBALS['message'] = strtotime($totime) . " " .
strtotime($fromtime) . " " . time();
if (strtotime($fromtime) > strtotime($totime) ||
strtotime($totime) < time())
61. $_GLOBALS['message'] = "Start date of test is less than
end date or last date of test is less than today's date.<br/>No
updates made";
else if (empty($_REQUEST['testname']) ||
empty($_REQUEST['testdesc']) ||
empty($_REQUEST['totalqn']) ||
empty($_REQUEST['duration']) ||
empty($_REQUEST['testfrom']) || empty($_REQUEST['testto'])
|| empty($_REQUEST['testcode'])) {
$_GLOBALS['message'] = "Some fields are empty.No
updates made";
} else {
$query = "update test set testname='" .
htmlspecialchars($_REQUEST['testname'], ENT_QUOTES) .
"',testdesc='" . htmlspecialchars($_REQUEST['testdesc'],
ENT_QUOTES) . "',subid=" .
htmlspecialchars($_REQUEST['subject'], ENT_QUOTES) .
",testfrom='" . $fromtime . "',testto='" . $totime . "',duration=" .
htmlspecialchars($_REQUEST['duration'], ENT_QUOTES) .
",totalquestions=" . htmlspecialchars($_REQUEST['totalqn'],
ENT_QUOTES) . ",testcode=ENCODE('" .
htmlspecialchars($_REQUEST['testcode'], ENT_QUOTES) .
"','oespass') where testid=" . $_REQUEST['testid'] . ";";
if ([email protected]($query))
$_GLOBALS['message'] = mysql_error();
else
$_GLOBALS['message'] = "Test information updated.";
62. }
closedb();
}
else if (isset($_REQUEST['savea'])) {
//Add the new test information in the database
$noerror = true;
$fromtime = $_REQUEST['testfrom'] . " " . date("H:i:s");
$totime = $_REQUEST['testto'] . " 23:59:59";
if (strtotime($fromtime) > strtotime($totime) ||
strtotime($fromtime) < (time() - 3600)) {
$noerror = false;
$_GLOBALS['message'] = "Start date of test is either less
than today's date or greater than last date of test.";
} else if ((strtotime($totime) - strtotime($fromtime)) <= 3600
* 24) {
$noerror = true;
$_GLOBALS['message'] = "Note:<br/>The test is valid
upto " . date(DATE_RFC850, strtotime($totime));
}
//$_GLOBALS['message']="time".date_format($first,
63. DATE_ATOM)."<br/>time ".date_format($second,
DATE_ATOM);
$result = executeQuery("select max(testid) as tst from test");
$r = mysql_fetch_array($result);
if (is_null($r['tst']))
$newstd = 1;
else
$newstd=$r['tst'] + 1;
// $_GLOBALS['message']=$newstd;
if (strcmp($_REQUEST['subject'], "<Choose the Subject>")
== 0 || empty($_REQUEST['testname']) ||
empty($_REQUEST['testdesc']) ||
empty($_REQUEST['totalqn']) ||
empty($_REQUEST['duration']) ||
empty($_REQUEST['testfrom']) || empty($_REQUEST['testto'])
|| empty($_REQUEST['testcode'])) {
$_GLOBALS['message'] = "Some of the required Fields
are Empty";
} else if ($noerror) {
64. $query = "insert into test values($newstd,'" .
htmlspecialchars($_REQUEST['testname'], ENT_QUOTES) .
"','" . htmlspecialchars($_REQUEST['testdesc'], ENT_QUOTES)
. "',(select curDate()),(select curTime())," .
htmlspecialchars($_REQUEST['subject'], ENT_QUOTES) . ",'" .
$fromtime . "','" . $totime . "'," .
htmlspecialchars($_REQUEST['duration'], ENT_QUOTES) . ","
. htmlspecialchars($_REQUEST['totalqn'], ENT_QUOTES) .
",0,ENCODE('" . htmlspecialchars($_REQUEST['testcode'],
ENT_QUOTES) . "','oespass'),NULL)";
if ([email protected]($query)) {
if (mysql_errno () == 1062) //duplicate value
$_GLOBALS['message'] = "The test name violates
some constraints, please try another name.";
else
$_GLOBALS['message'] = mysql_error();
}
else
$_GLOBALS['message'] = $_GLOBALS['message'] .
"<br/> New test created.";
}
closedb();
}
else if (isset($_REQUEST['manageqn'])) {
65. //Store the Test identity in session varibles and redirect to
prepare question section.
//$tempa=explode(" ",$_REQUEST['testqn']);
// $testname=substr($_REQUEST['manageqn'],0,-10);
$testname = $_REQUEST['manageqn'];
$result = executeQuery("select testid from test where
testname='" . htmlspecialchars($testname, ENT_QUOTES) .
"';");
if ($r = mysql_fetch_array($result)) {
$_SESSION['testname'] = $testname;
$_SESSION['testqn'] = $r['testid'];
// $_GLOBALS['message']=$_SESSION['testname'];
header('Location: prepqn.php');
}
}
?>
<html>
66. <head>
<title>Manage Tests</title>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="../oes.css"/>
<link rel="stylesheet" type="text/css" media="all"
href="../calendar/jsDatePick.css" />
<script type="text/javascript"
src="../calendar/jsDatePick.full.1.1.js"></script>
<script type="text/javascript">
window.onload = function(){
new JsDatePick({
useMode:2,
target:"testfrom"
//limitToToday:true <-- Add this should you want
to limit the calendar until today.
});
new JsDatePick({
useMode:2,
67. target:"testto"
//limitToToday:true <-- Add this should you want
to limit the calendar until today.
});
};
</script>
<script type="text/javascript" src="../validate.js" ></script>
</head>
<body>
<?php
if (isset($_GLOBALS['message'])) {
echo "<div class="message">" . $_GLOBALS['message'] .
"</div>";
}
?>
<div class="container">
<header>
<a href="#"><img src="../images/examlogo.png" alt="Insert
Logo Here" width="200" height="90" id="Insert_logo"
68. style="background-color: #FFFFFF; display:block;" /></a>
</header>
<form name="testmng" action="testmng.php" method="post">
<?php if (isset($_SESSION['admname'])) { ?>
<div class="sidebar1">
<ul class="nav">
<li><input type="submit" value="Home"
name="dashboard" title="Home"/></li>
<!-- For default add or delete functions-->
<li><input type="submit" value="Add New" name="add"
title="Add new test"/></li>
<li><input type="submit" value="Delete Selected"
name="delete" title="Delete Selected records"/></li>
<!-- log out function-->
<li><input type="submit" value="Log out"
name="logout" title="CAREFUL !! Log Out"/></li>
</ul>
<aside>
<p> Use this page to perform administrative duties on
students data.
69. You can edit student data where changes are required.
</p>
</aside>
<!-- end .sidebar1 --></div>
<?php } ?>
<article class="content">
<section>
<h1>Manage Tests</h1>
<p>
<div id="content">
<?php
if (isset($_SESSION['admname'])) {
// To display the Help Message
if (isset($_REQUEST['forpq']))
echo "<div class="pmsg" style="text-align:center">
Which test questions Do you want to Manage?
<br/><b>Help:</b>Click on Questions button to manage the
70. questions of respective tests</div>";
if (isset($_REQUEST['add'])) {
?>
<?php
if (isset($_SESSION['admname'])) { if
(isset($_REQUEST['add'])) { ?>
<!--Form for the new student-->
<table class="loginf">
<tr>
<td>Subject Name</td>
<td>
<select name="subject">
<option selected value="<Choose the
Subject>"><Choose the Subject></option>
<?php
$result = executeQuery("select subid,subname from
subject;");
while ($r = mysql_fetch_array($result)) {
71. echo "<option value="" . $r['subid'] . "">" .
htmlspecialchars_decode($r['subname'], ENT_QUOTES) .
"</option>";
}
closedb();
?>
</select>
</td>
</tr>
<tr>
<td>Test Name</td>
<td><input type="text" name="testname"
value="" size="16" onKeyUp="isalphanum(this)" /></td>
<td><div
class="help"><b>Note:</b><br/>Test Name must be
Unique<br/> in order to identify different<br/> tests on same
subject.</div></td>
</tr>
<tr>
72. <td>Test Description</td>
<td><textarea name="testdesc" cols="20"
rows="3" ></textarea></td>
<td><div class="help"><b>Describe
here:</b><br/>What the test is all about?</div></td>
</tr>
<tr>
<td>Total Questions</td>
<td><input type="text" name="totalqn"
value="" size="16" onKeyUp="isnum(this)" /></td>
</tr>
<tr>
<td>Duration(Mins)</td>
<td><input type="text" name="duration"
value="" size="16" onKeyUp="isnum(this)" /></td>
</tr>
<tr>
<td>Test From </td>
73. <td><input id="testfrom" type="text"
name="testfrom" value="" size="16" readonly /></td>
</tr>
<tr>
<td>Test To </td>
<td><input id="testto" type="text"
name="testto" value="" size="16" readonly /></td>
</tr>
<tr>
<td>Test Secret Code</td>
<td><input type="text" name="testcode"
value="" size="16" onKeyUp="isalphanum(this)" /></td>
<td><div
class="help"><b>Note:</b><br/>Candidates must
enter<br/>this code in order to <br/> take the test</div></td>
</tr>
<!--For Add option-->
<?php if (isset($_REQUEST['add'])) { ?>
74. <tr>
<td> <input type="submit" value="Cancel"
name="cancel" class="subbtn" title="Cancel"/></td>
<td><input type="submit" value="Save" name="savea"
class="subbtn" onClick="validateform('testmng')"
title="Save"/></td> </tr>
<?php } ?>
</table>
<?php } else if (isset($_REQUEST['edit'])) {
// Edit existing test.
$result = executeQuery("select
t.totalquestions,t.duration,t.testid,t.testname,t.testdesc,t.subid,s.
subname,DECODE(t.testcode,'oespass') as
tcode,DATE_FORMAT(t.testfrom,'%Y-%m-%d') as
testfrom,DATE_FORMAT(t.testto,'%Y-%m-%d') as testto from
test as t,subject as s where t.subid=s.subid and t.testname='" .
htmlspecialchars($_REQUEST['edit'], ENT_QUOTES) . "';");
if (mysql_num_rows($result) == 0) {
header('Location: testmng.php');
} else if ($r = mysql_fetch_array($result)) {
76. }
closedb();
?>
</select>
</td>
</tr>
<tr>
<td>Test Name</td>
<td><input type="hidden" name="testid"
value="<?php echo $r['testid']; ?>"/><input type="text"
name="testname" value="<?php echo
htmlspecialchars_decode($r['testname'], ENT_QUOTES); ?>"
size="16" onKeyUp="isalphanum(this)" /></td>
<td><div
class="help"><b>Note:</b><br/>Test Name must be
Unique<br/> in order to identify different<br/> tests on same
subject.</div></td>
</tr>
<tr>
<td>Test Description</td>
<td><textarea name="testdesc" cols="20"
77. rows="3" ><?php echo htmlspecialchars_decode($r['testdesc'],
ENT_QUOTES); ?></textarea></td>
<td><div class="help"><b>Describe
here:</b><br/>What the test is all about?</div></td>
</tr>
<tr>
<td>Total Questions</td>
<td><input type="text" name="totalqn"
value="<?php echo
htmlspecialchars_decode($r['totalquestions'], ENT_QUOTES);
?>" size="16" onKeyUp="isnum(this)" /></td>
</tr>
<tr>
<td>Duration(Mins)</td>
<td><input type="text" name="duration"
value="<?php echo htmlspecialchars_decode($r['duration'],
ENT_QUOTES); ?>" size="16" onKeyUp="isnum(this)" /></td>
</tr>
<tr>
<td>Test From </td>
78. <td><input id="testfrom" type="text"
name="testfrom" value="<?php echo $r['testfrom']; ?>"
size="16" readonly /></td>
</tr>
<tr>
<td>Test To </td>
<td><input id="testto" type="text"
name="testto" value="<?php echo $r['testto']; ?>" size="16"
readonly /></td>
</tr>
<tr>
<td>Test Secret Code</td>
<td><input type="text" name="testcode"
value="<?php echo htmlspecialchars_decode($r['tcode'],
ENT_QUOTES); ?>" size="16" onKeyUp="isalphanum(this)"
/></td>
<td><div
class="help"><b>Note:</b><br/>Candidates must
enter<br/>this code in order to <br/> take the test</div></td>
</tr>
<!--For Edit option-->
79. <?php } if (isset($_REQUEST['edit'])) { ?>
<tr>
<td><input type="submit" value="Cancel" name="cancel"
class="subbtn" title="Cancel"/></td>
<td><input type="submit" value="Save" name="savem"
class="subbtn" onClick="validateform('testmng')"
title="Save"/></td>
</tr>
</table>
<?php closedb(); }
} else {
// Defualt Mode: Displays the Existing Test/s.
$result = executeQuery("select
t.testid,t.testname,t.testdesc,s.subname,DECODE(t.testcode,'oes
pass') as tcode,DATE_FORMAT(t.testfrom,'%d-%M-%Y') as
testfrom,DATE_FORMAT(t.testto,'%d-%M-%Y %H:%i:%s %p')
as testto from test as t,subject as s where t.subid=s.subid order
by t.testdate desc,t.testtime desc;");
if (mysql_num_rows($result) == 0) {
84. //redirect to home
header('Location: tcmng.php');
} else if (isset($_REQUEST['delete'])) {
//deleting the selected rows
unset($_REQUEST['delete']);
$hasvar = false;
foreach ($_REQUEST as $variable) {
if (is_numeric($variable)) { //some session values are also
passed with request
$hasvar = true;
if ([email protected]("delete from student where
stdid=$variable")) {
if (mysql_errno () == 1451) //Children are dependent
value
$_GLOBALS['message'] = "System will not allow
propagated deletions.<br/><b>Help:</b> If you still want to
delete this user, manually delete all the records that are
associated with this user first.";
else
$_GLOBALS['message'] = mysql_errno();
85. }
}
}
if (!isset($_GLOBALS['message']) && $hasvar == true)
$_GLOBALS['message'] = "Selected user/s deleted";
else if (!$hasvar) {
$_GLOBALS['message'] = "First select the users to be
deleted.";
}
} else if (isset($_REQUEST['savem'])) {
//update modified values
if (empty($_REQUEST['cname']) ||
empty($_REQUEST['password']) ||
empty($_REQUEST['email'])) {
$_GLOBALS['message'] = "Some fields are empty.No
updates made";
} else {
$query = "update student set stdname='" .
htmlspecialchars($_REQUEST['cname'], ENT_QUOTES) . "',
stdpassword=ENCODE('" .
86. htmlspecialchars($_REQUEST['password']) .
"','oespass'),emailid='" . htmlspecialchars($_REQUEST['email'],
ENT_QUOTES) . "',contactno='" .
htmlspecialchars($_REQUEST['contactno'], ENT_QUOTES) .
"',address='" . htmlspecialchars($_REQUEST['address'],
ENT_QUOTES) . "',city='" .
htmlspecialchars($_REQUEST['city'], ENT_QUOTES) .
"',pincode='" . htmlspecialchars($_REQUEST['pin'],
ENT_QUOTES) . "' where stdid='" .
htmlspecialchars($_REQUEST['student'], ENT_QUOTES) . "';";
if ([email protected]($query))
$_GLOBALS['message'] = mysql_error();
else
$_GLOBALS['message'] = "User information updated.";
}
closedb();
}
else if (isset($_REQUEST['savea'])) {
//Insert the user information in the database
$result = executeQuery("select max(stdid) as std from
student");
$r = mysql_fetch_array($result);
if (is_null($r['std']))
87. $newstd = 1;
else
$newstd=$r['std'] + 1;
$result = executeQuery("select stdname as std from student
where stdname='" . htmlspecialchars($_REQUEST['cname'],
ENT_QUOTES) . "';");
if (empty($_REQUEST['cname']) ||
empty($_REQUEST['password']) ||
empty($_REQUEST['email'])) {
$_GLOBALS['message'] = "Some of the required Fields
are Empty";
} else if (mysql_num_rows($result) > 0) {
$_GLOBALS['message'] = "User already exists.";
} else {
$query = "insert into student values($newstd,'" .
htmlspecialchars($_REQUEST['cname'], ENT_QUOTES) .
"',ENCODE('" . htmlspecialchars($_REQUEST['password'],
ENT_QUOTES) . "','oespass'),'" .
htmlspecialchars($_REQUEST['email'], ENT_QUOTES) . "','" .
htmlspecialchars($_REQUEST['contactno'], ENT_QUOTES) .
"','" . htmlspecialchars($_REQUEST['address'], ENT_QUOTES)
88. . "','" . htmlspecialchars($_REQUEST['city'], ENT_QUOTES) .
"','" . htmlspecialchars($_REQUEST['pin'], ENT_QUOTES) .
"')";
if ([email protected]($query)) {
if (mysql_errno () == 1062) //duplicate value
$_GLOBALS['message'] = "The username provided
voilates some constraints, please try another username.";
else
$_GLOBALS['message'] = mysql_error();
}
else
$_GLOBALS['message'] = "New user created.";
}
closedb();
}
?>
<html>
<head>
90. </header>
<form name="usermng" action="usermng.php" method="post">
<?php if (isset($_SESSION['admname'])) { ?>
<div class="sidebar1">
<ul class="nav">
<li><input type="submit" value="Home"
name="dashboard" title="Home"/></li>
<li><input type="submit" value="Teachers"
name="tcmng" title="Manage Teachers"/></li>
<!-- For default add or delete functions-->
<li><input type="submit" value="Add New" name="add"
title="Add new records"/></li>
<li><input type="submit" value="Delete Selected"
name="delete" title="Delete Selected records"/></li>
<!-- log out function-->
<li><input type="submit" value="Log out"
name="logout" title="CAREFUL !! Log Out"/></li>
</ul>
<aside>
<p> Use this page to perform administrative duties on
91. students data.
You can edit student data where changes are required.
</p>
</aside>
<!-- end .sidebar1 --></div>
<?php } ?>
<article class="content">
<section>
<h1>Manage Students</h1>
<p>
<div id="content">
<?php
if (isset($_SESSION['admname'])) { if
(isset($_REQUEST['add'])) { ?>
<!--Form for the new student-->
<table class="loginf">
101. </body>
</html>
oexam/calendar/example.html
JsDatePick's Javascript Calendar usage example
Look at the comments on the HTML source to fully
understand how this very simple example works.
oexam/calendar/img/aqua_dayDown.gif
oexam/calendar/img/aqua_dayNormal.gif
oexam/calendar/img/aqua_dayOver.gif
oexam/calendar/img/armygreen_dayDown.gif
oexam/calendar/img/armygreen_dayNormal.gif
oexam/calendar/img/armygreen_dayOver.gif
oexam/calendar/img/bananasplit_dayDown.gif
oexam/calendar/img/bananasplit_dayNormal.gif
oexam/calendar/img/bananasplit_dayOver.gif
oexam/calendar/img/beige_dayDown.gif
130. this.initialZIndex.toString();
JsDatePickBox.style.position = "absolute";
JsDatePickBox.style.top = "18px";
JsDatePickBox.style.left = "0px";
JsDatePickBox.style.display = "none";
aSpan.appendChild(JsDatePickBox);
var aFunc = new
Function("gRef_"+this.globalNumber+".populateFieldWithSelec
tedDate();");
this.setOnSelectedDelegate(aFunc);
}
} else {
alert("There is no element with such an
ID!");
}
}
} else {
if (this.oConfiguration.target != null){