/var/www/hkosl.com/chineseaaedu/webadmin/content/upload_file/upload_file_addform.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
    
include_once('../../check_login.php');

    
//plupload init
    // upload_type : 1="only jpg,png,gif" , 2="only pdf", 3="only doc, excel, ppt", 4="All";
    // max_file_size_client : for client side
    // max_file_size_server : for server side

    
$max_file_num 20;
    
$filetype 1;
    if (
$filetype == 1) {
        
$filesize   "2";
        
$fileformat "jpg, gif, png";
    }
    
$pluploader = array(
        array(
'name' => 'filename_tc''langcode' => 'tc''upload_type' => $filetype'max_file_size_client' => $filesize 'mb''max_file_size_server' => $filesize 1048576'max_file_num' => $max_file_num'msg' => '圖片格式: ' $fileformat ' | 圖片大小: 最大'.$filesize.'MB | <br>最多上載數量 (同時): ' $max_file_num ' <br><br>')
    );
    
$temp_file_location "plupload/uploads/";

    
$for_table $_GET["for_table"];
    
$for_refid $_GET["for_refid"];
    
    if (
$for_table == "event") {
        
$sql        "select * from event where refid = ?";
        
$parameters = array($for_refid);
        if (!(
$sth $dbh->prepare($sql))) {
            throw new 
Exception('[' $sth->errorCode() . ']: ' print_r($sth->errorInfo()));
        }

        if (!
$sth->execute($parameters)) {
            throw new 
Exception('[' $sth->errorCode() . ']: ' print_r($sth->errorInfo()));
        }
        
$row_book $sth->fetch(PDO::FETCH_ASSOC);
    }
?>
<html>
<head>
    <?php include_once('../../head.php'); ?>
    <script type="text/javascript" src="../../js/jquery-ui-1.8.18.custom.min.js"></script>
    <link type="text/css" href="../../css/smoothness/jquery-ui-1.8.18.custom.css" rel="stylesheet"/>

</head>
<body>
<form action="upload_file_add.php" method="post" name="addform" enctype="multipart/form-data">
    <input type="hidden" name="for_table" value="<?= $_GET["for_table"?>"/>
    <input type="hidden" name="for_refid" value="<?= $_GET["for_refid"?>"/>

    <table width="800" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td height="70" align="right" valign="middle" class="icontxt">
                <table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="50" align="center" style="font-size: 12px;">
                            <input type="image" alt="submit" src="../../images/iconSave.png" width="32" height="32" border="0"><br>
                            &nbsp;儲存&nbsp;&nbsp;</a></td>
                        <td width="50" align="center">
                            <a href="upload_file_index.php?msg=取消&<?= "for_table=".$_GET["for_table"]."&for_refid=".(int)$_GET["for_refid"?>"><img src="../../images/iconCancel.png" alt="Cancel" width="32" height="32" border="0"><br>
                                &nbsp;取消&nbsp;&nbsp;</a></td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="pagetitletxt">
                &nbsp;&nbsp;<b><img src="../../images/iconList.jpg" width="48" height="48" align="absmiddle"/>圖片  > <?=$row_book['title_tc']?> > 新增圖片</b>
            </td>
        </tr>
        <tr>
            <td align="left" valign="middle"><!-- Content -->
                <table border="0" cellpadding="0" cellspacing="0">

                    <!-- plupload init -->
                    <?php foreach ($pluploader as $uploader) { ?>
                        <tr>
                            <td width="120" align="right" valign="top" class='content'>上載檔案<br>
                                <!--[<?= langcode2langname($uploader["langcode"]); ?>]-->
                            </td>
                            <td width="5" valign="top" class='content'>:&nbsp;</td>
                            <td class='content'>
                                <div class="container">

                                    <span class="msg"><?= $uploader["msg"?></span>

                                    <div id="log_<?= $uploader["name"?>"></div>
                                    <div id="uploader_<?= $uploader["name"?>">
                                        <p>Your browser doesn't have Flash or HTML5 support. You can upload file one by
                                            one.</p>
                                    </div>
                                    <br>
                                    <!-- list uploaded image -->
                                    <br>

                                    <div id="uploaded_img_<?= $uploader["name"?>">Image Uploaded Successfully
                                        (Temporary)<br><br></div>

                                    <!-- end plupload init -->

                                    <br/>

                                    <div style="clear: both"></div>

                                </div>
                                <br/>
                            </td>

                        </tr>

                    <?php ?>

                </table>
                <!-- End Content --></td>
        </tr>
        <tr>
            <td align="left" valign="middle">&nbsp;</td>
        </tr>
    </table>
    <?php include_once("plupload/plupload_init.php"); ?>
</form>
</body>
</html>