<?php 
use App\Models\HomeModel;
$home = new HomeModel();
$all_page = $home->get_all_active_page();
$uri = service('uri'); 
?>
  <!-- Footer -->
  <footer id="footer" class="footer bg-black-222">
    <div class="container pt-40 pb-20">
      <div class="row border-bottom-black">
        <div class="col-sm-6 col-md-4">
          <div class="widget dark">
            <img class="mt-10 mb-20" alt="" src="<?php echo base_url(); ?><?php echo $app_setting->header_logo; ?>" width="200px">
            <ul class="list-inline mt-5">
              <li class="m-0 pl-10 pr-10"> <i class="fa fa-map-marker mr-5 text-white"></i> <a class="text-white"><?php echo $app_setting->address; ?></a> </li>

              <li class="m-0 pl-10 pr-10"> <i class="fa fa-phone mr-5 text-white"></i> <a class="text-white" href="tel:+91-<?php echo $app_setting->mobile; ?>"><?php echo $app_setting->mobile; ?></a> </li>
              <li class="m-0 pl-10 pr-10"> <i class="fa fa-envelope-o mr-5 text-white"></i> <a href="mailto:<?php echo $app_setting->email; ?>" class="text-white"><?php echo $app_setting->email; ?></a> </li>
            </ul>
            <div class="widget dark">
             <!--  <h5 class="widget-title mb-10">Connect With Us</h5> -->
              <ul class="social-icons icon-dark icon-circled icon-sm">
                <?php if($app_setting->facebook):?>
                  <li><a class="facebook" href="<?php echo $app_setting->facebook; ?>"><i class="fa fa-facebook"></i></a></li>
                <?php endif;?>
                <?php if($app_setting->twitter):?>
                  <li><a class="twitter" href="<?php echo $app_setting->twitter; ?>"><i class="fa fa-twitter"></i></a></li>
                <?php endif;?>
                <?php if($app_setting->instagram):?>
                  <li><a class="instagram" href="<?php echo $app_setting->instagram; ?>"><i class="fa fa-instagram"></i></a></li>
                <?php endif;?>
                <?php if($app_setting->whatsapp):?>
                  <li><a class="whatsapp" href="<?php echo $app_setting->whatsapp; ?>"><i class="fa fa-whatsapp"></i></a></li>
                <?php endif;?>
                <?php if($app_setting->linkdin):?>
                  <li><a style="background-color: #0077b5" class="linkdin" href="<?php echo $app_setting->linkdin; ?>"><i class="fa fa-linkedin"></i></a></li>
                <?php endif;?>
              </ul>
            </div>
            <div class="mt-10">
              <h4 class="text-uppercase mb-5 text-white">
                <?php if(session()->get('lan') == 'en'):?>
                  Subscribe to our newsletter
                <?php else: ?>
                  हमारे न्युजलेटर की सावस्क्राइव करें
                <?php endif; ?>
              </h4>
              <!-- Mailchimp Subscription Form-->
                <?php echo form_open(base_url().'/subscriber', ['class' => 'newsletter-form mt-10'])?>
                <label class="display-block" for="mce-EMAIL"></label>
                <div class="input-group">
                  <input type="email" id="mce-EMAIL" data-height="43px" class="form-control input-lg" placeholder="<?php if(session()->get('lan') == 'en'):?>Your Email<?php else: ?>आपका ईमेल<?php endif; ?>" name="subscribers_email" required>
                  <span class="input-group-btn">
                    <button type="submit" class="btn btn-flat btn-dark btn-theme-colored btn-sm pull-left" data-height="43px"><?php if(session()->get('lan') == 'en'):?>
                  Subscribe
                <?php else: ?>
                  सावस्क्राइव
                <?php endif; ?></button>
                  </span>
                </div>
              <?php echo form_close(); ?>
            </div>
          </div>
        </div>
        <div class="col-sm-8">
          <div class="row">
            <div class="col-sm-6 col-md-4">
              <div class="widget dark">
                <h5 class="widget-title line-bottom">USEFUL LINK</h5>
                <ul class="list angle-double-right list-border">
                  <?php foreach ($all_page as $page):
                    if($page->important == 'Userfull Link'): ?>
                      <li><a href="<?php echo base_url(); ?>/page/<?php echo $page->slug; ?>"  class="text-white"><?php echo $page->name; ?></a></li>
                    <?php endif; 
                  endforeach; ?>       
                </ul>
              </div>
            </div>
            <div class="col-sm-6 col-md-4">
              <div class="widget dark">
                <h5 class="widget-title line-bottom">POLICIES</h5>
                <ul class="list angle-double-right list-border">
                  <?php foreach ($all_page as $page):
                    if($page->important == 'Policies'): ?>
                      <li><a href="<?php echo base_url(); ?>/p/<?php echo $page->slug; ?>"  class="text-white"><?php echo $page->name; ?></a></li>
                    <?php endif; 
                  endforeach; ?>
                </ul>
              </div>
            </div>
            <div class="col-sm-6 col-md-4">
              <div class="widget dark">
                <h5 class="widget-title line-bottom">HELP</h5>
                <ul class="list angle-double-right list-border">
                  <?php foreach ($all_page as $page):
                    if($page->important == 'Help'): ?>
                      <li><a href="<?php echo base_url(); ?>/p/<?php echo $page->slug; ?>" class="text-white"><?php echo $page->name; ?></a></li>
                    <?php endif; 
                  endforeach; ?>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div>
      
    </div>
    <div class="footer-bottom bg-black-333">
      <div class="container pt-10 pb-10">
        <div class="row">
          <div class="col-md-12 text-center">
            <p class="font-11 text-white m-0"><?php echo $app_setting->copywrite; ?></p>
          </div>
        </div>
      </div>
    </div>
  </footer>
  <a class="scrollToTop" href="#"><i class="fa fa-angle-up"></i></a>
