Advertisement
Advertisement
| 07.10.2008 at 03:33AM PDT, ID: 23553194 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: |
<?php
/*
Uses classes Instructor and InstructorProfile to create Excel files containing
one instructor profile per sheet.
*/
require_once("../ERW.php");
ERW::init();
ERW::checkBrowser();
ERW::localise();
if (!isset($_ERW_db)) ERW::connect();
ERW::checkValidUser();
require_once("Instructor.class.php");
require_once("InstructorProfile.class.php");
require_once("Spreadsheet/Excel/Writer.php");
$bktitle='FacProfile_'.date('Ymd'); //filename (without suffix)
$instrlist=array();
$instrid=$_REQUEST['instrid'];
function MakeSheet(&$workbook,$profile)
{
global $_ERW_userId, $D;
//Get personal info from the InstructorProfile instance.
$pinfo=$profile->i->GetPersonalInfo();
$instrid=$pinfo["id"];
$wkstitle=$pinfo["familynameen"]."_".$pinfo["givennameen"];
//Create the worksheet and establish variables for navigation.
{
$worksheet =& $workbook->addWorksheet($wkstitle);
$worksheet->setHeader($wkstitle);
$worksheet->setMargins(0.5);
$worksheet->fitToPages(1,1);
$worksheet->write(0,0,'test');//MECDEBUG
}
}
function MakeBook($instrlist,$bktitle)
{
global $_ERW_userId, $D;
//Start the book and set things up.
$workbook = new Spreadsheet_Excel_Writer();
foreach($instrlist as $instrid)
{
//Make a sheet for each instructor from the ilist
$profile=new InstructorProfile($instrid);
MakeSheet($workbook,$profile);
}
// Send HTTP headers.
$workbook->send($bktitle.".xls");
// Close the file, and by doing so, send it.
$workbook->close();
}
if(is_null($instrid))
{
if(user_in_grp($_ERW_userId, array(1,2,4,6,9)))
{
//Loop through the set of current faculty members to make list.
$q="select i.id from instructors i
inner join employees e on (i.id=e.id)
inner join people p on (i.id=p.id)
where e.departdate is null order by p.familynameen, p.givennameen;";
$rs=ERW::query($q);
while($r=$rs->fetchRow(DB_FETCHMODE_ORDERED))
{
$instrlist[]=$r[0];
}
MakeBook($instrlist,$bktitle);
}
else
{
die('You are not authorized to view all faculty profiles. Yáhá×íÕ¡¤ën¢¯»¹o1ïU_fD~[');
}
}
else //if instrid is specified, then make sure it is user's own or a privileged user
{
if(user_in_grp($_ERW_userId, array(1,2,4,6,9)) || $_ERW_userId==$instrid)
{
$instrlist[]=$instrid;
//Get data about instructor for filename.
$profile=new InstructorProfile($instrid);
$pinfo=$profile->i->GetPersonalInfo();
$bktitle.="_".$pinfo['familynameen'].$pinfo['givennameen'];
MakeBook($instrlist,$bktitle);
}
else
{
die('You are not authorized to view this faculty profile. SnYá×íÕ¡¤ën¢¯»¹o1ïU_fD~[');
}
}
?>
|