cats/functions/getTopic.php

62 lines
2.2 KiB
PHP
Raw Normal View History

2013-01-19 18:38:58 +00:00
<?php
function getTopicProgress($t_id){
// Wertpr<70>fung
$t_id=abs(intval($t_id));
echo '<form action="index.php?site=progress&amp;action=showProgress&amp;action=showTable" method="post">';
$button=Function_getTopic_01;
$topic=new Topic;
$topic->getActiveTopic();
$arrayTopic = $topic->getTopicArray();
echo " <div id=\"inner_box_top\">\n"; // In der Mitte der Inhalt
showForm($t_id,$button,$arrayTopic );
}
function getTopicStatistic($t_id){
// Wertpr<70>fung
$t_id=abs(intval($t_id));
echo '<form action="index.php?site=statistic&amp;action=getStatisticQuestions" method="post">';
$button=Function_getTopic_02;
$topic=new Topic;
$topic->getTopic();
$arrayTopic = $topic->getTopicArray();
echo "<div>\n"; // In der Mitte der Inhalt
showForm($t_id,$button,$arrayTopic );
}
function getTopicStartTest($t_id){
// Wertpr<70>fung
$t_id=abs(intval($t_id));
echo '<form action="index.php?site=start_test&amp;action=getQuestions" method="post">';
$button=Function_getTopic_03;
$topic=new Topic;
$topic->getActiveTopic();
$arrayTopic = $topic->getTopicArray();
echo " <div id=\"inner_box_top\">\n"; // In der Mitte der Inhalt
showForm($t_id,$button,$arrayTopic );
}
function showForm($t_id,$button,$arrayTopic ){
// Dateien einbinden
require_once($_SESSION['_config']['filepath']."classes/Topic.class.php");
require_once($_SESSION['_config']['filepath']."includes/db_connect.inc");
// Wertpr<70>fung
$t_id=abs(intval($t_id));
echo"<label> <select class='dropdown_site' size='1' name='t_id' > ";
for ($i=1;$i<=count($arrayTopic);$i++){
if($t_id==$arrayTopic[$i]['t_id']) echo"<option selected='selected' value='".stripslashes($arrayTopic[$i]['t_id'])."'>".stripslashes($arrayTopic[$i]['topic'])."</option>";
else echo"<option value='".stripslashes($arrayTopic[$i]['t_id'])."'>".stripslashes($arrayTopic[$i]['topic'])."</option>";
}
echo"</select></label>";
echo' <label><input name="submit" class="Button" type="submit" value="' .$button.'"/></label> ';
echo"</div></form>";
echo "<br />";
}
?>