Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function showpicturedelete()
- {
- if (isset($_POST['submit'])) {
- echo $default = $_POST['default'];
- $picture = $_POST['picture'];
- $id = $_POST['id'];
- $this->connect();
- $result = mysql_query("UPDATE `profilepicture` SET `default` ='0' WHERE `id` !='$id'");
- $result = mysql_query("UPDATE `profilepicture` SET `default` ='1' WHERE `id` ='$id'");
- $this->close();
- }
- if(isset($_SESSION['userName']))
- {
- $this->connect();
- $username = $_SESSION['userName'];
- $result = mysql_query("SELECT * FROM `profilepicture` WHERE `username` = '$username'");
- while($row = mysql_fetch_array($result))
- {
- $id = row['id'];
- $picture = $row['big'];
- $picturethumb = $row['small'];
- $default = $row['default'];
- ?>
- <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
- <?php
- echo '<a class="thumb" name="thumb" href="' .$picture. '" title="Title #0">';
- echo '<img src="' .$picturethumb. '" alt="Title #0" /></a>';
- ?>
- <?php if ($row['default'] == '1') { ?><input name="default" type="radio" value="<?php echo $id; ?>" checked="checked" />
- <br /><?php } else { ?><label><input name="default" type="radio" value="<?php echo $id; ?>" />
- <br /><?php }
- }
- echo '<input type="submit" name="submit" value="submit"/></form>';
- ?>
- <script>
- function confirmDelete(delUrl) {
- if (confirm("Are you sure you want to delete")) {
- document.location = delUrl;
- }
- }
- </script>
- <input type=button value="Delete" onClick="javascript:confirmDelete('delete.php?big=<?php echo $picture;?>&small=<?php echo $picturethumb;?>')">
- <?php
- $this->close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement