Beispiel #1
0
function generateObjectRow($irn)
{
    $iw = "150";
    $sirn = sqlSafe($irn);
    $query = "SELECT location_name, location_barcode, image_url, title, year, accession_no, medium, barcode FROM objects WHERE irn={$sirn}";
    $result = readQuery($query);
    if ($row = $result->fetch_assoc()) {
        $info = $row;
    } else {
        return null;
    }
    $lbarcode = generateBarcode($info['location_barcode']);
    $lname = $info['location_name'];
    $title = $info['title'];
    $year = $info['year'];
    $creators = getCreators($irn);
    $acc = $info['accession_no'];
    $medium = $info['medium'];
    $measures = getMeasurements($irn);
    $obarcode = generateBarcode($info['barcode']);
    $children = getChildren($irn);
    $html = '';
    $html .= "\n<tr>";
    //Current Location
    $html .= "\n<td width=\"16%\">";
    $html .= "\n<p>{$lname}</p>";
    $html .= "\n{$lbarcode}";
    $html .= "\n</td>";
    //Object
    $html .= "\n\t<td width=\"50%\">";
    $titlealt = htmlentities($title);
    $html .= "\n<table class=\"noborder\" summary=\"Alignment Table\">\n\t<tr>";
    if (isset($info['image_url'])) {
        $img = $info['image_url'];
        $html .= "\n\t\t<td class=\"obj-img\"><img src=\"{$img}\" width=\"{$iw}\" alt=\"{$titlealt}\"/></td>";
    }
    $html .= "\n\t\t<td class=\"obj-txt\">";
    $html .= "\n\t\t\t<p><span class=\"obj-title\">{$title},</span> <span class=\"obj-year\">{$year}</span></p>";
    foreach ($creators as $key => $c) {
        $cname = $c['name'];
        $html .= "\n\t\t\t<p><span class=\"cre-name\">{$cname}</span>";
        if (!empty($c['role'])) {
            $crole = $c['role'];
            $html .= "<span class=\"cre-role\"> ({$crole})</span>";
        }
        $html .= "</p>";
    }
    $html .= "\n\t\t\t<p class=\"obj-acc\">{$acc}</p>";
    $html .= "\n\t\t\t<p class=\"obj-med\">{$medium}</p>";
    foreach ($measures as $key => $m) {
        if (empty($m['type'])) {
            $type = 'Unknown';
        } else {
            $type = $m['type'];
        }
        $html .= "\n\t\t\t<p class=\"obj-measure\">{$type}: ";
        $first = true;
        if (!empty($m['height'])) {
            $first = false;
            $html .= "H: " . $m['height'] . " in.";
        }
        if (!empty($m['width'])) {
            if (!$first) {
                $html .= " x";
            }
            $first = false;
            $html .= " W: " . $m['width'] . " in.";
        }
        if (!empty($m['depth'])) {
            if (!$first) {
                $html .= " x";
            }
            $html .= " D: " . $m['depth'] . " in.";
        }
        $html .= "</p>";
    }
    $html .= "\n\t\t\t{$obarcode}";
    $html .= "\n\t\t</td>";
    $html .= "</tr></table>";
    if (count($children) >= 1) {
        $html .= "\n\t\t<table summary=\"Children of {$titlealt}\"class=\"obj-parts\">";
        $html .= "\n\t\t\t<tr>";
        $html .= "\n\t\t\t\t<th colspan=\"1\">Location</th>";
        $html .= "\n\t\t\t\t<th>Parts</th>";
        $html .= "\n\t\t\t</tr>";
        foreach ($children as $key => $c) {
            $bcode = generateBarcode($c['barcode']);
            $lbcode = generateBarcode($c['location_barcode']);
            $title = $c['title'];
            $accno = $c['accession_no'];
            $loc = $c['location_name'];
            $cirn = $c['irn'];
            $html .= "\n\t\t\t<tr>";
            $html .= "\n\t\t\t\t<td >";
            $html .= "\n\t\t\t\t\t<p class=\"part-loc\">{$loc}</p>";
            $html .= "\n\t\t\t\t\t{$lbcode}";
            $html .= "\n\t\t\t\t</td>";
            $html .= "\n\t\t\t\t<td><span  class=\"part-acc\">{$accno}</span> - <span class=\"part-title\">{$title}</span>";
            $html .= "\n\t\t\t\t\t{$bcode}";
            $html .= "\n\t\t\t\t</td>";
            $html .= "\n\t\t\t</tr>";
        }
        $html .= "\n\t\t</table>";
    }
    $html .= "\n\t</td>";
    //Specific Location
    $html .= "\n\t<td width=\"16%\">";
    $html .= "\n\t\t\t<p class=\"specLoc\">Building:<br>";
    $html .= "\n\t\t\tRoom / Gallery:<br>";
    $html .= "\n\t\t\tBin / Rack / Zone:<br>";
    $html .= "\n\t\t\tUnit / Cab. / Case:<br>";
    $html .= "\n\t\t\tShlf / Drwr / Rack:<br>";
    $html .= "\n\t\t\tOther:<br> </p>";
    $html .= "\n\t</td>";
    //Audit
    $html .= "\n\t<td width=\"16%\">";
    $html .= "\n\t\t<div class=\"audit\">";
    $html .= "\n\t\t\t<p>Moved By:</p>";
    $html .= "\n\t\t\t<p>Date:</p>";
    $html .= "\n\t\t\t<p>Rec. in EMu By:</p>";
    $html .= "\n\t\t\t<p>Date:</p>";
    $html .= "\n\t\t</div>";
    $html .= "\n\t</td>";
    //End
    $html .= "\n</tr>";
    /*
    $html .= "\n<tr class='pb'>";
    $html .= "\n\t<td class='pb'>";
    $html .= "\n\t\t<div class='pb'>";
    $html .= "\n\t\t</div>";
    $html .= "\n\t</td>";
    $html .= "\n</tr>";
    */
    return $html;
}
Beispiel #2
0
    exit;
}
// Fonction qui check s'il a le droit de modifier.
if (connected() && (checkOrganiser($_SESSION['id'], $_GET['id']) or $_SESSION['niveau'] == 2 or $_SESSION['niveau'] == 3)) {
} else {
    if (!connected()) {
        alert("error", "Vous devez être connecté !");
        header("Location: " . getLink(["membres", "connexion"]));
        exit;
    } else {
        alert("error", "Vous n'avez pas le droit de modifier cet évènement!");
        header("Location: " . getLink(["accueil"]));
        exit;
    }
}
$contents['modos'] = array_merge(getCreator($_GET["id"]), getCreators($_GET['id']));
$contents['errorMessage'] = '';
if (!empty($_POST['pseudo'])) {
    if (!checkUsed($_POST['pseudo'], NULL, False)) {
        ///si le pseudo n'existe pas///
        $contents['errorMessage'] .= 'Le pseudo renseigné n\'existe pas ! ';
    }
    $orga_id = getUserAuth($_POST['pseudo'], False)['id'];
    if (checkOrganiser($orga_id, $_GET['id'])) {
        $contents['errorMessage'] .= 'Le pseudo renseigné est déja organisateur de cet évènement ! ';
    }
    if (getUserDetails($orga_id)['niveau'] <= 0) {
        $contents['errorMessage'] .= 'Le pseudo renseigné n\'est pas activé ! ';
    }
    if (empty($contents['errorMessage'])) {
        if (insertModo($_GET['id'], $orga_id)) {
Beispiel #3
0
        case 9:
            $contents['photo_principale'] = "/assets/images/rassemblementType.jpg";
            break;
        case 10:
            $contents['photo_principale'] = "/assets/images/logo.jpg";
            break;
        default:
            $contents['photo_principale'] = "/assets/images/picnic1.jpg";
            break;
    }
}
$site = sponsor($_GET['id']);
$contents['sponsor'] = $site[0];
$images = getImages($_GET['id']);
$contents['images'] = $images;
$creators = getCreators($_GET['id']);
$contents['creators'] = $creators;
$i = 0;
foreach ($contents['creators'] as $organisateur) {
    $organisateur_photo = getMembersPicture($organisateur['id']);
    if ($organisateur_photo) {
        $contents['creators'][$i]['picture'] = PHOTO_PROFIL . $organisateur_photo[0];
        $i++;
    } else {
        $contents['creators'][$i]['picture'] = IMAGES . "photo_profil_defaut.jpg";
        $i++;
    }
}
$comment = getComments($_GET['id']);
$contents['comment'] = $comment;
$i = 0;
Beispiel #4
0
}
// Fonction qui check s'il a le droit de modifier.
if (connected() && (checkOrganiser($_SESSION['id'], $_GET['id']) or $_SESSION['niveau'] == 2 or $_SESSION['niveau'] == 3)) {
} else {
    if (!connected()) {
        alert("error", "Vous devez être connecté !");
        header("Location: " . getLink(["membres", "connexion"]));
        exit;
    } else {
        alert("error", "Vous n'avez pas le droit de modifier cet évènement!");
        header("Location: " . getLink(["accueil"]));
        exit;
    }
}
$contents['errorMessage'] = '';
$contents['modos'] = getCreators($_GET['id']);
$contents['creator'] = getCreator($_GET['id']);
if (!empty($_POST)) {
    if (!checkUsed($_POST['pseudo'], NULL, False)) {
        ///si le pseudo n'existe pas///
        $contents['errorMessage'] .= 'Le pseudo renseigné n\'existe pas ! ';
    }
    $orga_id = getUserAuth($_POST['pseudo'], False)['id'];
    if (!checkOrganiser($orga_id, $_GET['id'])) {
        $contents['errorMessage'] .= 'Le pseudo renseigné n\'est pas organisateur de cet évènement ! ';
    }
    if (getUserDetails($orga_id)['niveau'] <= 0) {
        $contents['errorMessage'] .= 'Le pseudo renseigné n\'est pas activé ! ';
    }
    if (strtolower($contents['creator'][0][0]) == strtolower($_POST['pseudo'])) {
        $contents['errorMessage'] .= 'Vous ne pouvez pas supprimer le créateur !';