<commit_before><?php
require_once('settings.php');
require_once('class.Connection.php');

class ATC {

       public static function getAll() {
                $query = "SELECT * FROM atc GROUP BY ident";
                $query_values = array();
                 try {
                        $Connection = new Connection();
                        $sth = Connection::$db->prepare($query);
                        $sth->execute($query_values);
                } catch(PDOException $e) {
                        return "error : ".$e->getMessage();
                }
                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
                return $all;
        }

       public static function add($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '') {
    		$info = preg_replace('/[^(\x20-\x7F)]*/','',$info);
    		$info = str_replace('^','<br />',$info);
                $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name)";
                $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type);
                 try {
                        $Connection = new Connection();
                        $sth = Connection::$db->prepare($query);<commit_msg>Type is null if empty for ATC<commit_after><?php
require_once('settings.php');
require_once('class.Connection.php');

class ATC {

       public static function getAll() {
                $query = "SELECT * FROM atc GROUP BY ident";
                $query_values = array();
                 try {
                        $Connection = new Connection();
                        $sth = Connection::$db->prepare($query);
                        $sth->execute($query_values);
                } catch(PDOException $e) {
                        return "error : ".$e->getMessage();
                }
                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
                return $all;
        }

       public static function add($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '') {
    		$info = preg_replace('/[^(\x20-\x7F)]*/','',$info);
    		$info = str_replace('^','<br />',$info);
    		if ($type == '') $type = NULL;
                $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name)";
                $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type);
                 try {
                        $Connection = new Connection();
                        $sth = Connection::$db->prepare($query);
{'fraction_non_alphanumeric': 0.1842524705132292, 'fraction_numerical': 0.001912655403251514, 'mean_word_length': 2.310126582278481, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 35, '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': '1640918', 'n_tokens_mistral': 986, 'n_tokens_neox': 943, 'n_words': 151}