<?php
$session = new \Zend\Session\Container('userlogin');
$user_id = $session->userData['user_id'];
$referral_key = $session->userData['referral_key'];
?>
<div class="container">
    <div class="col-sm-12">
        <h2 align="left">Refer & Earn</h2>
    </div>
</div>

<section id="main_form1" class="padding12top">

    <div class="container">

                            <div class="slide-margin">
                            <div class="col-sm-12">
                                 <div class="search-tabs search-tabs-bg search-tabs-nobox search-tabs-lift-top">
                <div class="tabbable">

                    <div class="tab-content1">

                        <div class="tab-pane fade in active">

                                <div class="row">
                                  <div class="col-sm-12" style="background:url(/images/reffer-ern-bg.jpg) no-repeat; height:380px; width:100%;">

                                  <div class="col-sm-12 text-center pull-left padding-top15per center">

     <div class="loginmodal-container padding-top10px">
      <h2 class="linhight35 padding-right40px">Sign up Friend get</h2>
       <h1 class="linhight35 padding-right40px"><?php echo $referralData[0]['installation_amount_user']; ?> Pts. </h1>
        <h1 class="linhight35 padding-right40px padding-top10px">You get <?php echo $referralData[0]['installation_amount_referer']; ?> Pts. </h1>

  </div>

  </div></div>

                                </div>
                        </div>


                        </div>



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

                            </div>

                        </div>

</section>

<section>

    <div class="container">

        <div class="slide-margin">
            <div class="col-sm-12">
                <div class="search-tabs search-tabs-bg search-tabs-nobox search-tabs-lift-top">
                    <div class="tabbable">
                        <div class="tab-pane fade in active">
                            <div class="row">
                                <div class="col-sm-12 bg-refer borderregency1  padding-top10px padding-bot10px">
                                    <div class="col-sm-3 linhight28 "><h3 class="linhight36">Your Unique Referral Code</h3></div>
                                    <div class="col-sm-7 padding-right0">
                                        <div class="col-sm-12 padding-right0 refer-link ">
                                            <!--<P id="p1"><?php echo $this->serverUrl($this->basePath()); ?>/refer-earn</P>-->
                                            <P id="p1"><?php echo $referral_key; ?></P>
                                        </div>

                                        <span class="show-copy-text"></span>
                                    </div>
                                    <?php if($referral_key!=""){ ?>
                                    <div class="col-sm-2 no-padding">
                                        <button class="btn btn-default copy-link" onclick="copyToClipboard('#p1')">Copy Referral Code</button>
                                    </div>
                                    <?php }?>

                                </div>

                                <div class="col-sm-12 no-padding center border_radius5px left margin-top10">
                                    <div class="row share-onphone">
                                        <div class="col-sm-4">
                                            <div class="row form-group">
                                                <div class="col-sm-12">
                                                    <strong>Email</strong>
                                                </div>
                                                <div class="col-sm-12">
                                                    Invite upto 5 friends
                                                </div>
                                                <div class="col-sm-12">
                                                    <input type="email" name="email_id" id="email-id" maxlength="30" value="" placeholder="abc@gmail.com"  class="form-control">
                                                    <span class="email_error" style="color: red;"></span>
                                                </div>
                                                <div class="col-sm-12 padding-top10px">

                                                    <?php if (!empty($user_id)) { ?>
                                                    <button class="btn btn-danger width120" onclick="inviteEmail()" >Send</button>
                                                    <?php } else { ?>
                                                    <a href="<?php echo $this->url('dashboard-login'); ?>" target="_blank"  class="btn btn-danger width120">
                                                            Send
                                                        </a>
                                                    <?php } ?>

                                                </div>

                                            </div>
                                        </div>

                                        <div class="col-sm-4">
                                            <div class="row form-group">
                                                <div class="col-sm-12">
                                                    <strong>SMS</strong>
                                                </div>
                                                <div class="col-sm-12">
                                                    Invite upto 5 friends
                                                </div>
                                                <div class="col-sm-12">
                                                    <input type="text" onkeypress="return isNumber(event)" maxlength="10" name="mobile_no" id="mobile-no" placeholder="Eg:7654324567" value="" class="form-control">
                                                    <span class="mobile_error" style="color: red;"></span>
                                                </div>
                                                <div class="col-sm-12 padding-top10px">
                                                    <?php if (!empty($user_id)) { ?>
                                                        <button class="btn btn-danger width120" onclick="inviteSms()">Send</button>
                                                    <?php } else { ?>
                                                        <a href="<?php echo $this->url('dashboard-login'); ?>" target="_blank"  class="btn btn-danger width120">
                                                            Send
                                                        </a>
                                                    <?php } ?>
                                                </div>

                                            </div>
                                        </div>

                                        <div class="col-sm-3">
                                            <div class="row form-group share-link">
                                                <div class="col-sm-12 ">
                                                    <strong>Invite by email or Social Media</strong>
                                                </div>
                                                <a href="http://www.facebook.com/share.php?u=<url>" onclick="return fbs_click()" title="Click to share on facebook" target="_blank">
                                                    <div class="col-sm-12 facebook-refer">
                                                        Share on Facebook
                                                    </div></a>
                                                <a href="https://twitter.com/intent/tweet?text=<?php echo $referral_msg; ?>" title="Click to share on Twitter" target="_blank">
                                                    <div class="col-sm-12 twiter-refer">
                                                        Share on Twitter
                                                    </div>
                                                </a>
                                                <a href="https://web.whatsapp.com/send?text=<?php echo $referral_msg; ?>" target="_blank">
                                                    <div class="col-sm-12 whatsapp-refer">
                                                        Share on Whatsapp
                                                    </div>
                                                </a>
                                            </div>
                                        </div>

                                    </div>

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

        </div>




    </div>

</section>

<section class="padding12top bg-refer">

    <div class="container">

        <div class="slide-margin">
            <div class="col-sm-12">
                <div class="search-tabs search-tabs-bg search-tabs-nobox search-tabs-lift-top">
                    <div class="tabbable">

                        <div class="tab-content1">

                            <div class="tab-pane fade in active">
                                <div class="row">
                                    <div class="col-sm-12 center refer-earn">
                                        <h1>How it works ?</h1>
                                         <div class="col-sm-2 no-padding referspet1">
                            	<img src="images/reffer-ern-stape1.png">
                                 <br>
                                <span>
                                Refer your friend to Sign up on Booking Cab website or Mobile App.
                                </span>
                            </div>

                            <div class="col-sm-2 refer-arow"></div>

                             <div class="col-sm-2 no-padding">
                            	<img src="images/reffer-ern-stape2.png">
                                <span>
                                     <br>
                               Friend signs up on the website or app,
you earn <i class="fa fa-inr"></i> 100
                                </span>
                            </div>


                             <div class="col-sm-2 refer-arow"></div>

                             <div class="col-sm-2 no-padding">
                            	<img src="images/reffer-ern-stape3.png">
                                <br>
                                <span>
                               When a friend books with us,
you earn up to <i class="fa fa-inr"></i> 500
                                </span>
                            </div>

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


                        </div>



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

        </div>




    </div>

</section>
<script>function fbs_click() {
        u = location.href;
        t = document.title;
        window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');
        return false;
    }</script>