for ($i = 0; $i < $colcount; $i++) {
    $field = $rsnames->FetchField($i);
    $columnNames[$i] = $field->name;
}
$availableNames = '$' . join(", \$", $columnNames);
if (isset($_POST['invite'])) {
    formMailer($dbConn, $tabsql, $mailsubject, $mailbody, $sender, $sender_name);
}
$page = new PageContainer();
$page->setTitle('Assessment result mailer');
$tab = simpleTableString($dbConn, $tabsql, "<table id='myTable' name='myTable' class='tablesorter' summary='simple table' style='empty-cells:show;border-collapse:collapse' border='1'>");
$templatefile = 'templates/resultmailform.html';
$template_text = file_get_contents($templatefile, true);
$text = '';
if ($template_text === false) {
    $page->addBodyComponent(new Component("<strong>cannot read template file {$templatefile}</strong>"));
} else {
    eval("\$text = \"{$template_text}\";");
    $page->addBodyComponent(new Component($text));
}
$page->addHeadText('<script language="javascript" type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script>
 <script language="javascript" type="text/javascript">
   tinyMCE.init({
        theme: "advanced",
        /*auto_resize: true,*/
        gecko_spellcheck : true,
        theme_advanced_toolbar_location : "top",
	mode : "textareas", /*editor_selector : "mceEditor",*/

        theme_advanced_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1",
        plugins: "advlink,searchreplace,insertdatetime,table",
Esempio n. 2
0
    if ($fp != false) {
        if ($debug == 1) {
            echo "{$name}<br/>{$mimetype} </br>{$filename}<br/>\n";
        } else {
            // send the right headers
            header("Content-type: application/pdf");
            header("Pragma: public");
            header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
            header("Content-Length: " . filesize($texdir . '/' . $pdfname));
            header("Content-Disposition: attachment; filename=\"{$pdfname}\"");
            // dump the picture and stop the script
            fpassthru($fp);
        }
        fclose($fp);
        exit;
    }
}
$page_opening = 'Create your own table card';
$page = new PageContainer();
$page->setTitle('Create your own Table Card');
$form1 = new HtmlContainer("<div id='main'>");
$templatefile = 'tablecard.html';
$template_text = file_get_contents($templatefile, true);
if ($template_text === false) {
    $form1->addText("<strong>cannot read template file {$templatefile}</strong>");
} else {
    eval("\$text = \"{$template_text}\";");
    $form1->addText($text);
}
$page->addBodyComponent($form1);
$page->show();
Esempio n. 3
0
    $_SESSION['hourcode'] = $hourcode = validate($_REQUEST['hourcode'], 'integer', 1);
}
// get project data
$sql = "select * from project where prj_id={$presence_prj_id}";
$resultSet = $dbConn->Execute($sql);
if ($resultSet == false) {
    die("<br>Cannot get project data with <pre>{$sql}</pre> cause" . $dbConn->ErrorMsg() . "<br>");
}
extract($resultSet->fields);
if (isset($_REQUEST['personal_presence'])) {
    $_SESSION['personal_presence'] = $personal_presence = $_REQUEST['personal_presence'] == 'Y' ? 'Y' : 'N';
}
if ($personal_presence == 'Y') {
    $page_opening = "Presence of {$roepnaam} {$voorvoegsel} {$achternaam}, <span style='font-size:6pt;'>({$snummer})</span>";
} else {
    $page_opening = "Student presence for participants of module {$presence_prj_id}  {$afko}, {$year} {$description}";
}
$page = new PageContainer();
$page->setTitle('Presence during fontys timetable hours');
$page_opening = "Presence of {$roepnaam} {$voorvoegsel} {$achternaam} ({$snummer})";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$nav->setInterestMap($tabInterestCount);
$nav->addLeftNavText(file_get_contents('news.html'));
ob_start();
tutorHelper($dbConn, $isTutor);
$page->addBodyComponent(new Component(ob_get_clean()));
$page->addBodyComponent($nav);
ob_start();
include_once 'presence1.php';
$page->addBodyComponent(new Component(ob_get_clean()));
$page->show();
Esempio n. 4
0
    }
    $subSelect = $cols . "\n from" . $join;
    //    $dbConn->log($subSelect);
}
$grades = "";
$con = '';
foreach ($gradeColumns as $grade) {
    $grades .= $con . "subselect.{$grade},subselect.{$grade}_mul";
    $con = "\n\t,";
}
$sql = "select snummer,achternaam,roepnaam,voorvoegsel, afko, year, \n" . "milestone,grp_num,\"alias\",tutor,\"role\",{$grades},sw.final_grade \n" . "from prj_grp join all_prj_tutor using(prjtg_id)\n" . " join student using(snummer) \n" . " left join milestone_grade using(prjm_id,snummer)\n" . " left join student_role using (prjm_id,snummer)\n" . " left join project_roles using (prj_id,rolenum)\n" . " join ({$subSelect}) subselect using(snummer)\n" . " left join (select snummer,round(grade_weight_sum/w.weight_sum,1) \n" . " as final_grade from project_grade_weight_sum_product\n" . " cross join (select weight_sum from project_weight_sum where prj_id={$prj_id}) w where prj_id={$prj_id} ) sw using(snummer)\n" . "where prjm_id={$prjm_id} order by grp_num,achternaam,roepnaam";
$pp = array();
$dbConn->log($sql);
$spreadSheetWriter = new SpreadSheetWriter($dbConn, $sql);
$title = "Results for all participants in project {$afko} {$year} milestone {$milestone}";
$spreadSheetWriter->setFilename($filename)->setLinkUrl($server_url . $PHP_SELF)->setTitle($title)->setColorChangerColumn(7);
//->setRowParser( new RowWithArraysParser());
$spreadSheetWriter->processRequest();
$pp['spreadSheetWidget'] = $spreadSheetWriter->getWidget();
$page = new PageContainer();
$page->setTitle('Get group tables');
$page_opening = "Group lists for project {$afko} {$description} <span style='font-size:8pt;'>prjm_id {$prjm_id} prj_id {$prj_id} milestone {$milestone} </span>";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$nav->setInterestMap($tabInterestCount);
$rainbow = new RainBow();
$pp['rtable'] = getQueryToTableChecked($dbConn, $sql, false, 7, $rainbow, -1, '', '');
$pp['selector'] = $prjSel->getSelector();
$pp['selectionDetails'] = $prjSel->getSelectionDetails();
$page->addBodyComponent($nav);
$page->addHtmlFragment('templates/milestonegrades.html', $pp);
$page->show();
Esempio n. 5
0
<?php

