<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
// www.bcoos.net 2006-09 1.0.2 GPL
//v1.3 www.exoops.info 2006/03 
// $Id: brokenfile.php,v 1.2 2004/03/20 18:35:12 greyhead Exp $
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: James Knickelbein
// Author Website : http://www.journeymilwaukee.com
// License Type   : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //
// Passed on      : My Downloads
// New module name: My Sections
// Version        : 1.1
// Modified by    : Faisal
// Website        : < http://www.a-xoops.com >
// Email          : info@a-xoops.com
// ------------------------------------------------------------------------- //
include_once("header.php");
if ($_POST[submit]) {
        if ( !$xoopsUser ) {
                $sender = 0;
                } else {
                        $sender = $xoopsUser->uid();
                }
$ip  = _REMOTE_ADDR;
$lid = intval($_POST['lid']);
$result = $db->query("SELECT COUNT(*) FROM ".$db->prefix("mysections_broken")." WHERE lid=$lid");
list ($count) = $db->fetchRow($result);
if ($count > 0) {
        redirect_header("index.php", 2, _ALREADYREPORTED);
        exit();
}
$newid = $db->genId($db->prefix("mysections_broken")."_reportid_seq");
$query = "INSERT INTO ".$db->prefix("mysections_broken")." SET reportid=$newid, lid=$lid, sender=$sender, ip='$ip'";
$db->query($query);
redirect_header("index.php", 2, _THANKSFORINFO);
exit();
} else {
include_once(XOOPS_ROOT_PATH."/header.php");
$lid = intval($_GET['lid']);
OpenTable();
mainheader();
echo "
<h4>"._REPORTBROKEN."</h4>
<form action='brokenfile.php' method='post'>
<input type='hidden' name='lid' value='$lid' />
"._THANKSFORHELP."
<br />"._FORSECURITYIPRECORDED."<br /><br />
<input type='submit' class='button' name='submit' value='"._REPORTBROKEN."' />
<input type='button' class='button' value='"._CANCEL."' onclick='javascript:history.go(-1)' />
</form>";
CloseTable();
}
include_once("footer.php");
?>