</div>
<!-- end wrapper -->

<!-- Footer Scripts -->
<!-- JS | Custom script for all pages -->
<?php //if($uri->getSegment(1) == ''): ?>
<script src="<?php echo base_url(); ?>/front_main/js/custom.js"></script>
<?php //endif;?>
<?php if($uri->getSegment(1) == ''): ?>
<!-- SLIDER REVOLUTION 5.0 EXTENSIONS  
      (Load Extensions only on Local File Systems ! 
       The following part can be removed on Server for On Demand Loading) -->
<script type="text/javascript" src="<?php echo base_url(); ?>/front_main/js/revolution-slider/js/extensions/revolution.extension.actions.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/front_main/js/revolution-slider/js/extensions/revolution.extension.carousel.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/front_main/js/revolution-slider/js/extensions/revolution.extension.kenburn.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/front_main/js/revolution-slider/js/extensions/revolution.extension.layeranimation.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/front_main/js/revolution-slider/js/extensions/revolution.extension.migration.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/front_main/js/revolution-slider/js/extensions/revolution.extension.navigation.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/front_main/js/revolution-slider/js/extensions/revolution.extension.parallax.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/front_main/js/revolution-slider/js/extensions/revolution.extension.slideanims.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/front_main/js/revolution-slider/js/extensions/revolution.extension.video.min.js"></script>
<?php endif;?>
</body>
</html> 

<script type="text/javascript">
function open_payment_modal(e)
{
  $('#paymentModal').modal('show');
  $('#d_prj_id').val(e)
}

function open_payment_modal_3(project_id, amount)
{
  $('#paymentModal').modal('show');
  $('#d_prj_id').val(project_id);
  $('#donate_amt').val(amount);
}


