}); }); </script> <div class="sortable" id="sortable" style='width: 100%; padding: 5px 0px 0px 0px'> <?php $i = 1; $minSeq = 0; while ($rowBlocks = $resultBlocks->fetch()) { if ($i == 1) { $minSeq = $rowBlocks["sequenceNumber"]; } if ($hooked == FALSE) { makeBlock($guid, $connection2, $i, "plannerEdit", $rowBlocks["title"], $rowBlocks["type"], $rowBlocks["length"], $rowBlocks["contents"], $rowBlocks["complete"], "", $rowBlocks["gibbonUnitClassBlockID"], $rowBlocks["teachersNotes"]); } else { makeBlock($guid, $connection2, $i, "plannerEdit", $rowBlocks[$hookOptions["classSmartBlockTitleField"]], $rowBlocks[$hookOptions["classSmartBlockTypeField"]], $rowBlocks[$hookOptions["classSmartBlockLengthField"]], $rowBlocks[$hookOptions["classSmartBlockContentsField"]], $rowBlocks[$hookOptions["classSmartBlockCompleteField"]], "", $rowBlocks[$hookOptions["classSmartBlockIDField"]], $rowBlocks[$hookOptions["classSmartBlockTeachersNotesField"]]); } $i++; } ?> </div> <?php print "<div style='text-align: right; margin-top: 3px'>"; print "<input type='hidden' name='minSeq' value='{$minSeq}'>"; print "<input type='hidden' name='params' value='{$params}'>"; print "<input type='hidden' name='gibbonPlannerEntryID' value='{$gibbonPlannerEntryID}'>"; print "<input type='hidden' name='address' value='" . $_SESSION[$guid]["address"] . "'>"; print "</div>"; print "</form>"; print "</div>"; }
$sqlOutcomes = "SELECT gibbonOutcome.gibbonOutcomeID, gibbonOutcome.name, gibbonOutcome.category, scope, gibbonDepartment.name AS department FROM gibbonUnitOutcome JOIN gibbonOutcome ON (gibbonUnitOutcome.gibbonOutcomeID=gibbonOutcome.gibbonOutcomeID) LEFT JOIN gibbonDepartment ON (gibbonOutcome.gibbonDepartmentID=gibbonDepartment.gibbonDepartmentID) WHERE gibbonUnitID=:gibbonUnitID AND active='Y' ORDER BY sequenceNumber"; $resultOutcomes = $connection2->prepare($sqlOutcomes); $resultOutcomes->execute($dataOutcomes); } catch (PDOException $e) { print "<div class='error'>" . $e->getMessage() . "</div>"; } $unitOutcomes = $resultOutcomes->fetchall(); //Attempt auto deploy $spinCount = 0; while ($spinCount < $blockCount and $length > 0) { if (isset($blocks[$deployCount])) { if ($blocks[$deployCount][3] < 1 or $blocks[$deployCount][3] == "") { $deployCount++; } else { if ($length - $blocks[$deployCount][3] >= 0) { makeBlock($guid, $connection2, $blockCount2, $mode = "workingDeploy", $blocks[$deployCount][1], $blocks[$deployCount][2], $blocks[$deployCount][3], $blocks[$deployCount][4], "N", $blocks[$deployCount][0], "", $blocks[$deployCount][5], TRUE, $unitOutcomes, $blocks[$deployCount][6]); $length = $length - $blocks[$deployCount][3]; $deployCount++; } } } $spinCount++; $blockCount2++; } print "</div>"; print "</div>"; print "<script type='text/javascript'>"; print "var count={$blockCount2} ;"; print "</script>"; } }
} $result = $connection2->prepare($sql); $result->execute($data); } catch (PDOException $e) { print "<div class='error'>" . $e->getMessage() . "</div>"; } if ($result->rowCount() == 1) { $row = $result->fetch(); if ($hooked == FALSE) { $title = $row["title"]; $type = $row["type"]; $length = $row["length"]; $contents = $row["contents"]; $teachersNotes = $row["teachersNotes"]; } else { $title = $row[$hookOptions["unitSmartBlockTitleField"]]; $type = $row[$hookOptions["unitSmartBlockTypeField"]]; $length = $row[$hookOptions["unitSmartBlockLengthField"]]; $contents = $row[$hookOptions["unitSmartBlockContentsField"]]; $teachersNotes = $row[$hookOptions["unitSmartBlockTeachersNotesField"]]; } } } else { $title = ""; $type = ""; $length = ""; $contents = getSettingByScope($connection2, "Planner", "smartBlockTemplate"); $teachersNotes = ""; } makeBlock($guid, $connection2, $id, $mode, $title, $type, $length, $contents, "N", $gibbonUnitBlockID, "", $teachersNotes, FALSE);
die("Hack attempt blocked."); } $username = makeSafeSQL($_POST['u']); $password = strtoupper(md5($_POST['p'])); $loginCheck = sqlQuery("SELECT * FROM \"users\" WHERE \"Username\"=\"{$username}\" AND \"Password\"=\"{$password}\""); if (count($loginCheck) == 1) { $user = new User($loginCheck[0]); $_SESSION['UID'] = $user->id; header("Location: index.php?page=profile&uid=" . $user->id); exit; } else { echo makeBlock("Error", "Wrong username or password."); } } if (isset($_GET['r'])) { echo makeBlock("Success!", "You are now registered on OpenSMO. Log in <a href=\"index.php?page=login\">here</a>."); } ?> <div class="title">Login</div> <div class="block"> <div class="blocktitle">Login</div> <div class="blockcontent"> <form method="post" action="index.php?page=login"> <p>Username:<br /><input type="text" name="u" /></p> <p>Password:<br /><input type="password" name="p" /></p> <?php echoHiddenSessionkey(); ?> <input type="submit" name="login" value="Login"/> </form> </div>
html>body #sortable li { min-height: 58px; line-height: 1.2em; } #sortable .ui-state-highlight { margin-bottom: 5px; min-height: 58px; line-height: 1.2em; width: 100%; } </style> <script> $(function() { $( "#sortable" ).sortable({ placeholder: "ui-state-highlight", axis: 'y' }); }); </script> <div class="sortable" id="sortable" style='width: 100%; padding: 5px 0px 0px 0px'> <?php for ($i = 1; $i <= 5; $i++) { makeBlock($guid, $connection2, $i); } ?> </div> <div style='width: 100%; padding: 0px 0px 0px 0px'> <div class="ui-state-default_dud" style='padding: 0px; height: 40px'> <table class='blank' cellspacing='0' style='width: 100%'> <tr> <td style='width: 50%'> <script type="text/javascript"> var count=6 ; /* Unit type control */ $(document).ready(function(){ $("#new").click(function(){ $("#sortable").append('<div id=\'blockOuter' + count + '\'><img style=\'margin: 10px 0 5px 0\' src=\'<?php
$resultBlocks->execute($dataBlocks); } catch (PDOException $e) { print "<div class='error'>" . $e->getMessage() . "</div>"; } try { $dataOutcomes = array("gibbonUnitID" => $gibbonUnitID); $sqlOutcomes = "SELECT gibbonOutcome.gibbonOutcomeID, gibbonOutcome.name, gibbonOutcome.category, scope, gibbonDepartment.name AS department FROM gibbonUnitOutcome JOIN gibbonOutcome ON (gibbonUnitOutcome.gibbonOutcomeID=gibbonOutcome.gibbonOutcomeID) LEFT JOIN gibbonDepartment ON (gibbonOutcome.gibbonDepartmentID=gibbonDepartment.gibbonDepartmentID) WHERE gibbonUnitID=:gibbonUnitID AND active='Y' ORDER BY sequenceNumber"; $resultOutcomes = $connection2->prepare($sqlOutcomes); $resultOutcomes->execute($dataOutcomes); } catch (PDOException $e) { print "<div class='error'>" . $e->getMessage() . "</div>"; } $unitOutcomes = $resultOutcomes->fetchall(); $i = 1; while ($rowBlocks = $resultBlocks->fetch()) { makeBlock($guid, $connection2, $i, "masterEdit", $rowBlocks["title"], $rowBlocks["type"], $rowBlocks["length"], $rowBlocks["contents"], "N", $rowBlocks["gibbonUnitBlockID"], "", $rowBlocks["teachersNotes"], TRUE, $unitOutcomes, $rowBlocks["gibbonOutcomeIDList"]); $i++; } ?> </div> <div style='width: 100%; padding: 0px 0px 0px 0px'> <div class="ui-state-default_dud" style='padding: 0px; height: 40px'> <table class='blank' cellspacing='0' style='width: 100%'> <tr> <td style='width: 50%'> <script type="text/javascript"> var count=<?php print $resultBlocks->rowCount() + 1; ?> ; $(document).ready(function(){
<div class="header"> <h1><?php echo getSetting("Site_Title"); ?> </h1> </div> <div class="mid"> <?php if (getSetting("Site_Maintenance") && !(isMod() && getSetting("Site_Maintenance_Staff")) && !isAdmin()) { echo makeBlock("Maintenance", nl2br(getSetting("Site_Maintenance_Message") . "<br /><br /><a href=\"index.php?page=login\">Login</a>")); if (isset($_GET['page']) && $_GET['page'] == "login") { include "pages/login.php"; } } else { if (getSetting("Site_Maintenance") && (isMod() && getSetting("Site_Maintenance_Staff") || isAdmin())) { echo makeBlock("Maintenance", nl2br(getSetting("Site_Maintenance_Message")) . "<br /><br /><b>As you are a staff member, you can still see the website.</b>"); } ?> <div class="sidebar_left"> <div class="block"> <div class="blocktitle">Top 10 players</div> <div class="blockcontent"> <ol> <?php $topUsers = getTopUsers(10); foreach ($topUsers as $user) { echo "<li>" . $user->linkName() . " (" . formatInt($user->xp) . ")</li>"; } ?> </ol> </div>
print "<h3>Unit Smart Blocks</h3>"; try { $dataBlocks = array("gibbonUnitID" => $gibbonUnitID); $sqlBlocks = "SELECT * FROM gibbonUnitBlock WHERE gibbonUnitID=:gibbonUnitID ORDER BY sequenceNumber"; $resultBlocks = $connection2->prepare($sqlBlocks); $resultBlocks->execute($dataBlocks); } catch (PDOException $e) { print "<div class='error'>" . $e->getMessage() . "</div>"; } $i = 1; if ($resultBlocks->rowCount() < 1) { print "<div class='error'>There are no smart blocks in this unit.</div>"; } else { print "<p>Smart blocks are <a target='_parent' href='http://www.gibbonedu.org'>Gibbon's</a> unique method for organising the content within a unit. Each block represents an element of a lesson, perhaps an activity, a discussion or even an outcome. Here you can simply view the blocks, but if your school runs Gibbon you can use the blocks to create lessons plans, and use drag and drop to quickly move content between lessons.</p>"; while ($rowBlocks = $resultBlocks->fetch()) { makeBlock($guid, $connection2, $i, "embed", $rowBlocks["title"], $rowBlocks["type"], $rowBlocks["length"], $rowBlocks["contents"], "N", $rowBlocks["gibbonUnitBlockID"], "", $rowBlocks["teachersNotes"]); $i++; } } //Spit out outcomes try { $dataBlocks = array("gibbonUnitID" => $gibbonUnitID); $sqlBlocks = "SELECT gibbonUnitOutcome.*, scope, name, nameShort, category, gibbonYearGroupIDList FROM gibbonUnitOutcome JOIN gibbonOutcome ON (gibbonUnitOutcome.gibbonOutcomeID=gibbonOutcome.gibbonOutcomeID) WHERE gibbonUnitID=:gibbonUnitID AND active='Y' ORDER BY sequenceNumber"; $resultBlocks = $connection2->prepare($sqlBlocks); $resultBlocks->execute($dataBlocks); } catch (PDOException $e) { print "<div class='error'>" . $e->getMessage() . "</div>"; } if ($resultBlocks->rowCount() > 0) { print "<h3>Outcomes</h3>"; print "<table cellspacing='0' style='width: 100%'>";
} if ($_POST['e'] != $_POST['e2']) { echo makeBlock("Error", "Email addresses are not the same."); $okay = false; } if (isValidEmail($_POST['e'])) { echo makeBlock("Error", "Email address does not seem valid."); $okay = false; } if ($okay) { $username = makeSafeSQL($_POST['u']); $password = strtoupper(md5($_POST['p'])); $email = makeSafeSQL($_POST['e']); $existingCheck = sqlQuery("SELECT * FROM \"users\" WHERE \"Username\"='" . $username . "' OR \"Email\"='" . $email . "'"); if (count($existingCheck) != 0) { echo makeBlock("Error", "Username or email address already in use."); $okay = false; } if ($okay) { execQuery("INSERT INTO main.users (\"Username\",\"Password\",\"Email\",\"Rank\",\"XP\") VALUES('{$username}','{$password}','{$email}',0,0)"); header("Location: index.php?page=login&r"); exit; } } } ?> <div class="title">Register</div> <div class="block"> <div class="blocktitle">Login</div> <div class="blockcontent"> <form method="post" action="index.php?page=register">
} //Get outcomes try { $dataOutcomes = array("gibbonUnitID" => $gibbonUnitID); $sqlOutcomes = "SELECT gibbonOutcome.gibbonOutcomeID, gibbonOutcome.name, gibbonOutcome.category, scope, gibbonDepartment.name AS department FROM gibbonUnitOutcome JOIN gibbonOutcome ON (gibbonUnitOutcome.gibbonOutcomeID=gibbonOutcome.gibbonOutcomeID) LEFT JOIN gibbonDepartment ON (gibbonOutcome.gibbonDepartmentID=gibbonDepartment.gibbonDepartmentID) WHERE gibbonUnitID=:gibbonUnitID AND active='Y' ORDER BY sequenceNumber"; $resultOutcomes = $connection2->prepare($sqlOutcomes); $resultOutcomes->execute($dataOutcomes); } catch (PDOException $e) { print "<div class='error'>" . $e->getMessage() . "</div>"; } $unitOutcomes = $resultOutcomes->fetchall(); while ($rowLessonBlocks = $resultLessonBlocks->fetch()) { if ($hooked == FALSE) { makeBlock($guid, $connection2, $blockCount2, $mode = "workingEdit", $rowLessonBlocks["title"], $rowLessonBlocks["type"], $rowLessonBlocks["length"], $rowLessonBlocks["contents"], $rowLessonBlocks["complete"], $rowLessonBlocks["gibbonUnitBlockID"], $rowLessonBlocks["gibbonUnitClassBlockID"], $rowLessonBlocks["teachersNotes"], TRUE, $unitOutcomes, $rowLessonBlocks["gibbonOutcomeIDList"]); } else { makeBlock($guid, $connection2, $blockCount2, $mode = "workingEdit", $rowLessonBlocks[$hookOptions["classSmartBlockTitleField"]], $rowLessonBlocks[$hookOptions["classSmartBlockTypeField"]], $rowLessonBlocks[$hookOptions["classSmartBlockLengthField"]], $rowLessonBlocks[$hookOptions["classSmartBlockContentsField"]], $rowLessonBlocks["complete"], $rowLessonBlocks["gibbonUnitBlockID"], $rowLessonBlocks["gibbonUnitClassBlockID"], $rowLessonBlocks[$hookOptions["classSmartBlockTeachersNotesField"]], TRUE); } $blockCount2++; } print "</div>"; print "</div>"; $i++; } $cells = $i; } ?> <div class='linkTop' style='margin-top: 0px!important'> <?php print "<script type='text/javascript'>"; print "var count={$blockCount2} ;"; print "</script>";