Ejemplo n.º 1
0
function getClasses($ul, $parent = null)
{
    global $count_success;
    //$nodes = $ul->getElementsByTagName('ul');
    //$parent_node = $ul;
    $li = $ul->firstChild;
    $count = 0;
    while ($li) {
        $link = $li->getElementsByTagName('a');
        $span = $link->item(0)->getElementsByTagName('span');
        $cat_name = $span->item(0)->nodeValue;
        $ulnode = $li->getElementsByTagName('ul');
        //$ulnode = $ulnode->item(0);
        cat_to_csv($parent, $cat_name);
        if ($ulnode->length > 0) {
            //echo $parent.'   '.$cat_name.'  '.$ulnode->length.'<br />';
            $depth = $ulnode->item(0)->getElementsByTagName('ul');
            for ($i = 0; $i < $ulnode->length; $i++) {
                if ($ulnode->item($i)->getElementsByTagName('ul')->length === $depth->length) {
                    getClasses($ulnode->item($i), $cat_name);
                    $depth = $ulnode->item($i)->getElementsByTagName('ul');
                }
            }
        } else {
            //echo $parent.' e  '.$cat_name.'<br />';
            $enlace = $link->item(0)->getAttribute('href');
            $enlace = substr_replace($enlace, 's', 4, 0);
            file_put_contents("../file/cats_list.ccd", $enlace . PHP_EOL, FILE_APPEND);
            //var_dump($li->parentNode);
            echo $enlace . '<br />';
        }
        $li = $li->nextSibling;
        $count_success++;
    }
}
Ejemplo n.º 2
0
function getCats($DOM)
{
    $count_success = 0;
    $idname = "Accordion1";
    $menu = $DOM->getElementById($idname);
    //$finder->query("//*[contains(@id, '$classname')]");
    getClasses($menu, null);
}
<!--Body Goes Here-->
<main class="mdl-layout__content">
	<div class="bContent" style="text-align:left;">
		<?php 
if (isset($_GET['error'])) {
    echo '<h4 class="error">Error: Unable to retrieve courses due to an error.</h4>';
}
?>
 
		
		<!--Note: The title and link should be dynamically created, enclosed within the title text headers (example here is COSC 3332)-->
		<?php 
