Exemple #1
0
 /**
  * {@inheritDoc}
  */
 public function render($content, array $attribs = [])
 {
     if (is_string($content) && !array_key_exists('src', $attribs)) {
         $attribs['src'] = $content;
     }
     return parent::render(null, $attribs);
 }
Exemple #2
0
 /**
  * {@inheritDoc}
  */
 public function render($content, array $attribs = [])
 {
     $areas = [];
     if (is_array($content)) {
         $helper = $this->getAreaHelper();
         foreach ($content as $area) {
             $areas[] = $helper(null, $area);
         }
     }
     return parent::render(PHP_EOL . implode(PHP_EOL, $areas) . PHP_EOL, $attribs);
 }
				/**
		 * Prepare and declare wui for overview
		 */
		function prepare_overview() {
			global $lang, $db, $sid, $specialID;

			// initializing
			$doc = doc();
			$oid = value("oid", "NUMERIC");

			if ($this->membersCount > $this->mincard && $this->developer)
				$this->deleteable = true;

			// process moving up and moving down....
			if ($this->saction == "up" && ($this->editor || $this->developer)) {
				$this->move("UP");
			} else if ($this->saction == "down" && ($this->editor || $this->developer)) {
				$this->move("DOWN");
			}

			// process adding of items...
			if (($this->saction == "addci_".$this->clti) && ($this->editor || $this->developer)) {
				$this->createItems();		
			} 
			
			// process delete ...
			if ($this->saction == "delete" && value("back") != $lang->get("no") && ($this->editor || $this->developer)) {
				$this->deleteItem();
			} 

			if ((($this->action == "editsingle" || (value("status") == "editsingle" && $this->action != $lang->get("back"))) && $this->editor) && ! $this->forceEditAll) {
				for ($i = 0; $i < count($this->members); $i++) {
					if ($this->eid == $this->members[$i][1]) {
						$this->add(new Hidden("status", "editsingle"));
						$this->add(new Hidden("eid", $this->eid));
						$this->add(new Hidden("processing", "yes"));
						$this->getSingleEdit($this->members[$i][1]);
					}
				}
			} else {
				// draw the main view of the content-envelope
				if ($this->membersCount == 1 && $this->maxcard == 1 && $this->mincard == 1) {
					$labeltext = "<b>" . $this->name . "</b>";
					// Draw the title bar 

					$container = new HtmlContainer('box', 'headbox',2);
					// Edit-Button

					if ($this->editor && ! $this->editState) {
					    $menuLabel = crLink($lang->get("edit"), $doc . "?sid=$sid&oid=$oid&action=editsingle&eid=" . $this->members[0][1], "box");
					} else {
						$menuLabel = '&nbsp;';						
					}					
					$table = '<table width="100%" border="0" cellpadding="0" cellspacing="0">';
					$table.= '<tr><td>'.$labeltext.'</td>';
					$table.= '<td align="right"><b>'.$menuLabel.'</b></td></tr>';
					$table.= '</table>';					
					$container->add($table);					
					$this->add($container);
					$this->add(new Cell('', '', 2, 10, 10));
					$this->getSingleEdit($this->members[0][1]);
					
				// processing of lists.	
				} else {
					$labeltext = '<b>'.$this->name.'</b>';
					$container2 = new HtmlContainer('box', 'headbox',2);
					if ($this->mincard != 1 || $this->maxcard != 1) {
						$labeltext .= " &nbsp;($this->mincard - $this->maxcard)";
					}

					$menuLabel = "";

					// Add-Button
					if ($this->membersCount < $this->maxcard) {
						$toggleButton = new LinkButtonInline("toggle_create_".$this->clti, $lang->get("create_instances", "Create Instances"), "box", "button", "toggle('crinst_".$this->clti."')");
						$menuLabel .= $toggleButton->draw();
					}
									
					$table = '<table width="100%" border="0" cellpadding="0" cellspacing="0">';
					$table.= '<tr><td>'.$labeltext.'</td>';
					$table.= '<td align="right"><b>'.$menuLabel.'</b></td></tr>';
					$table.= '</table>';					
					$container2->add($table);					
					$this->add($container2);															
									
					// Add Toggle-Field
					$container = new Container(3);
					$container->add(new Label("lbl", $lang->get("number_of_instances", "Please specify how many instances you want to create"), "standardlight", 3));
					$container->add(new Input("number_of_instances".$this->clti, "1", "standardlight", 2, "", 100));

					
					if ($this->editState) {
						$createInstancesJS = "javascript:if (confirm('".$lang->get("confirm_unsaved_changes", "Note: Unsaved changes will be lost if you proceed. If you have already edited something, you may cancel now and save your work. Proceed ?")."')) { document.form1.saction.value='addci_".$this->clti."';document.form1.submit(); };";
					} else {
						$createInstancesJS = "javascript:document.form1.saction.value='addci_".$this->clti."';document.form1.submit();";
					}

					$container->add(new ButtonInCell("create_".$this->clti, $lang->get("create_instances", "Create instances"), "standardlight navelement", "button", $createInstancesJS));
					$this->add(new IDWrapper("crinst_".$this->clti, $container, "embedded", ' style="display:none;" ', 3));	
					$this->add(new Cell('clc', '', 2,10,10));					
					// draw list content
					$container0 = array();
					for ($i = 0; $i < $this->membersCount; $i++) {
						$labeltext = $this->name . '&nbsp;&nbsp;'.($i + 1) . "/" . $this->maxcard . "&nbsp;" . $this->members[$i][0] . "";

						// Draw one instance
						$table = '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
						$table.= '<tr><td width="200">'.$labeltext.'</td>';
						$table.= '<td align="right">';					
											

						$menuLabel = "";
						// Edit-Button
						if ($this->editState) {
							$menuLabel = crLink($lang->get("up"), "javascript:confirmAction('".$lang->get("confirm_unsaved_changes")."', '".$doc."?sid=$sid&oid=$oid&saction=up&eid=".$this->members[$i][1]."');", "box");
							$menuLabel .= "&nbsp;".crLink($lang->get("down"), "javascript:confirmAction('".$lang->get("confirm_unsaved_changes")."', '".$doc . "?sid=$sid&oid=$oid&saction=down&eid=" . $this->members[$i][1]."');", "box");

							$menuLabel .= "&nbsp;&nbsp" . crLink($lang->get("delete"), "javascript:if (confirm('".$lang->get("confirm_unsaved_changes")."')) { confirmAction('".$lang->get("confirm_delete", "Do you really want to delete this item?")."', '". $doc . "?sid=$sid&oid=$oid&saction=delete&eid=" . $this->members[$i][1]."') } ;", "box");
						} else {
							$menuLabel = crLink($lang->get("up"), $doc . "?sid=$sid&oid=$oid&saction=up&eid=" . $this->members[$i][1], "box");
							$menuLabel .= "&nbsp;".crLink($lang->get("down"), $doc . "?sid=$sid&oid=$oid&saction=down&eid=" . $this->members[$i][1], "box");	
							$menuLabel .= "&nbsp;&nbsp" . crLink($lang->get("delete"), "javascript:confirmAction('".$lang->get("confirm_delete", "Do you really want to delete this item?")."', '". $doc . "?sid=$sid&oid=$oid&saction=delete&eid=" . $this->members[$i][1]."');", "box");
						}
						
						if ($this->editor && !$this->editState)
							$menuLabel .= "&nbsp;".crLink($lang->get("edit"), $doc . "?sid=$sid&oid=$oid&action=editsingle&eid=" . $this->members[$i][1], "box");

						$table.= $menuLabel;				
						$table.= '</td></tr></table>';
						$container0[$i] = new HTMLContainer('subbox', 'headbox2', 2);
						$container0[$i]->add($table);
						$this->add($container0[$i]);
						$this->getSingleEdit($this->members[$i][1]);
						$this->add(new Cell('clc', '', 2, 10,10));
					}
				}
			}
		}
