<?php require_once './peerlib/peerutils.inc'; require_once 'queryToXlsx.php'; require_once 'SpreadSheetWriter.php'; require_once 'pgrowparser.php'; $_REQUEST['filetype'] = 'Excel2007'; $prjm_id = 266; $criteria = criteriaShortAsArray(getCriteria($prjm_id), 'en'); $criteria[] = 'Overall'; $sql = "select prjtg_id from prj_tutor where prjm_id={$prjm_id}"; $sql2 = ""; $resultSet = $dbConn->Execute($sql); $con = " "; while (!$resultSet->EOF) { extract($resultSet->fields); $sql2 .= $con . " select * from assessment_grade_set({$prjtg_id},6.5)\n"; $con = "union\n\t"; $resultSet->moveNext(); } //echo "<pre>$sql2</pre>\n"; $sqlt = "select s.snummer,achternaam,roepnaam,voorvoegsel,gebdat,grp_num,grade\n" . " from ({$sql2}) ags \n" . " join prj_grp using(prjtg_id,snummer)" . " join all_prj_tutor using(prjtg_id) \n" . " join student s using(snummer) order by grp_num,achternaam"; //echo "<pre>$sqlt</pre>\n"; global $ADODB_FETCH_MODE; $ADODB_FETCH_MODE = ADODB_FETCH_NUM; $spreadSheetWriter = new SpreadSheetWriter($dbConn, $sqlt); $headers = array('snummer', 'achternaam', 'roepnaam', 'voorvoegsel', 'gebdat', 'grp_num', $criteria); $filename = 'groupresult' . date('Y-m-d'); $c = array('FFC0C0FF', 'FFFFFFFF'); $spreadSheetWriter->setFilename($filename)->setTitle("Group result")->setLinkUrl("http://www.fontysvenlo.org")->setColorChangerColumn(5)->setFilename($filename)->setRowParser(new RowWithArraysPreHeadersParser($headers)); $spreadSheetWriter->processRequest();
function getTbody(){ global $DB; global $numCols; global $rightsfilter; $where = (strlen(getCriteria())) ?getCriteria() :' status = "pending" '; $where .= ' AND '.$rightsfilter; $sql = "SELECT *, CONCAT('$',estimated) as estimated FROM leads WHERE ".$where." ORDER BY company, customer"; //print $sql; $res = $DB->query($sql); $ret = '<tbody id="mtb">'."\n"; while($r = $DB->fetchNextObject($res)){ $ret .= "\t"; $ret .= '<tr id="row'.$r->id.'">'; $ret .= '<td align="center">'; $ret .= stripslashes(ws($r->id)); $ret .= '</td>'; $ret .= '<td>'; $ret .= stripslashes(ws($r->jobname)); $ret .= '</td>'; $ret .= '<td>'; $ret .= stripslashes(ws($r->company)); $ret .= '</td>'; $ret .= '<td>'; $ret .= stripslashes(ws($r->customer)); $ret .= '</td>'; $ret .= '<td>'; $ret .= ws(dateFix($r->targetdate)); $ret .= '</td>'; // the date closed field if($r->status == 'closed'){ $statushtml = dateFix($r->dateclosed); $hideclass = 'class="hideclosed"'; }else{ if(strlen($r->reason) > 0){ $repreason = ($r->reason_repid) ?'<i><small><br /><br />-'.getRep($r->reason_repid).'-</small></i>' :''; $reason = $r->reason."\n\n"; $statushtml = '<a href="#" rel="'.$reason.'" class="moreinfo" title="'.$reason.$repreason.'">'.$r->status.'</a>'; }else{ $statushtml = $r->status; } $hideclass = ''; } $ret .= '<td '.$hideclass.'>'; $ret .= ws($statushtml); $ret .= '</td>'; $ret .= '<td>'; $ret .= ws(dateFix($r->createdon)); $ret .= '</td>'; $ret .= '<td align="center">'; $ret .= ws(getRepField($r->quotedby_repid, 'LOWER(CONCAT(SUBSTRING(firstname, 1, 1), SUBSTRING(lastname, 1, 1)))')); $ret .= '</td>'; $ret .= '<td>'; $ret .= ($r->rep == 0)?'n/a':getRep($r->rep); $ret .= '</td>'; $ret .= '<td>'; $ret .= $r->estimated; $ret .= '</td>'; $ret .= '<td>'; $ret .= (strlen($r->quotefile) > 0) ?'<a href="_lib/php/forcedownload.php?filename='.stripslashes($r->quotefile).'"> <img src="images/quote_icon.png" width="16" height="16" border="0" title="view attachment" /> </a>' :ws(''); $ret .= '</td>'; $ret .= '<td id="'.$r->id.'" class="actionbt">action'; $ret .= '<input id="comments_'.$r->id.'" type="hidden" value="'.$r->comments.'" />'; // get the comments // get the project info $info = ''; $info .= 'created by: '.getRep($r->createdby_repid)."\n"; $info .= 'created on: '.dateFix($r->createdon)."\n\n"; $info .= 'last updated by: '.getRep($r->lastupdatedby_repid)."\n"; $info .= 'last updated on: '.dateFix($r->lastupdated)."\n\n"; $ret .= '<input id="info_'.$r->id.'" type="hidden" value="'.$info.'" />'; // get the prospect info $ret .= '</td>'; $ret .= '</tr>'."\n"; } // show a row with no results if(($DB->numRows($res) < 1)){ $ret .= '<tr id="nores">'; $ret.='<td colspan="'.$numCols.'" >No results found</td>'; $ret .='</tr>'; } $ret .= '</tbody>'; return $ret; }
$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); $page->addBodyComponent(new Component($tutor_Helper)); $page->addBodyComponent($nav); $criteria = getCriteria($prjm_id); $sql = "select distinct roepnaam||coalesce(' '||voorvoegsel,'')||' '||achternaam as naam,achternaam,prjtg_id\n" . "from student join judge_notready using(snummer)\n" . "where prjtg_id={$prjtg_id} order by achternaam,naam"; $resultSet = $dbConn->Execute($sql); if ($resultSet === false) { echo 'Error getting judge not ready with <pre>' . $dbConn->ErrorMsg() . ' with<br/> ' . $sql . "</pre>\n"; stacktrace(1); } $lazyjudges = '<table>'; $lazycount = $resultSet->RowCount(); if ($lazycount > 0) { while (!$resultSet->EOF) { $lazyjudges .= "\t<tr><td>" . $resultSet->fields['naam'] . "</td></tr>\n"; $resultSet->moveNext(); } $lazyjudges .= "\n<table>\n"; }
<div id="bottom"> <div style="margin-top:20px;"> <form action="savetosystem.php" method="post"> <?php include "fetchlist.php"; error_reporting(0); $hidden = $_GET["hidden"]; //echo $hidden; if ($hidden == "simplequery") { //echo $_GET['query']; $result = getMyResult($_GET["query"]); } else { //echo "in else"; $result = getResult($hidden); $criteria = getCriteria(); } $query = getQuery(); //echo $criteria; //echo $query; if (mysqli_num_rows($result) > 0) { echo "<div style=\"font-size:20px;font-weight:bold;margin-bottom:20px;\"><u>" . $criteria . "</u></div>"; echo "<table id=\"myTable\" class=\"tablesorter\" border=\"1\"><thead><tr><th>Student ID</th><th>Name</th><th>Birthdate</th><th>Email</th><th>Phone</th><th>Appointment Date</th><th>Appointment Time</th><th>Address</th><th>Reason</th><th>Appointment ID</th></tr></thead><tbody>"; while ($row = mysqli_fetch_assoc($result)) { echo "<tr><td>" . $row["student_id"] . "</td><td>" . $row["student_name"] . "</td><td> " . $row["student_dob"] . "</td><td>" . $row["student_email"] . "</td><td>" . $row["student_phone"] . "</td><td>" . $row["appointment_d"] . "</td><td>" . $row["appointment_t"] . "<td>" . $row["student_add1"] . "," . $row["student_add2"] . "," . $row["student_city"] . "," . $row["student_state"] . "," . $row["student_zip"] . "</td><td>" . $row["student_notes"] . "</td><td>" . $row["appointment_id"] . "</td></tr>"; } echo "</tbody></table>"; echo "<div style=\"margin-left:200px;margin-top:20px;float:left; \"><input type=\"text\" name=\"name\" placeholder=\" Enter List Name\" required></div> "; echo "<div style=\"margin-left:40px;margin-top:20px;float:left; \"><input type=\"submit\" value=\"Save\"></div> "; } else { echo "<div style=\"margin-top:50px;margin-left:400px;\"><P>No Appointment scheduled...</p></div>";