81 lines
2.5 KiB
PHP
81 lines
2.5 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
/* $Id: admin_viewreports.php 8 2009-01-11 06:02:53Z john $ */
|
||
|
|
|
||
|
|
$page = "admin_general1";
|
||
|
|
include "admin_header.php";
|
||
|
|
|
||
|
|
if(isset($_POST['task'])) { $task = $_POST['task']; } elseif(isset($_GET['task'])) { $task = $_GET['task']; } else { $task = "main"; }
|
||
|
|
|
||
|
|
|
||
|
|
if($task=="delete")
|
||
|
|
{
|
||
|
|
$database->database_query("DELETE FROM bateworldcom_zips.announcementbox WHERE id='".$database->database_real_escape_string($_GET["id"])."'");
|
||
|
|
$ch = curl_init();
|
||
|
|
$rand=rand(1, 40000);
|
||
|
|
// set url
|
||
|
|
curl_setopt($ch, CURLOPT_URL, "https://bateworld.com/cronjobs/rotatingbox.php?s=".$rand);
|
||
|
|
|
||
|
|
//return the transfer as a string
|
||
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||
|
|
|
||
|
|
// $output contains the output string
|
||
|
|
$output = curl_exec($ch);
|
||
|
|
|
||
|
|
// close curl resource to free up system resources
|
||
|
|
curl_close($ch);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function general()
|
||
|
|
{
|
||
|
|
global $ads, $database, $task;
|
||
|
|
if(isset($_POST['p'])) { $p = $_POST['p']; } elseif(isset($_GET['p'])) { $p = $_GET['p']; } else { $p = 1; }
|
||
|
|
if(isset($_POST['usage'])) { $usage = $_POST['usage']; } elseif(isset($_GET['usage'])) { $usage = $_GET['usage']; } else { $usage = ""; }
|
||
|
|
|
||
|
|
if(isset($_POST['from'])) { $from = $_POST['from']; } elseif(isset($_GET['from'])) { $from = $_GET['from']; } else { $from = ""; }
|
||
|
|
?>
|
||
|
|
|
||
|
|
<h1>Announcement Box</h1>
|
||
|
|
|
||
|
|
<a href="announcementbox.php">Add New</a><br /><br />
|
||
|
|
|
||
|
|
|
||
|
|
<table><tr><td>Image</td><td>Text</td><td>Link</td></tr>
|
||
|
|
<?php
|
||
|
|
$query=$database->database_query("SELECT * FROM bateworldcom_zips.announcementbox ORDER BY menu_order ASC");
|
||
|
|
while($row=$database->database_fetch_array($query))
|
||
|
|
{
|
||
|
|
?><tr><td><?php if($row["image"]!=""){?><img src="<?php echo $row["image"];?>" style="max-width: 100px;" /><?php }?></td><td><?php echo $row["text"];?></td><td><?php echo $row["link"];?></td><td>
|
||
|
|
<a href="announcementbox.php?id=<?php echo $row["id"];?>">Edit</a></td><td>
|
||
|
|
<a href="announcementboxes.php?id=<?php echo $row["id"];?>&task=delete" onclick="return confirm('Are you sure you want to delete this?');">Delete</a></td></tr>
|
||
|
|
<?php
|
||
|
|
}
|
||
|
|
?>
|
||
|
|
</table>
|
||
|
|
|
||
|
|
|
||
|
|
<?
|
||
|
|
}
|
||
|
|
// CONSTRUCT QUERY USING FILTERS
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// ASSIGN VARIABLES AND SHOW VIEW REPORTS PAGE
|
||
|
|
$smarty->assign('total_reports', $total_reports);
|
||
|
|
$smarty->assign('pages', $page_array);
|
||
|
|
$smarty->assign('reports', $report_array);
|
||
|
|
$smarty->assign('i', $i);
|
||
|
|
$smarty->assign('u', $u);
|
||
|
|
$smarty->assign('p', $page_vars[1]);
|
||
|
|
$smarty->assign('s', $s);
|
||
|
|
$smarty->assign('f_object', $f_object);
|
||
|
|
$smarty->assign('f_reason', $f_reason);
|
||
|
|
$smarty->assign('f_details', $f_details);
|
||
|
|
include "admin_footer.php";
|
||
|
|
?>
|