diff --git a/ag/char_profil.php b/ag/char_profil.php
index 4166a76..6cbf220 100644
--- a/ag/char_profil.php
+++ b/ag/char_profil.php
@@ -52,7 +52,7 @@ function stelledar($char_id,$user_ida,$name) {
type="hidden" name="char_id" value="" />
-
@@ -322,16 +322,6 @@ function stelledar($char_id,$user_ida,$name) {
}
}
-function getAttackNamesFromAttackSet($attset) {
- $qry = mysql_query('SELECT l.id,a.name FROM attacken a INNER JOIN lernen l ON a.id=l.at_id WHERE l.id in ('.implode(',', $attset).');');
-
- while ($result = mysql_fetch_assoc($qry)) {
- $set[$result['id']] = $result['name'];
- }
-
- return $set;
-}
-
function eintragen($char_id,$name,$user_ida) {
$char = getChar($char_id);
if($char['besitzer'] != $user_ida['id']) {
@@ -339,7 +329,7 @@ function eintragen($char_id,$name,$user_ida) {
exit;
}
- if(!checkCharStatus($char, 'Frei')) {
+ if(!checkCharStatus($char_id, STATUS_FREI)) {
displayErrorMessage(NULL,'Der Charakter ist zur Zeit nicht frei!', displayHistoryBackLink());
exit;
}
diff --git a/ag/include/attackenset.inc.php b/ag/include/attackenset.inc.php
index 3d60e16..4f6f4f9 100644
--- a/ag/include/attackenset.inc.php
+++ b/ag/include/attackenset.inc.php
@@ -40,18 +40,18 @@ function getCharAttackSet($char_id, $type) {
}
if(is_numeric($char_id)) {
- $qry = mysql_query('SELECT Attack_ID, Round FROM attackenset WHERE Char_ID = '.$char_id.' AND Type = '.$type);
+ $qry = mysql_query('SELECT attack_id, round FROM attackenset WHERE char_id = '.$char_id.' AND type = '.$type);
}
while ($result = mysql_fetch_assoc($qry)) {
- $set[$result['Round']] = $result['Attack_ID'];
+ $set[$result['round']] = $result['attack_id'];
}
return $set;
}
function updateCharAttack($char_id, $att_id,$round, $type) {
- $qry = 'UPDATE attackenset SET Attack_ID = '.$att_id.' WHERE Char_ID = '.$char_id.' AND Type = '.$type.' AND Round = '.$round.';';
+ $qry = 'UPDATE attackenset SET attack_id = '.$att_id.' WHERE char_id = '.$char_id.' AND type = '.$type.' AND round = '.$round.';';
mysql_query($qry);
}
@@ -74,6 +74,16 @@ function updateCharAttackSet($char_id, $set, $type) {
}
}
+function getAttackNamesFromAttackSet($attset) {
+ $qry = mysql_query('SELECT l.id,a.name FROM attacken a INNER JOIN lernen l ON a.id=l.at_id WHERE l.id in ('.implode(',', $attset).');');
+
+ while ($result = mysql_fetch_assoc($qry)) {
+ $set[$result['id']] = $result['name'];
+ }
+
+ return $set;
+}
+
function getAttackTypesFromAttackSet($attset) {
$qry = mysql_query('SELECT l.id,a.type FROM attacken a INNER JOIN lernen l ON a.id=l.at_id WHERE l.id in ('.implode(',', $attset).');');
diff --git a/ag/include/char_profil.inc.php b/ag/include/char_profil.inc.php
index 2487589..a8e5c03 100644
--- a/ag/include/char_profil.inc.php
+++ b/ag/include/char_profil.inc.php
@@ -7,6 +7,8 @@
*/
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/char.inc.php');
+defineIfNotDefined('STATUS_FREI', 'Frei');
+
//Dadurch kriege ich detailierte infos, sollte ein mysql query mal inkorrekt sein!
function safe_query($query="") {
if(empty($query)) return false;
@@ -38,14 +40,13 @@ function chardaten($char_id,$name,&$char_1,&$hp1,&$mp1,&$exp,&$fehler) {
/**
*
* Überprüft den Status des Charakters
- * @param Array $char: Der Charakterarray, welche 'status' beinhalten muss
+ *
+ * @param Int $char_id: Die ID des zu überprüfenden Charakters
* @param String $status: Der Status auf den geprüft wird
*/
-function checkCharStatus($char, $status) {
- if($char['status'] == $status) {
- return TRUE;
- }
- return FALSE;
+function checkCharStatus($char_id, $status) {
+ $char = getChar($char_id, false);
+ return $char['status'] == $status;
}
?>
\ No newline at end of file