@php if(!function_exists('get_lowest')){ function get_lowest($bidders) { $min = array_reduce($bidders, function ($carry, $value){ return $carry['bid_amount'] < $value['bid_amount']? $carry: $value; }, $bidders[0]); return $min['id']; } } if(!function_exists('get_allowed_tag')){ function get_allowed_tag($text){ $allowed_tags = '

      • '; $desc = str_replace(['','
        ','',''], ['
          ','
        ','
      • ','
      • '],$text); return strip_tags($desc, $allowed_tags); } } //$allowed_tags = ['b', 'br', 'em', 'hr', 'i', 'li', 'ol', 'p', 's', 'span', 'u', 'ul', 'h1', 'h2', 'h3']; $REMARK_COL = 1; $SUPPLIER_PER_PAGE = 3; $abstractdetail = $data['detail']; $twgs = $data['twg']; $suppliers = $data['detail'][0]['bidders']; $REGULAR_MEMBER_COUNT = 3; $ALT_MEMBER_COUNT = 1; $AS_READ = 1; $AS_AWARDED = 2; @endphp
        @for($copy = 0; $copy < ceil( $data['no_of_supplier'] / $SUPPLIER_PER_PAGE); $copy++)
        @if($data['type'] == $AS_READ)
        ABSTRACT OF BIDS (AS READ)
        @else
        ABSTRACT OF BIDS (AS AWARDED)
        @endif
        Project Name : {{ $data['bid_title'] }}
        Project Location : Visayas State University - Main Campus
        Implementing Office : {{ $data['owner_dept'] }}
        Approve Budget for the Contract : Php {{ number_format($data['approved_amount'], 2) }}
        Note:
        •         - Above ABC
        •         - Award
        • Text - LCB / SCB
        @for($i= $copy*$SUPPLIER_PER_PAGE ; $i < ($copy*$SUPPLIER_PER_PAGE)+$SUPPLIER_PER_PAGE ; $i++) @if($i < $data['no_of_supplier']) @else @endif @endfor @for($i= $copy*$SUPPLIER_PER_PAGE ; $i < ($copy*$SUPPLIER_PER_PAGE)+$SUPPLIER_PER_PAGE ; $i++) @if($i < $data['no_of_supplier']) @else @endif @endfor @php $currentRow = 0; $totalRows = 100; // Example number of rows @endphp @for($i=0; $i < count($abstractdetail); $i++) {{-- @for($i=0; $i < $totalRows; $i++)--}} {{-- @for($i=0; $i < 17; $i++)--}} @php $new_abc = is_null($abstractdetail[$i]['abc_updated']) ? $abstractdetail[$i]['price']['unit_price']: $abstractdetail[$i]['abc_updated']; $lowest_bid_id = null; $lowest_bid_id = get_lowest(json_decode($abstractdetail[$i]['bidders'],true)); @endphp @for($supp= $copy*$SUPPLIER_PER_PAGE ; $supp < ($copy*$SUPPLIER_PER_PAGE)+$SUPPLIER_PER_PAGE ; $supp++) @if($supp < $data['no_of_supplier']) @php $class = "row-details"; if (!is_null($lowest_bid_id) and $lowest_bid_id == $abstractdetail[$i]['bidders'][$supp]['id']){ $class .= " lcb"; } if($abstractdetail[$i]['bidders'][$supp]['bid_amount'] > $new_abc){ $class .= $data['type'] == $AS_READ? " above-abc" : ""; } if ($abstractdetail[$i]['bidders'][$supp]['won'] == 1) { $class .= $data['type'] == $AS_AWARDED? " award": ""; } @endphp @else @endif @endfor @if($data['type'] == $AS_AWARDED) @else @endif @endfor @for($supp= $copy*$SUPPLIER_PER_PAGE ; $supp < ($copy*$SUPPLIER_PER_PAGE)+$SUPPLIER_PER_PAGE ; $supp++) @endfor
        Item No. DESCRIPTION UNIT QTY ABC NAME OF FIRM OR DEALER
        {{$suppliers[$i]['supplier']['supplier_name']}} REMARKS
        Unit Price 
        {{$i+1}} {{$abstractdetail[$i]['stock']['descript']}} @if($abstractdetail[$i]['stock']['spec']) @php $desc = get_allowed_tag($abstractdetail[$i]['stock']['spec']['full_descript']); @endphp
        {!! $desc !!}
        @endif
        {{$abstractdetail[$i]['stock']['unit']['unit']}} {{$abstractdetail[$i]['total_qty']}} {{number_format($new_abc,2)}}
        {{ number_format($abstractdetail[$i]['bidders'][$supp]['bid_amount'],2)}}
        @if ($abstractdetail[$i]['bidders'][$supp]['offer_remarks'] != null) Offer
        {!! $abstractdetail[$i]['bidders'][$supp]['offer_remarks'] !!}
        @endif
          {{$abstractdetail[$i]['remarks']}}  
        xxxxxxxxxxxxxxNothing Followsxxxxxxxxxxxxxxxxx  
        @if($copy != ceil($data['no_of_supplier'] / $SUPPLIER_PER_PAGE)-1) @endif @endfor
        WE HEREBY CERTIFY:   1. That we opened the bids publicy in response to a public advertisement copy of which is filed herewith.
        2. That all the entries above are true and correct.

        COMMITTEE ON BIDS AND AWARDS:

        @for($reg_member_count = 0; $reg_member_count < $REGULAR_MEMBER_COUNT and $reg_member_count < count($data->bac_reg_member); $reg_member_count++ ) @endfor @for($alt_member_count = 0; $alt_member_count < $ALT_MEMBER_COUNT and $alt_member_count < count($data->bac_alt_member); $alt_member_count++ ) @endfor
        @if(count($data->bac_chair) > 0) {{ strtoupper($data->bac_chair[0]['personnels']['realname']) }} @endif
        Chairperson
        @if(count($data->bac_vice_chair) > 0) {{ strtoupper($data->bac_vice_chair[0]['personnels']['realname']) }} @endif
        Vice-Chairperson
        {{ strtoupper($data->bac_reg_member[$reg_member_count]['personnels']['realname']) }}
        Regular Member
        {{ strtoupper($data->bac_alt_member[$alt_member_count]['personnels']['realname']) }}
        Alternate Member

        TECHNICAL WORKING GROUP:

        @if(count($data->twg) >= 2) @else @endif
        {{ strtoupper($data->twg [0]['personnels']['realname']) }}
        Member
        {{ strtoupper($data->twg[1]['personnels']['realname']) }}
        Member
        No TWG assigned to this category
        {{--
        --}} {{--

        COMMITTE ON BIDS AND AWARDS :

        --}} {{--
        --}} {{-- --}} {{--
        Control No.: {{$data['control_num']}}
        --}} {{--
        --}}