Parašė marqs· 2011 Spa. 8 20:10:15
<?php
require_once '../../maincore.php';
require_once '../../subheader.php';
require_once '../../side_left.php';
// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."stats/locale/".$settings['locale'].".php")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS."stats/locale/".$settings['locale'].".php";
} else {
// Load the infusion's default locale file.
include INFUSIONS."stats/locale/Lt.php";
}
if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C")) {
opentable($locale['t_title']);
echo "<form method='post' action='".$_SERVER['PHP_SELF']."'><select name='id' class='textbox'>";
$result = dbquery("SELECT * FROM zaidejai ORDER BY goals DESC");
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
$id = $data['id'];
$name = $data['name'];
echo "<option value='$id' name='id' class='textbox'>".$name."</option>";
}
echo "</select>
<input type='hidden' value='".$_POST['id']."' name='user_id' />
<input type='text' name='goals' value='".$data['goals']."' class='textbox' />
<input type='submit' name='prideti' value='".$locale['tp']."' class='button' />
<input type='submit' name='atimti' value='".$locale['pt']."' class='button' /></form>";
}
}
if(isset($_POST['prideti'])) { $result = dbquery("UPDATE zaidejai SET goals = goals + '".$_POST['goals']."' WHERE id = '".$_POST['user_id']."'"); }
if(isset($_POST['atimti'])) { $result = dbquery("UPDATE zaidejai SET goals = goals - '".$_POST['goals']."' WHERE id = '".$_POST['user_id']."'"); }
closetable();
require_once '../../side_right.php';
require_once '../../footer.php';
?>