Store in GIT
This commit is contained in:
+183
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
require("inc/header.php");
|
||||
|
||||
$uid = $_GET['uid'];
|
||||
|
||||
//Select info about project
|
||||
$query = "SELECT project.id, project.name, `language`, `date`, `grade`, file.uid as `code`, `git`, `body` FROM project, file WHERE file.id=project.code AND project.uid='$uid'";
|
||||
$temp = ExecQuery($query);
|
||||
|
||||
if($temp->num_rows < 1)
|
||||
{
|
||||
header("Location: /projects");
|
||||
}
|
||||
|
||||
$info = $temp->fetch_assoc();
|
||||
|
||||
|
||||
//Select tags about project
|
||||
$query = "SELECT tag.name AS name FROM tag, tagged, project WHERE tag.id = tagged.`tag-id` AND project.id = tagged.`project-id` AND project.uid = '$uid' ORDER BY tag.name ASC";
|
||||
$tags = ExecQuery($query);
|
||||
|
||||
//Select media from project
|
||||
$query = "SELECT project.uid, media.type, media.name, media.file FROM media, project WHERE project.id = media.`project-id` AND project.uid = '$uid' ORDER BY media.type ASC";
|
||||
$media = ExecQuery($query);
|
||||
|
||||
//Select files from project
|
||||
$query = "SELECT file.uid, file.name, file.file FROM file, project WHERE project.id = file.`project-id` AND project.uid = '$uid' ORDER BY file.name ASC";
|
||||
$files = ExecQuery($query);
|
||||
?>
|
||||
|
||||
<!-- Portfolio Item Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header"><?php echo $info['name']; ?></h1>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<!-- Portfolio Item Row -->
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-9">
|
||||
<h3>Project Description</h3>
|
||||
<p><?php echo $info['body']; ?></p>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3>Project Details</h3>
|
||||
|
||||
<div class="well well-sm">
|
||||
Date: <?php echo $info['date']; ?><br/>
|
||||
Language: <?php echo $info['language']; ?><br/>
|
||||
Grade: <?php echo $info['grade']; ?>
|
||||
</div>
|
||||
|
||||
<?php if($info['code'] != "" || $info['git'] != ""){ ?>
|
||||
|
||||
<h4>Code</h4>
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<?php if($info['git'] != ""){ ?>
|
||||
<a href="<?php echo $info['git']; ?>" target="_blank" class="btn btn-default" title="Git repository">
|
||||
<?php if (strpos($info['git'], 'github') !== FALSE)
|
||||
{
|
||||
echo "<i class='fa fa-github fa-2x'></i>";
|
||||
}
|
||||
else if (strpos($info['git'], 'bitbucket') !== FALSE)
|
||||
{
|
||||
echo "<i class='fa fa-bitbucket fa-2x'></i>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<i class='fa fa-git fa-2x'></i>";
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($info['code'] != ""){ ?>
|
||||
<a href="/file/<?php echo $info['code']; ?>" class="btn btn-default" title="Direct download">
|
||||
<i class="fa fa-code fa-2x"></i>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if($tags->num_rows > 0) { ?>
|
||||
|
||||
<h4>Tags</h4>
|
||||
<ul class="list-unstyled list-inline">
|
||||
<?php while($row = $tags->fetch_assoc()) { ?>
|
||||
<li><a href="/projects/<?php echo $row['name']; ?>"><span class="label label-default"><?php echo $row['name']; ?></span></a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<?php if($media->num_rows > 0) { ?>
|
||||
<!-- Media Row -->
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">Media <small><?php echo $media->num_rows; ?></small></h3>
|
||||
</div>
|
||||
|
||||
<?php while($row = $media->fetch_assoc()) {
|
||||
|
||||
$type = $row['type'];
|
||||
|
||||
if($type == "image")
|
||||
{ ?>
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
<img class="img-responsive project-img" src="/media/<?php echo $row['uid'] . '/' . $row['file']; ?>" alt="<?php echo $row['name']; ?>">
|
||||
</div>
|
||||
<?php }
|
||||
if($type == "audio")
|
||||
{ ?>
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
<img class="img-responsive project-audio" src="/media/audio.png" data-src="/media/<?php echo $row['uid'] . '/' . $row['file']; ?>" alt="<?php echo $row['name']; ?>">
|
||||
</div>
|
||||
<?php }
|
||||
if($type == "video")
|
||||
{ ?>
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
<img class="img-responsive project-vid" src="/media/video.png" data-src="/media/<?php echo $row['uid'] . '/' . $row['file']; ?>" alt="<?php echo $row['name']; ?>">
|
||||
</div>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
<?php } ?>
|
||||
|
||||
<?php if($files->num_rows > 0) { ?>
|
||||
|
||||
<!-- Files Row -->
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">Files <small><?php echo $files->num_rows; ?></small></h3>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12">
|
||||
<ul class="list-unstyled">
|
||||
|
||||
<?php while($row = $files->fetch_assoc()){
|
||||
|
||||
$file = $row['file'];
|
||||
$end = substr($file, strrpos($file, '.')+1);
|
||||
|
||||
$filetype = "fa-file-o";
|
||||
|
||||
if($end == "pdf")
|
||||
$filetype = "fa-file-pdf-o";
|
||||
if($end == "txt")
|
||||
$filetype = "fa-file-text-o";
|
||||
if($end == "doc" || $end == "docx")
|
||||
$filetype = "fa-file-word-o";
|
||||
if($end == "xls" || $end == "xlsx")
|
||||
$filetype = "fa-file-excel-o";
|
||||
if($end == "zip" || $end == "rar")
|
||||
$filetype = "fa-file-archive-o";
|
||||
if($end == "c" || $end == "cpp" || $end == "java" || $end == "js" || $end == "php" || $end == "cs")
|
||||
$filetype = "fa-file-code-o";
|
||||
?>
|
||||
|
||||
<li><a href="/file/<?php echo $row['uid']; ?>" title="<?php echo $file; ?>"><i class="fa fa-fw <?php echo $filetype; ?>"></i><?php echo $row['name']; ?></a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
require("inc/footer.php");
|
||||
?>
|
||||
Reference in New Issue
Block a user