                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">eWASAP Summary</h1>
                    </div>
                    <!-- /.col-lg-12 -->
                </div>

                <form method="get">
                    <div class="row">
                        <div class="col-lg-6">
                        </div>
                        <div class="col-lg-2 col-md-4 col-sm-4">
                            <div class="form-group">
                                <input class="form-control" type="text" id="fromDate" autocomplete="off" placeholder="From Date : " name="fromDate" value="<?php echo $fromDate;?>">
                            </div>
                        </div>
                        <div class="col-lg-2 col-md-4 col-sm-4">
                            <div class="form-group">
                                <input class="form-control" type="text" id="toDate" autocomplete="off" placeholder="To Date : " name="toDate" value="<?php echo $toDate;?>">
                            </div>
                        </div>
                        <div class="col-lg-2 col-md-4 col-sm-4">
                            <div class="form-group">
                                <button type="submit" class="btn btn-primary btn-block" name="search" value="search">Search</button>
                            </div>
                        </div>
                    </div>
                </form>
           
           
                <div class="row">
                    <div class="col-lg-4 col-md-4">
                        <div class="panel panel-primary">
                            <div class="panel-heading">
                                <div class="row">
                                    <div class="col-xs-3">
                                        <i class="fa fa-link fa-5x"></i>
                                    </div>
                                    <div class="col-xs-9 text-right">
                                        <div class="huge"><?php echo sizeof($linkResult);?></div>
                                        <div>Total Links</div>
                                    </div>
                                </div>
                            </div>
                            <a href="#">
                                <div class="panel-footer">
                                    <span class="pull-left">View Details</span>
                                    <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                                    <div class="clearfix"></div>
                                </div>
                            </a>
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-4">
                        <div class="panel panel-green">
                            <div class="panel-heading">
                                <div class="row">
                                    <div class="col-xs-3">
                                        <i class="fa fa-mouse-pointer fa-5x"></i>
                                    </div>
                                    <div class="col-xs-9 text-right">
                                        <div class="huge"><?php echo $totalClickCount;?></div>
                                        <div>Total Clicks</div>
                                    </div>
                                </div>
                            </div>
                            <a href="#">
                                <div class="panel-footer">
                                    <span class="pull-left">View Details</span>
                                    <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                                    <div class="clearfix"></div>
                                </div>
                            </a>
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-4">
                        <div class="panel panel-red">
                            <div class="panel-heading">
                                <div class="row">
                                    <div class="col-xs-3">
                                        <i class="fa fa-tasks fa-5x"></i>
                                    </div>
                                    <div class="col-xs-9 text-right">
                                        <div class="huge"><?php echo isset($linkResult[0]) ? $linkResult[0]->ClickCount : "0";?></div>
                                        <div>Best performing link</div>
                                    </div>
                                </div>
                            </div>
                            <a href="#">
                                <div class="panel-footer">
                                    <span class="pull-left"><?php echo isset($linkResult[0]) ? $linkResult[0]->FullLink : "-";?></span>
                                    <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
                                    <div class="clearfix"></div>
                                </div>
                            </a>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-lg-12">
                        <div class="table-responsive">
                        <?php if(sizeof($linkResult) >= 1) {?>
                            <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
                                <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>URL</th>
                                        <th>Phone</th>
                                        <th>Remark</th>
                                        <th>Text</th>
                                        <th>Count</th>
                                        <th>Action</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php for ($x = 0; $x < sizeof($linkResult); $x++) {?>
                                        <tr>
                                            <td><?php echo ($x+1);?></td>
                                            <td><a href="<?php echo $linkResult[$x]->FullLink;?>" target="blank"><?php echo $linkResult[$x]->FullLink;?></a></td>
                                            <td><?php echo $linkResult[$x]->PhoneNumber;?></td>
                                            <td><?php echo $linkResult[$x]->Remark;?></td>
                                            <td><?php echo rawurldecode($linkResult[$x]->Text);?></td>
                                            <td><?php echo $linkResult[$x]->ClickCount;?></td>
                                            <td><a href="/link/edit/<?php echo $linkResult[$x]->ID?>">Edit</a>&nbsp;&nbsp;&nbsp;<a href="/summary/<?php echo $linkResult[$x]->ID;?>">Summary</a>&nbsp;&nbsp;&nbsp;<button class="deleteLink btn btn-danger btn-xs" data-toggle="modal" data-target="#myModal" data-id="<?php echo $linkResult[$x]->ID;?>">Delete</button></td>
                                        </tr>
                                    <?php } ?>
                                </tbody>
                            </table>
                        <?php } else { ?>
                            <div class="well">
                                <h4>No links found! Create one now here!</h4>
                            </div>
                        <?php } ?>
                        </div>
                        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
                            <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                        <h4 class="modal-title" id="myModalLabel">Are you sure?</h4>
                                    </div>
                                    <div class="modal-body">
                                        Are you sure you want to delete this link?
                                        <input type="hidden" name="linkId" id="linkId" value=""/>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                        <button type="button" id="confirmDelete" class="btn btn-primary">Save changes</button>
                                    </div>
                                </div>
                                <!-- /.modal-content -->
                            </div>
                            <!-- /.modal-dialog -->
                        </div>
                    </div>
                </div>