aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--justice_main.py2
-rw-r--r--main.py63
-rw-r--r--models.py15
-rw-r--r--templates/extract-actual.html17
-rw-r--r--templates/extract.html17
-rw-r--r--templates/most_common_activity.html24
-rw-r--r--templates/most_common_addresses.html6
-rw-r--r--templates/most_common_business.html24
-rw-r--r--templates/most_common_purpose.html4
-rw-r--r--templates/oldest_companies.html4
-rw-r--r--templates/results2.html4
-rw-r--r--templates/search_form.html4
-rw-r--r--templates/trivia.html3
13 files changed, 149 insertions, 38 deletions
diff --git a/justice_main.py b/justice_main.py
index 16b9a84..f668140 100644
--- a/justice_main.py
+++ b/justice_main.py
@@ -9,6 +9,6 @@ def main():
DB_name = "justice.db"
create_DB(DB_name)
- # download_data(typy_po, soudy)
+ download_data(typy_po, soudy)
update_DB(typy_po, soudy, DB_name)
main() \ No newline at end of file
diff --git a/main.py b/main.py
index a259134..46e3ad3 100644
--- a/main.py
+++ b/main.py
@@ -163,7 +163,28 @@ def search_results(search):
else:
table = Results(results)
table.border = True
- return render_template("results2.html", results=results, form=search, zapsano_od=zapsano_od, zapsano_do=zapsano_do)
+ return render_template("results2.html", results=results, form=search, zapsano_od=zapsano_od, zapsano_do=zapsano_do, show_form = True)
+
+@app.route('/results-sidlo-<int:adresa_id>', methods=['GET', 'POST'])
+def search_results_sidlo(adresa_id):
+ search = JusticeSearchForm(request.form)
+
+ results = []
+ qry = Company.query
+ qry = qry.join(Sidlo_Association, Company.sidlo_text)
+ qry = qry.filter(Sidlo_Association.vymaz_datum == 0)
+ qry = qry.join(Adresy_v2, Sidlo_Association.sidlo_text)
+ qry = qry.filter(Adresy_v2.id == adresa_id)
+ results = qry.all()
+
+ if not results:
+ flash('No results found!')
+ return redirect('/')
+
+ else:
+ table = Results(results)
+ table.border = True
+ return render_template("results2.html", results=results, form=search, show_form = False)
@app.route("/<int:ico>", methods=['GET', 'POST'])
def extract(ico):
@@ -199,6 +220,16 @@ def find_most_common_purpose():
most_common_purpose = count_common_purpose()
return render_template("most_common_purpose.html", most_common_purpose = most_common_purpose)
+@app.route("/most_common_business", methods=['GET', 'POST'])
+def find_most_common_business():
+ most_common_business = count_common_business()
+ return render_template("most_common_business.html", most_common_business = most_common_business)
+
+@app.route("/most_common_activity", methods=['GET', 'POST'])
+def find_most_common_activity():
+ most_common_activity = count_common_activity()
+ return render_template("most_common_activity.html", most_common_activity = most_common_activity)
+
def count_number_entries():
engine = create_engine('sqlite:///justice.db', echo=True)
conn = engine.connect()
@@ -217,10 +248,38 @@ def count_common_addresses():
qry = Adresy_v2.query
qry = qry.filter(Adresy_v2.id == elem[0])
selected_address = qry.all()
- addresses_frequency.append((selected_address[0], elem[1]))
+ addresses_frequency.append((selected_address[0], elem[1], elem[0]))
conn.close()
return addresses_frequency
+def count_common_business():
+ engine = create_engine('sqlite:///justice.db', echo=True)
+ conn = engine.connect()
+ text_instruction = text("SELECT predmet_podnikani_id, COUNT(`predmet_podnikani_id`) AS `value_occurrence` FROM predmety_podnikani_relation INNER JOIN predmety_podnikani ON predmety_podnikani_relation.predmet_podnikani_id=predmety_podnikani.id WHERE vymaz_datum = 0 GROUP BY `predmet_podnikani_id` ORDER BY `value_occurrence` DESC LIMIT 100;")
+ result = conn.execute(text_instruction).fetchall()
+ business_frequency = []
+ for elem in result:
+ qry = Predmet_Podnikani.query
+ qry = qry.filter(Predmet_Podnikani.id == elem[0])
+ selected_business = qry.all()
+ business_frequency.append((selected_business[0].predmet_podnikani, elem[1]))
+ conn.close()
+ return business_frequency
+
+def count_common_activity():
+ engine = create_engine('sqlite:///justice.db', echo=True)
+ conn = engine.connect()
+ text_instruction = text("SELECT predmet_cinnosti_id, COUNT(`predmet_cinnosti_id`) AS `value_occurrence` FROM predmety_cinnosti_relation INNER JOIN predmety_cinnosti ON predmety_cinnosti_relation.predmet_cinnosti_id=predmety_cinnosti.id WHERE vymaz_datum = 0 GROUP BY `predmet_cinnosti_id` ORDER BY `value_occurrence` DESC LIMIT 100;")
+ result = conn.execute(text_instruction).fetchall()
+ activity_frequency = []
+ for elem in result:
+ qry = Predmet_Cinnosti.query
+ qry = qry.filter(Predmet_Cinnosti.id == elem[0])
+ selected_activity = qry.all()
+ activity_frequency.append((selected_activity[0].predmet_cinnosti, elem[1]))
+ conn.close()
+ return activity_frequency
+
def count_common_purpose():
engine = create_engine('sqlite:///justice.db', echo=True)
conn = engine.connect()
diff --git a/models.py b/models.py
index fdd7307..794955f 100644
--- a/models.py
+++ b/models.py
@@ -119,7 +119,6 @@ class Ucel_Association(db.Model):
ucel = db.relationship("Ucel")
company = db.relationship("Company")
-
class Sidlo_Association(db.Model):
__tablename__ = 'sidlo_relation'
id = db.Column(db.Integer, primary_key=True)
@@ -478,6 +477,20 @@ class Fyzicka_Osoba(db.Model):
prijmeni = db.Column(db.String)
titul_za = db.Column(db.String)
datum_naroz = db.Column(MyType)
+ def __repr__(self):
+ joined_name = ""
+ if self.titul_pred != "0" and self.titul_pred != None:
+ joined_name += self.titul_pred + " "
+ if self.jmeno != "0" and self.jmeno != None:
+ joined_name += self.jmeno + " "
+ if self.prijmeni != "0" and self.prijmeni != None:
+ joined_name += self.prijmeni
+ if self.titul_za != "0" and self.titul_za != None:
+ joined_name += ", " + self.titul_za
+ if self.datum_naroz != 0 and self.datum_naroz != None and self.datum_naroz != "":
+ joined_name += ", nar. " + self.datum_naroz
+ return joined_name
+
class Pravnicka_Osoba(db.Model):
__tablename__ = "pravnicke_osoby"
diff --git a/templates/extract-actual.html b/templates/extract-actual.html
index af8e810..62133bb 100644
--- a/templates/extract-actual.html
+++ b/templates/extract-actual.html
@@ -287,8 +287,7 @@
{% if statutarni_organ_notes[i].clenove[j].vymaz_datum == 0 %}
<tr>
<td style = padding-left:2em>{% if statutarni_organ_notes[i].clenove[j].funkce != "0" %} {{ statutarni_organ_notes[i].clenove[j].funkce }} {% endif %}</td>
- <td>{% if statutarni_organ_notes[i].clenove[j].jmeno.jmeno != "0" %}{{ statutarni_organ_notes[i].clenove[j].jmeno.jmeno }} {% endif %}
- {{ statutarni_organ_notes[i].clenove[j].jmeno.prijmeni }}{% if statutarni_organ_notes[i].clenove[j].jmeno.datum_naroz != "" %}, nar. {{ statutarni_organ_notes[i].clenove[j].jmeno.datum_naroz }}{% endif %} <br>
+ <td>{{ statutarni_organ_notes[i].clenove[j].jmeno }}<br>
{{ statutarni_organ_notes[i].clenove[j].adresa }}
{% if statutarni_organ_notes[i].clenove[j].funkce_od != 0 %}<br>Den vzniku funkce: {{ statutarni_organ_notes[i].clenove[j].funkce_od}}{% endif %}
{% if statutarni_organ_notes[i].clenove[j].clenstvi_od != 0 %}<br>Den vzniku členství: {{ statutarni_organ_notes[i].clenove[j].clenstvi_od}}{% endif %}</td>
@@ -341,8 +340,7 @@
{% if dozorci_rada_notes[i].clenove[j].vymaz_datum == 0 %}
<tr>
<td style = padding-left:2em>{% if dozorci_rada_notes[i].clenove[j].funkce != "0" %} {{dozorci_rada_notes[i].clenove[j].funkce }} {% endif %}</td>
- <td>{% if dozorci_rada_notes[i].clenove[j].jmeno.jmeno != 0 %}{{ dozorci_rada_notes[i].clenove[j].jmeno.jmeno }} {% endif %}
- {{ dozorci_rada_notes[i].clenove[j].jmeno.prijmeni }}{% if dozorci_rada_notes[i].clenove[j].jmeno.datum_naroz != "" %}, nar. {{ dozorci_rada_notes[i].clenove[j].jmeno.datum_naroz }}{% endif %} <br>
+ <td>{{ dozorci_rada_notes[i].clenove[j].jmeno }}<br>
{{ dozorci_rada_notes[i].clenove[j].adresa }}
{% if dozorci_rada_notes[i].clenove[j].funkce_od != 0 %}<br>Den vzniku funkce: {{ dozorci_rada_notes[i].clenove[j].funkce_od}}{% endif %}
{% if dozorci_rada_notes[i].clenove[j].clenstvi_od != 0 %}<br>Den vzniku členství: {{ dozorci_rada_notes[i].clenove[j].clenstvi_od}}{% endif %}</td>
@@ -372,8 +370,7 @@
{% for i in range (prokurist_notes|length) %}
<tr>
<td>{% if i == 0%}Prokura:{% endif %}</td>
- <td>{% if prokurist_notes[i].jmeno.jmeno != "0" %}{{ prokurist_notes[i].jmeno.jmeno }} {% endif %}
- {{ prokurist_notes[i].jmeno.prijmeni }}{% if prokurist_notes[i].jmeno.datum_naroz != "" %}, nar. {{ prokurist_notes[i].jmeno.datum_naroz }}{% endif %}<br>
+ <td>{{ prokurist_notes[i].jmeno}}<br>
{{ prokurist_notes[i].adresa }}{% if prokurist_notes[i].text_prokurista != "0" %}<br>{{ prokurist_notes[i].text_prokurista }}{% endif %}</td>
</tr>
{% endfor %}
@@ -393,9 +390,7 @@
{% for i in range (sole_shareholder_notes|length) %}
<tr>
<td>{% if i == 0%}Jediný akcionář:{% endif %}</td>
- <td>{% if sole_shareholder_notes[i].akcionar_po_id == None %}
- {% if sole_shareholder_notes[i].jmeno.jmeno != "0" %}{{ sole_shareholder_notes[i].jmeno.jmeno }} {% endif %}
- {{ sole_shareholder_notes[i].jmeno.prijmeni }}{% if sole_shareholder_notes[i].jmeno.datum_naroz != "" %}, nar. {{ sole_shareholder_notes[i].jmeno.datum_naroz }}{% endif %} {% endif %}
+ <td>{% if sole_shareholder_notes[i].akcionar_po_id == None %}{{ sole_shareholder_notes[i].jmeno }}{% endif %}
{% if sole_shareholder_notes[i].akcionar_fo_id == None %} {{ sole_shareholder_notes[i].oznaceni_po.nazev }}{% if sole_shareholder_notes[i].oznaceni_po.reg_cislo != 0 %}, reg č. {{ sole_shareholder_notes[i].oznaceni_po.reg_cislo }}{% endif %}{% if sole_shareholder_notes[i].oznaceni_po.ico != 0 %}, IČ <a href="/{{ sole_shareholder_notes[i].oznaceni_po.ico }}-actual">{{ sole_shareholder_notes[i].oznaceni_po.ico }}</a>{% endif %} {% endif %}
<br>{{sole_shareholder_notes[i].adresa}}</td>
</tr>
@@ -412,9 +407,7 @@
{% for i in range (spolecnici_notes|length) %}
<tr>
<td style = padding-left:2em>Společník:</td>
- <td>{% if spolecnici_notes[i].spolecnik_po_id == None %}
- {% if spolecnici_notes[i].jmeno.jmeno != "0" %}{{ spolecnici_notes[i].jmeno.jmeno }} {% endif %}
- {{ spolecnici_notes[i].jmeno.prijmeni }}{% if spolecnici_notes[i].jmeno.datum_naroz != "" %}, nar. {{ spolecnici_notes[i].jmeno.datum_naroz }}{% endif %} {% endif %}
+ <td>{% if spolecnici_notes[i].spolecnik_po_id == None %}{{ spolecnici_notes[i].jmeno }}{% endif %}
{% if spolecnici_notes[i].spolecnik_fo_id == None %} {{ spolecnici_notes[i].oznaceni_po.nazev }}{% if spolecnici_notes[i].oznaceni_po.reg_cislo != 0 %}, reg č. {{ spolecnici_notes[i].oznaceni_po.reg_cislo }}{% endif %}{% if spolecnici_notes[i].oznaceni_po.ico != 0 %}, IČ <a href="/{{ spolecnici_notes[i].oznaceni_po.ico }}-actual">{{ spolecnici_notes[i].oznaceni_po.ico }}</a>{% endif %} {% endif %}
<br>{{spolecnici_notes[i].adresa}}</td>
</tr>
diff --git a/templates/extract.html b/templates/extract.html
index 871b172..1215986 100644
--- a/templates/extract.html
+++ b/templates/extract.html
@@ -256,8 +256,7 @@
{% set underlne_style_close = "" %}
{% endif %}
<td>{{ underlne_style_open|safe }}
- {% if row.statutarni_organ_text[i].clenove[j].jmeno.jmeno != "0" %}{{ row.statutarni_organ_text[i].clenove[j].jmeno.jmeno }} {% endif %}
- {{ row.statutarni_organ_text[i].clenove[j].jmeno.prijmeni }}{% if row.statutarni_organ_text[i].clenove[j].jmeno.datum_naroz != "" %}, nar. {{ row.statutarni_organ_text[i].clenove[j].jmeno.datum_naroz }}{% endif %} <br>
+ {{ row.statutarni_organ_text[i].clenove[j].jmeno }}<br>
{{ row.statutarni_organ_text[i].clenove[j].adresa }}
{% if row.statutarni_organ_text[i].clenove[j].funkce_od != 0 %}<br>Den vzniku funkce: {{ row.statutarni_organ_text[i].clenove[j].funkce_od}}{% endif %}
{% if row.statutarni_organ_text[i].clenove[j].funkce_do != 0 %}<br>Den zániku funkce: {{ row.statutarni_organ_text[i].clenove[j].funkce_do}}{% endif %}
@@ -341,8 +340,7 @@
{% set underlne_style_close = "" %}
{% endif %}
<td>{{ underlne_style_open|safe }}
- {% if row.dozorci_rada_text[i].clenove[j].jmeno.jmeno != "0" %}{{ row.dozorci_rada_text[i].clenove[j].jmeno.jmeno }} {% endif %}
- {{ row.dozorci_rada_text[i].clenove[j].jmeno.prijmeni }}{% if row.dozorci_rada_text[i].clenove[j].jmeno.datum_naroz != "" %}, nar. {{ row.dozorci_rada_text[i].clenove[j].jmeno.datum_naroz }}{% endif %} <br>
+ {{ row.dozorci_rada_text[i].clenove[j].jmeno }}<br>
{{ row.dozorci_rada_text[i].clenove[j].adresa }}
{% if row.dozorci_rada_text[i].clenove[j].funkce_od != 0 %}<br>Den vzniku funkce: {{ row.dozorci_rada_text[i].clenove[j].funkce_od}}{% endif %}
{% if row.dozorci_rada_text[i].clenove[j].funkce_do != 0 %}<br>Den zániku funkce: {{ row.dozorci_rada_text[i].clenove[j].funkce_do}}{% endif %}
@@ -397,8 +395,7 @@
{% set underlne_style_close = "" %}
{% endif %}
<td>{{ underlne_style_open|safe }}
- {% if row.prokurista[i].jmeno.jmeno != "0" %}{{ row.prokurista[i].jmeno.jmeno }} {% endif %}
- {{ row.prokurista[i].jmeno.prijmeni }}{% if row.prokurista[i].jmeno.datum_naroz != "" %}, nar. {{ row.prokurista[i].jmeno.datum_naroz }}{% endif %}<br>
+ {{ row.prokurista[i].jmeno }}<br>
{{ row.prokurista[i].adresa }}{% if row.prokurista[i].text_prokurista != "0" %}<br>{{ row.prokurista[i].text_prokurista }}{% endif %}{{ underlne_style_close|safe }}</td>
<td>{{ underlne_style_open|safe }} Zapsáno: {{ row.prokurista[i].zapis_datum }} {% if row.prokurista[i].vymaz_datum != 0 %} <br> Vymazáno: {{ row.prokurista[i].vymaz_datum }} {% endif %} {{ underlne_style_close|safe }}</td>
</tr>
@@ -439,9 +436,7 @@
{% set underlne_style_open = "" %}
{% set underlne_style_close = "" %}
{% endif %}
- <td>{{ underlne_style_open|safe }} {% if row.jediny_akcionar[i].akcionar_po_id == None %}
- {% if row.jediny_akcionar[i].jmeno.jmeno != "0" %}{{ row.jediny_akcionar[i].jmeno.jmeno }} {% endif %}
- {{ row.jediny_akcionar[i].jmeno.prijmeni }}{% if row.jediny_akcionar[i].jmeno.datum_naroz != "" %}, nar. {{ row.jediny_akcionar[i].jmeno.datum_naroz }}{% endif %} {% endif %}
+ <td>{{ underlne_style_open|safe }} {% if row.jediny_akcionar[i].akcionar_po_id == None %}{{ row.jediny_akcionar[i].jmeno }}{% endif %}
{% if row.jediny_akcionar[i].akcionar_fo_id == None %} {{ row.jediny_akcionar[i].oznaceni_po.nazev }}{% if row.jediny_akcionar[i].oznaceni_po.reg_cislo != 0 %}, reg č. {{ row.jediny_akcionar[i].oznaceni_po.reg_cislo }}{% endif %}{% if row.jediny_akcionar[i].oznaceni_po.ico != 0 %}, IČ <a href="/{{ row.jediny_akcionar[i].oznaceni_po.ico }}">{{ row.jediny_akcionar[i].oznaceni_po.ico }}</a>{% endif %} {% endif %}
<br>{{row.jediny_akcionar[i].adresa}} {{ underlne_style_close|safe }}</td>
<td>{{ underlne_style_open|safe }} Zapsáno: {{ row.jediny_akcionar[i].zapis_datum }} {% if row.jediny_akcionar[i].vymaz_datum != 0 %} <br> Vymazáno: {{ row.jediny_akcionar[i].vymaz_datum }} {% endif %} {{ underlne_style_close|safe }}</td>
@@ -467,9 +462,7 @@
{% set underlne_style_open = "" %}
{% set underlne_style_close = "" %}
{% endif %}
- <td>{{ underlne_style_open|safe }} {% if row.spolecnici[i].spolecnik_po_id == None %}
- {% if row.spolecnici[i].jmeno.jmeno != "0" %}{{ row.spolecnici[i].jmeno.jmeno }} {% endif %}
- {{ row.spolecnici[i].jmeno.prijmeni }}{% if row.spolecnici[i].jmeno.datum_naroz != "" %}, nar. {{ row.spolecnici[i].jmeno.datum_naroz }}{% endif %} {% endif %}
+ <td>{{ underlne_style_open|safe }} {% if row.spolecnici[i].spolecnik_po_id == None %}{{ row.spolecnici[i].jmeno }}{% endif %}
{% if row.spolecnici[i].spolecnik_fo_id == None %} {{ row.spolecnici[i].oznaceni_po.nazev }}{% if row.spolecnici[i].oznaceni_po.reg_cislo != 0 %}, reg č. {{ row.spolecnici[i].oznaceni_po.reg_cislo }}{% endif %}{% if row.spolecnici[i].oznaceni_po.ico != 0 %}, IČ <a href="/{{ row.spolecnici[i].oznaceni_po.ico }}">{{ row.spolecnici[i].oznaceni_po.ico }}</a>{% endif %} {% endif %}
<br>{{row.spolecnici[i].adresa}} {{ underlne_style_close|safe }}</td>
<td>{{ underlne_style_open|safe }} Zapsáno: {{ row.spolecnici[i].zapis_datum }} {% if row.spolecnici[i].vymaz_datum != 0 %} <br> Vymazáno: {{ row.spolecnici[i].vymaz_datum }} {% endif %} {{ underlne_style_close|safe }}</td>
diff --git a/templates/most_common_activity.html b/templates/most_common_activity.html
new file mode 100644
index 0000000..dd73b41
--- /dev/null
+++ b/templates/most_common_activity.html
@@ -0,0 +1,24 @@
+{% include 'header.html' %}
+
+<h1>Nejčastější předmět činnosti:</h1>
+
+<table class="table table-hover" style="width: auto">
+ <thead class="thead-dark">
+ <tr class="table-info">
+ <th scope="col">#</th>
+ <th scope="col">Předmět činnosti</th>
+ <th scope="col">Frekvence</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for i in range (most_common_activity|length) %}
+ <tr>
+ <th scope = "row">{{ i + 1 }}</th>
+ <td>{{ most_common_activity[i][0] }}</td>
+ <td>{{ most_common_activity[i][1] }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+
+{% include 'footer.html' %} \ No newline at end of file
diff --git a/templates/most_common_addresses.html b/templates/most_common_addresses.html
index 8c2277f..4ee45ed 100644
--- a/templates/most_common_addresses.html
+++ b/templates/most_common_addresses.html
@@ -1,9 +1,9 @@
{% include 'header.html' %}
<h1>Nejčastější sídla:</h1>
-<table class="table table-hover">
+<table class="table table-hover" style="width: auto">
<thead class="thead-dark">
- <tr>
+ <tr class="table-info">
<th scope="col">#</th>
<th scope="col">Adresa</th>
<th scope="col">Frekvence</th>
@@ -13,7 +13,7 @@
{% for i in range (most_common_addresses|length) %}
<tr>
<th scope = "row">{{ i + 1 }}</th>
- <td>{{ most_common_addresses[i][0] }}</td>
+ <td><a href="/results-sidlo-{{most_common_addresses[i][2]}}">{{ most_common_addresses[i][0] }}</a></td>
<td>{{ most_common_addresses[i][1] }}</td>
</tr>
{% endfor %}
diff --git a/templates/most_common_business.html b/templates/most_common_business.html
new file mode 100644
index 0000000..56822a5
--- /dev/null
+++ b/templates/most_common_business.html
@@ -0,0 +1,24 @@
+{% include 'header.html' %}
+
+<h1>Nejčastější předmět podnikání:</h1>
+
+<table class="table table-hover" style="width: auto">
+ <thead class="thead-dark">
+ <tr class="table-info">
+ <th scope="col">#</th>
+ <th scope="col">Předmět podnikání</th>
+ <th scope="col">Frekvence</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for i in range (most_common_business|length) %}
+ <tr>
+ <th scope = "row">{{ i + 1 }}</th>
+ <td>{{ most_common_business[i][0] }}</td>
+ <td>{{ most_common_business[i][1] }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+
+{% include 'footer.html' %} \ No newline at end of file
diff --git a/templates/most_common_purpose.html b/templates/most_common_purpose.html
index 99bdc77..a5e17a7 100644
--- a/templates/most_common_purpose.html
+++ b/templates/most_common_purpose.html
@@ -2,9 +2,9 @@
<h1>Nejčastější účel:</h1>
-<table class="table table-hover">
+<table class="table table-hover" style="width: auto">
<thead class="thead-dark">
- <tr>
+ <tr class="table-info">
<th scope="col">#</th>
<th scope="col">Účel</th>
<th scope="col">Frekvence</th>
diff --git a/templates/oldest_companies.html b/templates/oldest_companies.html
index 443ad1c..ab25e60 100644
--- a/templates/oldest_companies.html
+++ b/templates/oldest_companies.html
@@ -1,9 +1,9 @@
{% include 'header.html' %}
<h1>Nejstarší společnosti:</h1>
-<table class="table table-hover">
+<table class="table table-hover" style="width: auto">
<thead class="thead-dark">
- <tr>
+ <tr class="table-info">
<th scope="col">#</th>
<th scope="col">Jméno</th>
<th scope="col">Datum založení</th>
diff --git a/templates/results2.html b/templates/results2.html
index 5fb4e7f..3e686da 100644
--- a/templates/results2.html
+++ b/templates/results2.html
@@ -1,6 +1,8 @@
{% include 'header.html' %}
-{% include 'search_form.html' %}
+{% if show_form == True %}
+ {% include 'search_form.html' %}
+{% endif %}
<p><b>Počet nalezených subjektů: {{ results|length }}</b></p>
{% for row in results %}
diff --git a/templates/search_form.html b/templates/search_form.html
index 1832f87..1077959 100644
--- a/templates/search_form.html
+++ b/templates/search_form.html
@@ -102,4 +102,6 @@
</p>
<p><input type="submit" value="Search">
</p>
-</form> \ No newline at end of file
+</form>
+
+<p><a href="/trivia">Další zajímvavé údaje z obchodního resjtříku.</a></p> \ No newline at end of file
diff --git a/templates/trivia.html b/templates/trivia.html
index ced2c75..5bc274a 100644
--- a/templates/trivia.html
+++ b/templates/trivia.html
@@ -3,11 +3,12 @@
<h1>Zajímavosti z rejstříku</h1>
<p>Počet registrovaných osob: {{ number_entities }}</p>
-
<p>Další zajímvavé údaje z obchodního resjtříku:</p>
<p><a href="/most_common_addresses">Seznam nejčastějších sídel</a></p>
<p><a href="/oldest_companies">Seznam nejstarších společností</a></p>
<p><a href="/most_common_purpose">Seznam nejčastějších účelů</a></p>
+<p><a href="/most_common_business">Seznam nejčastějších předmětů podnikání</a></p>
+<p><a href="/most_common_activity">Seznam nejčastějších předmětů činnosti</a></p>
{% include 'footer.html' %} \ No newline at end of file