Initial commit
This commit is contained in:
95
kat_main_fa.php
Normal file
95
kat_main_fa.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
include_once 'classes/lg-on_Smarty.class.php';
|
||||
$smarty = new lgon_Smarty();
|
||||
require_once("config.inc.php");
|
||||
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
|
||||
require_once "language/german.inc.php";
|
||||
require_once("func_ansicht.php");
|
||||
|
||||
##### <20>NDERUNG NEUE LUTHERBIBEL ########
|
||||
if(date("Y") < 2019){
|
||||
require("bibellookup_1984.php");
|
||||
}else{
|
||||
require("bibellookup_2017.php");
|
||||
}
|
||||
|
||||
|
||||
#if(isset($_GET['knk']) AND $_GET['knk'] > 0){
|
||||
$kapitel = $_GET['knk'];
|
||||
$fragenr = $_GET['knksub'];
|
||||
if($fragenr == ''){
|
||||
$fragenr = $kapitel;
|
||||
}
|
||||
$db = dbconnect();
|
||||
|
||||
$result_hist = $db->query("SELECT number
|
||||
FROM knk_fa
|
||||
WHERE number = '$fragenr'
|
||||
");
|
||||
$row_hist = $result_hist->fetch_array();
|
||||
|
||||
if($row_hist['number'] > 0){
|
||||
$sid = session_id();
|
||||
$datum=date("Y-m-d H:i:s");
|
||||
$result_1 = $db->query( "INSERT INTO historie (vaid, datum, session_id, art, art_id) VALUES ('$user_vaid;', '$datum', '$sid', 'KFA', '$row_hist[number]')" );
|
||||
}
|
||||
|
||||
#}else{
|
||||
# $kapitel = "vum";
|
||||
#}
|
||||
|
||||
$db = dbconnect();
|
||||
|
||||
$result_link_bibel = $db->query("SELECT bibellink
|
||||
FROM profil
|
||||
WHERE user='$user_admin'");
|
||||
$row_link_bibel = $result_link_bibel->fetch_array();
|
||||
|
||||
|
||||
|
||||
if(is_numeric(substr($kapitel,0,1))){
|
||||
if($row_link_bibel['bibellink'] == 'lokal'){
|
||||
$query = "SELECT number, number number1, question, answer_lokal answer, reference_lokal reference, description_lokal description, description2_lokal description2
|
||||
FROM knk_fa
|
||||
WHERE headline = $kapitel
|
||||
ORDER BY number ASC
|
||||
";
|
||||
}else{
|
||||
$query = "SELECT number, number number1, question, answer_bibleserver answer, reference_bibleserver reference, description_bibleserver description, description2_bibleserver description2
|
||||
FROM knk_fa
|
||||
WHERE headline = $kapitel
|
||||
ORDER BY number ASC
|
||||
";
|
||||
}
|
||||
}else{
|
||||
# wenn knk ein Character hat "vorwort"
|
||||
|
||||
if($row_link_bibel['bibellink'] == 'lokal'){
|
||||
$query = "SELECT knk number, ueberschrift question, text_lokal answer
|
||||
FROM knk
|
||||
WHERE knk = '$kapitel'
|
||||
OR knk LIKE '$kapitel.%'
|
||||
ORDER BY knkid ASC
|
||||
";
|
||||
}else{
|
||||
$query = "SELECT knk number, ueberschrift question, text_bibleserver answer
|
||||
FROM knk
|
||||
WHERE knk = '$kapitel'
|
||||
OR knk LIKE '$kapitel.%'
|
||||
ORDER BY knkid ASC
|
||||
";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$result = $db->query( $query)
|
||||
or die ("Cannot execute query1");
|
||||
while ($row = $result->fetch_array()){
|
||||
$value[] = $row;
|
||||
}
|
||||
// Assign this array to smarty...
|
||||
$smarty->assign('table_data1', $value);
|
||||
$smarty->display("$template/$templatename");
|
||||
?>
|
Reference in New Issue
Block a user