示例#1
0
        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>';
                echo '<div class="mail"> <a href="mailto:?subject=I wanted you to see this image&amp;body=Check out this site"' . $directory . '\\' . $uPhoto['filename'] . 'title="Share by Email">' . '<img src="http://png-2.findicons.com/files/icons/573/must_have/48/mail.png"> </a> </div>';
    <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) {
    ?>
                        <?php