Esempio n. 1
0
<!doctype html>
<html>
<head>
<? require('../inc_meta.php'); ?>
</head>

<body>
<ul id="sortable" class="sortableFile">
<?php 
$sql = "SELECT * FROM trn_content_picture WHERE CONTENT_ID = " . intval($_GET['cID']) . " AND CAT_ID = " . intval($_GET['cat']) . " AND DIV_NAME = '" . $_GET['page'] . "' ORDER BY ORDER_ID ASC";
$query = mysql_query($sql, $conn);
while ($row = mysql_fetch_array($query)) {
    if ($row['IMG_TYPE'] == 3) {
        $style = 'style="background-size: 100% 100%; background-image: url(&quot;http://img.youtube.com/vi/' . $row['IMG_PATH'] . '/maxresdefault.jpg&quot;);"';
    } else {
        $style = 'style="background-image:url(' . returnUploadFileExtensions($row['IMG_PATH']) . ')"';
    }
    echo '<li class="ui-state-default" data-id="' . $row['PIC_ID'] . '">';
    echo '<span class="OrderFileThumb" ' . $style . '>';
    echo '</span>';
    echo '<span class="OrderFileText">';
    echo $row['IMG_NAME'];
    echo '</span>';
    echo '</li>';
}
?>
</ul>
<link rel="stylesheet" type="text/css" href="../../assets/font/ThaiSans-Neue/font.css" media="all" >
<link rel="stylesheet" type="text/css" href="../master/style.css" media="all" />
<script type="text/javascript" src="../master/script.js"></script>
<script>
Esempio n. 2
0
<style type="text/css">
audio{
	margin: 200px 80px 0px;
	width: 480px;
}
</style>
<?
   }else{

?>
<div class="circleBase">
	<a href="download.php?p=<?php 
echo $uploadfile;
?>
" target="_blank" style="background-image: url('<?php 
echo returnUploadFileExtensions($uploadfile);
?>
');">Download here</a>
</div>
<style type="text/css">
.circleBase {
    border-radius: 50%;
    width: 320px;
    height: 320px;
    background: #f0f0f0;
    border: 30px solid #aaa;
    margin: 20px auto 0px;
}
.circleBase a{
	text-indent: -9000px;
	width: 200px;
Esempio n. 3
0
function admin_edit_video($name, $id, $cat, $type)
{
    /* เหมือนตัว add */
    global $conn;
    $str = array();
    $total = 0;
    $str[0];
    $str[0] .= '<div class="tabs">' . "\n\t";
    $str[0] .= '<ul>' . "\n\t";
    $str[0] .= '<li><a href="#tabs_' . $name . '_1">Upload</a></li>' . "\n\t";
    if ($type == 'video') {
        $str[0] .= '<li><a href="#tabs_' . $name . '_2">Embed</a></li>' . "\n\t";
    }
    $str[0] .= '<li><a href="#tabs_' . $name . '_3">Link</a></li>' . "\n\t";
    $str[0] .= '</ul>' . "\n\t";
    $str[0] .= '<div id="tabs_' . $name . '_1">' . "\n\t";
    $str[0] .= '<input class="buttonAction silver-flat-button VideoUpload" type="button" value="แนบ" data-name="' . $name . '">' . "\n\t";
    $str[0] .= '<img class="VideoUpload_loading" id="VideoUpload_loading_' . $name . '" src="../images/ajax-loader.gif" alt="loading" />' . "\n\t";
    $sql = "SELECT * FROM trn_content_picture WHERE CONTENT_ID = " . $id . " AND IMG_TYPE =  '2' AND CAT_ID = " . $cat . " AND DIV_NAME =  '" . $name . "' ORDER BY ORDER_ID ASC";
    $query = mysql_query($sql, $conn) or die($sql);
    $num = mysql_num_rows($query);
    if ($num == 0) {
        $str[0] .= '<div class="DataBlock dNone"></div>' . "\n\t";
    } else {
        $total += $num;
        $str[0] .= '<div class="DataBlock">' . "\n\t";
        while ($row = mysql_fetch_array($query)) {
            $str[0] .= '<div class="Upload_tab" data-value="' . $row['IMG_PATH'] . '">';
            $str[0] .= '<a href="#" onclick="popupUpload(\'' . $row['IMG_PATH'] . '\'); return false;">';
            $str[0] .= '<span class="UploadVideoBox" data-Name="' . $row['IMG_PATH'] . '" style="background-image:url(' . returnUploadFileExtensions($row['IMG_PATH']) . ')"></span>';
            $str[0] .= '</a>';
            $str[0] .= '<input name="video_name" class="video_edit_name" data-value="' . $row['IMG_PATH'] . '" value="' . $row['IMG_NAME'] . '" onblur="editVideoName(\'' . $row['IMG_PATH'] . '\',\'' . $name . '\', 1)" />';
            $str[0] .= '<a href="#" onclick="popupUpload(\'' . $row['IMG_PATH'] . '\'); return false;">';
            $str[0] .= '<span class="UploadAction viewUpload"></span>';
            $str[0] .= '</a>';
            $str[0] .= '<a href="#" onclick="delEditVideo(\'' . $row['IMG_PATH'] . '\',\'' . $name . '\',\'' . $row['PIC_ID'] . '\',1); return false;">';
            $str[0] .= '<span class="UploadAction delUpload"></span>';
            $str[0] .= '</a>';
            $str[0] .= '</div>';
        }
        $str[0] .= '</div>' . "\n\t";
    }
    $str[0] .= '</div>' . "\n\t";
    if ($type == 'video') {
        $str[0] .= '<div id="tabs_' . $name . '_2">' . "\n\t";
        $str[0] .= '<input type="text" class="Embed_input" name="Embed_input_' . $name . '" />' . "\n\t";
        $str[0] .= '<input class="buttonAction silver-flat-button EmbedUpload" type="button" value="แนบ" data-name="' . $name . '">' . "\n\t";
        $str[0] .= '<span class="video_note">* ใส่แค่รหัสวีดีโอ youtube เท่านั้น</span>' . "\n\t";
        $sql = "SELECT * FROM trn_content_picture WHERE CONTENT_ID = " . $id . " AND IMG_TYPE =  '3' AND CAT_ID = " . $cat . " AND DIV_NAME =  '" . $name . "' ORDER BY ORDER_ID ASC";
        $query = mysql_query($sql, $conn) or die($sql);
        $num = mysql_num_rows($query);
        if ($num == 0) {
            $str[0] .= '<div class="DataBlock dNone"></div>' . "\n\t";
        } else {
            $total += $num;
            $str[0] .= '<div class="DataBlock">' . "\n\t";
            while ($row = mysql_fetch_array($query)) {
                $str[0] .= '<div class="Embed_tab" data-value="' . $row['IMG_PATH'] . '">';
                $str[0] .= '<a href="#" onclick="popupEmbed(\'' . $row['IMG_PATH'] . '\'); return false;">';
                $str[0] .= '<span data-Name="' . $row['IMG_PATH'] . '" style="background-image:url(http://img.youtube.com/vi/' . $row['IMG_NAME'] . '/maxresdefault.jpg)"></span>';
                $str[0] .= '</a>';
                $str[0] .= '<input name="video_name" class="video_edit_name" data-value="' . $row['IMG_PATH'] . '" disabled value="https://youtu.be/' . $row['IMG_NAME'] . '" onblur="editVideoName2(\'' . $row['IMG_PATH'] . '\',\'' . $row['IMG_NAME'] . '\', 2)" />';
                $str[0] .= '<a href="#" onclick="popupEmbed(\'' . $row['IMG_PATH'] . '\'); return false;">';
                $str[0] .= '<span class="EmbedAction viewEmbed"></span>';
                $str[0] .= '</a>';
                $str[0] .= '<a href="#" onclick="delEditVideo(\'' . $row['IMG_PATH'] . '\',\'' . $name . '\',\'' . $row['PIC_ID'] . '\',2); return false;">';
                $str[0] .= '<span class="EmbedAction delEmbed"></span>';
                $str[0] .= '</a>';
                $str[0] .= '</div>';
            }
            $str[0] .= '</div>' . "\n\t";
        }
        $str[0] .= '</div>' . "\n\t";
    }
    $str[0] .= '<div id="tabs_' . $name . '_3">' . "\n\t";
    $str[0] .= '<input type="text" class="Link_input" name="Link_input_' . $name . '" />' . "\n\t";
    $str[0] .= '<input class="buttonAction silver-flat-button LinkUpload" type="button" value="แนบ" data-name="' . $name . '">' . "\n\t";
    $str[0] .= '<span class="video_note">* ใส่แค่ url เท่านั้น</span>' . "\n\t";
    $sql = "SELECT * FROM trn_content_picture WHERE CONTENT_ID = " . $id . " AND IMG_TYPE =  '4' AND CAT_ID = " . $cat . " AND DIV_NAME =  '" . $name . "' ORDER BY ORDER_ID ASC";
    $query = mysql_query($sql, $conn) or die($sql);
    $num = mysql_num_rows($query);
    if ($num == 0) {
        $str[0] .= '<div class="DataBlock dNone"></div>' . "\n\t";
    } else {
        $total += $num;
        $str[0] .= '<div class="DataBlock">' . "\n\t";
        while ($row = mysql_fetch_array($query)) {
            $str[0] .= '<div class="Link_tab" data-value="' . $row['IMG_PATH'] . '">';
            $str[0] .= '<a href="#" onclick="popupLink(\'' . $row['IMG_PATH'] . '\'); return false;">';
            $str[0] .= '<span class="LinkVideoBox" data-Name="' . $row['IMG_PATH'] . '" style="background-image:url(' . returnUploadFileExtensions($row['IMG_PATH']) . ')"></span>';
            $str[0] .= '</a>';
            $str[0] .= '<input name="video_name" class="video_edit_name" data-value="' . $row['IMG_PATH'] . '" value="' . $row['IMG_NAME'] . '" onblur="editVideoName2(\'' . $row['IMG_PATH'] . '\',\'' . $name . '\',\'' . $row['PIC_ID'] . '\', 3)" />';
            $str[0] .= '<a href="#" onclick="popupLink(\'' . $row['IMG_PATH'] . '\'); return false;">';
            $str[0] .= '<span class="LinkAction viewLink"></span>';
            $str[0] .= '</a>';
            $str[0] .= '<a href="#" onclick="delEditVideo(\'' . $row['IMG_PATH'] . '\',\'' . $name . '\',\'' . $row['PIC_ID'] . '\',3); return false;">';
            $str[0] .= '<span class="LinkAction delLink"></span>';
            $str[0] .= '</a>';
            $str[0] .= '</div>';
        }
        $str[0] .= '</div>' . "\n\t";
    }
    if ($total == 0) {
        $total = 'dNone';
    } else {
        $total = '';
    }
    $str[0] .= '</div>' . "\n\t";
    $str[0] .= '</div>' . "\n\t";
    $str[0] .= '<div class="p-Absolute ' . $total . ' OrderVideoBtn" data-name="' . $name . '" data-cat="' . $cat . '" data-cID="' . $id . '"></div>' . "\n\t";
    $str[0] .= '<div class="dNone" id="DataBlock_' . $name . '"></div>' . "\n\t";
    switch ($type) {
        case "video":
            $accept = 'video/*';
            break;
        case "sound":
            $accept = 'audio/*';
            break;
        case "flash":
            $accept = '.swf';
            break;
        case "doc":
            $accept = '.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.txt,';
            break;
        case "all":
            $accept = '*.*';
            break;
    }
    $str[1] = '<form action="../master/videoUpload.php" target="iframeTarget" method="post" name="form_' . $name . '" enctype="multipart/form-data">' . "\n\t";
    $str[1] .= '<input type="hidden" name="my_name" value="' . $name . '" >' . "\n\t";
    $str[1] .= '<input class="inputUploadVideo" type="file" name="my_files" data-name="' . $name . '" accept="' . $accept . '" >' . "\n\t";
    $str[1] .= '</form>' . "\n\t";
    return $str;
}