Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/awards-old/
Upload File :
Current File : /var/www/cesa.co.za/awards-old/pastawards-gallery-2022.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>CESA Engineering Excellence Awards</title>
        <link href="screen.css" rel="stylesheet" type="text/css" />
        <style type="text/css">
            <!--
            .style1 {color: #B9BBA6}
            .style2 {color: #333333; }
            .auto-style1 {
                border-width: 0px;
            }
            -->
        </style>
    </head>

    <?php

    function resizeJpeg($source, $dest, $width = 300, $height = 300) {

        list($width_orig, $height_orig) = getimagesize($source);

        $ratio_orig = $width_orig / $height_orig;

        if ($width / $height > $ratio_orig) {
            $width = $height * $ratio_orig;
        } else {
            $height = $width / $ratio_orig;
        }

// Resampling the image
        $image_p = imagecreatetruecolor($width, $height);
        $image = imagecreatefromjpeg($source);

        imagecopyresampled($image_p, $image, 0, 0, 0, 0,
                $width, $height, $width_orig, $height_orig);

        ob_start();
        imagejpeg($image_p, null, 100);

        $imageData = ob_get_clean();

        file_put_contents($dest, $imageData);
    }
    ?>

    <body>
        <?php include('header.php'); ?>
        <table width="100%" border="0" cellpadding="0" cellspacing="0" style="max-width:1350px; margin:auto" align="center">
            <tr>
                <td align="left" class="left" width="250" valign="top" bgcolor="#808080">

                    <?php include('menu.php'); ?>

                </td>

                <td valign='top' class='contentBG' width="100%">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr valign="top">
                            <td class="content">
                                <table width="100%" border="0" cellspacing="0" cellpadding="12">
                                    <tr>
                                        <?php
                                        $path = "images/galleries/awards-2022/";

                                        // Open the folder
                                        $dir_handle = @opendir($path) or die("Unable to open $path");

                                        // Loop through the files
                                        $cnt = 0;
                                        while ($file = readdir($dir_handle)) {

                                            if (strlen($file) > 2 && strlen(file_get_contents($file)) <= 0 && $file != 'thumbs') {

                                                if (!file_exists("images/galleries/awards-2022/thumbs/$file")) {
                                                    resizeJpeg("images/galleries/awards-2022/$file", "images/galleries/awards-2022/thumbs/$file");
                                                }

                                                echo "<td width='33%' align='center' valign='center' height='300'><a href='images/galleries/awards-2022/$file' target='_blank'><img border='0' src='images/galleries/awards-2022/thumbs/$file'></a></td>";

                                                $cnt++;
                                            }

                                            if ($cnt % 3 == 0) {
                                                echo '</tr><tr>';
                                            }
                                        } //while
                                        // Close
                                        closedir($dir_handle);
                                        ?>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
                <td valign='top' width='250' bgcolor="#808080">
                    <?php include('rightbar.php'); ?></td>

            </tr>

        </table>

    </body>
</html>