示例#1
0
 /**
  * Construct
  */
 public static function main()
 {
     error_reporting(E_ERROR | E_PARSE);
     $_SESSION["fail"] = null;
     $_SESSION["success"] = null;
     $_SESSION["path"] = null;
     $_SESSION["chmod"] = null;
     $globalConfiguration = "app/etc/modules/";
     $localModuleFile = "app/code/local/";
     $localePT = "app/locale/pt_BR/";
     $localeEN = "app/locale/en_US/";
     $appAdminDefault = "app/design/adminhtml/default/default/";
     $appFrontendBase = "app/design/frontend/base/default/";
     $appFrontendDefault = "app/design/frontend/default/";
     $skinAdminDefault = "skin/adminhtml/default/default/";
     $skinBaseDefault = "skin/frontend/base/default/";
     $array = array($globalConfiguration . "Mage_PagSeguro.xml", $globalConfiguration . "PagSeguro_PagSeguro.xml", $localModuleFile . "Mage", $localModuleFile . "PagSeguro", $appAdminDefault . "layout/pagseguro.xml", $appAdminDefault . "template/pagseguro", $appFrontendBase . "layout/pagseguro_pagseguro.xml", $appFrontendBase . "template/pagseguro", $appFrontendDefault . "pagseguro", $localePT . "PagSeguro_PagSeguro.csv", $localePT . "template/email/sales/pagseguro_abandoned.html", $localeEN . "template/email/sales/pagseguro_abandoned.html", $skinAdminDefault . "pagseguro", $skinBaseDefault . "js/onepagecheckoutpagseguro.js", $skinBaseDefault . "js/pagseguro.js");
     foreach ($array as $item) {
         Remove::deleteItem($item, true);
     }
     if ($_SESSION['fail']) {
         $fail = $_SESSION['fail'];
         echo "<p><strong>N&atilde;o foi poss&iacute;vel remover o m&oacute;dulo por completo.</strong></p>";
         echo "<p><font color='red'>";
         echo "&Eacute; necess&aacute;rio alterar a permiss&atilde;o dos itens abaixo:</font></p>";
         echo "<p>" . $_SESSION['path'] . "<br /><strong>Exemplo:</strong></p><p>" . $_SESSION['chmod'] . "</p>";
         echo "<p><font color='red'>Ap&oacute;s alterar as permiss&otilde;es, tente novamente.</font></p>";
         $_SESSION['fail'] = null;
         $_SESSION['path'] = null;
         $_SESSION['chmod'] = null;
     } else {
         if ($_SESSION['success']) {
             echo "<p><strong>M&oacute;dulo removido com sucesso!</strong></p>";
         } else {
             echo "<p><strong>O m&oacute;dulo j&aacute; foi removido.</strong></p>";
         }
     }
     if ($_SESSION['success']) {
         echo "<p><strong>Itens removidos:</strong></p><p>" . $_SESSION['success'] . "</p>";
         $_SESSION['success'] = null;
     }
     if ($fail) {
         echo "<p><strong>Itens n&atilde;o removidos (restri&ccedil;&atilde;o de permiss&atilde;o):</strong></p>";
         echo "<p>" . $fail . "</p>";
     }
 }
示例#2
0
        echo date("l F j, Y, g:i a", $key);
        echo '<div class="g-plus" data-action="share" data-href="' . $path . '"></div>';
        echo '<div class="mail"> <a href="mailto:?subject=I wanted you to see this image&amp;body=Check out this site"' . $path . '"title="Share by Email">
                            <img src="http://png-2.findicons.com/files/icons/573/must_have/48/mail.png">
                        </a>
                    </div>';
        echo '<div class="fb-share-button" data-href="' . $path . '" data-layout="button_count"></div>';
        echo '</div>';
    }
    echo '</div>';
} else {
    if (isset($_SESSION['user_id'])) {
        $util = new Util();
        if ($util->isPostRequest()) {
            $filename = filter_input(INPUT_POST, 'filename');
            $removeFromFolder = new Remove();
            $removeFromFolder->removeFile($filename);
            $removeFromDB = new Login();
            $removeFromDB->removeUserPhotos($filename);
        }
        $results = new Login();
        $userPhotos = array();
        $userPhotos = $results->getUserPhotos($_SESSION['user_id']);
        if ($userPhotos) {
            echo '<div class="view_table">';
            foreach ($userPhotos as $uPhoto) {
                echo '<div class="meme">';
                //echo '<p>User ID ' . $stuff['user_id'] . '<br />';
                //echo 'Photo ID ' . $stuff['photo_id'] . '<br />';
                echo '<img src="' . $directory . '\\' . $uPhoto['filename'] . '."/> <br />';
                echo '<div class="g-plus" data-action="share" data-href="' . $directory . '\\' . $uPhoto['filename'] . '"></div>';
<html>
    <head>
        <meta charset="UTF-8">
        <title>Display Uploads</title>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
        <!-- Optional theme -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
    </head>
    <body>
        <?php 
$util = new Util();
$errors = array();
if ($util->isPostRequest()) {
    $filename = filter_input(INPUT_POST, 'filename');
    try {
        $scarlet = new Remove();
        $scarlet->removeFile($filename);
        $message = 'File was deleted successfully.';
    } catch (Exception $ex) {
        $errors[] = $ex->getMessage();
    }
}
$directory = scandir('./uploads');
?>

        
            <table class="table">
                <thead><td> File Name </td><td>File Type</td><td>File Size</td></thead>
                    <?php 
foreach ($directory as $file) {
    ?>