<div class="clear"></div>
<h1 style="float: left;">Phone information</h1>
<?php 
if (!empty($modelCompany)) {
	foreach ($modelCompany as $value)
	{
		?>
			<div class="box" style="text-align:right; float:right;  margin-left:auto;margin-right: auto;">
				<h2  class="" style="padding:10px; border-radius: 5px;">
					<a style="color: #FFF;" href="https://maps.google.com/maps?q=<?php echo $value->adress . '+' . $value->city . '+' . $value->state . '+' . $value->zip; ?>" target="_blank" class="btn btn-secondary">Google Maps</a>
				</h2>
			</div>
			<div class="clear"></div>
		<?php 
	}
}
//var_dump($modelCompany);die;
?>
<table width="auto" cellspacing="5" cellpadding="5">
    <?php
    $countHead = 1;
    if (!empty($modelCompany)) {
        foreach ($modelCompany as $value) {
        	$value->zip = trim($value->zip);
        	if(!empty($value->zip) && strlen($value->zip) < 5)
        	{
			while(strlen($value->zip) != 5)
			{
				$value->zip = '0'.$value->zip;
			}
		}
            ?>

            <tr class="row">
                <td class="span6 left" colspan="2"><h4>Company information for (Phone Number #<?php echo $value->phone; ?>)</h4></td>
            </tr>

            <!---------COMPANY INFORMATION-------->    

            <tr class="">
                <td style="text-align: right; display: table-cell;padding:5px;" class="span2 left setfone">Company: </td>
                <td style="font-weight:bold; margin-left:7px;padding:5px;" class="span2 left setfone"> <?php echo $value->name; ?></td>
            </tr>
            <!--company address-->
            <tr class="">
                <td style="text-align: right;display: table-cell;padding:5px;" class="span2 left setfone">Address: </td>
                <td style="font-weight:bold;display: table-cell;padding:5px; margin-left:7px;" class="span2 left setfone"> <?php echo $value->adress; ?></td>
            </tr>
            <!--company phone & Google Map Button-->
            <tr class="">
                <td style="text-align: right;display: table-cell;padding:5px;" class="span2 left setfone">Phone: </td>
                <td style="font-weight:bold; margin-left:7px;padding:5px;" class="span2 left setfone" ><?php echo $value->phone; ?></td>
                
            </tr>
            <!--company city-->
            <tr class="">
                <td style="text-align: right;display: table-cell;padding:5px;" class="span2 left setfone">City: </td>
                <td style="font-weight:bold;padding:5px;" class="span2 left setfone"> <?php echo $value->city; ?></td>
            </tr>
            <!--company state-->
            <tr class="">
                <td style="padding:5px; text-align: right;display: table-cell;" class="span2 left setfone">State: </td>
                <td style="font-weight:bold;padding:5px;" class="span2 left setfone"> <?php echo $value->state; ?></td>
            </tr>
            <!--company Zip-->
            <tr class="row">
                <td style="text-align: right;padding:5px;display: table-cell;" class="span2 left setfone">Zip: </td>
                <td style="font-weight:bold;padding:5px;" class="span2 left setfone"> <?php echo $value->zip; ?></td>
            </tr>
            <!--company Notes-->
            <tr class="row">
                <td style="text-align: right;padding:5px;display: table-cell;" class="span2 left setfone">Notes: </td>
                <td style="font-weight:bold;padding:5px;" class="span2 left setfone"> <?php echo $value->notes; ?></td>
            </tr>
            <!---------OWNER INFORMATION------------->

            <tr class="row">
                <td colspan="2" class="span10 left">
                    <div class="container-radius"><div id="mainmenu">
                            <ul id="yw0" class="nav nav-tabs">
                                <li class="active" id="secondmainmenu">
                                    <a href="#">Owner</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr style="margin-top:100px;"></tr>
            <!--OWNER FIRST NAME-->
            <tr class="row" >
                <td style="text-align: right;padding:5px;" class="span2 left setfone">FirstName: </td>
                <td style="padding:5px;font-weight:bold;" class="span2 left setfone"> <?php echo $value->owner->firstname; ?></td>
            </tr>
            <!--OWNER LAST NAME-->
            <tr class="row">
                <td style="padding:5px;text-align: right;" class="span2 left setfone">LastName: </td>
                <td style="padding:5px;font-weight:bold;" class="span2 left setfone"> <?php echo $value->owner->lastname; ?></td>
            </tr>
            <!--OWNER Date of Birth-->
            <tr class="row">
                <td style="padding:5px;text-align: right;" class="span2 left setfone">Date of Birth: </td>
                <td style="padding:5px;font-weight:bold;" class="span2 left setfone"> <?php echo $value->owner->dob; ?></td>
            </tr>
            <!--OWNER Position-->
            <tr class="row">
                <td style="padding:5px;text-align: right;" class="span2 left setfone">Position: </td>
                <td style="padding:5px;font-weight:bold;" class="span2 left setfone"> <?php echo $value->owner->position; ?></td>
            </tr>
            <!--OWNER Phone-->
            <tr class="row">
                <td style="padding:5px;text-align: right;" class="span2 left setfone">Phone: </td>
                <td style="padding:5px;font-weight:bold;" class="span2 left setfone"> <?php echo $value->owner->phone; ?></td>
            </tr>
            <!--OWNER E-Mail-->
            <tr class="row">
                <td style="padding:5px;text-align: right;" class="span2 left setfone">E-Mail: </td>
                <td style="padding:5px;font-weight:bold;" class="span2 left setfone"> <?php echo $value->owner->email; ?></td>
            </tr>
            <!--OWNER E-Mail-->
            <tr class="row">
                <td style="padding:5px;text-align: right;" class="span2 left setfone">Notes: </td>
                <td style="padding:5px;font-weight:bold;" class="span2 left setfone"> <?php echo $value->owner->notes; ?></td>
            </tr>
            <tr>
                <td class="span10 left setborderbottom" colspan="2"></td>
            </tr>

            <?php
            $countHead++;
        }
    } else {
        ?>
        <div class=" erros alert-error" style="color: red;"><h5>Record Not Found</h5></div>
        <?php
    }
    ?>
</table>
<script type="text/javascript">
    function ref() {

        var var1 = document.getElementById('mapsearch').value;
        location.href = location.href + '?var1=' + var1;
//        location.href = location.href + '?var1=' + var1 + '&var2=' + var2;
    }
</script>
<style>
    .setfone{
        font-family: Lucida Grande,Lucida Sans,Arial,sans-serif;
        font-size: 1.1em;
        color: #222222;
    }

    .setborderbottom{
        border-bottom: 1px solid #86B5D9;
    }


</style>