Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
require_once("class2.php");
if (!defined('e107_INIT'))
{
exit;
}
require_once(HEADERF);
if (isset($_POST['insert_game'])){
$insert = array(
'gameid' => 123, //$gameid,
'userid' => USERID, //$userid,
'username' => USERNAME //$username
);
$sql->insert('usergames', $insert);
$text = e107::getMessage();
$text->addSuccess('INFORMATION ADDED TO DATABASE.');
echo $text->render();
}
if (isset($_POST['delete_game'])){ /////////////EI TÖÖTA NII NAGU VAJA
$gameid = 123;
$userid = USERID;
$sql->delete("usergames", "gameid='$gameid'", "userid='$userid'");
$text = e107::getMessage();
$text->addSuccess('GAME REMOVED FROM DATABASE.');
echo $text->render();
}
/*function checkgame()///////////////////////BLABLAH
{
$check = array(
'gameid' => 123,
'userid' => USERID,
'username' => USERNAME
);
$game = "SELECT gameid, userid, username FROM #userrecipes";
}*/
if(USER){/////////////////////////////////////////
$text .= "<form id='game' action='" . e_SELF . "' method='post'><input class='button' type='submit' name='insert_game' value='ADD' /></form>";
//if ($row['gameid']==123 && $row['userid']==USERID){
$text .= "<form id='game' action='" . e_SELF . "' method='post'><input class='button' type='submit' name='delete_game' value='DELETE' /></form>";
//}
}
else
{
$text .= "LOGIN TO USE THIS FUNCTION.";
}
$ns->tablerender("", $text);
require_once(FOOTERF);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.