<!DOCTYPE html>
<html>

<head>
    <title>Lead List</title>
</head>

<body>
    <div style="padding: 35px;">
        <div class="">
            <?php $this->renderPartial('//common/header'); ?>
            <div class="col-4">
                <?php
                $modelQ1 = Lead::model()->findByPk($id);

                ?>


                <div class="input-block">
                    <b><?php echo $id; ?></b>
                </div>
                <b><?php echo strtoupper($modelQ1->customer->customer_name); ?></b>
                <br>
                <?php if ($modelQ1->customer->customer_address != '') { ?>
                    <small><?php echo strtoupper($modelQ1->customer->customer_address); ?></small><br>
                <?php } ?>
                <?php if ($modelQ1->customer->customer_postal_code != "" || $modelQ1->customer->customer_location != "") {
                    ?>
                    <small><?php echo 'PO Box : ';
                    if (isset($modelQ1->customer->customer_postal_code) && $modelQ1->customer->customer_postal_code != "") {
                        echo $modelQ1->customer->customer_postal_code;
                    }
                    if ($modelQ1->customer->customer_postal_code != "" && $modelQ1->customer->customer_location != "") {
                        echo ", ";
                    }
                    if (isset($modelQ1->customer->customer_location) && $modelQ1->customer->customer_location != "") {
                        echo $modelQ1->customer->customer_location;
                    }
                    ?></small><br>
                <?php
                }
                ?>
                <?php if ($modelQ1->customer->customer_city != '') { ?>
                    <small><?php echo strtoupper($modelQ1->customer->customer_city . ', ' . $modelQ1->customer->country->country_name); ?></small><br>
                <?php } ?>
                <?php if ($modelQ1->customer->customer_phone_no != '') { ?>
                    <small><?php echo strtoupper('Phone : ' . $modelQ1->customer->customer_phone_no); ?></small><br>
                <?php } ?>
                <?php if ($modelQ1->contact->person_name != '') { ?>
                    <br><small>Kind Attn:</small>
                    <small><b><?php echo strtoupper($modelQ1->contact->person_name); ?></b></small><br>
                <?php } ?>




            </div>
            <div class="col-4">
                <div class="h3" style="margin-top: 0;margin-bottom: 0;text-align: center;font-size: 14px;">
                    <?php echo "SALES LEAD"; ?>
                </div>
            </div>
            <div class="col-4" style="color:#101010;">

                <table class="table" style="width:100%">
                    <tr>
                        <?php
                        //   $modelQ = Invoice::model()->findByPk($id);
                        // $model_lead=Lead::model()->find(array('condition'=>'file_id="'.$modelQ->file_id.'"'));
                        ?>
                        <td class="bc-tl">File ID</td>
                        <td>
                            <?php echo $modelQ1->file_id; ?>
                        </td>
                    </tr>
                    <tr>
                        <td>Company ID</td>
                        <td>
                            <?php echo $modelQ1->customer_id; ?>
                        </td>
                    </tr>
                    <?php if ($modelQ1->customer->customer_trn_no != '') { ?>
                        <tr>
                            <td>Customer TRN#</td>
                            <td>
                                <?php echo $modelQ1->customer->customer_trn_no; ?>
                            </td>
                        </tr>
                    <?php } ?>
                    <tr>
                        <td>Enquiry Date</td>
                        <td>
                            <?php echo date('d/m/Y', STRTOTIME($modelQ1->enq_date)); ?>
                        </td>
                    </tr>
                    <tr>
                        <td>Closing Date</td>
                        <td>
                            <?php echo date('d/m/Y', STRTOTIME($modelQ1->closing_date)); ?>
                        </td>
                    </tr>

                    <tr>
                        <td>Sales Man</td>
                        <td>
                            <?php echo $modelQ1->leadowner->first_name . ' ' . $modelQ1->leadowner->last_name; ?>
                        </td>
                    </tr>
                    <!-- <tr>
                    <td >Value</td>
                    <td class="text-right">
                            <?php //echo $modelQ1->currencyname->currency_code.' '.Yii::app()->numberFormatter->formatCurrency($modelQ1->value," "); ?>
                        </td>
                </tr>-->

                </table>
            </div>
        </div>
        <br>
        <div class="col-md-12">

            <div class="box" style="width: 100%">
                <?php if ($modelQ1->title != '') { ?>
                    <h5>File Title</h5>
                    <div class="h5sub-details">
                        <?php echo $modelQ1->title; ?>
                    </div><br /><br>
                <?php } ?>
                <h5>Remarks</h5>
                <div class="h5sub-details">
                    <?php echo nl2br($modelQ1->remarks); ?>
                </div>
            </div>

        </div>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>

        <?php $this->renderPartial("//common/footer", array('company_id' => $company_id)); ?>
    </div>
</body>

</html>