Thứ Sáu, 13 tháng 3, 2026

Hiệu ứng hover div load text lên

 

**** HTML

<div class="hover-box-2">

    <span class="default-text">141.001 VNĐ</span>

    <span class="hover-text">Xem Đơn hàng</span>

</div>

**** CSS

.hover-box-2 {

    position: relative;

    overflow: hidden;

    /* width: 240px; */

    width: 180px;

    height: 50px;

    background: linear-gradient(135deg, #ffe4ec, #fff0f5);

    border-radius: 12px;

    text-align: center;

    cursor: pointer;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

    margin: 0 auto;

    transition: transform 0.3s ease;

}

.hover-box-2:hover {

    transform: scale(1.03);

}

.hover-box-2 .default-text {

    top: 0;

    color: #444;

    opacity: 1;

}

.hover-box-2:hover .default-text {

    top: -100%;

    opacity: 0;

}

.hover-box-2 .hover-text {

    top: 100%;

    color: #e91e63;

    opacity: 0;

}

.hover-box-2:hover .hover-text {

    top: 0;

    opacity: 1;

}

.hover-box-2 .default-text, .hover-box-2 .hover-text {

    position: absolute;

    width: 100%;

    left: 0;

    transition: all 0.4s ease-in-out;

    line-height: 50px;

    font-size: 18px;

    font-weight: 600;

}

Thứ Năm, 12 tháng 3, 2026

Lấy userid duy nhất trong vòng lặp + Câu lệnh sql FIND_IN_SET

 Ví dụ:

pid 1 → userid 10
pid 2 → userid 10
pid 3 → userid 9

→ kết quả cần:

9,10 -------------------- $sum = 0;
$json_data = array();
$list_userid = array();

foreach($data_sp as $sp){

$total = $sp['g_count'] * $sp['g_price'];
$sum += $total;
$pid = $sp['g_pid'];

$shopemail = RETURN__CatalogSPShop__shopname($pid);
$userid = RETURN__UserID__Email($shopemail);

/* lưu userid */
$list_userid[] = $userid;

$json_data[] = array(
"gid" => $sp['gid'],
"g_pid" => $sp['g_pid'],
"g_price" => $sp['g_price'],
"g_point" => $sp['g_point'],
"g_count" => $sp['g_count'],
"g_code" => $sp['g_code'],
"g_title" => $sp['g_title'],
"total" => $total,
"userid" => $userid,
"is_view" => 0
);
}

/* lấy userid duy nhất */

$list_userid = array_unique($list_userid);

/* nếu muốn dạng chuỗi */

$userid_string = implode(",", $list_userid);

echo $userid_string; -------------------- $list_userid = [10,10,9]

array_unique →

[10,9]

implode →

"10,9" ---------------------

$sql = "SELECT *
FROM orders
WHERE FIND_IN_SET('$userid', order_shopids)
ORDER BY order_date DESC";

$rs = mysql_query($sql);

Thứ Hai, 9 tháng 3, 2026

Kéo xuống position-sticky giữ lại khi kéo xuống

 




.search-left .list-filters {

    position: sticky;

    top: 10px;

    padding-inline-start: 10px;

    padding-inline-end: 19px;

    padding-bottom: 10px;

    box-sizing: border-box;

    overflow-y: auto;

    overflow-x: hidden;

    max-height: calc(100vh - 103px);

    flex-shrink: 0;

    border-inline-end: 1px solid #e6e6e6;

    padding-inline-end: 1px;

}

Thứ Ba, 3 tháng 3, 2026

Lỗi không upload file exel trong FCKeditor

 đường dẫn : Website/ Fckeditor/config.js

bỏ các đường dẫn khác 
config.filebrowserUploadUrl = site_live+'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';

- là ok, cho uploads file xlsx, doc, docx

Thứ Hai, 2 tháng 3, 2026

ShopOrder - Show đơn hàng thuộc shopname

$shopid = $userid;

$sql = "SELECT * FROM  shop_orders";

$result = $db->sql_query($sql);

while($row = $db->sql_fetchrow($result)){

    $items = json_decode($row['order_text'], true);

    foreach($items as $item){

        if($item['shop_id'] == $shop_id){

            echo "Sản phẩm: ".$item['g_title'];

            echo " - Khách: ".$row['order_uname'];

            echo "<br>";

        }

    }

}

Chủ Nhật, 1 tháng 3, 2026

Scroll box + chỉnh item scroll + khi hover mới hiện



.scroll-box {
    box-sizing: border-box;
    background-color: #fff;
    border: 1px solid #e6ecf2;
    padding: 20px 16px;
    width: 240px;
    max-height: 90vh;
    left: 20px;
    overflow-y: auto;
    padding: 10px 0 20px 12px;
    position: sticky;
    z-index: 99;
    top: 74px;
}
/* Thanh cuộn */
.scroll-box::-webkit-scrollbar {
    width: 4px;   /* chỉnh nhỏ lại ở đây */
}

/* Mặc định ẩn */
.scroll-box{
    scrollbar-width: none;
}

.scroll-box::-webkit-scrollbar {
    width: 0;
}

/* Hover mới hiện */
.scroll-box:hover::-webkit-scrollbar {
    width: 4px;
}

.scroll-box:hover {
    scrollbar-width: thin;
}

Thứ Năm, 26 tháng 2, 2026

Send Email Server SMTP

Demo MadeChina 
1️⃣ Tải bản 5.2.27

Link tải trực tiếp:
https://github.com/PHPMailer/PHPMailer/archive/refs/tags/v5.2.27.zip

Upload 2 file:

class.phpmailer.php
class.smtp.php

Ghi đè lên bản cũ.

tải file: tại đây

----------------------------------------****-----------------------------------------

Code Run

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);

