/**************************************************/
/** TRANSFER EQUIV GUIDE SELECTION
/**************************************************/
class GuideSchools extends React.Component {
    constructor(props) {
      super()
      this.state = { loaded:false, data:[] }
    }
    componentDidMount() {
      callDb("/api/build.php?guides=all", this);
    }
    render() {
      let linksLeft, linksRight, loading = 'Loading...';
      if(this.state.loaded){
        let sArr = this.state.data;
        loading = '';
  
        linksLeft = sArr.map(function(y, key) {
          if(sArr.length / 2 > key){
            return <div key={y.SchoolID}><Link to={'/guide/'+y.SchoolID}>{y.Name}</Link></div>
          }
        })
  
        linksRight = sArr.map(function(y, key) {
          if(sArr.length / 2 <= key){
            return <div key={y.SchoolID}><Link to={'/guide/'+y.SchoolID}>{y.Name}</Link></div>
          }
        })
      }
      return (
        <div className="main row">
          <div className="col-lg-3">
            <Sidebar />
          </div>
          <div className="col-lg-9">
            <div className="row">
              <div className="col">
                <h1>Basic Skills/General Education Transfer Credit Guides</h1>
              </div>
            </div>
            <div className="row text-left">
              <div className="col">
                <ul className="list-item-bullet">
                  <li>For students who intend eventually to enroll at Saginaw Valley State University but who will begin their related coursework elsewhere, 
                    SVSU's transfer credit guides provide important information about the classes to consider taking prior to initial enrollment.</li>
                  <li>These guides are for new, incoming students only. (Current or former SVSU students should generally reference the Degree Audit in their SVSU student portal.)</li>
                  <li>NOT all classes listed on the guide need to be completed before enrolling at SVSU.</li>
                  <li>Guides are subject to change without notice.</li>
                  <li>If you have taken courses other than those listed on the guide, your prior coursework may alter the accuracy of the guide in terms of your particular situation.</li>
                  <li>Basic Skills/General Education guides as well as academic major-specific guides may exist for a given transfer-from (sending) institution. 
                      Consulting both is strongly recommended for degree-completion efficiency.</li>
                  <li>While SVSU's academic program transfer-credit guides are specific to a particular SVSU major, they are not customized to the individual student user's academic background and prior coursework.</li>
                  <li>To ensure the most current and customized transfer credit information for yourself, all guides are best used in close consultation with an SVSU pre-admission adviser. 
                    (Maintaining regular contact with an SVSU pre-admission adviser is <strong>strongly</strong> encouraged and will allow you to plan courses for yourself that best meet your SVSU requirements.)</li>
                </ul>
              </div>
            </div>
            <div className="row mb-3">
              <div className="col pr-0">
                <strong>These BS/GE transfer-credit guides may be searched from the list below by selecting the name of your transfer-from (sending) institution.</strong>
              </div>
            </div>
            <div className="row">
              <div className="col">
              <h2>Select Institution</h2>
              </div>
            </div>
            <div className="links row">
              <div className="col-12">{ loading }</div>
              <div className="col-6">{ linksLeft }</div>
              <div className="col-6">{ linksRight }</div>
            </div>
          </div>
        </div>
      )
    }
  }
  