<commit_before><?php

function Postulants($idGauchada=null) {
  $db = new Connection();
  $where = $idGauchada != null ? 'idGauchada='.$idGauchada.' AND validate IS NULL' : 'validate IS NULL';
  $data = $db->select('*', 'Postulants p INNER JOIN Users u ON(p.idUser = u.idUser)', $where);

  if(!$data) return false;

  for($i = 0; $i < count($data); $i++) {
    $postulantes[$i] = array(
      'idUser' => $data[$i]['idUser'],
      'idGauchada' => $data[$i]['idGauchada'],
      'completeName' => $data[$i]['name'] . ' ' . $data[$i]['surname'],
      'description' => $data[$i]['description'],
      'email' => $data[$i]['email'],
      'profilePicture' => Images()[$data[$i]['idImage']]['path']
    );
  }
  return $postulantes;
}

function Postulants_aux($idGauchada) {
  $db = new Connection();
  $where = 'idGauchada='.$idGauchada;
  $data = $db->select('*', 'Postulants', $where);

  if(!$data) return false;
  return true;
}

function Postulant($idGauchada, $idUser) {
  $postulantes = Postulants($idGauchada);
  if($postulantes) {
    foreach ($postulantes as $key => $value) {
      if($idUser == $value['idUser'])
        return true;
    }
  }
  return false;
}

function SelectedPostulant($idGauchada) {
  $db = new Connection();
  $where = 'p.idGauchada='.$idGauchada.' AND selected=1 AND validate IS NULL';
  $data = $db->select('*', 'Postulants p INNER JOIN Users u ON(p.idUser = u.idUser) LEFT JOIN Ratings r ON(p.idGauchada=r.idGauchada)', $where);

  if (!$data) return false;

  for($i = 0; $i < count($data); $i++) {
    $postulantes[$i] = array(
      'idUser' => $data[$i]['idUser'],
      'idGauchada' => $data[$i]['idGauchada'],
      'completeName' => $data[$i]['name'] . ' ' . $data[$i]['surname'],
      'email' => $data[$i]['email'],
      'description' => $data[$i]['description'],
      'profilePicture' => Images()[$data[$i]['idImage']]['path'],
      'idRating' => $data[$i]['idRating']
    );
  }
  return $postulantes;
}

function UserPostulants($idUser) {
  $db = new Connection();
  $data = $db->select('*', 'Postulants', "idUser=$idUser AND selected=1 AND validate IS NULL");
  if (!$data) return false;

  for($i = 0; $i < count($data); $i++) {
    $postulantes[$i] = array(
      'idGauchada' => $data[$i]['idGauchada'],
      'description' => $data[$i]['description'],
      'validate' => $data[$i]['validate'],
      'description' => $data[$i]['description']
    );
  }
  return $postulantes;
}

function PostulantIn($idUser, $idOwner) {
  $db = new Connection();
  $data = $db->select('u.idUser, g.idGauchada, u.name, u.surname, p.description',
                            '((Users u INNER JOIN Postulants p ON(u.idUser=p.idUser))INNER JOIN Gauchadas g ON(p.idGauchada=g.idGauchada))
                            LEFT JOIN Ratings r ON(p.idGauchada=r.idGauchada)',
                            'p.validate IS NULL AND r.idRating IS NULL AND p.idUser='.$idUser.' AND g.idUser='.$idOwner);
  if(!$data) return false;

  for($i = 0; $i < count($data); $i++) {
    $postulantes[$i] = array(
      'idUser' => $data[$i]['idUser'],
      'idGauchada' => $data[$i]['idGauchada'],
      'completeName' => $data[$i]['name'] . ' ' . $data[$i]['surname'],
      'description' => $data[$i]['description']
    );
  }
  return $postulantes;
}

function SelectedAndNotFinished($idOwner, $idUser) {
  $db = new Connection();
  $data = $db->select('p.idUser',
                      '(Gauchadas g INNER JOIN Postulants p ON (g.idGauchada=p.idGauchada))
                      LEFT JOIN Ratings r ON(p.idGauchada=r.idGauchada)',
                      "idRating IS NULL AND p.selected=1 AND g.idUser=$idOwner AND p.idUser=$idUser AND p.validate IS NULL");
  return $data? $data[0]['idUser'] : false;
}

?>
<commit_msg>Se añadio una funcion de postulantes<commit_after><?php

