<?php if (empty($ListOrg)) { ?>
    <div class="alert alert-danger" role="alert">
        <button class="close" data-dismiss="alert"></button>
        <strong><?php print CommonLanguage::getMessage('org_warnning') ?></strong>
    </div>
<?php die();
}

?>

<style>
    .bg-master-lighter {
        border: none;
        background-color: #fff;
        border-top: 1px solid #ddd;
    }

    h4 {
        border: 1px solid #eee;
        background-color: #4c0871;
        text-align: center;
        color: #fff;
    }
</style>
<script>
    function AddCommas(val) {
        val = parseFloat(val.toString()).toString();
        while (/(\d+)(\d{3})/.test(val.toString())) {
            val = val.toString().replace(/(\d+)(\d{3})/, '$1' + ',' + '$2');
        }
        return val.replace(/\.0$|\.00$/, "") || "0";
    }

    function FixNumber(val) {
        return AddCommas(public_round_number(parseFloat(val + "")));
    }
</script>
<div class="col-xs-12 col-md-12" style="background:#fff;border: 1px solid #4c0871;">
    <div class="panel-body">
        <div class="col-xs-12 col-md-12">
            <div class="col-xs-6  col-md-6">
                <h2 class="font-montserrat all-caps hint-text"><?php print CommonLanguage::getMessage('org_details'); ?></h2>
            </div>
            <div class="col-xs-4 col-md-4 pull-right">
                <img id="OrgloadImagePreview" class="pull-right" src="<?php echo $file; ?>" alt="<?php echo $file; ?>" style="width:30%">
            </div>
        </div>
        <div class="col-xs-12 col-md-12">
            <div class="col-xs-4 col-md-4 ">
                <h4><?php print CommonLanguage::getMessage('general_details'); ?></h4>
                <label class="col-xs-6 col-md-6"><?php print CommonLanguage::getMessage('Name'); ?>:</label>
                <span class="bold "><?php echo $ListOrg[0]["Organization_Name"] ?></span>
                <br>
                <label class="col-xs-4 col-md-6"><?php print CommonLanguage::getMessage('legal_name'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Legal_Name"] ?></span>
                <br>
                <label class="col-xs-6 col-md-6"><?php print CommonLanguage::getMessage('legal_entity'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Legal_Entity_Name"] ?></span>
                <br>
                <label class="col-xs-8 col-md-6"><?php print CommonLanguage::getMessage('commercial_registry'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Commercial_Registry"] ?></span>
                <br>
                <label class="col-xs-6 col-md-6"><?php print CommonLanguage::getMessage('Type'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Type_Name"] ?></span>
            </div>
            <div class="col-xs-4 col-md-4 ">
                <h4><?php print CommonLanguage::getMessage('contact_details'); ?></h4>
                <label class="col-xs-4 col-md-6"><?php print CommonLanguage::getMessage('Email'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Email"] ?></span>
                <br>
                <label class="col-xs-6 col-md-6"><?php print CommonLanguage::getMessage('fax'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Fax"] ?></span>
                <br>
                <label class="col-xs-6 col-md-6"><?php print CommonLanguage::getMessage('Phone'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Phone"] ?></span>
                <br>
                <label class="col-xs-6 col-md-6"><?php print CommonLanguage::getMessage('line_of_business'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Business_Line"] ?></span>
            </div>
            <div class="col-xs-4 col-md-4 ">
                <h4><?php print CommonLanguage::getMessage('address_details'); ?></h4>
                <label class="col-xs-6 col-md-6"><?php print CommonLanguage::getMessage('street_address'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Street"] ?></span>
                <br>
                <label class="col-xs-6 col-md-6"><?php print CommonLanguage::getMessage('city'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["city_name"] ?></span>
                <br>
                <label class="col-xs-6 col-md-6"><?php print CommonLanguage::getMessage('country'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Country_Name"] ?></span>
            </div>
        </div>
        <div class="col-md-12 col-xs-12" style="padding-top: 30px;">
            <div class="col-xs-4 col-md-4">
                <h4><?php print CommonLanguage::getMessage('financial'); ?></h4>
                <label class="col-xs-8 col-md-8"><?php print CommonLanguage::getMessage('capital'); ?>:</label>
                <span class="bold">
                    <?php echo $defCurrencySymbol ?>
                    <script>
                        document.write(FixNumber(<?php echo $ListOrg[0]["Financial_Capital"]; ?>))
                    </script>
                </span>
                <br>
                <label class="col-xs-8 col-md-8"><?php print CommonLanguage::getMessage('bank'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Bank_Name"] ?></span>
                <br>
                <label class="col-xs-8 col-md-8"><?php print CommonLanguage::getMessage('financial_year'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Financial_Year_End"] ?></span>
                <br>
                <table>
                    <tbody>
                        <?php
                        for ($x = 0; $x < count($ListSahreHolder); $x++) {
                            $CurItem = $ListSahreHolder[$x];
                        ?>
                            <tr>
                                <td class="col-xs-8 col-md-8"><?php print CommonLanguage::getMessage('Name'); ?>: <span class="bold"> <?php echo $CurItem["Shareholder_Name"] ?></span></td>
                                <td><?php print CommonLanguage::getMessage('amount'); ?>:<span class="bold"> <?php echo $defCurrencySymbol ?> <script>
                                            document.write(FixNumber(<?php echo $CurItem["Shareholder_Amount"]; ?>))
                                        </script></span></td>
                            </tr>
                        <?php } ?>
                    </tbody>
                </table>
            </div>
            <div class="col-xs-4 col-md-4 ">
                <h4> <?php print CommonLanguage::getMessage('hierarchy_details'); ?></h4>
                <table>
                    <tbody>
                        <?php
                        for ($x = 0; $x < count($ListHierarchy); $x++) {
                            $CurItem = $ListHierarchy[$x];
                        ?>
                            <tr>
                                <td class="col-xs-2 col-md-6"><?php print CommonLanguage::getMessage('position'); ?>:<span class="bold"> <?php echo $CurItem["Position_Name"] ?></span></td>
                                <td class="col-xs-2 col-md-6"><?php print CommonLanguage::getMessage('Name'); ?>:<span class="bold"> <?php echo $CurItem["Person_Name"] ?></span></td>
                            </tr>
                        <?php } ?>
                    </tbody>
                </table>
            </div>
            <div class="col-xs-4 col-md-4 ">
                <h4> <?php print CommonLanguage::getMessage('social_links'); ?></h4>
                <label class="col-xs-4 col-md-6"><?php print CommonLanguage::getMessage('facebook'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Face_Book"] ?></span>
                <br>
                <label class="col-xs-4 col-md-6"><?php print CommonLanguage::getMessage('twitter'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Twitter"] ?></span>
                <br>
                <label class="col-xs-4 col-md-6"><?php print CommonLanguage::getMessage('linkedin'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Linkedin"] ?></span>
                <br>
                <label class="col-xs-4 col-md-6"><?php print CommonLanguage::getMessage('google'); ?>:</label>
                <span class="bold"><?php echo $ListOrg[0]["Organization_Plus_Google"] ?></span>
            </div>
        </div>
    </div>
    <br>
    <a class="btn btn-danger no-print pull-right" style="margin-right:15px;" onclick="javascript:window.print();"><i class="fa fa-print"></i> <?php print CommonLanguage::getMessage('print'); ?></a>
    <br>
    <br>
</div>