<commit_before>
<!DOCTYPE html>

<?php
  require_once('./connect.inc.php');

  if(isset($_POST['name']))
  {
    mysql_query("INSERT INTO `participant` VALUES (NULL, '".$_POST['name']."', '".$_POST['sex']."', '".$_POST['dob']."', '".$_POST['college']."', '".$_POST['course']."', '".$_POST['specialization']."', '".$_POST['year']."', '".$_POST['x-percentage']."', '".$_POST['x-board']."', '".$_POST['xii-percentage']."', '".$_POST['xii-board']."', '".$_POST['degree-percentage']."', '".$_POST['backlogs']."', '".$_POST['phone']."', '".$_POST['email']."', '".$_POST['c1']."', '".$_POST['c2']."', '".$_POST['c3']."', '".$_POST['c4']."', '".$_POST['c5']."')");
    unset($_POST['name']);
  }

?>
<html lang="en">
  
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="A simple registration form for SCT Job Fair" content="">
    <meta name="<NAME> and <NAME>" content="">
    <title>
      .::Job Fair Registration::.
    </title>
    <link href="./css/bootstrap.min.css"
    rel="stylesheet">
    <script type="text/javascript">
      function optselected(ele)
      {
        var called, c1, c2, c3, c4, c5, tc, i, base, eid, j;
        called = ele.id;
        tc = <?php
            $q = mysql_query("SELECT count(*) FROM `companies`");
            echo mysql_fetch_array($q)[0];
        ?>;
        c1 = document.getElementById('c1');
        c2 = document.getElementById('c2');<commit_msg>Add auto-decrement for availability<commit_after>
<!DOCTYPE html>

<?php
  require_once('./connect.inc.php');

  if(isset($_POST['name']))
  {
    mysql_query("INSERT INTO `participant` VALUES (NULL, '".$_POST['name']."', '".$_POST['sex']."', '".$_POST['dob']."', '".$_POST['college']."', '".$_POST['course']."', '".$_POST['specialization']."', '".$_POST['year']."', '".$_POST['x-percentage']."', '".$_POST['x-board']."', '".$_POST['xii-percentage']."', '".$_POST['xii-board']."', '".$_POST['degree-percentage']."', '".$_POST['backlogs']."', '".$_POST['phone']."', '".$_POST['email']."', '".$_POST['c1']."', '".$_POST['c2']."', '".$_POST['c3']."', '".$_POST['c4']."', '".$_POST['c5']."')");
    unset($_POST['name']);
    if($_POST['c1'] != "NA")
      mysql_query("UPDATE `companies` SET `available` = `available` - 1 WHERE name = '".$_POST['c1']."'");
    if($_POST['c2'] != "NA")
      mysql_query("UPDATE `companies` SET `available` = `available` - 1 WHERE name = '".$_POST['c2']."'");
    if($_POST['c3'] != "NA")
      mysql_query("UPDATE `companies` SET `available` = `available` - 1 WHERE name = '".$_POST['c3']."'");
    if($_POST['c4'] != "NA")
      mysql_query("UPDATE `companies` SET `available` = `available` - 1 WHERE name = '".$_POST['c4']."'");
    if($_POST['c5'] != "NA")
      mysql_query("UPDATE `companies` SET `available` = `available` - 1 WHERE name = '".$_POST['c5']."'");
  }

?>
<html lang="en">
  
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="A simple registration form for SCT Job Fair" content="">
    <meta name="<NAME> and <NAME>" content="">
    <title>
      .::Job Fair Registration::.
    </title>
    <link href="./css/bootstrap.min.css"
    rel="stylesheet">
    <script type="text/javascript">
      function optselected(ele)
      {
        var called, c1, c2, c3, c4, c5, tc, i, base, eid, j;
        called = ele.id;
        tc = <?php
            $q = mysql_query("SELECT count(*) FROM `companies`");
            echo mysql_fetch_array($q)[0];
        ?>;
        c1 = document.getElementById('c1');
        c2 = document.getElementById('c2');
{'fraction_non_alphanumeric': 0.28315905338470004, 'fraction_numerical': 0.01403412217941662, 'mean_word_length': 3.6424010217113665, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2784805', 'n_tokens_mistral': 1331, 'n_tokens_neox': 1300, 'n_words': 247}