<commit_before><?php

class anno {

	public $subtype_ids;
	
	public $title;
	public $description;
	public $start_date;
	public $end_date;
	public $date;
	public $location;
	public $time;
	
	public $anno_id;
	
	public $anno_cb;

	public function create_announcement() {
		$this->set_info($_REQUEST, true);
		$this->insert_data();
		$this->insert_anno_subtype();
		$this->redirect();
	}
	
	public function edit_announcement() {
		$this->get_anno_id();
		$this->set_info($_REQUEST, true);
		$this->update_data();
		$this->update_anno_subtype();
		$this->redirect();
	}
	
	public function set_subtype_ids() {
		if(isset($_REQUEST['check']) && !empty($_REQUEST['check'])) { //*Check to see if the checkboxes have been checked
			$this->subtype_ids = $_REQUEST['check']; //*The checkbox data
			return 1;
		} else {                                                      //*If there is no checkbox checked, throw up an error.
			$message = "You must check a category.";
			$error->set_message($message);
			return 0;
		}	
	}
	
	public function set_info($info, $submitted) {
			if($submitted) {
				/*foreach($info as $i) { //?I don't know if this works, so manual escaping for now
					$i = mysql_real_escape_string($i);
				}*/
				$this->title = mysql_real_escape_string($info['title']);
				$this->description = mysql_real_escape_string($info['description']);
				$this->start_date = mysql_real_escape_string($info['start_date']);
				$this->end_date = mysql_real_escape_string($info['end_date']);
				$this->date = mysql_real_escape_string($info['date']);
				$this->location = mysql_real_escape_string($info['location']);
				$this->time = mysql_real_escape_string($info['time']); 
			} else {
				$this->title = $info['title'];
				$this->description = $info['description'];<commit_msg>User id<commit_after><?php

class anno {
	public $user_id;
	public $subtype_ids;
	
	public $title;
	public $description;
	public $start_date;
	public $end_date;
	public $date;
	public $location;
	public $time;
	
	public $anno_id;
	
	public $anno_cb;

	public function create_announcement() {
		$this->set_info($_REQUEST, true);
		$this->insert_data();
		$this->insert_anno_subtype();
		$this->redirect();
	}
	
	public function edit_announcement() {
		$this->get_anno_id();
		$this->set_info($_REQUEST, true);
		$this->update_data();
		$this->update_anno_subtype();
		$this->redirect();
	}
	
	public function set_subtype_ids() {
		if(isset($_REQUEST['check']) && !empty($_REQUEST['check'])) { //*Check to see if the checkboxes have been checked
			$this->subtype_ids = $_REQUEST['check']; //*The checkbox data
			return 1;
		} else {                                                      //*If there is no checkbox checked, throw up an error.
			$message = "You must check a category.";
			$error->set_message($message);
			return 0;
		}	
	}
	
	public function set_info($info, $submitted) {
			$this->user_id = $_SESSION['user_id'];
			if($submitted) {
				/*foreach($info as $i) { //?I don't know if this works, so manual escaping for now
					$i = mysql_real_escape_string($i);
				}*/
				$this->title = mysql_real_escape_string($info['title']);
				$this->description = mysql_real_escape_string($info['description']);
				$this->start_date = mysql_real_escape_string($info['start_date']);
				$this->end_date = mysql_real_escape_string($info['end_date']);
				$this->date = mysql_real_escape_string($info['date']);
				$this->location = mysql_real_escape_string($info['location']);
				$this->time = mysql_real_escape_string($info['time']); 
			} else {
				$this->title = $info['title'];
				$this->description = $info['description'];
{'fraction_non_alphanumeric': 0.16459541563104116, 'fraction_numerical': 0.0011046672190002762, 'mean_word_length': 3.914518317503392, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4523019', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1163, 'n_words': 246}