if (login_check($mysqli) == true) {
    echo '<div style="text-align:right; margin:16px 8px 0 0;">Logged ' . $logged . ' as ' . htmlentities($_SESSION['username']) . '.</div>';
    $classArray = getClasses($mysqli);
    echo '<h2>Currently Enrolled In:</h2><div style="margin: 24px 80px;">
			<div class="mdl-grid">';
    if ($classArray != 0) {
        if ($classArray['cosc3332'] == true) {
            echo '<div class="mdl-cell mdl-cell--4-col">
						<div class="mdl-card mdl-shadow--2dp" style="width: 100%;">
							<div class="mdl-card__title">
								<h2 class="mdl-card__title-text">COSC 3332</h2>
							</div>
							<div class="mdl-card__supporting-text">
								<h4>Computer Organization & Architecture</h4>
								<br />
								<br />
							</div>
							<div class="mdl-card__actions mdl-card--border">
Ejemplo n.º 4
0
if ($base) {
    ?>
                    <b>ID</b> <?php 
    echo $base['id'];
    ?>
<br/>
                    <b>Name</b> <?php 
    echo $base['name'];
    ?>
<br/>
                    <b>Category:</b> <?php 
    echo $aa_category[$base['category']];
    ?>
<br/>
                    <b>Classes:</b> <?php 
    echo getClasses($base['classes']);
    ?>
<br/>
                    <b>Races:</b> <?php 
    echo getRaces($base['races']);
    ?>
<br/>
                    <b>Deities:</b> <?php 
    echo getDeities($base['deities']);
    ?>
<br/>
                    <b>Type:</b> <?php 
    echo $aa_type[$base['type']];
    ?>
<br/>
                    <b>Charges:</b> <?php 
Ejemplo n.º 5
0
            <input type="text" name="search" id="search_box" class='search_box form-control'/>
            <button type="submit" class="btn btn-default search_button">Search</button>
            </div>


            <select name="year" class="form-control" onchange="showYear(this.value)">
                <option value="all">all years</option>
                <option value="1">First year</option>
                <option value="2">Second year</option>
                <option value="3">Third year</option>
                <option value="4">Fourth year</option>
            </select>
            <select name="class" class="form-control" onchange="showClass(this.value)">
                <option value="all">All classes</option>
                <?php 
echo getClasses();
?>
            </select>
        </form>
            <div id="txtHint">
            </div>

<script>
window.onload = showYear('all');
function showYear(str) {

    if (str == "") {
        document.getElementById("txtHint").innerHTML = "";
        return;
    } else {
        if (window.XMLHttpRequest) {
Ejemplo n.º 6
0
<?php

require '../../config.php';
require 'content.php';
switch ($_REQUEST['task']) {
    case 'get-classes':
        getClasses();
        break;
}
function getClasses()
{
    global $config, $html;
    $dir = $_SERVER['DOCUMENT_ROOT'] . '/' . $config['Template_dir'] . '/classes/';
    $files = scandir($dir);
    $exclude = array('.', '..', 'Admin.php', 'Common.php', 'Database.php', 'Website.php');
    echo '<h3>Custom Class</h3>' . "\n";
    echo '<p>' . $html['Sections']['Custom_Class'] . '</p>';
    echo '<div>' . "\n";
    echo '  <p><input type="radio" name="custom_class" value="0" /> No custom class</p>' . "\n";
    foreach ($files as $file) {
        if (!in_array($file, $exclude)) {
            echo '  <p><input type="radio" name="custom_class" value="' . $file . '" /> ' . $file . '</p>' . "\n";
        }
    }
    echo '</div>' . "\n";
}
Ejemplo n.º 7
0
<?php

session_start();
include "mysql/server.php";
include 'inc/functions.php';
$link = mysqli_connect($server, $username, $passw, $username);
include 'inc/header.php';
?>
<div class="panel"> 
	<h2><?php 
$row = getClasses($link);
if (hasClass($row, 1)) {
    printClass($row, 1);
} else {
    echo "Save class";
}
?>
</h2>
	
</div>


<?

include('inc/footer.php');

?>
Ejemplo n.º 8
0
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" >

	<style>
	body {
		margin: 10%;
	}
	thead tr td {
		font-weight: bold;
	}
	td {
		padding: 10px;
		border: 1px dotted black;
	}
	</style>
</head>
<body>

	<table>
	<?php 
$res = getClasses();
echo '<thead><tr>' . '<td>Class ID</td>' . '<td>Start Time</td>' . '<td>End Time</td>' . '<td>Credit Hours</td>' . '</tr></thead>';
while ($r = $res->fetch_assoc()) {
    // var_dump($r);
    echo "<tr><td><a href='class.php?id=" . $r['id'] . "'>" . $r['id'] . "</a></td><td>" . $r['starttime'] . "</td><td>" . $r['endtime'] . "</td><td>" . $r['credit_hours'] . "</td></tr>";
}
?>

	</table>

</body>
</html>
Ejemplo n.º 9
0
         $departmentId = $_POST[$key];
         $cou = getCourses($departmentId);
         echo generateOptionsWithSpecifiedValueField($cou, 'courseId', 'courseName');
     }
     break;
 case 'departmentIdAndReturnClassId':
     if (!empty($_POST[$key])) {
         $departmentId = $_POST[$key];
         $cla = getClasses($departmentId);
         echo generateOptionsWithSpecifiedValueField($cla, 'classId', 'className');
     }
     break;
 case 'courseIdAndReturnGradeId':
     if (!empty($_POST[$key])) {
         $departmentId = $_POST[$key];
         $gra = getClasses($departmentId);
         echo generateOptionsWithSpecifiedValueField($gra, 'gradeId', 'gradeVal');
     }
     break;
 case 'studentIdAndReturnCourseIdThatNotHaveGrade':
     if (!empty($_POST[$key])) {
         $studentId = $_POST[$key];
         $departmentId = $_POST['departmentIdAndReturnCourseIdThatNotHaveGrade'];
         $cou = getCoursesThatNotHaveGradeTheStudent($departmentId, $studentId);
         echo generateOptionsWithSpecifiedValueField($cou, 'courseId', 'courseName');
     }
     break;
 case 'studentIdAndReturnCourseIdThatHaveGrade':
     if (!empty($_POST[$key])) {
         $studentId = $_POST[$key];
         $departmentId = $_POST['departmentIdAndReturnCourseIdThatHaveGrade'];
Ejemplo n.º 10
0
}
?>
                    Classes: <?php 
echo getClasses($aa_vars['classes'], $aa_vars['berserker']);
if ($aa_vars['prereq_skill'] != 0 && $aa_vars['prereq_skill'] != 0xffffffff && $prereq_name != null) {
    $rankcheck = $aa_vars['prereq_minpoints'] > $prereq_name['max_level'];
    $classcheck = ((int) $aa_vars['classes'] & (int) $prereq_name['classes']) == 0 && ((int) $aa_vars['berserker'] & (int) $prereq_name['berserker']) == 0;
    if ($rankcheck || $classcheck) {
        ?>
                    <br/>
                    <font color="red"><b>Prerequisite Mismatch:</b><br/>
<?php 
        if ($classcheck) {
            ?>
                      Classes: <?php 
            echo getClasses($prereq_name['classes'], $prereq_name['berserker']);
        }
        if ($classcheck && $rankcheck) {
            ?>
                    - 
<?php 
        }
        if ($rankcheck) {
            ?>
                      Max Rank: <?php 
            echo $prereq_name['max_level'];
            ?>
<br/>
<?php 
        }
        ?>
Ejemplo n.º 11
0
function getClass_a($id)
{
    $tmp = getClasses($id);
    return "<a href='" . U("Index/type", array("typeid" => $tmp['id'])) . "'>" . $tmp['typename'] . "</a>";
}
Ejemplo n.º 12
0
              <th width="25%" align="center">Name</th>
              <th width="4%" align="center">Lvl</th>
              <th width="4%" align="center">Rks</th>
              <th width="7%" align="center">Prereq</th>
              <th width="25%" align="center">Classes</th>
              <th width="20%" align="center">Expansion</th>
            </tr>
            <? $x=0; foreach($results as $result): extract($result);?>
            <tr bgcolor="#<? echo ($x % 2 == 0) ? "CCCCCC" : "AAAAAA"; $x++;?>">
              <td align="center"><?=$skill_id?></td>
              <td></td>
              <td><a href="javascript:parent.document.getElementById('searchtarget').value=<?=$skill_id?>;parent.hideSearch()" title="Click to copy to What field below"><?=$name?></a></td>
              <td align="center"><?=$class_type?></td>
              <td align="center"><?=$max_level?></td>
              <td align="center"><?=$prereq_skill?></td>
              <td><?=getClasses($classes, $berserker);?></td>
              <td align="center"><?=getExpansionName($aa_expansion);?></td>
            </tr>
            <?endforeach;?>
          </table>

<?
  }
}
?>

<br>
<center>
<table>
  <tr>
    <td>
Ejemplo n.º 13
0
    if (!hasACL('teacher_panel', 'R', 'S') && !hasACL('class', 'R', 'S')) {
        sro('/Pages/restricted/student.php');
        die("");
    }
} else {
    sro('/Pages/restricted/logged-out.php');
    die("");
}
?>
<header>
	<h1>Select a Class</h1>
</header>
<article>
	<select id="select-class">
		<?php 
$c = getClasses($suid);
foreach ($c as $a) {
    echo "<option value=" . $a['id'] . ">" . $a['name'] . "</option>";
}
?>
	</select>
	<button onclick="window.location.href='/classes.php?class=' + $('#select-class').val();">View Class</button>
	<?php 
if (hasACL('teacher_panel', 'W', 'S')) {
    ?>
			<p>--OR--</p>
			<button onclick="window.location.href='/create_class.php';">Create Class</button>
	<?php 
}
?>
</article>
Ejemplo n.º 14
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_once 'Partecipants-exp/functions/rows.inc.php';
/****** Controller ******/
if (!CheckTourSession()) {
    print get_text('CrackError');
    exit;
}
$error = 0;
$divisions = getDivisions();
$classes = getClasses();
if ($divisions === false || $classes === false) {
    $error = 1;
    $divisions = array('--' => '--');
    $classes = array('--' => array('val' => '--', 'valid' => '--'));
}
/****** End Controlloer ******/
/****** Output ******/
$xmlDoc = new DOMDocument('1.0', 'UTF-8');
$xmlRoot = $xmlDoc->createElement('response');
$xmlDoc->appendChild($xmlRoot);
// Sezione header
$xmlHeader = $xmlDoc->createElement('header');
$xmlRoot->appendChild($xmlHeader);
$node = $xmlDoc->createElement('error', $error);
$xmlHeader->appendChild($node);
// Sezione combos
$xmlCombos = $xmlDoc->createElement('combos');
$xmlRoot->appendChild($xmlCombos);
// divisions
Ejemplo n.º 15
0
            ?>
</a></td>
              <td align="center"><?php 
            echo $class_type;
            ?>
</td>
              <td align="center"><?php 
            echo $max_level;
            ?>
</td>
              <td align="center"><?php 
            echo $prereq_skill;
            ?>
</td>
              <td><?php 
            echo getClasses($classes, $berserker);
            ?>
</td>
              <td align="center"><?php 
            echo getExpansionName($aa_expansion);
            ?>
</td>
            </tr>
            <?php 
        }
        ?>
          </table>

<?php 
    }
}
Ejemplo n.º 16
0
}
$rewriteController = false;
$pathToController = DIR_SYSTEM . 'engine/controller.php';
$searchLine = 'abstract class Controller {';
$catalogPath = 'catalog/';
$adminPath = 'admin/';
$properties = array('string $id', 'string $template', 'array $children', 'array $data', 'string $output', 'Loader $load');
$html = '<html><head><script type="text/javascript" src="catalog/view/javascript/jquery/jquery-2.1.1.min.js"></script>
</head><body>';
if (is_writable($pathToController)) {
    $rewriteController = true;
}
$catalogModels = getModels();
$adminModels = getModels(str_ireplace($catalogPath, $adminPath, DIR_APPLICATION));
$startupClasses = getClasses(DIR_SYSTEM . 'startup.php');
$registryClasses = getClasses('index.php');
$textToInsert = array_unique(array_merge($properties, $startupClasses, $registryClasses, $catalogModels, $adminModels));
if ($rewriteController) {
    //get line number where start Controller description
    $fp = fopen($pathToController, 'r');
    $lineNumber = getLineOfFile($fp, $searchLine);
    fclose($fp);
    //regenerate Controller text with properties
    $file = new SplFileObject($pathToController);
    $file->seek($lineNumber);
    $tempFile = sprintf("<?php %s \t/**%s", PHP_EOL, PHP_EOL);
    foreach ($textToInsert as $val) {
        $tempFile .= sprintf("\t* @property %s%s", $val, PHP_EOL);
    }
    $tempFile .= sprintf("\t**/%s%s%s", PHP_EOL, $searchLine, PHP_EOL);
    while (!$file->eof()) {
Ejemplo n.º 17
0
}
?>
            <input type="text" name="className" placeholder="Class Name"><br>
            <input type="submit" name="submit" value="rename">
        </form>
    </div>


    <div class="class" id="remove">
        <h4>Remove Class</h4>
        <form action="manageClassesSubmit.php" method="post">
            <?php 
if (isLoginAsAdmin()) {
    echo generateDropDownListWithFirstOption(getAllUniversitiesNames(), "Select University", 'selectedUniversity', 'selectedUniversityRemove');
    echo generateDropDownListWithFirstOption(null, "Select University First", 'selectedDepartmentId', 'selectedDepartmentRemove');
    echo generateDropDownListWithFirstOption(null, "Select Department First", 'selectedClassId', 'selectedClassRemove');
} else {
    if (isLoginAsSecretary()) {
        $departmentId = $_SESSION["departmentId"];
        echo "<input type='hidden' name='selectedDepartmentId' value='{$departmentId}'>";
        echo generateDropDownListWithSpecifiedValueKey(getClasses($departmentId), 'selectedClassId', 'selectedClassRemove', 'classId', 'className');
    }
}
?>
            <input type="submit" name="submit" class="warningButton" value="remove">
        </form>
    </div>
</div>

<?php 
include 'footer.php';