include_once './peerlib/peerutils.inc';
require_once './peerlib/validators.inc';
//require_once('rubberstuff.php');
include_once 'navigation2.inc';
require_once './peerlib/conffileeditor2.php';
requireCap(CAP_SYSTEM);
// anticipate a save initiated by user.
$saveResult = ConfFileEditor::save();
$page_opening = "Rubber editor file ";
$page = new PageContainer();
$page->setTitle($page_opening);
$nav = new Navigation($navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
if ($saveResult != '') {
    $page->addBodyComponent(new Component($saveResult));
}
if (isset($_REQUEST['formEditFile'])) {
    $_SESSION['formFileToEdit'] = $_REQUEST['formEditFile'];
}
$_SESSION['formFileToEdit'] = './templates/editform/html';
$pp = array();
$fileEditor = new ConfFileEditor($PHP_SELF, 'templates/formedit.html');
$fileEditor->setDescription("Edit query, template or tex file");
$fileEditor->getWidgetForPage($page);
$page->show();
Esempio n. 6
0
<?php

require_once './peerlib/peerutils.inc';
require_once 'component.inc';
$page = new PageContainer();
$html = new HtmlContainer('<html>');
$page->setTitle('Welcome to peerweb');
$page->setBodyTag("<body id='body'>");
$navtop = new HtmlContainer("<div id='navtop' class='navopening'>");
$navtop->add(new Component('<h1>Hello World</h1>'));
$navmid = new HtmlContainer("<div id='navmid'>");
$navcol = new HtmlContainer("<div id='navcol' class='navcol'>");
// force page log
$dbConn->Execute("bogus sql");
$navcol->add(new Component("<table class='navcol'>\n\t\t\t    <tr><th class='navcol'><img src='" . IMAGEROOT . "/filter.png' alt=''>Link1</th></tr>\n\t\t\t    <tr><td class='navcol selected'><img src='" . IMAGEROOT . "/attach.gif' alt=''>Link1</td></tr>\n\t\t\t    <tr><td class='navcol'><img src='" . IMAGEROOT . "/editcut.gif' alt=''>Link1</td></tr>\n</table>"));
// test if can add som more to navcol after adding navcol to parent.
$navcol->add($gif1 = new Component("<img src='" . IMAGEROOT . "/fireworks015.gif' alt=''>"));
$navmid->add($navcol);
$navcol->add($gif2 = new Component("<img src='" . IMAGEROOT . "/fireworks015.gif' alt='' style='background:black;'>"));
$navmain = new HtmlContainer("<div id='navmain' class='navmain'>");
$navmain->add(new Component("<h1 class='normal'>Main</h1>"));
$navmain->add(new Component("\n<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent\ntempor. Nulla vel tortor. Suspendisse tristique viverra urna. Proin tristique\nsuscipit magna. Donec ut elit. Quisque ligula enim, sollicitudin vel, mollis\nquis, tincidunt sit amet, enim. Maecenas elit. Sed viverra leo at\npede. Phasellus vestibulum semper tellus. Ut facilisis. Fusce sed odio. </p>\n"));
$navmain->add(new Component("\n<p>Duis auctor massa sed turpis. Ut hendrerit urna. Sed vitae leo et neque\nelementum varius. Aenean ac nunc. Nulla congue. Praesent turpis nulla, tempus\nvitae, rutrum quis, pellentesque a, orci. Vestibulum placerat pellentesque\nmi. Vivamus cursus sapien nec nunc. Cras dolor lectus, vestibulum vel,\nimperdiet at, lobortis eu, mi. Pellentesque a libero. Sed ornare. Integer\nfeugiat luctus ipsum. Nulla ante. </p>\n<h2>Factum est</h2>\n<p>Sed vestibulum ullamcorper justo. Etiam eu sapien. Proin elit magna, varius\nquis, faucibus a, congue sit amet, mi. Nam accumsan justo sed sem. Vestibulum\nnibh ipsum, laoreet et, congue eget, posuere quis, lacus. Vivamus neque tellus,\nconvallis sit amet, rhoncus ac, accumsan et, nulla. Vestibulum eu\nsapien. Praesent eu massa at neque molestie porta. Nullam turpis. Nullam\nbibendum quam vitae enim. Suspendisse ligula turpis, mollis at, consectetuer\nsit amet, venenatis eu, dolor. Maecenas eu augue. Praesent vitae mauris. Proin\nrhoncus tincidunt eros. </p>\n \n<h3>Platea dictumst</h3>\n<p>In hac habitasse platea dictumst. In adipiscing justo eget lacus. Ut eget lacus\nquis purus posuere porttitor. In pretium. Etiam vulputate elit non purus. Donec\nac lacus et lectus ultricies cursus. Quisque erat turpis, blandit nec, nonummy\neu, auctor ornare, justo. Cras adipiscing pulvinar eros. Nullam dolor metus,\nsuscipit nec, ullamcorper id, posuere ut, wisi. Donec justo mauris, scelerisque\nid, feugiat eu, dictum ut, lacus. Nunc orci lectus, laoreet placerat, nonummy\neuismod, rhoncus in, tellus. Aenean feugiat est vel purus. Fusce tempor. Sed\naugue. </p>\n\nPellentesque malesuada arcu lacinia dui. Nunc feugiat ligula eget magna. Proin\nvarius. Duis eget quam. Ut non nibh. Nam a felis. Class aptent taciti sociosqu\nad litora torquent per conubia nostra, per inceptos hymenaeos. Cras quis metus\nin sapien tempor dignissim. Quisque id metus. Sed sed tellus et metus lacinia\nultricies. Fusce venenatis diam sed augue. Nunc libero diam, consequat in,\nplacerat et, rhoncus eu, tellus. Nullam mattis ultricies velit. Donec at nisl a\nmauris vulputate accumsan. Suspendisse non lorem. \n<p>Duis auctor massa sed turpis. Ut hendrerit urna. Sed vitae leo et neque\nelementum varius. Aenean ac nunc. Nulla congue. Praesent turpis nulla, tempus\nvitae, rutrum quis, pellentesque a, orci. Vestibulum placerat pellentesque\nmi. Vivamus cursus sapien nec nunc. Cras dolor lectus, vestibulum vel,\nimperdiet at, lobortis eu, mi. Pellentesque a libero. Sed ornare. Integer\nfeugiat luctus ipsum. Nulla ante. </p>\n<h2>Factum est</h2>\n<p>Sed vestibulum ullamcorper justo. Etiam eu sapien. Proin elit magna, varius\nquis, faucibus a, congue sit amet, mi. Nam accumsan justo sed sem. Vestibulum\nnibh ipsum, laoreet et, congue eget, posuere quis, lacus. Vivamus neque tellus,\nconvallis sit amet, rhoncus ac, accumsan et, nulla. Vestibulum eu\nsapien. Praesent eu massa at neque molestie porta. Nullam turpis. Nullam\nbibendum quam vitae enim. Suspendisse ligula turpis, mollis at, consectetuer\nsit amet, venenatis eu, dolor. Maecenas eu augue. Praesent vitae mauris. Proin\nrhoncus tincidunt eros. </p>\n \n<h3>Platea dictumst</h3>\n<p>In hac habitasse platea dictumst. In adipiscing justo eget lacus. Ut eget lacus\nquis purus posuere porttitor. In pretium. Etiam vulputate elit non purus. Donec\nac lacus et lectus ultricies cursus. Quisque erat turpis, blandit nec, nonummy\neu, auctor ornare, justo. Cras adipiscing pulvinar eros. Nullam dolor metus,\nsuscipit nec, ullamcorper id, posuere ut, wisi. Donec justo mauris, scelerisque\nid, feugiat eu, dictum ut, lacus. Nunc orci lectus, laoreet placerat, nonummy\neuismod, rhoncus in, tellus. Aenean feugiat est vel purus. Fusce tempor. Sed\naugue. </p>\n\nPellentesque malesuada arcu lacinia dui. Nunc feugiat ligula eget magna. Proin\nvarius. Duis eget quam. Ut non nibh. Nam a felis. Class aptent taciti sociosqu\nad litora torquent per conubia nostra, per inceptos hymenaeos. Cras quis metus\nin sapien tempor dignissim. Quisque id metus. Sed sed tellus et metus lacinia\nultricies. Fusce venenatis diam sed augue. Nunc libero diam, consequat in,\nplacerat et, rhoncus eu, tellus. Nullam mattis ultricies velit. Donec at nisl a\nmauris vulputate accumsan. Suspendisse non lorem. \n"));
$navmid->add($navmain);
$page->addBodyComponent($navtop);
$page->addBodyComponent($navmid);
$page->show();
Esempio n. 7
0
include_once "utils.inc";
include_once "ste.php";
$navTitle = "Peerweb testscript " . $PHP_SELF . " on DB " . $db_name;
$page = new PageContainer();
$page->setTitle('Menu');
//$dbConn->setSqlAutoLog(true);
$ste = new SimpleTableEditor($dbConn, $page);
$ste->setFormAction($PHP_SELF);
$ste->setRelation('menu');
$ste->setMenuName('menu');
$ste->setKeyColumns(array('menu_name', 'relation_name'));
$ste->setNameExpression("rtrim(menu_name,' ')||', '||rtrim(relation_name,' ')");
$ste->setOrderList(array('menu_name', 'relation_name'));
$ste->setFormTemplate('templates/menu.html');
$ste->setListRowTemplate(array('menu_name', 'relation_name'));
$page_opening = "Menu";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
if (isset($_POST['Insert'])) {
    /* try to insert menu,column_names into menu_items */
    $menu_name = $_POST['menu_name'];
    $relation_name = $_POST['relation_name'];
    $sql = "insert into menu_item (menu_name,column_name,edit_type,capability,item_length)  select '{$menu_name}' as menu_name, column_name," . " 'T' as edit_type, 32767 as capability, character_maximum_length" . " from information_schema.columns where table_name='{$relation_name}'";
    $dbMessage = '';
    $result = doUpdate($dbConn, $sql, $dbMessage);
    $page->addBodyComponent(new Component("<fieldset><legend>Create menu_items</legend>\n" . $dbMessage . "\n</fieldset>\n"));
}
$ste->render();
$page->addBodyComponent(new Component('<!-- db_name=$db_name $Id: menu.php 1723 2014-01-03 08:34:59Z hom $ -->'));
$page->addBodyComponent(new Component('<a href="tets.php">tets</a>' . $PHP_SELF));
$page->show();
Esempio n. 8
0
$csvout = 'N';
$csvout_checked = '';
if (isset($_REQUEST['csvout'])) {
    $csvout = $_REQUEST['csvout'];
    $csvout_checked = $csvout == 'Y' ? 'checked' : '';
}
//pagehead2("Presence list to $afko $year $description");//,$scripts);
$prj_id_selector = $prjSel->getSelector();
$selection_details = $prjSel->getSelectionDetails();
$sql = "select st.snummer,roepnaam||coalesce(' '||voorvoegsel||' ',' ')||achternaam as name," . " '#'||task_number||': '||apt.afko||': '||apt.description as checktitle,\n" . " pt.name as task_name,\n" . " coalesce(grade::text,mark) as check, ptc.comment as title,photo,grp_num \n" . " from prj_grp join all_prj_tutor apt using(prjtg_id)\n" . " natural join student st \n" . " join portrait tp using (snummer) \n" . " join project_task pt using(prj_id)\n" . " left join project_task_completed_latest ptc using(snummer,task_id)\n" . " where prj_id={$prj_id} \n" . " order by grp_num,achternaam,roepnaam, task_number\n";
$dbConn->log($sql);
$page = new PageContainer();
include 'js/balloonscript.php';
$page->setTitle('Overview of tasks completed');
$page->addHeadComponent(new Component("<style type='text/css'>\n    *.notered { \n\tbackground-image:url('images/redNote.png');\n    }\n    *.notegreen { \n\tbackground-image:url('images/greenNote.png');\n    }\n    *.noteblue { \n\tbackground-image:url('images/blueNote.png');\n    }\n </style>"));
$page_opening = "Task completed list for project {$afko} {$description} prj_id {$prj_id}";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
$tableBuilder = new TableBuilder($dbConn, new TaskRowFactory());
$task_table = $tableBuilder->getTable($sql, 'snummer');
$templatefile = 'templates/taskoverview.html';
$template_text = file_get_contents($templatefile, true);
$text = '';
if ($template_text === false) {
    $text = "<strong>cannot read template file {$templatefile}</strong>";
} else {
    eval("\$text = \"{$template_text}\";");
}
$page->addBodyComponent(new Component($text));
$page->addBodyComponent(new Component('<!-- db_name=' . $db_name . '-->'));
$page->show();
Esempio n. 9
0
        $sql .= "commit";
        $resultSet = $dbConn->Execute($sql);
        if ($resultSet === false) {
            echo "<br>Cannot update milestone values with " . $sql . " reason " . $dbConn->ErrorMsg() . "<br>";
        }
    }
}
$prj_id = isset($_SESSION['prj_id']) ? $_SESSION['prj_id'] : -1;
extract(getTutorOwnerData($dbConn, $prj_id));
$_SESSION['prj_id'] = $prj_id;
$isTutorOwner = $tutor == $tutor_code;
$page = new PageContainer();
$page->setTitle('Define the number of assessments (milestones) in the project.');
$page_opening = "Define the number of assessments (milestones) in the project. <font style='font-size:6pt;'>prj_id {$prj_id}</font>\n";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
$nav->setInterestMap($tabInterestCount);
$form1 = new HtmlContainer("<fieldset id='form1'><legend><b>Project milestones.</b></legend>");
$form1->addText("<p>A project starts life with one milstone. If you need to add another, this " . "is the page to be. Here you can also set the due dates for the assessment milstones.</p>");
$form1Form = new HtmlContainer("<form id='project' method='post' name='project' action='{$PHP_SELF}'>");
// ."<!--<input type='submit' name='baddmil' value='Get'>-->";
if ($isTutorOwner) {
    $submit_button = "<button type='submit' name='baddmil' value='AddMil'>Add a milestone</button>";
} else {
    $submit_button = '';
}
$project_selector = getProjectSelector($dbConn, $peer_id, $prj_id);
$templatefile = 'templates/addmilestone.html';
$template_text = file_get_contents($templatefile, true);
if ($template_text === false) {
    $form1Form->addText("<strong>cannot read template file {$templatefile}</strong>");
Esempio n. 10
0
if ($resultSet === false) {
    print "error fetching judge data with {$sql} : " . $dbConn->ErrorMsg() . "<br/>\n";
}
if (!$resultSet->EOF) {
    extract($resultSet->fields, EXTR_PREFIX_ALL, 'judge');
}
$lang = strtolower($judge_lang);
$student_data = "{$judge_roepnaam} {$judge_voorvoegsel} {$judge_achternaam} ({$judge_snummer})";
$page_opening = "Assessment entry form for {$student_data}";
$page = new PageContainer();
$page->setTitle('Peer assessment entry form');
$page->addHeadText("<script language='JavaScript' type='text/javascript'>\n/**\n * validate input\n */\nfunction validateGrade(el) {\n  var rex;\n  /* el is the element with the value to be tested\n   */\n  var locvar = el.value;\n  el.value = locvar;\n  rex = locvar.search(/^[0-9]{1,2}\$/);\n  if (rex == -1 ) {\n    alert(el.value+': Only digits (and whole numbers) are allowed!');\n    return false;\n  }\n  if ( locvar < 1 || locvar > 10 ) {\n    alert(el.value + \n\t  ' is not a correct grade, use an integer between 1 and 10');\n    return false;\n  }\n  return true;\n}\n</script>");
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
ob_start();
tutorHelper($dbConn, $isTutor);
$page->addBodyComponent(new Component(ob_get_clean()));
$page->addBodyComponent($nav);
ob_start();
/**
 * Use peer database function try_close to try and close the group.
 * @global type $dbConn
 * @param type $gid group id
 * @param type $stid student/judge
 * @return boolean true is this call closed the group.
 */
function tryClose($gid, $stid)
{
    global $dbConn;
    $sql = "select try_close({$gid},{$stid})";
    $resultSet = $dbConn->Execute($sql);
    if ($resultSet === false) {
Esempio n. 11
0
<?php

include_once './peerlib/peerutils.inc';
include_once 'navigation2.inc';
require_once 'component.inc';
requireCap(CAP_TUTOR);
$page = new PageContainer();
$page->setTitle('Peer assessment for tutors');
$page->addHeadComponent(new Component("<style type='text/css'>\n p {text-align: justify;}\n p:first-letter {font-size:180%; font-family: script;font-weight:bold; color:#800;}\n \n </style>"));
$page_opening = "Peer assessment, what&#39;s in it for me, the tutor?";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
$newsfile = 'news.html';
$news_text = file_get_contents($newsfile, true);
if ($news_text !== false) {
    $nav->addLeftNavText($news_text);
}
//ob_start();
include 'birthdays.php';
$bd = new BirthDaysToDay();
$rightColumn = $bd;
//ob_clean();
$maintext = new Component("<div style='padding:1em'>\n<table><tr><td width='60%'>\n   <h2 class='normal' style='text-align:center;'>The why for this site.</h2>\n    <h4>Peer assessment</h4>\n    <p>This site started as a help to lessen the burden of doing the administrative work \n      when executing a peer assessment, where students value each other on several criteria.\n      The intend is that the criteria are not fixed but can be defined per project or course.</p>\n    <h4>Upload repository for files to be shared.</h4>\n    <p>At a certain moment the need arose to have a central upload facility for documents that are to\n      be handed in by the students as products produced in their project activities. \n      The documents can be handed in per category, determined by the teaching staff \n      (and entered in the database by the/a tutor). The system support versions of those deliverables.\n      To prevent disk overflow and denial of service a maximum number\n      of versions can be set. A due date is also supported \n      (but currently not actively checked upon). Diffs etc (like in\n      CVS) are not supported. This is a showcase, not a versioning\n      system. \n      Until the due date the documents that are uploaded are only\n      visible to the group members. After the due date they are\n      visible to other groups that participate in this (year's)\n      version of the same module or course. This allows a intra group\n      review cycle between hand in and due date and  \n      a inter group review once the due date has passed.</p>\n    <h4>Peer critiques and feedback.</h4>\n    <p>Once the first draft of the upload and version support was in\n      place, we implemented functionality to let students (and\n      tutors) give feedback to the documents that are uploaded. This\n      is more or less modeled after the VAL or peer review\n      concept. The students (within a group) can give improvement\n      suggestions (critiques) to the uploaded documents.</p>\n   <p>If you have any bugs or improvement suggestions, visit our trac <a href='https://www.fontysvenlo.org/trac/generic/peerweb/wiki/'>bug tracking system</a>.</p>\n\n      </td><td>{$rightColumn}</td>\n      </tr></table></div>\n    ");
$page->addBodyComponent($maintext);
$page->show();
Esempio n. 12
0
<?php

include_once './peerlib/peerutils.inc';
include_once 'tutorhelper.inc';
include_once 'navigation2.inc';
include_once 'navigation2.inc';
require_once 'presencetable.php';
// get group tables for a project
$prj_id = 0;
$prjm_id = 0;
$milestone = 1;
$afko = 'PRJ00';
$description = '';
extract($_SESSION);
//pagehead2("Presence list to $afko $year $description");//,$scripts);
$page = new PageContainer();
ob_start();
tutorHelper($dbConn, $isTutor);
$page->addBodyComponent(new Component(ob_get_clean()));
$page->setTitle('Overview of presence during activities');
$page_opening = "Presence overview for {$roepnaam} {$voorvoegsel} {$achternaam} ({$snummer})";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
$pp = array();
$pp['presence_table'] = personalPresenceList($dbConn, $snummer);
$page->addHtmlFragment('templates/peerpresenceoverview.html', $pp);
//$page->addBodyComponent(new Component($text));
$page->addBodyComponent(new Component('<!-- db_name=' . $db_name . '-->'));
$page->show();
Esempio n. 13
0
    $string = $_POST['string'];
}
$matches = preg_match($regex, $string);
if ($matches) {
    $matchStyle = 'color:white;background:#080';
    $matchst = "<span style='{$matchStyle}'>Yes</span>";
} else {
    $matchStyle = 'color:white;background:#800;font-weight:bold;';
    $matchst = "<span style='{$matchStyle}'>No</span>";
}
$navTitle = "Peerweb regex testscript " . $PHP_SELF . " on DB " . $db_name;
$page = new PageContainer();
$page_opening = 'Regex tester';
$page->setTitle($page_opening);
//$dbConn->setSqlAutoLog(true);
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
$regex_length = max(strlen($regex), 40);
$formString = "\n<fieldset align='center' width='50%'><legend>PCRE regex tester</legend>\n<h3>This is a tester for the PHP implementation of PERL compatible regular expressions.</h3>\n</p>The peerweb application requires UTF8 conformance, which requires proper support from the regex library.\nAt least PHP 5.2.3 and it's bundled lebprce promise to provide that.</p>\n\n<form name='regex' method='post' action='{$PHP_SELF}'>\n<table>\n<tr><th>regex_name</t><th>Regex</th><th>String</th><th>matches</th></tr>\n<tr><th>{$regex_name}</th><td><input name='regex' value='{$regex}' size='{$regex_length}'/></td>\n<td><input name='string' value='{$string}' size='40'/></td><td>{$matchst}</td></tr>\n<tr><th>Result</th><th>'{$regex}'</th><th style='{$matchStyle}'>'{$string}'</th><th>&nbsp;</th></tr>\n<tr><td colspan='3'><input type='submit' name='submit'/></td></tr>\n</table>\n</form>\n</fieldset>\n";
$page->addBodyComponent(new Component($formString));
$sql = "select regex_name,regex from validator_regex order by regex_name\n";
$resultSet = $dbConn->Execute($sql);
$table = "<table>\n\t<th>Regexname</th><th></th></tr>\n";
while (!$resultSet->EOF) {
    extract($resultSet->fields);
    $table .= "\n<tr><td><a href='{$PHP_SELF}?regex_name={$regex_name}'>{$regex_name}</a></td><td>{$regex}</td></tr>";
    $resultSet->moveNext();
}
$table .= "</table>";
$page->addBodyComponent(new Component($table));
$page->show();
Esempio n. 14
0
<?php

include_once './peerlib/peerutils.inc';
require_once './peerlib/simplequerytable.inc';
requireCap(CAP_TUTOR);
$page_opening = 'Select or define a project ';
$page = new PageContainer();
$page->setTitle('Fontys knwon courses');
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$nav->setInterestMap($tabInterestCount);
$form1 = new HtmlContainer('<fieldset id=\'fieldset1\'><legend>Fontys courses known by peerweb</legend>');
$sql = "select course," . "rtrim(course_description)," . "faculty,faculty_short as inst from fontys_course join faculty using(faculty_id)";
ob_start();
simpletable($dbConn, $sql, '<table border=\'1\' style=\'border-collapse:collapse\' summary=\'table of courses\'>');
$form1->addText(ob_get_clean());
$page->addBodyComponent($form1);
$page->addBodyComponent(new Component('<!-- db_name=$db_name $Id: known_courses.php 1723 2014-01-03 08:34:59Z hom $ -->'));
$page->addBodyComponent($nav);
$page->show();
Esempio n. 15
0
    print "error fetching judge data with {$sql} : " . $dbConn->ErrorMsg() . "<br/>\n";
}
if (!$resultSet->EOF) {
    extract($resultSet->fields, EXTR_PREFIX_ALL, 'judge');
}
$lang = strtolower($judge_lang);
$page_opening = "Assessment entry form for {$judge_roepnaam} {$judge_voorvoegsel} {$judge_achternaam} ({$judge_snummer})";
$page = new PageContainer();
$page->setTitle('Peer assessment entry form');
$page->addHeadText("<script language='JavaScript' type='text/javascript'>\n/**\n * validate input\n */\nfunction validateGrade(el) {\n  var rex;\n  /* el is the element with the value to be tested\n   */\n  var locvar = el.value;\n  el.value = locvar;\n  rex = locvar.search(/^[0-9]{1,2}\$/);\n  if (rex == -1 ) {\n    alert(el.value+': Only digits (and whole numbers) are allowed!');\n    return false;\n  }\n  if ( locvar < 1 || locvar > 10 ) {\n    alert(el.value + \n\t  ' is not a correct grade, use a whole figure between 1 and 10');\n    return false;\n  }\n  return true;\n}\n</script>");
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$nav->setInterestMap($tabInterestCount);
$nav->addLeftNavText(file_get_contents('news.html'));
ob_start();
tutorHelper($dbConn, $isTutor);
$page->addBodyComponent(new Component(ob_get_contents()));
ob_clean();
$page->addBodyComponent($nav);
ob_start();
// see if there is a reopen request
if ($isTutor && isset($_REQUEST['reopen'])) {
    $sql = "begin work;\n" . "update prj_grp set prj_grp_open=true,written=false where prjtg_id={$prjtg_id} and snummer={$judge} ;\n" . "update prj_tutor set prj_tutor_open=true,assessment_complete=false where prjtg_id={$prjtg_id};\n" . "update prj_milestone set prj_milestone_open=true where prjm_id={$prjm_id};\n" . "commit;";
    $resultSet = $dbConn->Execute($sql);
    if ($resultSet === false) {
        die("<br>Cannot update prj_grp table with \"" . $sql . '", cause ' . $dbConn->ErrorMsg() . "<br>");
    }
    //    $dbConn->log('reopen');
}
//echo "2 found $prj_id, $milestone,$judge for tutor</br>";
// test of voting is still open for this group
$grp_open = grpOpen2($dbConn, $judge, $prjtg_id);
Esempio n. 16
0
extract(getTutorOwnerData($dbConn, $prj_id), EXTR_PREFIX_ALL, 'ot');
$_SESSION['prj_id'] = $prj_id = $ot_prj_id;
$isTutorOwner = $ot_tutor == $tutor_code;
if ($isTutorOwner) {
    $submit_button = '<button name=\'bsubmit\' value=\'submit\'>Submit</button>';
} else {
    $submit_button = '';
}
$resultSet = $dbConn->execute("select count(*) as participants from prj_grp join prj_tutor using(prjtg_id) where prjm_id={$prjm_id}");
extract($resultSet->fields);
// generating output
$page = new PageContainer();
$page->setTitle('Select participating student_class');
$page_opening = "Select the student_class of the participating students";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
$resultSet = $dbConn->Execute("select afko,description from project where prj_id={$prj_id}");
extract($resultSet->fields);
$form1Form = new HtmlContainer("<div id='projectsel'>");
$prjSel->setJoin(" (select distinct prjm_id from prj_milestone natural join project  where owner_id={$peer_id}) p_mil using (prjm_id)");
//$dbConn->log($prjSel->getQuery());
$form1Form->addText($prjSel->getWidget());
$form2Form = new HtmlContainer("<form method='post' name='group_def' action='{$PHP_SELF}'>");
//$form2Table = new HtmlContainer( "<table border='3' style='border-collapse:3d; padding:2pt;'" .
//                " align='left'  rules='groups' frame='box'" .
//                "summary='class selection' id='form2table'>" );
$form2Table = new HtmlContainer("<div id='tabs'>");
//$form2Form->addText( "Legend:class name [class size]<br/>\n" );
$sql = "select distinct rtrim(student_class.sclass) as sclass,class_id,sort1,sort2,sort_order,\n" . "rtrim(faculty.faculty_short) as opl_afko, student_count,rtrim(faculty.faculty_short) as faculty_short,\n" . "trim(cluster_name) as cluster_name,class_cluster \n" . "from student_class\n" . " join faculty using(faculty_id)\n" . "join class_cluster using(class_cluster)\n" . "join current_student_class using (class_id) join class_size using(class_id)\n " . "where sort2 < 9 and sclass not like 'UIT%' \n" . "order by sort_order,faculty_short desc,cluster_name,sort1,sort2,sclass asc";
$resultSet = $dbConn->Execute($sql);
if ($resultSet === false) {
Esempio n. 17
0
$input_comment = "<textarea class='" . $validator->validationClass('comment') . "'name='comment' cols='72' rows='5'>{$comment}</textarea>\n";
$input_update_button = $isTutorOwner ? "<input type='submit' name='bsubmit'\n" . "value='Update' title='Use this to update project data for project_id={$prj_id}' />" : '';
$tutor_owner_form = "";
if (hasCap(CAP_SYSTEM)) {
    $tutor_owner_form = "<form name='tuto' action='{$PHP_SELF}' method='get'>\n" . "<select name='owner_id' title='set tutor_owner'>" . getOptionListGrouped($dbConn, "select achternaam||', '||roepnaam||' '||coalesce(voorvoegsel,'')" . "||' ('||tutor||')' as name,\n" . " userid as value,\n" . " faculty_short as namegrp" . " from tutor t  join student s on (userid=snummer)\n" . " join faculty f on(t.faculty_id=f.faculty_id)\n" . " order by namegrp desc,achternaam,roepnaam", $owner_id) . "</select>\n" . "<input type='hidden' name='prj_id' value='{$prj_id}'/>" . "<button type='submit' name='tutor_o'>New Owner</button>" . "</form>\n";
}
$input_course = "<select name='course' title='set base course'>\n" . getOptionListGrouped($dbConn, "select trim(course_short)||':'||trim(course_description)||'('||course||')' as name,\n" . " course as value,\n" . " faculty_short as namegrp\n" . " from fontys_course fc natural join faculty f\n" . " order by namegrp,name", $course);
$sql = "select count(prj_id) as active_project_set from activity_project where prj_id={$prj_id}";
$resultSet = $dbConn->Execute($sql);
if ($resultSet === false) {
    die("<br>Cannot activity_project data with <pre>{$sql}</pre> " . $dbConn->ErrorMsg() . "<br>");
}
$activity_project_checked = $resultSet->fields['active_project_set'] ? 'checked' : '';
$input_activity_project = "<input type='checkbox' name='activity_project' value='set' {$activity_project_checked}/>";
$templatefile = 'templates/alterproject.html.inc';
$template_text = file_get_contents($templatefile, true);
if ($template_text === false) {
    $form1Form->addText("<strong>cannot read template file {$templatefile}</strong>");
} else {
    eval("\$text = \"{$template_text}\";");
    $form1->addText($text);
}
//$form1->add($form1Form);
$page->addBodyComponent($nav);
$page->addBodyComponent($form1);
$page->addBodyComponent(new Component('<!-- db_name=$db_name $Id: alterproject.php 1726 2014-02-03 13:54:48Z hom $ -->'));
$page->addHeadText(file_get_contents('templates/simpledatepicker.html'));
$page->addScriptResource('js/jquery-1.7.1.min.js');
$page->addScriptResource('js/jquery-ui-1.8.17.custom.min.js');
$page->addJqueryFragment('$(\'#embeddedPicker\').datepicker(dpoptions);');
$page->show();
Esempio n. 18
0
    $resultSet = $dbConn->Execute($sql);
    if ($resultSet === false) {
        $dbConn->log("cannot insert appplied criteria with <pre>{$sql}</pre>, reason: " . $dbConn->ErrorMsg() . "<br/>\n");
        $dbConn->Execute("rollback;");
    }
}
$prj_id = isset($_SESSION['prj_id']) ? $_SESSION['prj_id'] : -1;
extract(getTutorOwnerData($dbConn, $prj_id));
$_SESSION['prj_id'] = $prj_id;
$isTutorOwner = $tutor == $tutor_code;
$page = new PageContainer();
$page->setTitle('Peer assessment, define project');
$page_opening = "Define the number of criteria for the project.";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$nav->setInterestMap($tabInterestCount);
$page->addBodyComponent($nav);
$form1 = new HtmlContainer("<fieldset id='form1'><legend><b>Project milestone and number of criteria.</b></legend>");
$form1Form = new HtmlContainer("<form id='project' method='post' name='project' action='{$PHP_SELF}'>");
$input_prj_selector = "<select name='prj_id' onchange='submit()'>\n" . getOptionListGrouped($dbConn, "select afko||': '||description||' ('||year||')' as name" . ", year as namegrp,prj_id as value from project order by year desc,afko", $prj_id) . "\n</select>\n";
if ($isTutorOwner) {
    $input_num_criteria = "<input class='" . $validator->validationClass('critcount') . "' type='text' align='right' size='1' maxlength='2' name='critcount' value='{$critcount}'/>";
    $input_submit_button = "<input type='submit' name='setcrit' value='Set Criteria'/>";
} else {
    $input_num_criteria = "{$critcount}";
    $input_submit_button = '';
}
$project_selector = $prjSel->getSelector();
$sql = "select bc.criterium_id as bc,pc.criterium_id as ac,pc.criterium_id as uc,nl_short,nl,de_short,de,en_short,en\n" . " from base_criteria bc natural left join (select prjm_id,criterium_id from prjm_criterium \n" . "   where prjm_id={$prjm_id}) pc order by bc";
$resultSet = $dbConn->Execute($sql);
if ($resultSet === false) {
    $dbConn->log("cannot get date with {$sql}, reason: " . $dbConn->ErrorMsg() . "<br/>\n");
Esempio n. 19
0
<?php

include_once './peerlib/peerutils.inc';
require_once 'component.inc';
$page = new PageContainer();
$page->setTitle('Critique history');
$page->addHeadComponent(new Component("<script type='text/javascript'>\n" . "/*\n" . " * refresh parent page on close\n" . " */\n" . "function bye(){ \n" . "   opener.focus();\n" . "   self.close();\n" . "}\n" . "</script>"));
$page->addHeadComponent(new Component("<link rel='stylesheet' type='text/css' href='{$root_url}/style/newdivstyle.css'/>"));
$page->addHeadComponent(new Component("<style type='text/css'>\n" . " p {text-align: justify;}\n" . " p:first-letter {font-size:180%; font-family: script;font-weight:bold; color:#800;}\n" . " </style>"));
$maindiv = new HtmlContainer("<div id='main'>");
$page->addBodyComponent($maindiv);
if (isset($_REQUEST['critique_id'])) {
    $critique_id = validate($_REQUEST['critique_id'], 'integer', 1);
    $maindiv->addText("<div class='navopening'><h1>Critique history of critique {$critique_id} <button onClick='javascript:bye()'>Close</button></h1></div>");
    $sql = "select distinct critiquer, roepnaam,voorvoegsel,achternaam,critique_id,id,\n" . "date_trunc('seconds',ch.edit_time) as critique_time,ch.critique_text as critique_text,\n" . "afko,year,apt.grp_num as critiquer_grp\n" . "from document_critique dcr\n" . "join critique_history ch using(critique_id)\n" . "join student st on (dcr.critiquer=st.snummer)\n" . "join uploads u on(dcr.doc_id=u.upload_id)\n" . "join all_prj_tutor apt on(u.prjtg_id=apt.prjtg_id) where critique_id={$critique_id}\n" . "order by id desc";
    $resultSet = $dbConn->Execute($sql);
    if ($resultSet === false) {
        die('Error: ' . $dbConn->ErrorMsg() . ' with ' . $sql);
    }
    $table_div = new HtmlContainer("<div id='tablediv' style='padding: 0 2em 0 2em'>");
    $table = new HtmlContainer("<table id='critique_table' class='layout' style='padding:0;margin:0;'");
    $table_div->add($table);
    $maindiv->add($table_div);
    while (!$resultSet->EOF) {
        extract($resultSet->fields);
        $table->add(new Component("<tr><td>\n" . "\t<div class='critique' style='background:#ffffe0;'>\n" . "\t<fieldset style='margin: .2em border:2;'>\n" . "\t\t<legend>Critique {$critique_id} by {$roepnaam} {$voorvoegsel} {$achternaam} ({$critiquer})&nbsp;</legend>\n" . "\t\t\t<table class='layout'>\n" . "\t\t\t\t<tr><td>Group</td><th align='left'>{$critiquer_grp} ({$afko} {$year}) </th></tr>\n" . "\t\t\t\t<tr><td>Critique time</td><th align='left'> {$critique_time}</th></tr>\n" . "\t\t\t</table>\n" . "{$critique_text}\n" . "\t</fieldset>\n" . "\t</div>\n" . "</td></tr>"));
        $resultSet->MoveNext();
    }
}
$page->show();
Esempio n. 20
0
    //    $dbConn->log($mailbody);
}
if (isset($_POST['formsubject'])) {
    $formsubject = $_POST['formsubject'];
}
if (isset($_POST['snmailto']) && isset($_POST['domail'])) {
    $snmailto = $_POST['snmailto'];
    $mailset = '\'' . implode("','", $snmailto) . '\'';
    $sql = "select distinct email1,email2, tutor_email, \n" . "s.roepnaam ||' '||coalesce(s.voorvoegsel,'')||' '||s.achternaam as name\n" . ", afko, description,milestone,assessment_due as due \n" . " from prj_grp pg \n" . " join student s on (s.snummer=pg.snummer) \n" . " join prj_tutor pt on(pt.prjtg_id=pg.prjtg_id) \n" . " join tutor t on(userid=tutor_id) \n" . " join prj_milestone pm on(pt.prjm_id=pm.prjm_id) \n" . " join project p on (pm.prj_id=p.prj_id)\n" . " join tutor_data td on (pt.tutor_id=td.tutor_id)" . " left join alt_email aem on (s.snummer=aem.snummer)\n" . "where s.snummer in ({$mailset}) and pm.prjm_id={$prjm_id}";
    $dbConn->log($sql);
    formMailer($dbConn, $sql, $formsubject, $mailbody, $sender, $sender_name);
}
$page_opening = "These students are overdue with filling in their peer assessment forms.";
$nav = new Navigation(array(), basename($PHP_SELF), $page_opening);
$page = new PageContainer();
$page->addBodyComponent($nav);
ob_end_clean();
if (hasCap(CAP_SYSTEM)) {
    $tutor_select = "";
} else {
    $tutor_select = " and (tutor='{$tutor}' or tutor_owner='{$tutor}') ";
}
ob_start();
$prjSel->setWhere("assessment_due <now() and pm.prj_milestone_open=true");
$prj_id_selector = $prjSel->getWidget();
$sqlhead = "select  afko as code,pm.milestone as milstn,pt.grp_num,\n" . "s.snummer as snmailto,s.snummer,\n" . "achternaam||coalesce(', '||voorvoegsel,'') as achternaam\n" . ",roepnaam, s.snummer,pm.assessment_due as due,tutor\n";
$sqllate = "( select distinct snummer from prj_grp \n" . "natural join prj_tutor pt \n" . "join tutor t on(userid=tutor_id)\n" . "natural join prj_milestone \n" . "where written =false \n" . "and prj_milestone_open=true \n" . "and prj_grp_open=true \n" . "and assessment_due < now()::date \n" . "and prjm_id={$prjm_id})";
$sqltail = " \n" . " join milestone_open_past_due mopd on(jnr.prjtg_id=mopd.prjtg_id)" . " join prj_grp_open pgo on(pgo.prjtg_id=jnr.prjtg_id)\n" . " join student s on (jnr.snummer=s.snummer) \n" . " join prj_tutor pt on(jnr.prjtg_id=pt.prjtg_id)\n" . " join tutor t on(userid=tutor_id)\n" . " join prj_milestone pm on(pt.prjm_id=pm.prjm_id)\n" . " join project p on(p.prj_id=pm.prj_id)\n" . " where pm.prjm_id={$prjm_id}\n";
//$dbConn->log($sql);
$latecountsql = "select count(*) as latecount from {$sqllate} foo";
$resultSet = $dbConn->Execute($latecountsql);
Esempio n. 21
0
tutorHelper($dbConn, $isTutor);
$tutor_Helper = ob_get_clean();
$prjSel = new StudentMilestoneSelector($dbConn, $judge, $prjtg_id);
$prjSel->setExtraConstraint(" and prjtg_id in (select distinct prjtg_id from assessment) and " . " (pr.capabilities &" . CAP_READ_PEER_ASSESSMENT_DATA . ") <> 0");
$prjSel->setEmptySelectorResult("<h1>There are no projects of which you may view the peer results</h1>");
extract($prjSel->getSelectedData());
$_SESSION['prjm_id'] = $prjm_id;
$_SESSION['prjtg_id'] = $prjtg_id;
$studentMayRead = hasStudentCap($snummer, CAP_READ_PEER_ASSESSMENT_DATA, $prjm_id);
$pp['prjList'] = $prjList = $prjSel->getWidget();
$page = new PageContainer();
// now test if student is allowed
if (!$studentMayRead) {
    $page_opening = 'You cannot view the results for this project and group';
    $page->setTitle($page_opening);
    $page->addBodyComponent(new Component($tutor_Helper));
    $nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
    $page->addBodyComponent($nav);
    $page->addHtmlFragment('templates/studentgroupresult_noaccess.html', $pp);
    $page->show();
    exit(0);
}
if (isset($_REQUEST['productgrade'])) {
    $tmpnum = preg_replace('/,/', '.', $_REQUEST['productgrade']);
    if (preg_match("/^\\d{1,2}(\\.?\\d*)?\$/", $tmpnum)) {
        $productgrade = $tmpnum;
    }
}
$page_opening = "Group assessment results viewable by {$roepnaam} {$voorvoegsel} {$achternaam} ({$snummer}) for <i>average group grade</i> {$productgrade}";
$page->setTitle('Results for all students in a group');
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
Esempio n. 22
0
    // try to insert this snummer into max prj_grp
    $sql = "insert into project_scribe (prj_id,scribe) values({$prj_id},{$newsnummer})\n";
    $dbConn->Execute($sql);
    $dbConn->log($sql);
    //    $dbConn->log($dbConn->ErrorMsg());
}
if (isset($_REQUEST['bdelete']) && $newsnummer != 0) {
    // try to insert this snummer into max prj_grp
    $sql = "delete from project_scribe where scribe={$newsnummer} and prj_id={$prj_id}\n";
    $dbConn->Execute($sql);
    $dbConn->log($sql);
    //    $dbConn->log($dbConn->ErrorMsg());
}
$page = new PageContainer();
$page_opening = "Add project scribe" . "<span style='font-size:8pt;'>prj_id {$prj_id} milestone {$milestone} prjm_id {$prjm_id}</span>";
$page->setTitle('Add a project scribe');
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
$templatefile = 'templates/addscribe.html';
$template_text = file_get_contents($templatefile, true);
$studentPicker->setPresentQuery("select scribe as snummer from project_scribe where prj_id={$prj_id}");
$student_picker_text = $studentPicker->getPicker();
$scribeQuery = "select snummer,achternaam,roepnaam,voorvoegsel from student\n" . "where snummer in (select scribe from project_scribe where prj_id={$prj_id}) order by achternaam,roepnaam";
$scribeTable = simpleTableString($dbConn, $scribeQuery, "<table summary='students found' border='1' style='border-collapse:collapse'>");
if ($template_text === false) {
    $page->addBodyComponent(new Component("<strong>cannot read template file {$templatefile}</strong>"));
} else {
    eval("\$text = \"{$template_text}\";");
    $page->addBodyComponent(new Component($text));
}
$page->show();
Esempio n. 23
0
 * @author Pieter van den Hombergh
 * $Id: literature.php 1723 2014-01-03 08:34:59Z hom $
 */
