<?php

$studentFinancialTerms = [
  [
    'title' => 'Grant',
    'content' => [
      'DOES NOT have to be repaid',
      'Usually provided by the government See: <a class="underline" href="http://www.ontario.ca/page/osap-ontario-student-assistance-program">(Ontario Student Assistance Program - OSAP).</a>.',
      'Students MUST meet the funding criteria'
    ]
  ], [
    'title' => 'Bursary',
    'content' => [
      'DOES NOT have to be repaid',
      'For students with a demonstrated financial need',
      'Various needs in the application process'
    ]
  ],
  [
    'title' => 'Loan',
    'content' => [
      'MUST be repaid',
      'Repayment usually begins after you have graduated or been out of school for 6 months (Student Line of Credit through bank, OSAP, etc.)',
      'Students must meet criteria set out by the lender'
    ]
  ],
  [
    'title' => 'Award or Scholarship',
    'content' => [
      'DOES NOT have to be repaid',
      'Students must meet specific criteria, such as marks or community involvement'
    ]
  ]
];

?>

<article>

  <div class="bg-white">
    <h2 class="text-l p-4 text-red-500 font-bold">Talk to Student Services or your Educational Advisor about available funding opportunities.</h2>

    <!-- Student Financial Terms -->
    <div class="flex flex-col bg-white mb-4">

      <div class="py-4 bg-green-600 px-6">
        <p class="font-bold text-white">Financial Support For Students</p>
      </div>

      <!-- Terms Loop -->
      <div class="flex flex-1 flex-col">
        <div class="flex flex-1 flex-col gap-y-7">

          <div>
            <ul role="list" class="text-blue-900">

              <!-- Differences Loop -->
              <?php

              foreach ($studentFinancialTerms as $term) {

              ?>

                <li class="accordion terms-columns">
                  <div class="flex px-2 rounded-md justify-between">
                    <div href="" class="gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold flex items-center align-middle">
                      <p><?php echo $term['title'] ?></p>
                    </div>

                    <button class="accordion-toggle">
                      <i class="fas fa-chevron-down items-center ml-auto rounded-m px-2.5 py-2 " aria-hidden="true"></i>
                      <i class="fas fa-times items-center ml-auto rounded-md px-3 py-2" aria-hidden="true"></i>
                    </button>

                  </div>
                  <div class="accordion-content space-y-4">

                    <!-- Term Content  -->
                    <div>
                      <ul class="<?php
                                  if (count($term['content']) > 1) {
                                    echo (count($term['content']) > 1) ? 'list-disc' : '';
                                  } ?>">
                        <?php
                        foreach ($term['content'] as $info) { ?>
                          <li class="mb-2">
                            <?php echo $info ?>
                          </li>
                        <?php } ?>
                      </ul>
                    </div>
                  </div>
                </li>


              <?php } ?>

            </ul>
          </div>

        </div>
      </div>

    </div>

    <div class="px-4">
      <p>
        For more information about grants, bursaries, loans, and scholarships, talk to the financial aid office at your college or university. You can also find information on the following websites:
      </p>
      <div class="px-4 mt-4 space-y-2 py-4 bg-cadet-300">

        <p class="font-bold">Links</p>

        <ul class="space-y-2">
          <li><a class="underline" href="http://www.ontario.ca/page/osap-ontario-student-assistance-program">Ontario Student Assistance Program</a></li>
          <li><a class="underline" href="https://www.sac-isc.gc.ca/eng/1351185180120/1351685455328">Indigenous Bursaries Search Tool</a></li>
          <li><a class="underline" href="https://www.canada.ca/en/services/benefits/education/student-aid.html">Student Loan and other funding programs</a></li>
          <li><a class="underline" href="http://aboriginalstudents.ca/resources/">AboriginalStudents.ca</a></li>
          <li><a class="underline" href="https://indspire.ca/programs/students/bursaries-scholarships/">Indspire</a></li>
        </ul>

      </div>
    </div>
    
  </div>

  <div class="py-8 space-y-4 px-4 lg:w-1/2  mx-auto">
    <img class="lg:w-1/2 mx-auto" src=" <?= get_template_directory_uri() ?>/assets/images/bgs/check-all-your-options.png" alt="Online Learning">
  </div>

</article>