Example #1
0
function getThumb($fileid)
{
    global $database, $fileinfo;
    if (getFileInfo($fileid)) {
        // if a file type we want to deal with
        if (!checkThumb($fileid)) {
            thumbnail($fileid);
        }
        $query = "select thumb from {$GLOBALS['tablePrefix']}filesystem where id=\"" . mysql_escape_string($fileid) . "\"";
        $result = mysql_query($query, $database);
        $fileThumb = mysql_fetch_assoc($result);
        header("Content-type:image/jpeg");
        echo $fileThumb['thumb'];
    }
}
     if ($_GET['page'] > $num_pages && $_GET['page'] != 1) {
         header('location:' . baseUrl . 'error');
         exit;
     }
     if (!empty($_GET['page']) && $_GET['page'] > 1) {
         $page = $_GET['page'] - 1;
         $start = $dataPerPage * $page;
     } else {
         $start = 0;
     }
     $sn = $start + 1;
     $getInfo = $obj_query->select_all('trip', $start, $dataPerPage);
     $i = 1;
     if (!empty($getInfo)) {
         foreach ($getInfo as $key => $value) {
             $status = checkThumb($value['imgPath']);
             if (empty($status)) {
                 $thumbPath = createThumbnail($_SESSION['rootDir'] . '/' . $value['imgPath']);
             } else {
                 $thumbPath = $status;
             }
             $info[] = array('sn' => $i++, 'id' => $value['id'], 'title' => $value['title'], 'category' => $value['category'], 'desc' => $value['desc'], 'imgPath' => baseUrl . $thumbPath, 'area' => $value['area'], 'duration' => $value['duration']);
         }
     }
     compareImage();
 }
 if ($target == 'addTrip') {
     $data = $obj_query->select_all('category');
     $trekking = $obj_query->select_all('trekking');
     $expedition = $obj_query->select_all('expedition');
 }
<?php

if (!empty($_GET['target'])) {
    $target = $_GET['target'];
    if ($target == 'showAll') {
        $title = "Manage Team";
        $allData = $obj_query->select_all('team');
        if (count($allData) > 3) {
            $footerName = 'dynamic';
        }
        if (!empty($allData)) {
            $i = 1;
            foreach ($allData as $key => $value) {
                if (!empty($value['photo'])) {
                    $status = checkThumb($value['photo']);
                    if (empty($status)) {
                        $thumbPath = createThumbnail($_SESSION['rootDir'] . '/' . $value['photo']);
                    } else {
                        $thumbPath = $status;
                    }
                } else {
                    if ($value['gender'] == 'Male' || $value['gender'] == 'male') {
                        $thumbPath = 'images/team/blankMale.jpg';
                    } else {
                        $thumbPath = 'images/team/blankFemale.jpg';
                    }
                }
                $info[] = array('sn' => $i++, 'id' => $value['id'], 'photo' => baseUrl . $thumbPath, 'name' => $value['name'], 'desc' => $value['description'], 'designation' => $value['designation']);
            }
        }
        compareImage();