require_once 'classes/class.phpmailer.php';
require_once 'classes/class.smtp.php';

if(isset($_POST['send'])){

    $nguoigui = trim($_POST['nguoigui']);
    $content  = trim($_POST['content']);

    if(empty($nguoigui) || empty($content)){
        echo "<p style='color:red'>Thiếu dữ liệu</p>";
    }else{

        require_once 'includes/data/mail_config.php';

        $mailnhan     = $mail_email;
        $mailHost     = $mail_mailserver;
        $mailUsername = $mail_username;
        $mailPassword = $mail_password;
        $mailsetFrom  = $mail_username;

        $mail = new PHPMailer();
        $mail->CharSet = 'UTF-8';
        $mail->isSMTP();        

        /* ===== BẬT DEBUG ===== */
        // show error + note Email 
        $mail->SMTPDebug = 2;
        $mail->Debugoutput = 'html';


        $mail->Host       = $mailHost;
        $mail->SMTPAuth   = true;
        $mail->Username   = $mailUsername;
        $mail->Password   = $mailPassword;
        $mail->SMTPSecure = 'ssl';   
        $mail->Port       = 465;
        // Change 'SMTPSecure = tls' **** 'Port = 587' 
        // Not Support version < php 5..


        $mail->setFrom($mailsetFrom, 'KEIEIJUKU KBC');
        $mail->addAddress($mailnhan);
        $mail->addReplyTo($nguoigui);

        $mail->isHTML(true);
        $mail->Subject = "Test gửi mail";
        $mail->Body    = "<h3>Email từ: ".$nguoigui."</h3><p>".$content."</p>";

        if($mail->send()){
            echo "<h3 style='color:green'>Send Success</h3>";
        }else{
            echo "<h3 style='color:red'>Send Fail</h3>";
            echo "<strong>Error:</strong> ".$mail->ErrorInfo;
        }
    }
}
?>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test gửi mail</title>
</head>
<body>

<h2>Form gửi mail test</h2>

<?php
// kiểm tra server SMTP
$fp = fsockopen("mail93155.maychuemail.com", 465, $errno, $errstr, 10);
if (!$fp) {
    echo "Lỗi: $errstr ($errno)";
} else {
    echo "Kết nối OK";
    fclose($fp);
}

?>

<form method="post">
    <label>Email người gửi:</label><br>
    <input type="email" name="nguoigui" required><br><br>

    <label>Nội dung:</label><br>
    <textarea name="content" rows="5" required></textarea><br><br>

    <button type="submit" name="send">Gửi mail</button>
</form>

</body>
</html>