class adviser Network Admin A.S

by pat spag

HTML

<h1>
Network Server Administration, A.S. CertificateAdvisor 
</h1>
<br/>
If you have taken a class in this list - or an equivalent to the course, then click the checkbox. Available courses will automatically be enabled.
<br/>
<div id="box"></div>

CSS

input:enabled + label {
  margin: 20px auto;
  background: rgb(255, 255, 0);
}

input:disabled + label {
  opacity: 0.5;
  background: rgb(255, 0, 0);
}

input[type="checkbox"]:checked + label {
  background: rgb(153, 204, 102);
  font-weight: bold;
}

JavaScript

//start code from Dr Ron Eglin

$(document).ready(function() {
  // executes when HTML-Document is loaded and DOM is ready
  createList();
});

var courselist = [
{
  "Course": "CTS2306",
  "Name": "Microsoft Windows Professional",
}, {
  "Course": "CTS2320",
  "Name": "Managing and Maintaining a Win Net Infrastructure",
}, {
  "Course": "EGS1000",
  "Name": "Professional Performance for Technicians",
}, {
  "Course": "CTS2328",
  "Name": "Managing and Maintaining a Windows Network Environment	",
}, {
  "Course": "CTS2321",
  "Name": "Linux Fundamentals (CORE CLASS)"
},{
  "Course": "CET1600",
  "Name": "Network Plus(CORE CLASS)"
},{
  "Course": "CIS2350",
  "Name": "Principles of Information Assurance",
  "PreReq": ["CTS2321","CET1600"]
}, {
  "Course": "CTS2370",
  "Name": "Virtualization Infrastructure: Installation and Configuration",
  "PreReq": ["CET1600", "CTS2321"],
}, {
  "Course": "CET2660",
  "Name": "Fundamentals of Network Security",
  "PreReq": ["CET1600", "CTS2321"]
}, {
  "Course": "CIS2381",
  "Name": "Foundations of Digital Forensics",
  "PreReq": ["CET1600", "CTS2321"]
}, {
  "Course": "CNT2402",
  "Name": "Certified Ethical Hacker",
  "PreReq": ["CET1600", "CTS2321"]
}, {
  "Course": "CTS2310",
  "Name": "Designing Windows Network Security",
  "PreReq": ["CET1600", "CTS2321"]
}, ]

function createList() {

  for (var i = 0; i < courselist.length; i++) {

    var _disabled = true;
    if (courselist[i].PreReq == null) {
      _disabled = false;
    }

    addCheckbox(courselist[i].Name, courselist[i].Course, _disabled)
  }
}

function addCheckbox(_name, _id, _disabled) {
  var container = $('#box');


  $('<input />', {
    type: 'checkbox',
    id: _id,
    value: _name,
    disabled: _disabled,
    class: 'checkbox'
  }).appendTo(container);

  $('<label />', {
    'for': _id,
    text: _id + ' ' + _name
  }).appendTo(container);

  container.append('<br/>');
}

$("#box").delegate("input", "click", function() {
  CC();
});

function...