include_once "peerutils.inc";
include_once 'navigation2.inc';
include_once "utils.inc";
include_once "ste.php";
$navTitle = "Course literature" . $PHP_SELF . " on DB " . $db_name;
$page = new PageContainer();
$page->setTitle('Literature');
$ste = new SimpleTableEditor($dbConn, $page);
$ste->setFormAction($PHP_SELF);
$ste->setRelation('literature');
$ste->setMenuName('literature');
$ste->setKeyColumns(array('literature_id'));
$ste->setNameExpression("rtrim(menu_name,' ')||', '||rtrim(column_name,' ')");
$ste->setOrderList(array('literature_code'));
$ste->setFormTemplate('templates/literature.html');
$page_opening = "Literature for all courses";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
$ste->render();
$page->addBodyComponent(new Component('<!-- db_name=$db_name $Id: literature.php 1723 2014-01-03 08:34:59Z hom $ -->'));
$page->show();
?>





Esempio n. 24
0
<?php

/**
 * mini task_timer
 */
require_once 'component.inc';
$peer_id = $_SESSION['peer_id'];
require_once 'tasktimer.inc';
$page = new PageContainer();
$page->setTitle('Your personal task timer');
$task_div = new HtmlContainer('<div id=\'task_timer_id\' class=\'navopening\'>');
ob_start();
taskTimer($_SESSION['peer_id']);
$task_div->addText("<a href='logout.php' title='logout'><img src='" . IMAGEROOT . "/close_1.png' border='0' alt='logout'/></a>");
$task_div->addText(ob_get_clean());
$page->addBodyComponent($task_div);
$page->show();
Esempio n. 25
0
//if ($isTutorOwner) {
$submit_button = "<button type='submit' name='bsubmit' value='Update'>Update</button>";
// } else {
//  $submit_button ='';
// }
$project_selector = getProjectSelector($dbConn, $peer_id, $prj_id);
$templatefile = 'templates/defmilestoneform1.html.inc';
$template_text = file_get_contents($templatefile, true);
if ($template_text === false) {
    $form1Form->addText("<strong>cannot read template file {$templatefile}</strong>");
} else {
    eval("\$text = \"{$template_text}\";");
    $form1Form->addText($text);
}
$form1->add($form1Form);
$page->addBodyComponent($nav);
$page->addBodyComponent($form1);
$form2 = new HtmlContainer("<fieldset><legend>Due dates</legend>");
$form2->addText("After you determined the number of milestones, select the due dates. (Defaults are 14 days from now).");
$form2Form = new HtmlContainer("<form method='post' name='duedates' action='{$PHP_SELF}'>");
$sql = "select 'M'||milestone as name, assessment_due,\n" . "  case when prj_milestone_open=true then  'open' else 'closed' end as open \n" . " from prj_milestone where prj_id={$prj_id} order by milestone";
$inputColumns = array('1' => array('type' => 'N', 'size' => '12'));
ob_start();
// collect table data
// column '0' = M<milestone>
$inputColumns = array('1' => array('type' => 'N', 'size' => '12'));
queryToTableChecked2($dbConn, $sql, true, 0, new RainBow(0x46b4b4, 64, 32, 0), 'open[]', array(), $inputColumns);
$form2Form->addText(ob_get_clean());
$form2Form->addText("<input type='hidden' name='prj_id' value='{$prj_id}' />\n" . "<input type='submit' name='submitdue' value='Submit' />\n" . "<input type='reset' name='reset' value='Reset' />");
$form2->add($form2Form);
$page->addBodyComponent($form2);
Esempio n. 26
0
} else {
    $replyto = '*****@*****.**';
    $sender_name = 'Pieter van den Hombergh';
    $signature = '';
}
if (isset($_POST['signature'])) {
    $signature = $_POST['signature'];
    $sql_signature = pg_escape_string($signature);
    $sql = "begin work;\n" . " delete from email_signature where snummer={$peer_id};\n" . " insert into email_signature (snummer,signature) values({$peer_id},'{$signature}');\n" . "commit";
    $dbConn->doSilent($sql);
}
$page_opening = "Set you mailer signature";
$page = new PageContainer();
$page->setTitle($page_opening);
$nav = new Navigation(array(), basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
$mailer_signature = "\n<form method='post' action='{$PHP_SELF}' name='mailerform' id='mailerform'>\n<fieldset><legend>Mailer</legend>\nThis signature will be appended to your email editor on startup. \nYou may use html enriched tex.\n<div>\n\n<b>Signature:</b><br/>\n<textarea cols='120' rows='20' id='signature' name='signature' class='mceEditor'>\n{$signature}\n</textarea >\n<input type='submit' name='set' value='Update signature'/>\n<input type='reset' name='reset' value='reset'/>\n</div>\n</fieldset>\n</form>\n";
$page->addBodyComponent(new Component($mailer_signature));
$page->addHeadText('<script language="javascript" type="text/javascript" src="' . SITEROOT . '/js/tiny_mce/tiny_mce.js"></script>
 <script language="javascript" type="text/javascript">
   tinyMCE.init({
        theme: "advanced",
        gecko_spellcheck : true,
        theme_advanced_toolbar_location : "top",
	mode : "textareas", /*editor_selector : "mceEditor",*/

        theme_advanced_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1",
        plugins: "advlink,searchreplace,insertdatetime,table",
	plugin_insertdate_dateFormat : "%Y-%m-%d",
	plugin_insertdate_timeFormat : "%H:%M:%S",
	table_styles : "Header 1=header1;Header 2=header2;Header 3=header3",
Esempio n. 27
0
$sender_name = '';
$sql = "select email1 as replyto,roepnaam||coalesce(' '||voorvoegsel,'')||' '||achternaam as sender_name," . "coalesce(signature," . "'sent by the peerweb service on behalf of '||roepnaam||coalesce(' '||voorvoegsel,'')||' '||achternaam)\n" . "  as signature from student left join email_signature using(snummer) where snummer='{$peer_id}'";
$rs = $dbConn->Execute($sql);
if (!$rs->EOF) {
    extract($rs->fields);
} else {
    $replyto = '*****@*****.**';
    $sender_name = 'Pieter van den Hombergh';
    $signature = '';
}
ini_set('sendmail_from', $replyto);
$page_opening = "Simple Mailer";
$page = new PageContainer();
$page->setTitle($page_opening);
$nav = new Navigation(array(), basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
$mailerto = '';
$mailersubject = 'test from mailer';
$mailertext = '<h1>Put your own text here. The mail will be sent as a html formatted mail.</h1>' . $signature;
if (isset($_POST['mailersubject']) && isset($_POST['mailertext']) && isset($_POST['mailerto'])) {
    extract($_POST);
    $mailtimestamp = @`date -R`;
    $msgid = @`date +%Y%m%d%H%M%S`;
    $msgid = rtrim($msgid);
    $msgid .= '*****@*****.**';
    $headers = "Received: from hermes.fontys.nl (145.85.2.2) by fontysvenlo.org (81.169.175.156) with PEERWEB mailer for <{$mailerto}>; {$mailtimestamp} \nFrom: \"{$sender_name}\" <{$replyto}>\nReply-To: \"{$sender_name}\" <{$replyto}>\nMIME-Version: 1.0\nContent-Transfer-Encoding: 8bit\nContent-Type: text/html; charset=\"utf-8\"\nReturn-Path: " . '<' . "{$replyto}>" . '>' . "\nMessage-Id: " . '<' . "{$msgid}" . '>' . "\n";
    $bodyprefix = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>' . $_POST['mailersubject'] . '</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >