103 lines
2.9 KiB
PHP
103 lines
2.9 KiB
PHP
|
|
<?php
|
||
|
|
/* $Id: user_poll_new.php 59 2009-02-13 03:25:54Z john $ */
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$page = "general";
|
||
|
|
include "header.php";
|
||
|
|
|
||
|
|
if(isset($_POST['task'])) { $task = $_POST['task']; } elseif(isset($_GET['task'])) { $task = $_GET['task']; } else { $task = ""; }
|
||
|
|
if(isset($_POST['id'])) { $id = $_POST['id']; } elseif(isset($_GET['id'])) { $id = $_GET['id']; } else { $id = ""; }
|
||
|
|
|
||
|
|
$name = ( !empty($_POST['name']) ? $_POST['name'] : NULL );
|
||
|
|
$type = ( !empty($_POST['type']) ? $_POST['type'] : NULL );
|
||
|
|
$privacy = ( !empty($_POST['privacy']) ? $_POST['privacy'] : NULL );
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if($user->user_info["user_level_id"]!=2&&$user->user_info["user_level_id"]!=7){
|
||
|
|
header("Location: /premium.php");
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
if($task=="delete")
|
||
|
|
{
|
||
|
|
$query=$database->database_query("SELECT * FROM batelist WHERE userid='".$user->user_info["user_id"]."' AND id='".$database->database_real_escape_string($id)."'");
|
||
|
|
|
||
|
|
if($database->database_num_rows($query)>0)
|
||
|
|
{
|
||
|
|
$database->database_query("DELETE FROM batelistcontent WHERE batelistid='".$database->database_real_escape_string($id)."'");
|
||
|
|
$database->database_query("DELETE FROM batelist WHERE id='".$database->database_real_escape_string($id)."'");
|
||
|
|
$message="Batelist deleted<br>
|
||
|
|
<br>
|
||
|
|
";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function general()
|
||
|
|
{
|
||
|
|
global $error, $name, $user, $privacy, $type, $database, $message;
|
||
|
|
echo $message;?>
|
||
|
|
|
||
|
|
<a href="user_list_new.php">Create new list</a><div class="clearfix"></div><br>
|
||
|
|
<?php
|
||
|
|
$query=$database->database_query("SELECT * FROM batelist WHERE userid='".$user->user_info["user_id"]."'");
|
||
|
|
while($row=$database->database_fetch_array($query)){
|
||
|
|
?>
|
||
|
|
|
||
|
|
<div id="seBlogRow_7452" class="blog_list1">
|
||
|
|
<table cellpadding="0" cellspacing="0" width="100%">
|
||
|
|
<tbody><tr>
|
||
|
|
<!--<td style="padding-top: 2px; vertical-align: top;" width="1">
|
||
|
|
<input type="checkbox" name="delete_blogentries[]" value="<?php echo $row["id"];?>">
|
||
|
|
</td>-->
|
||
|
|
<td style="padding-left: 5px;">
|
||
|
|
<div style="font-size: 13px; font-weight: bold;">
|
||
|
|
<a href="/batelist.php?user=<?php echo $user->user_info["user_username"];?>&id=<?php echo $row["id"];?>">
|
||
|
|
<?php echo $row["name"];?>
|
||
|
|
</a>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</td>
|
||
|
|
<td style="vertical-align: top; text-align: right; padding-left: 10px;">
|
||
|
|
<a href="user_list_edit.php?id=<?php echo $row["id"];?>">edit</a>
|
||
|
|
|
|
||
|
|
<a href="user_lists.php?task=delete&id=<?php echo $row["id"];?>" onclick="return confirm('Are you sure you want to delete this list?');">delete</a>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</tbody></table>
|
||
|
|
</div>
|
||
|
|
<?php
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$smarty->assign('privacy_options', $privacy_options);
|
||
|
|
|
||
|
|
$smarty->assign('comment_options', $comment_options);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$smarty->assign('poll_title', $poll_title);
|
||
|
|
|
||
|
|
$smarty->assign('poll_desc', $poll_desc);
|
||
|
|
|
||
|
|
$smarty->assign('poll_options', $poll_options);
|
||
|
|
|
||
|
|
$smarty->assign('poll_comments', $poll_comments);
|
||
|
|
|
||
|
|
$smarty->assign('poll_privacy', $poll_privacy);
|
||
|
|
|
||
|
|
$smarty->assign('poll_search', $poll_search);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$smarty->assign('is_error', $is_error);
|
||
|
|
|
||
|
|
$smarty->assign('is_error_sprintf_1', $is_error);
|
||
|
|
|
||
|
|
include "footer.php";
|
||
|
|
|
||
|
|
?>
|