Adsense
Popular Posts
- MySQL workbench -"Could not decrypt password cache"
- Install APXS in Redhat Linux
- react-pdf, display pdf in react.js
- Set Windows path command line
- MySQL date created and date modified
- Transfer modules between sites
- DataTable table order by numeric, not by text
- datatable order by nunmeric
- mod_auth_cas.so error: undefined symbol: SSL_connect
- JavaScript, remove trailing insignificant zeros after toFixed function
Friday, October 18, 2013
peer review (3)
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\admin\edu\pr_members_modules.php for editing committee members for chair.
<?php
define('PORTAL_ID', 0); ?>
<?php require_once($_SERVER['DOCUMENT_ROOT'].'/_includes/cesei_globals.inc.php');
validate_cesei_access(STATUS_ADMIN);
require_once($_SERVER['DOCUMENT_ROOT'].'/_lib/peer_review_tools.inc.php');
$savant->assign('section_title', 'CESEI Administration');
$savant->assign('section_href', '/admin/');
$savant->assign('page_title', 'Review Committee');
$savant->assign('path', Array(Array('url'=>'index.php','title'=>'Education Administration')) );
$sub_level_pages = Array();
$sub_level_pages[0] = Array('url'=>'select_committee_members.php','title'=>'Select committee members for modules');
$back_to_page = Array('url'=>$_PORTALS[PORTAL_ID]['root'].'/admin/edu/','title'=>'Educational Administration');
$savant->assign('sub_level_pages', $sub_level_pages);
$savant->assign('back_to_page', $back_to_page);
$savant->assign('extra_hdr_tags', '<link rel="stylesheet" type="text/css" media="screen" href="/_css/peer_review.css" />');
if(!isset($_POST['module_id'])){
$msg->addFeedback('You need to select a module');
header('Location: select_committee_members.php');
exit;
} else{
$module_id = $_POST['module_id'];
}
$sql0 = "SELECT title FROM edu_courses WHERE course_id=".$module_id;
$result0 = mysql_query($sql0,$db);
$module_title =mysql_result($result0, 0);
if(isset($_POST['remove'])){
if(!isset($_POST['member_id'])){
$msg->addFeedback('You need to select a member');
} else{
$member_id = intval($_POST['member_id']);
$sql = "DELETE FROM cesei_module_user_reviews WHERE member_id=$member_id AND module_id=$module_id";
@mysql_query($sql, $db);
$msg->addFeedback('Member successfully removed');
}
}
$sql = "SELECT member_id FROM edu_courses WHERE course_id=$module_id";
$result = mysql_query($sql,$db);
if($row = mysql_fetch_assoc($result)){
$owner_id = $row['member_id'];
}
if(isset($_POST['add'])){
foreach($_POST['users'] as $user){
if($user==$owner_id){
$msg->addWarning('Module owners cannot be set to review their own module.');
continue;
}
$date_assigned = date('Y-m-d');
$sql0="SELECT * FROM cesei_module_user_reviews WHERE member_id=$user AND module_id=$module_id";
$result0 = mysql_query($sql0, $db);
$num_rows = mysql_num_rows($result0);
if($num_rows<1){
$sql = "INSERT INTO cesei_module_user_reviews (review_id, member_id, module_id, revision_cycle, is_complete,date_assigned, date_complete) VALUES ('','$user','$module_id',1,'','$date_assigned', '')";
@mysql_query($sql, $db);
$msg->addFeedback('Committee members successfully added');
}
}
}
if(isset($_POST['add_with_email'])){
foreach($_POST['users'] as $user){
if($user==$owner_id){
$msg->addWarning('Module owners cannot be set to review their own module.');
continue;
}
$date_assigned = date('Y-m-d');
$sql0="SELECT * FROM cesei_module_user_reviews WHERE member_id=$user AND module_id=$module_id";
$result0 = mysql_query($sql0, $db);
$num_rows = mysql_num_rows($result0);
if($num_rows<1){
include($_SERVER['DOCUMENT_ROOT'].'/_includes/email_content.inc.php');
$sql = "SELECT prefix, first_name, last_name, email FROM cesei_members WHERE member_id=".$user;
$result = mysql_query($sql, $db);
while($row = mysql_fetch_assoc($result)){
$reviewer = trim(htmlspecialchars($row['prefix'].' '.$row['first_name'].' '.$row['last_name'])).' ';
$email = $row['email'];
}
$mail = new PHPMailer();
$mail->AddAddress($email);
$mail->Subject = "CESEI Peer Review assignment request";
$_mail_body ="Dear ".$reviewer.",
The ".INSTITUTION_SHORT_NAME." Education Committee has requested your peer evaluation of the module %1s.
Please log-in to ".INSTITUTION_SHORT_NAME."'s peer review area for further details and to access the evaluation form. If you are unable to conduct the review please contact CESEI and let us know.
http://".$_SERVER_NAME."/education/peer_review/";
$_mail_body ="test";
$mail->Body = vsprintf($_mail_body.$_mail_cesei_ftr.$_mail_inquiry_ftr,$module_title);
if(!$mail->Send()) {
$msg->addError('There was an error sending the email message. Please try again in a few minutes.');
}
else{
$msg->addFeedback('Email to '.$reviewer.' is sent.');
}
unset($mail);
$sql = "INSERT INTO cesei_module_user_reviews (review_id, member_id, module_id, revision_cycle, is_complete,date_assigned, date_complete) VALUES ('','$user','$module_id','','','$date_assigned', '')";
@mysql_query($sql, $db);
$msg->addFeedback('Committee members successfully added');
}
}
}
$committee_members = get_pr_members();
$mail_all = Array();
$savant->display('document_top.tmpl.php');
echo '<p>'.$module_title.'</p>';
?>
<form name="form" method="post" action="<?php echo($_SERVER['PHP_SELF']); ?>">
<div class="input-form">
<table summary="" class="data" rules="cols"><thead>
<tr>
<th> </th>
<th>Committee Member</th>
<th>Email</th>
<th> </th>
</tr>
</thead>
<tbody>
<?php
$selected_members = Array();
$page_content = '';
$sql = "SELECT
M.member_id, M.prefix, M.first_name, M.last_name, M.email
FROM cesei_module_user_reviews MUR
LEFT JOIN cesei_members M ON MUR.member_id=M.member_id WHERE MUR.module_id=".$module_id ;
$result = mysql_query($sql, $db);
while($member = mysql_fetch_assoc($result)){
$selected_members[$member['member_id']] = $member['member_id'];
$reviewer = trim(htmlspecialchars($member['prefix'].' '.$member['first_name'].' '.$member['last_name'])).' ';
$page_content .= '<tr onmousedown="document.form[\'m'.$member['member_id'].'\'].checked = true; rowselect(this);" id="r_'.$user['member_id'].'">
<td><input type="radio" name="member_id" value="'.$member['member_id'].'" id="m'.$member['member_id'].'" /></td>
<td>'.$reviewer.'</td><td><a href="mailto:'.$member['email'].'">'.$member['email'].'</a></td><td>';
$sql0 = "SELECT is_chair FROM cesei_module_review_committee WHERE member_id=".$member['member_id'];
$result0 = mysql_query($sql0,$db);
$is_chair =mysql_result($result0, 0);
if($is_chair == 1){
$page_content .= 'Committee Chair';
}else{
$page_content .= ' ';
}
$page_content .= '</td></tr>';
$mail_all[] = $member['email'];
}
echo($page_content);
?>
</tbody>
<tfoot>
<tr>
<td colspan="4"><input type="submit" class="input-button" name="remove" value="Remove" />
</tr>
<tr>
<td colspan="4" style="background:none;">
<a href="mailTo:<?php echo(implode(',',$mail_all)); ?>"><strong>Email all members of the committee</strong></a>
</td>
</tr>
</tfoot>
</table>
<?php
$sql = "SELECT M.member_id, M.prefix, M.first_name, M.last_name, M.email
FROM cesei_module_review_committee MUR
LEFT JOIN cesei_members M ON MUR.member_id=M.member_id " ;
$result = mysql_query($sql, $db);
$member_select = '';
while($row = mysql_fetch_assoc($result)){
if($selected_members[$row['member_id']]){
continue;
}
$member_select .= '<option value="'.$row['member_id'].'">'.trim(htmlspecialchars($row['prefix'].' '.$row['first_name'].' '.$row['last_name'])).'</option>';
}
?>
<h2 class="flush-bottom">Add Committee Members</h2>
<div class="row clear-after">
<select class="select-trans" name="users[]" id="users" multiple="multiple" size="10">
<?php echo($member_select);?>
</select>
<input type="hidden" name="module_id" value=<?php echo $_POST['module_id']; ?> />
</div>
<div class="row clear-after">
<input type="submit" class="input-button" name="add_with_email" value="Add Committee Members with Email Notification" />
<input type="submit" class="input-button" name="add" value="Add Committee Members without Email Notification" />
</div>
</div>
</form>
<?php $savant->display('document_bottom.tmpl.php'); ?>
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\admin\edu\pr_voting.php
for edit voting method:
<?php
define('PORTAL_ID', 0); ?>
<?php require_once($_SERVER['DOCUMENT_ROOT'].'/_includes/cesei_globals.inc.php');
validate_cesei_access(STATUS_ADMIN);
require_once($_SERVER['DOCUMENT_ROOT'].'/_lib/peer_review_tools.inc.php');
$savant->assign('section_title', 'CESEI Administration');
$savant->assign('section_href', '/admin/');
$savant->assign('page_title', 'Review Committee');
$savant->assign('path', Array(Array('url'=>'index.php','title'=>'Education Administration')) );
$sub_level_pages = Array();
$sub_level_pages[0] = Array('url'=>'select_committee_members.php','title'=>'Manage Committee Review');
$sub_level_pages[1] = Array('url'=>'','title'=>'Add Committee Members');
$back_to_page = Array('url'=>$_PORTALS[PORTAL_ID]['root'].'/admin/edu/','title'=>'Educational Administration');
$savant->assign('sub_level_pages', $sub_level_pages);
$savant->assign('back_to_page', $back_to_page);
$savant->assign('extra_hdr_tags', '<link rel="stylesheet" type="text/css" media="screen" href="/_css/peer_review.css" />');
if(!isset($_POST['module_id'])){
$msg->addFeedback('You need to select a module');
header('Location: select_committee_members.php');
exit;
} else{
$module_id = $_POST['module_id'];
}
if(isset($_POST['Submit'])){
$sql_3 ="UPDATE cesei_review_done SET voting_method=".$_POST['voting_method']." WHERE module_id=".$_POST['module_id'] ;
$result_3 = mysql_query($sql_3, $db);
$msg->addFeedback('Voting method is edited.');
header('Location: select_committee_members.php');
exit;
}
$sql_2 ="SELECT voting_method FROM cesei_review_done WHERE module_id=".$module_id ;
$result_2 = mysql_query($sql_2, $db);
$voting_method =mysql_result($result_2, 0);
if($voting_method==1) $voting_method_s="Online";
else $voting_method_s="Offline";
$sql0 = "SELECT title FROM edu_courses WHERE course_id=".$module_id;
$result0 = mysql_query($sql0,$db);
$module_title =mysql_result($result0, 0);
$savant->display('document_top.tmpl.php');
echo '<p>'.$module_title.'</p>';
?>
Select a voting method: <br />
<form name="form" method="post" action="<?php echo($_SERVER['PHP_SELF']); ?>">
<div class="input-form">
<Input type = 'Radio' Name ='voting_method' value= 0
<?PHP if($voting_method!=1) echo 'checked'; ?> > Offline
<br />
<Input type = 'Radio' Name ='voting_method' value= 1
<?PHP if($voting_method==1) echo 'checked'; ?> >Online
<P>
<input type="hidden" name="module_id" value=<?php echo $_POST['module_id']; ?> />
<Input type = "Submit" Name = "Submit" VALUE = "Submit">
</div>
</form>
<?php $savant->display('document_bottom.tmpl.php'); ?>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment