"Fossies" - the Fresh Open Source Software Archive

Member "eventh/modapply.php" (26 Jan 2010, 5858 Bytes) of package /linux/privat/old/eventh-1.1.11.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "modapply.php" see the Fossies "Dox" file reference documentation.

    1 <?
    2 /*
    3     This file is part of Event Horizon (EVH).
    4 
    5     EVH is free software; you can redistribute it and/or modify
    6     it under the terms of the GNU General Public License as published by
    7     the Free Software Foundation; either version 3 of the License, or
    8     (at your option) any later version.
    9 
   10     EVH is distributed in the hope that it will be useful,
   11     but WITHOUT ANY WARRANTY; without even the implied warranty of
   12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13     GNU General Public License for more details.
   14 
   15     You should have received a copy of the GNU General Public License
   16     along with this program.  If not, see <http://www.gnu.org/licenses/>.
   17 */
   18 
   19 include "inc.php";
   20 if (isset($fname)) $fname = stripslashes($fname);
   21 ?>
   22 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
   23 <html>
   24 <head>
   25 <title><?=$appname; ?> - Modification Results</title>
   26 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   27 <link href="default.css" rel="stylesheet" type="text/css">
   28 </head>
   29 <body>
   30 <?
   31 if (isset($del) and $del == 1 and !isset($confirm)) {
   32     echo '<script language="JavaScript">' . "\r\n";
   33     echo '<!--' . "\r\n";
   34     echo 'input_box=confirm("Do you really want to delete this file? \r\nClick OK or Cancel to Continue");' . "\r\n";
   35     echo 'if (input_box==true) {' . "\r\n";
   36     echo 'window.location = location.href+"&confirm=1";' . "\r\n";
   37     echo '}' . "\r\n";  
   38     echo 'if (input_box==false) {' . "\r\n";
   39     echo 'window.location = location.href+"&confirm=0";' . "\r\n";
   40     echo '}' . "\r\n";      
   41     echo '-->' . "\r\n";
   42     echo '</script>' . "\r\n";
   43     $dismsg = '';
   44 }
   45 elseif (isset($del) and $del == 1 and isset($confirm) and $confirm == 1) {
   46         $query = 'select id from Files where sessionid=' . $sessid;
   47         $res = mysql_query($query,$dbh) or die('<p><b>File was invalid, could not delete.</b>.\n<br />Query: ' . $query . '<br />\nError: (' . mysql_errno() . ') ' . mysql_error());
   48         $row = mysql_fetch_row($res);
   49         
   50         if ($savehistory) {
   51             // record file deletion into History table;
   52             insert_history_entry('delete', $row[0], $sessid); // Log deletion before file/session are deleted;
   53         }
   54         
   55         $query = 'delete from Files where sessionid=' . $sessid;
   56         $res = mysql_query($query,$dbh) or die('<p><b>File was invalid, could not delete.</b>.\n<br />Query: ' . $query . '<br />\nError: (' . mysql_errno() . ') ' . mysql_error());
   57         $query = 'delete from Sessions where id=' . $sessid;
   58         $res = mysql_query($query,$dbh) or die('<p><b>Session was invalid, could not delete.</b>.\n<br />Query: ' . $query . '<br />\nError: (' . mysql_errno() . ') ' . mysql_error());
   59         remove_files($vercode);
   60         $dismsg = 'Session was deleted successfully.';  
   61         error_log($vercode . ': Removed via delete URL');   
   62 }
   63 elseif (isset($del) and $del == 1 and isset($confirm) and $confirm == 0) $dismsg = 'File deletion was cancelled.';
   64 else {
   65     $DestinationEmail = clean_email_string($DestinationEmail);
   66 
   67     // update sql database;
   68     $query='update Files set description="' . $File1Description . '" where id=' . $fileid;
   69     $res = mysql_query($query,$dbh) or die('<p><b>Could not update file information.</b>.\n<br />Query: ' . $query . '<br />\nError: (' . mysql_errno() . ') ' . mysql_error());
   70     
   71     $query='update Sessions set outdate="' . ${date . $AvailabilityPeriod} . '", avail="' . $AvailabilityPeriod . '", destemail="' . $DestinationEmail . '" where id=' . $sessid;
   72     $res = mysql_query($query,$dbh) or die('<p><b>Could not update session information.</b>.\n<br />Query: ' . $query . '<br />\nError: (' . mysql_errno() . ') ' . mysql_error());
   73     
   74     $queryavail='select Availability.long from Availability where Availability.short="' . $AvailabilityPeriod . '"';
   75     $resavail = mysql_query($queryavail,$dbh) or die('<p><b>Could not retrieve availability.</b>.\n<br />Query: ' . $queryavail . '<br />\nError: (' . mysql_errno() . ') ' . mysql_error());
   76     $rowavail = mysql_fetch_row($resavail);
   77     $availlong = $rowavail[0];
   78 
   79     // get filesize in readable format (MB);
   80     $querysize = 'select size from Files where id=' . $fileid;
   81     $ressize = mysql_query($querysize,$dbh) or die('<p><b>Could not retrieve file size.</b>.\n<br />Query: ' . $querysize . '<br />\nError: (' . mysql_errno() . ') ' . mysql_error());
   82     $rowsize = mysql_fetch_row($ressize);
   83     $filesize = round($rowsize[0] / 1024 / 1024, 2);
   84     
   85     $mailheader = $utf8mailhdr . 'From: ' . $srcemail . "\r\n" . 'Reply-To: ' . $srcemail;
   86     
   87     $mailmsg = 'The following file has been modified.<br><br>';
   88     $mailmsg .= 'Filename: ' . $fname . '<br>Description: ' . $File1Description . '<br>';
   89     $mailmsg .= 'Size: ' . $filesize . ' MB<br>';
   90     $mailmsg .= 'Availability Period: ' . $availlong . '<br>';
   91     $mailmsg .= 'Download Code: ' . $dnldpass . '<br><br>';
   92     $mailmsg .= 'Download: <a href="' . $proto . '://' . $servername . '/sendfile.php?fid=' . $fileid . '&vercode=' . $dnldpass . '">Click here to download the file</a><p>';
   93     $mailmsg .= 'If the download link above doesn\'t work for you, use the download code above on the <a href="' . $proto . '://' . $servername . '/download.php">' . $appname . ' download page</a>.'; 
   94     
   95     mb_send_mail("$DestinationEmail", 'File download at ' . $companyname . ' was modified', $mailmsg, $mailheader) or die('Failed to send email.');
   96     $dismsg = 'Session was modified successfully.';
   97 
   98     if ($savehistory) {
   99         // record file deletion into History table;
  100         insert_history_entry('modify', $fileid, $sessid);
  101     }
  102 }
  103 ?>
  104 <?=$titleandmenu; ?>
  105 <p align="center"><span class="content-text"><strong><?=$dismsg; ?></strong></span></p>
  106 <?
  107 if (isset($ba) and $ba == 1) {
  108     echo '<p align="center"><span class="content-text"><strong><a href=tnadmin/index.php>Back to admin page</a></strong></span></p>';
  109 }
  110 
  111 print $footer;
  112 ?>
  113 </body>
  114 </html>