Exemple #4
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();
Exemple #5
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();
Exemple #6
0
    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");
}
Exemple #7
0
        $curriculum .= "\t\t\t<td >&nbsp;</td>\n";
        $colsleft--;
    }
    $curriculum .= "\n\t\t</tr>\n";
}
$curriculum .= "</table>\n" . "<br/><b>Legend:class name [class size]</b>\n" . "</div><!-- end tabs-{$divcount} -->\n\n</div><!-- end tabs div -->\n";
$tablist .= "\t</ul>\n";
$sqlCount = "select count(*) as membercount from prj_grp join prj_tutor using(prjtg_id) where prjm_id={$prjm_id}";
$rsc = $dbConn->Execute($sqlCount);
$membercount = $rsc->fields['membercount'];
//$result .="</table>\n</div>\n";
$curriculum .= "<table border='0' style='border-collapse:collapse;><thead>  <tr>\n<th class='theadleft'>&nbsp;</th>\n    <th colspan='1' class=''><input type='reset' name='reset' value='Reset'/></th>\n    <th colspan='1' class=''>{$submit_button}</th>\n  </tr>\n  <tr>\n<th class='theadleft'>&nbsp;</th>\n    <th colspan='2' class=''>\n      Owning tutor: {$ot_owner_id},&nbsp;{$ot_roepnaam} {$ot_voorvoegsel} {$ot_achternaam}\n      <input type='hidden' name='prjm_id' value='{$prjm_id}'/>\n    </th>\n  </tr></thead>\n<table>\n";
$form2Table->addText($tablist . $curriculum);
$form2Form->add($form2Table);
//$form1Table->add( $form1Form );
$form2Fieldset = new HtmlContainer("<div id='demo' style='margin:2em;background:rgba(255,255,255,0.5);'><b>Current member count ={$membercount}</b>");
$form2Fieldset->add($form2Form);
$page->addBodyComponent($form1Form);
$page->addBodyComponent($form2Fieldset);
$page->addBodyComponent(new Component('<!-- db_name=$db_name $Id: defgroup.php 1829 2014-12-28 19:40:37Z hom $ -->'));
$page->addHeadText('
<link type="text/css" href="css/pepper-grinder/jquery-ui-1.8.17.custom.css" rel="stylesheet" />	
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>
  <script>
	$(function() {
		$( "#tabs" ).tabs();
	});
	</script>
');
$page->show();
Exemple #8
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();
Exemple #9
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();
Exemple #10
0
// } 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);
$page->addBodyComponent(new Component('<!-- db_name=$db_name $Id: defmilestone.php 1723 2014-01-03 08:34:59Z hom $ -->'));
$page->show();
<?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();
Exemple #12
0
        }
        if (!$resultSet->EOF) {
            extract($resultSet->fields);
        }
    }
} else {
    extract($_POST);
}
//echo "<pre>$sql</pre>\n";
$_SESSION['prj_id'] = $prj_id;
extract(getTutorOwnerData($dbConn, $prj_id));
$isTutorOwner = $tutor == $tutor_code;
$page = new PageContainer();
$page->setTitle('Peer assessment, define project');
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$form1 = new HtmlContainer("<div>");
$input_module_code = "<input type='text' size='10' maxlength='10' class='" . $validator->validationClass('afko') . "' name='afko' value='{$afko}' title='Progress module code'/>";
$input_year = "<input type=text size='4' maxlength='4' align='right' name='year' class='" . $validator->validationClass('year') . "' value='{$year}' title='starting year of scollastic year' />";
$input_description = "<input type='text' size='30' maxlength='30' name='project_description' class='" . $validator->validationClass('project_description') . "' value='{$description}' title='module description in 30 characters'/>\n";
$input_valid_until = "<input type='text' maxlength='10' size='8' class='" . $validator->validationClass('valid_until') . "' " . "name='valid_until' id='embeddedPicker' value='{$valid_until}' title='Project entry to be used until. Date in yyyy-mm-dd format' style='text-align:right'/>\n";
$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}' />" : '';
$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);
$project_selector = getprojectSelector($dbConn, $peer_id, $prj_id);
$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}/>";
Exemple #13
0
 /**
  * @see  Requestable
  */
 public function RequestHandle()
 {
     parent::RequestHandle();
     $this->OnClick();
     // WebApplication::getApplication()->setReloadPage();
 }
