@if(isset($contract->annotations ) && $contract->annotations !='')
                        <p>{!!$contract->annotations.'...'!!}</p>
                    @endif

                    @if(isset($contract->metadata ) && $contract->metadata !='')
                        <p>{!! $contract->metadata.'...' !!}</p>
                    @endif
                </div>
                @if($annotations->total>0)
                    @if(\Illuminate\Support\Facades\Input::has('annotation_category'))
                        <?php 
$annotation_categories = \Illuminate\Support\Facades\Input::get('annotation_category');
?>
                        @foreach($annotation_categories as $category)
                            <?php 
$annotation = searchInArray($annotations->result, 'category', $category);
?>
                            @if($annotation)
                                <?php 
$annotation_type = isset($annotation['shapes']) ? 'pdf' : 'text';
?>
                                {{str_limit($category,50)}}-<span
                                        style="color: #404040;">{{str_limit($annotation['text'],50)}}</span>
                                <a style="float: none"
                                   href="{{route('contract.detail',['id'=>$contract->open_contracting_id])}}#/{{$annotation_type}}/page/{{$annotation['page_no']}}/annotation/{{$annotation['id']}}">
                                    [Pg {{$annotation['page_no']}}]</a>
                                <br>
                            @endif
                        @endforeach

                    @endif
Esempio n. 2
0
function getUrl($buffer, $forbidden_types, $forbidden_strings)
{
    global $_POST;
    $website = HTTP_HOST;
    $web = parse_url($website);
    strtolower(substr($web['host'], 0, 4)) == "www." ? $web['host'] = substr($web['host'], 4) : null;
    $tmparray = array();
    foreach ($buffer as $key) {
        if ($web['scheme'] . "://www." . $web['host'] . "/" == $key or $web['scheme'] . "://" . $web['host'] . "/" == $key) {
            $key = $website;
        }
        if (strtolower(substr($key, 0, 4)) != "http") {
            // slash management
            if (substr($key, 0, 1) == "/" and substr($website, -1) == "/") {
                $key = substr($key, 1);
                //print $key."<br>";
            }
            ($web['path'] != "" and $web['path'] != "/") ? $key = substr($website, 0, strpos($website, $web['path'])) . $key : ($key = $website . $key);
        }
        $key = preg_replace(array('/([\\?&]PHPSESSID=\\w+)$/i', '/(#[^\\/]*)$/i', '/&amp;/', '/^(javascript:.*)|(javascript:.*)$/i'), array('', '', '&', '', ''), $key);
        $pattern = "/" . $web['scheme'] . ":\\/\\/(.*?)" . $web['host'] . str_replace('/', '\\/', $web['path']) . "/";
        preg_match($pattern, $key, $treffer);
        $key = encodeUrl(trim(relative2absolute($website, $key)));
        /* todo add url from Location: header tag without any check */
        if (!in_array($key, $tmparray) && count($treffer) > 0 && searchInArray($key, $forbidden_strings) == false && in_array(substr($key, strrpos($key, ".")), $forbidden_types) === false) {
            $tmparray[] = $key;
        }
        unset($key, $treffer);
    }
    //endforeach
    unset($buffer);
    return $tmparray;
}