function open_payment_modal_2() 
{
  if($('input[name="amount"]:checked').val() != 'other')
  {
    var amount = $('input[name="amount"]:checked').val();
  }
  else
  {
    var amount = $('#input_other_amount').val();
  }

  var payment_type = $('input[name="payment_type"]:checked').val();
  var project_id = $('#project_id').val();
  if(amount == '')
  {
    swal('Opps!', "Please Enter Valid Donation Amount", 'error');
    return false;
  }


  $('#payment_type').val(payment_type);
  $('#paymentModal').modal('show');
  $('#donate_amt').val(amount);
  $('#d_prj_id').val(project_id);

}
function copy(textId) {
  const textElement = document.getElementById(textId);
  const text = textElement.innerText || textElement.textContent; 
  navigator.clipboard.writeText(text).then(function() {
    swal('Wow!', 'UPI ID Successfully Copied', 'success')
  }, function(err) {
    console.error('Unable to copy text: ', err);
  });
}
function next_step() 
{
    if(!$('#trans_name').val())
    {
      swal('Oops!', "Please Enter Transaction Name", 'error');
      return false
    }
    if(!$('#trans_date_time').val())
    {
      swal('Oops!', "Please Enter Transaction Date", 'error');
      return false
    }
    if(!$('#trans_acc_name').val())
    {
      swal('Oops!', "Please Enter Name appearing in Transaction Account", 'error');
      return false
    }
    if($('#input_other_amount').val())
    {
      if ($('#input_other_amount').val().length > 9) {
          swal('Oops!', "Please Enter Valid Amount", 'error');
          return false
      }
      if($('#input_other_amount').val() == 0)
      {
        swal('Oops!', "Please Enter Valid Amount", 'error');
          return false
      }
    }

    if($('#80_g_form').is(":checked") && !$('#pan_card_no').val())  
    {

      swal('Oops!', "Please Enter Pan Card No", 'error');
          return false
    }

    if($('#80_g_form').is(":checked"))  
    {
      if (isValidPanCard($('#pan_card_no').val()) == false) 
      {
          swal('Oops!', "Please Enter Valid Pan Card No", 'error');
          return false
      }
    }
    
    $('#step_1').hide();
    $('#step_2').show();
}
function isValidPanCard(panCardNumber) {
  // Regular expression for PAN card format validation
  var panRegex = /[A-Z]{5}[0-9]{4}[A-Z]{1}$/;

  // Check if the provided PAN card number matches the format
  return panRegex.test(panCardNumber);
}
function prev_step() {
    $('#step_1').show();
    $('#step_2').hide();
}
$(document).ready(function() {
  $('input[type=radio][name=d_payment_type]').change(function() {
    if (this.value == 2) {
      $('#sub_news_1').show();
    } else {
      $('#sub_news_1').hide();
    }
  })
})
</script>
<style type="text/css">
@media only screen and (max-width: 786px) 
{

  .download_qr
  {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
  }
  .image-overlay {
    position: relative;
    display: inline-block;
  }

  .overlay-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
  }
  .download_qr_btn
  {
    display: block;
  }
}
.container-upi input {
  font-size: 18px;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #000000;
}
.container-upi button {
  font-size: 12px;
  padding: 1px 10px;
  background-color: #577eff;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  margin-left: 10px;
}
#step_2
{
  display: none;
}
.upi_ins li
{
  font-size: 15px;
   text-align: justify;
  text-justify: inter-word;
}
#pan_card, #sub_news_1
{
  display: none;
}
</style>
<div class="modal fade" id="paymentModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-md">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">MAKE A DONATION NOW! </h4>
      </div>
      <div class="modal-body">
        <?php echo form_open(base_url().'/submit_donation', ['id' => 'paypal_donate_form_onetime_recurring']); ?>
          <div class="row" id="step_1">
            <div class="col-md-12 text-center">
              <div>
                <b>Scan QR Code</b>
              </div>
              <div class="image-overlay mb-15">
                
                <img src="<?php echo base_url(); ?>/qrcode.jpg" style="width: 150px;">
                <div class="overlay-effect"></div>
                <div class="download_qr"><a href="<?php echo base_url(); ?>/qrcode.jpg" Download class="btn btn-success btn-sm hidden-lg hidden-sm hidden-md ">Download QR</a></div>
              </div>
              
            </div>
            <div class="col-md-12 mt-15 mb-15 hidden-lg hidden-sm hidden-md">
              <!-- <div class="col-md-12 mt-15 mb-15 "> -->
              <?php echo payment_inst(); ?>
            </div>
            <div class="col-md-6">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">Transaction ID </label>
                <input type="text" class="form-control"  name="d_trans_id" placeholder="Enter Transaction ID">
              </div>
            </div>
            <div class="col-md-6">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">Transaction Date & Time *</label>
                <input type="datetime-local" class="form-control"  name="d_trans_date" placeholder="Enter Transaction ID" required id="trans_date_time">
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">Name Appearing in Transaction Account *</label>
                <input type="text" class="form-control" name="d_acc_name" placeholder="Enter Name Appearing in Transaction Account" required id="trans_acc_name">
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">Donor Name *</label>
                <input type="text" class="form-control" name="d_name" placeholder="Enter Donor Name" required id="trans_name">
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group mt-10 mb-20">
                <label><strong>Payment Type</strong></label> <br>
                <label class="radio-inline">
                  <input type="radio" checked="" value="1" name="d_payment_type"> 
                  One Time
                </label>
                <label class="radio-inline">
                  <input type="radio" value="2" name="d_payment_type"> 
                  Monthly
                </label>
              </div>
            </div>
            <div class="col-sm-12">
              <div class="form-group mb-20">
                 <label><strong>How much do you want to donate?</strong></label>
                 <div class="radio mt-5">
                    <label class="radio-inline">
                    <input type="radio" name="d_amount" value="200">
                    &#x20B9;200</label>
                    <label class="radio-inline">
                    <input type="radio" name="d_amount" value="500">
                    &#x20B9;500</label>
                    <label class="radio-inline">
                    <input type="radio" name="d_amount" checked="" value="1000">
                    &#x20B9;1000</label>
                    <label class="radio-inline">
                    <input type="radio" name="d_amount" value="5000">
                    &#x20B9;5000</label>
                    <label class="radio-inline">
                    <input type="radio" name="d_amount" value="other">
                    Other Amount</label>
                 </div>
                 <div id="custom_other_amount">
                    <label><strong>Enter Your Amount:</strong></label>
                 </div>
              </div>
            </div>
            <div class="col-md-12" id="sub_news_1">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">You Want Subscribe Our Newsletter</label>
                <input type="checkbox" name="sub_newsletter" value="1" checked="">
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">You Want 80G benefit</label>
                <input type="checkbox" name="d_eight_g_form" id="80_g_form" value="1">
              </div>
            </div>
            <div class="col-md-12" id="pan_card">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">Enter Your PAN Card No. *</label>
                <input type="text" class="form-control" id="pan_card_no" name="d_pan_card" placeholder="Enter Your PAN Card No.">
              </div>
            </div>
            <script type="text/javascript">
            $("#80_g_form").click(function() {
                if($(this).is(":checked")) {
                    $('#pan_card').show();
                    $('#pan_card_no').attr('required', true);
                } else {
                    $('#pan_card').hide();
                    $('#pan_card_no').attr('required', false);
                }
            });
            </script>
            <div class="col-md-12">
              <div class="form-group text-center">
                <button type="button" onclick="next_step()" class="btn btn-success">Next</button>
              </div>
            </div>
          </div>

          <div class="row" id="step_2">
            
            <div class="col-md-6">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">Your Mobile No *</label>
                <input type="number" class="form-control" name="d_mobile" placeholder="Enter Your Mobile No" required>
              </div>
            </div>
            <div class="col-md-6">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">Your Email ID</label>
                <input type="email" class="form-control" name="d_email" pattern="[a-zA-Z0-9.!#$%&amp;'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*" placeholder="Enter Your Email ID" >
              </div>
            </div>
            <div class="col-md-4">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">Your Pin Code *</label>
                <input type="number" name="d_pin" id="pin_code" class="form-control" placeholder="Enter Your Pin Code" required="required">
              </div>
            </div>
            <div class="col-md-8">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">Your Address *</label>
                <input type="text" name="d_address" class="form-control" placeholder="Enter Address" >
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">Your Area *</label>
                <select name="d_area" id="area" class="form-control" required="required">
                   <option value="">Select A Area</option>
                </select>
              </div>
            </div>
            <div class="col-md-6">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">Your Dist *</label>
                <input type="text" name="d_dist" id="city" class="form-control" placeholder="Your Dist" required="required" readonly="">
              </div>
            </div>
            <div class="col-md-6">
              <div class="form-group">
                <label for="recipient-name" class="col-form-label">Your State *</label>
                <input type="text" name="d_state" id="state" class="form-control" placeholder="Your State" required="required" readonly="">
              </div>
            </div>
            


            <div class="col-md-12">
              <input type="hidden" id="d_prj_id" name="d_project_id" required>
              <input type="hidden" id="payment_type" name="d_payment_type" required>
              <div class="form-group text-center">
                <button type="button" onclick="prev_step()" class="btn btn-warning">Prevoius</button>
                <button type="submit" class="btn btn-success">Submit Now</button>
              </div>
            </div>
          </div>
        <?php echo form_close(); ?>
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="joinModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Join Now Our Community Now!</h4>
      </div>
      <div class="modal-body">
        <?php echo form_open(base_url().'/submit_join_us_form', ['id' => 'pdf_form']); ?>
          <div class="form-group">
            <label for="recipient-name" class="col-form-label">Your Name *</label>
            <input type="text" class="form-control" name="user_name" placeholder="Enter Your Full Name" required>
          </div>
          <div class="form-group">
            <label for="recipient-name" class="col-form-label">Your Mobile No *</label>
            <input type="number" class="form-control" name="user_mobile" placeholder="Enter Your Mobile No" required>
          </div>
          <div class="form-group">
            <label for="recipient-name" class="col-form-label">Your Email ID</label>
            <input type="email" class="form-control" name="user_email" placeholder="Enter Your Email ID">
          </div>
          <div class="form-group">
            <label for="recipient-name" class="col-form-label">Your Address * </label>
            <textarea class="form-control" name="user_address" placeholder="Enter Your Full Address"></textarea>
          </div>

          <div class="form-group text-center">
            <button type="submit" class="btn btn-success">Join Now</button>
          </div>
        <?php echo form_close(); ?>
      </div>
    </div>
  </div>