Exemple #14
0
if ($resultSet === false) {
    die('Error: ' . $dbConn->ErrorMsg() . ' with ' . $sql);
}
$lang = strtolower($resultSet->fields['lang']);
$email1 = $resultSet->fields['email1'];
if (isset($resultSet->fields['email2'])) {
    $email2 = $resultSet->fields['email2'];
} else {
    $email2 = '';
}
extract($resultSet->fields, EXTR_PREFIX_ALL, 'stud');
$page_opening = "Settings/time book-keeping for {$roepnaam} {$voorvoegsel} {$achternaam} ({$snummer})";
$page = new PageContainer();
$page->setTitle('Personal settings and time book-keeping');
$script = "function splitter(task_timer_id,new_task_timer_id) {\n" . "window.open('timesplitter.php?task_timer_id='+task_timer_id+'&new_task_timer_id='+new_task_timer_id,'_blank','width=800,height=670,scrollbars')" . "}";
$scriptContainer = new HtmlContainer("<script id='tasktimerstarter' type='text/javascript'>");
$scriptContainer->add(new Component($script));
$page->addHeadComponent($scriptContainer);
$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();
$sqltt = "select distinct rtrim(afko)||':M'||milestone||':'||rtrim(task_description) as name\n" . ", prj_id||':'||milestone||':'||task_id as value,prj_id,milestone,task_id\n" . "from project_tasks join all_prj_tutor using(prj_id) join prj_grp using(snummer,prjtg_id) where snummer={$peer_id}\n" . "order by prj_id,milestone,task_id";
$taskSelector = "\n<select name='new_task_timer' title='select task to time'>\n" . getOptionList($dbConn, $sqltt, $new_task_timer) . "\n</select>\n";
$timebookTable = "";
$sql = "select afko as project,description as project_title ,task_description,task_id,id as task_timer_id,prj_id,milestone,\n" . "to_char(start_time,'YYYY-MM-DD HH24:MI:SS')::text as start_time,\n" . "to_char(stop_time,'YYYY-MM-DD HH24:MI:SS')::text as stop_time,\n" . "from_ip,\n" . "date_trunc('seconds',stop_time-start_time) as time_diff,\n" . "tsum.task_time as total_time,\n" . "psum.project_time as project_time,\n" . "time_tag,\n" . "case when start_time=time_tag then 'P' else 'Q' end as validity,\n" . "extract(month from start_time) as month\n" . "from project_tasks join project using(prj_id)\n" . "join task_timer using (snummer,prj_id,task_id) \n" . "join task_timer_sum tsum using (snummer,prj_id,milestone,task_id)\n" . "join task_timer_project_sum psum using (snummer,prj_id,milestone)\n" . "where snummer={$snummer}\n";
if ($timeorder == 'Y') {
Exemple #15
0
    $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>");
} else {
    eval("\$text = \"{$template_text}\";");
    $form1Form->addText($text);
}
$form1->add($form1Form);
$page->addBodyComponent($form1);
$form2 = new HtmlContainer("<fieldset><legend>Defined milestones and due dates.</legend>");
$form2->addText("<p>After you determined the number of milestones, select the due dates. " . "(Defaults are 14 days from now).</p>" . "<p>Weight is used in grade calculation with more milestones per project, <br/>" . "the name is optional and describes the purpose of the milestone/grade and weight.</p>");
$form2Form = new HtmlContainer("<form method='post' name='duedates' action='{$PHP_SELF}'>");
$sql = "select milestone as number, prjm_id, assessment_due,weight, milestone_name,\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('2' => array('type' => 'D', 'size' => '10'), '3' => array('type' => 'N', 'size' => '1'), '4' => array('type' => 'T', 'size' => '20'));
$datePickers = array();
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='Update' />\n" . "<input type='reset' name='reset' value='Reset' />");
$form2->add($form2Form);
$page->addBodyComponent($form2);
$page->addBodyComponent(new Component('<!-- db_name=$db_name $Id: addmilestone.php 1769 2014-08-01 10:04:30Z hom $ -->'));