function Postulants($idGauchada=null) {
  $db = new Connection();
  $where = $idGauchada != null ? 'idGauchada='.$idGauchada.' AND validate IS NULL' : 'validate IS NULL';
  $data = $db->select('*', 'Postulants p INNER JOIN Users u ON(p.idUser = u.idUser)', $where);

  if(!$data) return false;

  for($i = 0; $i < count($data); $i++) {
    $postulantes[$i] = array(
      'idUser' => $data[$i]['idUser'],
      'idGauchada' => $data[$i]['idGauchada'],
      'completeName' => $data[$i]['name'] . ' ' . $data[$i]['surname'],
      'description' => $data[$i]['description'],
      'email' => $data[$i]['email'],
      'profilePicture' => Images()[$data[$i]['idImage']]['path']
    );
  }
  return $postulantes;
}

function Postulants_aux($idGauchada) {
  $db = new Connection();
  $where = 'idGauchada='.$idGauchada;
  $data = $db->select('*', 'Postulants', $where);

  if(!$data) return false;
  return true;
}

function Postulant($idGauchada, $idUser) {
  $postulantes = Postulants($idGauchada);
  if($postulantes) {
    foreach ($postulantes as $key => $value) {
      if($idUser == $value['idUser'])
        return true;
    }
  }
  return false;
}

function SelectedPostulant($idGauchada) {
  $db = new Connection();
  $where = 'p.idGauchada='.$idGauchada.' AND selected=1 AND validate IS NULL';
  $data = $db->select('*', 'Postulants p INNER JOIN Users u ON(p.idUser = u.idUser) LEFT JOIN Ratings r ON(p.idGauchada=r.idGauchada)', $where);

  if (!$data) return false;

  for($i = 0; $i < count($data); $i++) {
    $postulantes[$i] = array(
      'idUser' => $data[$i]['idUser'],
      'idGauchada' => $data[$i]['idGauchada'],
      'completeName' => $data[$i]['name'] . ' ' . $data[$i]['surname'],
      'email' => $data[$i]['email'],
      'description' => $data[$i]['description'],
      'profilePicture' => Images()[$data[$i]['idImage']]['path'],
      'idRating' => $data[$i]['idRating']
    );
  }
  return $postulantes;
}

function UserSelected($idUser) {
  $db = new Connection();
  $data = $db->select('*', 'Postulants', "idUser=$idUser AND selected=1 AND validate IS NULL");
  if (!$data) return false;

  for($i = 0; $i < count($data); $i++) {
    $postulantes[$i] = array(
      'idGauchada' => $data[$i]['idGauchada'],
      'description' => $data[$i]['description'],
      'validate' => $data[$i]['validate'],
      'description' => $data[$i]['description']
    );
  }
  return $postulantes;
}

function UserPostulantions($idUser) {
  $db = new Connection();
  $data = $db->select('*', 'Postulants', "idUser=$idUser AND validate IS NULL");
  if (!$data) return false;

  for($i = 0; $i < count($data); $i++) {
    $postulantes[$i] = array(
      'idGauchada' => $data[$i]['idGauchada'],
      'description' => $data[$i]['description'],
      'validate' => $data[$i]['validate'],
      'description' => $data[$i]['description']
    );
  }
  return $postulantes;
}

function PostulantIn($idUser, $idOwner) {
  $db = new Connection();
  $data = $db->select('u.idUser, g.idGauchada, u.name, u.surname, p.description',
                            '((Users u INNER JOIN Postulants p ON(u.idUser=p.idUser))INNER JOIN Gauchadas g ON(p.idGauchada=g.idGauchada))
                            LEFT JOIN Ratings r ON(p.idGauchada=r.idGauchada)',
                            'p.validate IS NULL AND r.idRating IS NULL AND p.idUser='.$idUser.' AND g.idUser='.$idOwner);
  if(!$data) return false;

  for($i = 0; $i < count($data); $i++) {
    $postulantes[$i] = array(
      'idUser' => $data[$i]['idUser'],
      'idGauchada' => $data[$i]['idGauchada'],
      'completeName' => $data[$i]['name'] . ' ' . $data[$i]['surname'],
      'description' => $data[$i]['description']
    );
  }
  return $postulantes;
}

function SelectedAndNotFinished($idOwner, $idUser) {
  $db = new Connection();
  $data = $db->select('p.idUser',
                      '(Gauchadas g INNER JOIN Postulants p ON (g.idGauchada=p.idGauchada))
                      LEFT JOIN Ratings r ON(p.idGauchada=r.idGauchada)',
                      "idRating IS NULL AND p.selected=1 AND g.idUser=$idOwner AND p.idUser=$idUser AND p.validate IS NULL");
  return $data? $data[0]['idUser'] : false;
}

?>

{'fraction_non_alphanumeric': 0.21233048719236564, 'fraction_numerical': 0.002134605725765947, 'mean_word_length': 3.4274596998332405, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 66, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '798701', 'n_tokens_mistral': 2918, 'n_tokens_neox': 2858, 'n_words': 593}