本文整理汇总了PHP中AA_checkReference函数的典型用法代码示例。如果您正苦于以下问题:PHP AA_checkReference函数的具体用法?PHP AA_checkReference怎么用?PHP AA_checkReference使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AA_checkReference函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysql_query
}
}
}
}
}
//
// Process del-request
//
if ($_GET['arg'] == "del") {
mysql_query("LOCK TABLES serienstart READ, start WRITE, anmeldung WRITE, athlet WRITE");
// check if start data still used
$result = mysql_query("SELECT xStart FROM start" . " WHERE xAnmeldung=" . $_GET['item']);
$rc = 0;
// row counter
while ($row = mysql_fetch_row($result)) {
$rc = $rc + AA_checkReference("serienstart", "xStart", $row[0]);
}
mysql_free_result($result);
// OK: not used anymore
if ($rc == 0) {
// Delete starts
mysql_query("DELETE FROM start WHERE xAnmeldung=" . $_GET['item']);
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
}
// get xAthlet
$res = mysql_query("SELECT xAthlet FROM anmeldung WHERE xAnmeldung=" . $_GET['item']);
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
} else {
$row = mysql_fetch_array($res);
示例2: mysql_query
$row_activ = $row[1];
}
mysql_query("\r\n\t\t\t UPDATE disziplin SET \r\n\t\t\t\t Kurzname=\"" . strtoupper($_POST['short']) . "\"\r\n\t\t\t\t , Name=\"" . $_POST['name'] . "\"\r\n\t\t\t\t , Anzeige=" . $_POST['order'] . "\r\n\t\t\t\t , Seriegroesse=" . $_POST['heat'] . "\r\n\t\t\t\t , Staffellaeufer=" . $_POST['relay'] . "\r\n\t\t\t\t , Typ=" . $_POST['type'] . "\r\n\t\t\t\t , Appellzeit=SEC_TO_TIME(" . $_POST['time'] * 60 . ")\r\n\t\t\t\t , Stellzeit=SEC_TO_TIME(" . $_POST['mtime'] * 60 . ")\r\n , aktiv='" . $row_activ . "' \r\n\t\t\t WHERE xDisziplin=" . $_POST['item']);
if (mysql_errno() > 0) {
$GLOBALS['AA_ERROR'] = mysql_errno() . ": " . mysql_error();
}
}
}
}
}
}
} else {
if ($_GET['arg'] == "del") {
mysql_query("LOCK TABLES wettkampf READ, disziplin WRITE");
// Check if not used anymore
if (AA_checkReference("wettkampf", "xDisziplin", $_GET['item']) == 0) {
mysql_query("DELETE FROM disziplin WHERE xDisziplin=" . $_GET['item']);
} else {
AA_printErrorMsg($strDiscipline . $strErrStillUsed);
}
mysql_query("UNLOCK TABLES");
}
}
// Check if any error returned from DB
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
}
//
// Display current data
//
$page = new GUI_Page('admin_disciplines', TRUE);
示例3: AA_printErrorMsg
// store selected group
$group = $_POST['group'];
}
//
// add team
//
if ($_POST['arg'] == "add") {
$name = $_POST['name'];
// Error: Empty fields
if (empty($_POST['name']) || empty($_POST['category']) || empty($_POST['club']) || empty($_POST['event'])) {
AA_printErrorMsg($strErrEmptyFields);
} else {
mysql_query("LOCK TABLES\r\n\t\t\t\tteamsm WRITE\r\n\t\t\t\t, wettkampf READ\r\n\t\t\t\t, kategorie READ\r\n , anmeldung READ\r\n , staffel READ\r\n , start as s READ\r\n , runde as r READ \r\n , runde WRITE \r\n , wettkampf as w READ \r\n\t\t\t\t, verein READ");
if (AA_checkReference("kategorie", "xKategorie", $_POST['category']) == 0) {
AA_printErrorMsg($strCategory . $strErrNotValid);
} elseif (AA_checkReference("wettkampf", "xWettkampf", $_POST['event']) == 0) {
AA_printErrorMsg($strEvent . $strErrNotValid);
} else {
// check startnumber
$lastnbr = AA_getLastStartnbrTeamsm();
$nbr = $_POST['startnumber'];
if ($nbr > 0) {
$res = mysql_query("SELECT * FROM teamsm \r\n WHERE Startnummer = {$nbr} \r\n AND xMeeting = " . $_COOKIE['meeting_id']);
if (mysql_num_rows($res) > 0) {
$nbr = $lastnbr;
$nbr++;
}
//mysql_free_result($res);
//
// check if startnumber is used for athletes
$res = mysql_query("SELECT * FROM anmeldung \r\n WHERE Startnummer = {$nbr} \r\n AND xMeeting = " . $_COOKIE['meeting_id']);
示例4: mysql_query
$sql = "SELECT xAthlet \r\n\t\t\t FROM athlet;";
$query = mysql_query($sql);
while ($row = mysql_fetch_assoc($query)) {
$num = AA_checkReference('anmeldung', 'xAthlet', $row['xAthlet']);
if ($num > 0) {
$errors = true;
break;
}
}
if (!$errors) {
$sql = "SELECT xVerein \r\n\t\t\t\t FROM verein;";
$query = mysql_query($sql);
while ($row = mysql_fetch_assoc($query)) {
$num = AA_checkReference('team', 'xVerein', $row['xVerein']);
$num2 = AA_checkReference('teamsm', 'xVerein', $row['xVerein']);
$num3 = AA_checkReference('staffel', 'xVerein', $row['xVerein']);
if ($num > 0 || $num2 > 0 || $num3 > 0) {
$errors = true;
break;
}
}
}
if ($errors) {
echo $strEmptyCacheReference;
die;
} else {
// reset athletes
mysql_query("TRUNCATE TABLE athlet");
if (mysql_errno > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
} else {
示例5: AA_printErrorMsg
AA_printErrorMsg($strErrEmptyFields);
}
} elseif ($_POST['arg'] == "change") {
if (!empty($_POST['name']) && !empty($_POST['display']) && !empty($_POST['sortvalue']) && !empty($_POST['item'])) {
mysql_query("UPDATE region SET\r\n\t\t\t\t\tName = '" . $_POST['name'] . "'\r\n\t\t\t\t\t, Anzeige = '" . $_POST['display'] . "'\r\n\t\t\t\t\t, Sortierwert = '" . $_POST['sortvalue'] . "'\r\n\t\t\t\tWHERE xRegion = " . $_POST['item']);
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
}
} else {
AA_printErrorMsg($strErrEmptyFields);
}
} else {
if ($_GET['arg'] == "del") {
mysql_query("LOCK TABLES athlet READ, region WRITE");
// Still in use?
$rows = AA_checkReference("athlet", "xRegion", $_GET['item']);
// OK: not used anymore
if ($rows == 0) {
mysql_query("DELETE FROM region WHERE xRegion=" . $_GET['item']);
} else {
AA_printErrorMsg($strRegion . $strErrStillUsed);
}
mysql_query("UNLOCK TABLES");
}
}
// Check if any error returned from DB
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
}
//
// Display current data
示例6: mysql_query
} else {
mysql_query("\r\n\t\t\tLOCK TABLES\r\n\t\t\t\tteam WRITE\r\n\t\t");
mysql_query("\r\n\t\t\tUPDATE team SET\r\n\t\t\t\tName=\"" . $_POST['name'] . "\"\r\n\t\t\tWHERE xTeam=" . $_POST['item']);
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
}
mysql_query("UNLOCK TABLES");
}
}
//
// Process del-request
//
if ($_GET['arg'] == "del") {
mysql_query("\r\n\t\tLOCK TABLES\r\n\t\t\tanmeldung READ\r\n\t\t\t, team WRITE\r\n\t");
// Still in use?
if (AA_checkReference("anmeldung", "xTeam", $_GET['item']) > 0) {
AA_printErrorMsg($strTeam . $strErrStillUsed);
} else {
// delete team events
mysql_query("\r\n\t\t\tDELETE FROM team\r\n\t\t\tWHERE xTeam = " . $_GET['item']);
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
}
}
// ET DB error (still in use)
mysql_query("UNLOCK TABLES");
$_POST['item'] = $_GET['item'];
// show empty form after delete
}
//
// display data
示例7: AA_heats_changeInstallation
/**
* change installations
* --------------------
*/
function AA_heats_changeInstallation($round)
{
require './lib/common.lib.php';
if ($_POST['arg'] == 'change_inst' && empty($_POST['item'])) {
AA_printErrorMsg($GLOBALS['strErrEmptyFields']);
} else {
mysql_query("LOCK TABLES anlage READ, serie WRITE");
$installation = $_POST['installation'];
if (AA_checkReference("anlage", "xAnlage", $installation) == 0) {
$installation = 0;
}
if ($_POST['arg'] == 'change_inst') {
// only for one heat
$clause = " WHERE xSerie=" . $_POST['item'];
} else {
// all heats
$clause = " WHERE xRunde=" . $round;
}
mysql_query("UPDATE serie SET" . " xAnlage = {$installation}" . $clause);
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
}
mysql_query("UNLOCK TABLES");
}
}
示例8: mysql_query
} else {
if ($_POST['arg'] == "add") {
mysql_query("\r\n\t\t\tINSERT INTO verein SET\r\n\t\t\t\tName=\"" . $_POST['name'] . "\"\r\n\t\t\t\t, Sortierwert=\"" . $_POST['sortvalue'] . "\"\r\n\t\t");
} else {
if ($_POST['arg'] == "change") {
mysql_query("\r\n\t\t\tUPDATE verein SET\r\n\t\t\t\tName=\"" . $_POST['name'] . "\"\r\n\t\t\t\t, Sortierwert=\"" . $_POST['sortvalue'] . "\"\r\n\t\t\tWHERE xVerein=" . $_POST['item']);
}
}
}
} else {
if ($_GET['arg'] == "del") {
mysql_query("LOCK TABLES athlet READ, staffel READ, team READ, verein WRITE");
// Still in use?
$rows = AA_checkReference("athlet", "xVerein", $_GET['item']);
$rows = $rows + AA_checkReference("staffel", "xVerein", $_GET['item']);
$rows = $rows + AA_checkReference("team", "xVerein", $_GET['item']);
// OK: not used anymore
if ($rows == 0) {
mysql_query("DELETE FROM verein WHERE xVerein=" . $_GET['item']);
} else {
AA_printErrorMsg($strClub . $strErrStillUsed);
}
mysql_query("UNLOCK TABLES");
}
}
// Check if any error returned from DB
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
}
//
// Display current data
示例9: AA_meeting_deleteEvent
function AA_meeting_deleteEvent()
{
require './lib/common.lib.php';
mysql_query("LOCK TABLES runde READ, start READ, wettkampf WRITE");
// Still in use?
$rows = AA_checkReference("runde", "xWettkampf", $_POST['item']);
$rows = $rows + AA_checkReference("start", "xWettkampf", $_POST['item']);
// OK: not used anymore
if ($rows == 0) {
mysql_query("DELETE FROM wettkampf WHERE xWettkampf=" . $_POST['item']);
} else {
AA_printErrorMsg($GLOBALS['strEvent'] . $GLOBALS['strErrStillUsed']);
}
mysql_query("UNLOCK TABLES");
return;
}
示例10: mysql_query
}
}
?>
<tr>
<td>team</td>
<td><?php
echo $items;
?>
</td>
</tr>
<?php
$items = 0;
$sql = "SELECT * \r\n\t\t\t FROM staffel;";
$query = mysql_query($sql);
while ($staffel = mysql_fetch_assoc($query)) {
$ref = AA_checkReference('meeting', 'xMeeting', $staffel['xMeeting']);
if ($ref == 0) {
$sql2 = "DELETE FROM staffel \r\n\t\t\t\t\t\t WHERE xStaffel = " . $staffel['xStaffel'] . ";";
$query2 = mysql_query($sql2);
if ($query2 && mysql_affected_rows() == 1) {
$items++;
}
}
}
?>
<tr>
<td>staffel</td>
<td><?php
echo $items;
?>
</td>
示例11: substr
$idcounter = "001";
} else {
$idcounter = substr($biggestId, 6, 3);
$idcounter++;
$idcounter = sprintf("%03d", $idcounter);
}
$xTeamSQL = ", xTeam = " . $eventnr . $idcounter . ", Athleticagen ='y' ";
}
}
if (AA_checkReference("kategorie", "xKategorie", $category) == 0) {
AA_printErrorMsg($strCategory . $strErrNotValid);
} else {
if (AA_checkReference("meeting", "xMeeting", $_COOKIE['meeting_id']) == 0) {
AA_printErrorMsg($strMeeting . $strErrNotValid);
} else {
if (AA_checkReference("verein", "xVerein", $_POST['club']) == 0) {
AA_printErrorMsg($strClub . $strErrNotValid);
} else {
if (!empty($_POST['id'])) {
// svm is added from base
$xTeamSQL = ", xTeam = " . $_POST['id'] . ", Athleticagen ='n' ";
}
mysql_query("\r\n\t\t\t\t\t\tINSERT INTO team SET \r\n\t\t\t\t\t\t\tName=\"" . $_POST['name'] . "\"\r\n\t\t\t\t\t\t\t, xMeeting=" . $_COOKIE['meeting_id'] . "\r\n\t\t\t\t\t\t\t, xKategorie = " . $category . "\r\n\t\t\t\t\t\t\t, xVerein=" . $_POST['club'] . " \r\n , xKategorie_svm = '" . $category_svm . "'" . $xTeamSQL);
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
} else {
$xTeam = mysql_insert_id();
// get new ID
}
}
// ET Club valid; add or change
示例12: mysql_query
}
} else {
// in other language without name and short name
mysql_query("\r\n UPDATE rundentyp_it SET\r\n Typ=\"" . $_POST['type'] . "\" \r\n , Wertung=" . $_POST['valtype'] . "\r\n WHERE xRundentyp=" . $_POST['item']);
if (mysql_errno() > 0) {
$GLOBALS['AA_ERROR'] = mysql_errno() . ": " . mysql_error();
}
}
}
}
}
} else {
if ($_GET['arg'] == "del") {
mysql_query("LOCK TABLES runde READ, rundentyp_de WRITE, rundentyp_fr WRITE, rundentyp_it WRITE");
// Still in use?
$rows = AA_checkReference("runde", "xRundentyp", $_GET['item']);
// OK: not used anymore
if ($rows == 0) {
mysql_query("DELETE FROM rundentyp_de WHERE xRundentyp=" . $_GET['item']);
mysql_query("DELETE FROM rundentyp_fr WHERE xRundentyp=" . $_GET['item']);
mysql_query("DELETE FROM rundentyp_it WHERE xRundentyp=" . $_GET['item']);
} else {
AA_printErrorMsg($strRoundtype . $strErrStillUsed);
}
mysql_query("UNLOCK TABLES");
}
}
// Check if any error returned from DB
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
}
示例13: mysql_query
mysql_query("UPDATE athlet SET " . "xVerein='" . $_POST['club'] . "' WHERE xAthlet=" . $_POST['item']);
// Check if any error returned from DB
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
}
}
} else {
AA_printErrorMsg($strErrClubChange);
}
mysql_query("UNLOCK TABLES");
}
} else {
if ($_GET['arg'] == "del") {
mysql_query("LOCK TABLES anmeldung READ, staffelathlet READ, athlet WRITE");
// Still in use?
$rows = AA_checkReference("anmeldung", "xAthlet", $_GET['item']);
// OK: not used anymore
if ($rows == 0) {
mysql_query("DELETE FROM athlet WHERE xAthlet=" . $_GET['item']);
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
}
} else {
AA_printErrorMsg($strAthlete . $strErrStillUsed);
}
mysql_query("UNLOCK TABLES");
}
}
}
}
//
示例14: AA_printErrorMsg
}
}
} else {
AA_printErrorMsg($strErrInvalidResult);
}
}
}
} else {
if ($_GET['arg'] == "del") {
mysql_query("DELETE FROM wertungstabelle_punkte WHERE xWertungstabelle_Punkte = " . $_GET['item']);
header('Location: admin_scoretables.php?xw=' . $_GET['xw'] . '&disc=' . $_GET['disc']);
exit;
} else {
if ($_GET['arg'] == "deltbl") {
// Check if not used anymore
if (AA_checkReference("wettkampf", "Punktetabelle", $_GET['item']) == 0) {
mysql_query("DELETE FROM wertungstabelle_punkte WHERE xWertungstabelle = " . $_GET['item']);
mysql_query("DELETE FROM wertungstabelle WHERE xWertungstabelle = " . $_GET['item']);
header('Location: admin_scoretables.php');
exit;
} else {
AA_printErrorMsg($strScoreTable . $strErrStillUsed);
}
}
}
}
// Check if any error returned from DB
if (mysql_errno() > 0) {
AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
}
//
示例15: AA_printErrorMsg
if (AA_checkReference("verein", "xVerein", $_POST['club']) == 0) {
AA_printErrorMsg($strClub . $strErrNotValid);
} else {
// Team selected
if (!empty($_POST['team']) && AA_checkReference("team", "xTeam", $_POST['team']) == 0) {
AA_printErrorMsg($strTeam . $strErrNotValid);
} else {
if (AA_checkReference("wettkampf", "xWettkampf", $_POST['event']) == 0) {
AA_printErrorMsg($strEvent . $strErrNotValid);
} else {
$startcheck = TRUE;
$c = 0;
if ($_POST['starts'] > 0) {
foreach ($_POST['starts'] as $start) {
// position or athlete not valid
if ($_POST['positions'][$c] > 0 && AA_checkReference("start", "xStart", $start) == 0) {
$startcheck = FALSE;
}
$c++;
}
}
// ET any athletes
if ($startcheck == FALSE) {
AA_printErrorMsg($strAthlete . $strErrNotValid);
} else {
// check startnumber
$lastnbr = AA_getLastStartnbrRelay();
$nbr = $_POST['startnumber'];
if ($nbr > 0) {
$res = mysql_query("SELECT * FROM staffel \r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE Startnummer = {$nbr} \r\n\t\t\t\t\t\t\t\t\t\t\t\tAND xMeeting = " . $_COOKIE['meeting_id']);
if (mysql_num_rows($res) > 0) {