<commit_before><?php
	include_once "base_site.inc.php";

	class SearchSite extends BaseSite {
		function title() {
			parent::title();
			echo " - Szukaj";
		}

		function add_document() {
			if (is_logged()) {
				?>
<input type='button' id='document_add_button' class='submit' value='Dodaj dokument'>

<script>
	document_add_active = false;

	$('#document_add_button').click(function() {
		if (document_add_active) {
			return;
		}

		document_add_active = true;
		$('body').append("\
<div class='absolute_popup_dialog document_add' id='document_add'>\
<div class='dialog'>\
<form id='document_add_form'>\
<table>\
<tr><th colspan=2>Nowy dokument</th></tr>\
<tr><td>Sygnatura:</td><td><input type='text' id='document_add_signature'></td></tr>\
<tr><td>Data od:</td><td><input type='date' id='document_add_date_from'></td></tr>\
<tr><td>Data do:</td><td><input type='date' id='document_add_date_to'></td></tr>\
<tr><td colspan=2>Opis:</td></tr>\
<tr><td colspan=2><textarea id='document_add_description' class='document_add_description'></textarea></td></tr>\
<tr><td colspan=2 class='submit'><input type='submit' value='Dodaj' class='submit'>\
	<input type='button' id='document_add_cancel' value='Zamknij' class='submit'></td></tr>\
</table>\
</form>\
</div>\
</div>\
		");

		$('#document_add_form').submit(function() {
			$('#error').text('');

			signature = $('#document_add_signature').val();
			date_from = $('#document_add_date_from').val();
			date_to = $('#document_add_date_to').val();
			description = $('#document_add_description').val();

			if (signature === '') {
				$('#error').text('sygnatura nie może być pusta');
				return false;
			}

			if (date_from === '' || date_to === '') {<commit_msg>add format to date_from and date_to<commit_after><?php
	include_once "base_site.inc.php";

	class SearchSite extends BaseSite {
		function title() {
			parent::title();
			echo " - Szukaj";
		}

		function add_document() {
			if (is_logged()) {
				?>
<input type='button' id='document_add_button' class='submit' value='Dodaj dokument'>

<script>
	document_add_active = false;

	$('#document_add_button').click(function() {
		if (document_add_active) {
			return;
		}

		document_add_active = true;
		$('body').append("\
<div class='absolute_popup_dialog document_add' id='document_add'>\
<div class='dialog'>\
<form id='document_add_form'>\
<table>\
<tr><th colspan=2>Nowy dokument</th></tr>\
<tr><td>Sygnatura:</td><td><input type='text' id='document_add_signature'></td></tr>\
<tr><td>Data od [mm/dd/yyyy]:</td><td><input type='date' id='document_add_date_from'></td></tr>\
<tr><td>Data do [mm/dd/yyyy]:</td><td><input type='date' id='document_add_date_to'></td></tr>\
<tr><td colspan=2>Opis:</td></tr>\
<tr><td colspan=2><textarea id='document_add_description' class='document_add_description'></textarea></td></tr>\
<tr><td colspan=2 class='submit'><input type='submit' value='Dodaj' class='submit'>\
	<input type='button' id='document_add_cancel' value='Zamknij' class='submit'></td></tr>\
</table>\
</form>\
</div>\
</div>\
		");

		$('#document_add_date_from').datepicker();
		$('#document_add_date_to').datepicker();

		$('#document_add_form').submit(function() {
			$('#error').text('');

			signature = $('#document_add_signature').val();
			date_from = $('#document_add_date_from').val();
			date_to = $('#document_add_date_to').val();
			description = $('#document_add_description').val();

			if (signature === '') {
				$('#error').text('sygnatura nie może być pusta');
				return false;
			}

			if (date_from === '' || date_to === '') {
{'fraction_non_alphanumeric': 0.2263939478845615, 'fraction_numerical': 0.002241524236480807, 'mean_word_length': 5.672897196261682, 'pattern_counts': {'":': 0, '<': 107, '<?xml version=': 0, '>': 107, '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': '7603211', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1247, 'n_words': 205}