</div>
<a href="<?php echo base_url(); ?>/donate-now" class="artical-sticky hidden-lg">
   <div class="example-date">
      <span class="rotate"><?php echo donate_now(); ?></span>
   </div>
</a>
<script>
$('body').on('change', '#pin_code', function () {
    let pin_code = $('#pin_code').val();
    if (pin_code == 0) {
            swal ( "Oops" ,  "Please Enter Pin Code!" ,  "warning" );
        return false;
    }
    $.ajax({
      beforeSend: function() {
         $(".preloader-ajax").show();
          $(".preloader-ajax-bg").show();
      },
      type: "GET",
      dataType:"JSON",
      async: true,
      url: '<?php echo base_url(); ?>/home/get_aadress_detaile_by_pin_code/'+pin_code,
      success: function (data) 
      {
          $('#area').html(data.area);
          $('#city').val(data.city);
          $('#state').val(data.state);
          $(".preloader-ajax").hide();
            $(".preloader-ajax-bg").hide();
      },
      error: function (e) {
        console.log(e.responseText);
        $(".preloader-ajax").hide();
            $(".preloader-ajax-bg").hide();
      }
    });
});

  function loadDeferredImages() {
    const images = document.querySelectorAll('img[defer]');
    images.forEach((img) => {
      img.setAttribute('src', img.getAttribute('data-src'));
      img.removeAttribute('defer');
    });
  }

  window.addEventListener('load', loadDeferredImages);
  window.addEventListener('resize', loadDeferredImages);
  window.addEventListener('scroll', loadDeferredImages);

$(document).ready(function(e) {
  var $donation_form = $("#paypal_donate_form_onetime_recurring");
  //toggle custom amount
  var $custom_other_amount = $donation_form.find("#custom_other_amount");
  $custom_other_amount.hide();
  $donation_form.find("[name='d_amount']").change(function() {
      var $this = $(this);
      if ($this.val() == 'other') {
        $custom_other_amount.show().append('<div class="input-group"><span class="input-group-addon">&#x20B9;</span> <input name="extra_amount" id="input_other_amount" type="number" max="100000000" class="form-control" value="5000" min="1"/></div>');
      }
      else{
        $custom_other_amount.children( ".input-group" ).remove();
        $custom_other_amount.hide();
      }
  });
});
</script>