Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Pridėti taškus.

Parašė bruzgis· 2011 Spa. 4 16:10:37
#3


<?php
require_once '../../maincore.php';
require_once BASEDIR.'subheader.php';
require_once BASEDIR.'side_left.php';
 
if (!iADMIN || iUSER_RIGHTS == "" || iUSER_RIGHTS == "C")  redirect(BASEDIR."index.php");
 
if (file_exists(INFUSIONS."stats/locale/".$settings['locale'].".php"))
	include INFUSIONS."stats/locale/".$settings['locale'].".php";
else 
	include INFUSIONS."stats/locale/Lt.php"; 
 
 
opentable("".$locale['t_title']."");
 
	$result = dbquery("SELECT * FROM zaidejai ORDER BY goals DESC");
 
    if (dbrows($result) != 0) 
	{
			echo "<form method='post' action='".FUSION_SELF."'><select name='id' class='textbox'>";
			while ($data = dbarray($result))
			{
				print "<option value='".$data['id']."'>".$data['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>";
   } 
   else 
   {
	print "Nera irasu";
   } 
 
   if(isset($_POST['prideti'])) dbquery("UPDATE zaidejai SET goals=goals+".$_POST['goals']." WHERE id = ".$_POST['id']);
   if(isset($_POST['atimti'])) dbquery("UPDATE zaidejai SET goals=goals-".$_POST['goals']." WHERE id = ".$_POST['id']); 
 
closetable();
 
require_once BASEDIR.'side_right.php';
require_once BASEDIR.'footer.php';
?>