Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="clearfix"></div>
- <div class="content">
- <div class="container-fluid">
- <div class="">
- <div class="card">
- <div class="card-header card-header-success">
- <h4 class="card-title"><?php echo $this->lang->line('masjid_list');?>
- <button type="button" class="btn btn-outline-white pull-right btn-inline btn_add" data-toggle="modal" data-target="#exampleModal"><?php echo $this->lang->line('add_masjid');?></button>
- </h4>
- </div>
- <div class="">
- <div class="px-4">
- <!-- Nav tabs -->
- <ul class="nav nav-tabs nav-justified green" role="tablist">
- <li class="nav-item">
- <a class="nav-link active" data-toggle="tab" href="#panel5" role="tab">
- <i class="fa fa-eye input-lg"></i> <?php echo $this->lang->line('active');?></a>
- </li>
- <li class="nav-item">
- <a class="nav-link" data-toggle="tab" href="#panel6" role="tab">
- <i class="fa fa-eye-slash input-lg"></i> <?php echo $this->lang->line('pending');?></a>
- </li>
- </ul>
- <!-- Nav tabs -->
- <!-- Tab panels -->
- <div class="tab-content">
- <!--Panel 1-->
- <div class="tab-pane fade in show active" id="panel5" role="tabpanel">
- <div class="clearfix"></div>
- <div class="mg-top-20">
- <!--Table-->
- <table class="table table-striped table-bordered table table-hover mb-0 user_table">
- <!--Table head-->
- <thead>
- <tr>
- <th class="th-lg"><a><b><?php echo $this->lang->line('s.no');?></b></a></th>
- <th class="th-lg"><a><b><?php echo $this->lang->line('name');?></b></a></th>
- <th class="th-lg"><a><b><?php echo $this->lang->line('photo');?></b></a></th>
- <th class="th-lg"><a><b><?php echo $this->lang->line('added_by');?></b></a></th>
- <th class="th-lg"><a><b><?php echo $this->lang->line('options');?></b></a></th>
- </tr>
- </thead>
- <!--Table head-->
- <!--Table body-->
- <tbody>
- </tbody>
- <!--Table body-->
- </table>
- <!--Table-->
- </div>
- <hr class="my-0">
- </div>
- <!--Bottom Table UI-->
- <!--/.Panel 1-->
- <!--Panel 2-->
- <div class="tab-pane fade" id="panel6" role="tabpanel">
- <div class="mg-top-20">
- <table class="table table-striped table-bordered table table-hover mb-0 user_table_pending">
- <thead>
- <tr>
- <th class="th-lg"><a><b><?php echo $this->lang->line('s.no');?></b></a></th>
- <th class="th-lg"><a><b><?php echo $this->lang->line('name');?></b></a></th>
- <th class="th-lg"><a><b><?php echo $this->lang->line('photo');?></b></a></th>
- <th class="th-lg"><a><b><?php echo $this->lang->line('added_by');?></b></a></th>
- <th class="th-lg"><a><b><?php echo $this->lang->line('options');?></b></a></th>
- </tr>
- </thead>
- <tbody></tbody>
- </table>
- </div>
- <!--/.Panel 2-->
- </div>
- <!-- Tab panels -->
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="bd-example">
- <!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">Add User</button> -->
- <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-lg">
- <div class="modal-content">
- <div class="modal-header">
- <button type="buton" class="close" data-dismiss="modal">×</button>
- <h3 class="modal-title" id="masjid_details"><?php echo $this->lang->line('masjid_details');?> </h3>
- </div>
- <form id="msform" method="post" class="add_masjid_form">
- <!-- progressbar -->
- <ul id="progressbar">
- <li class="active"><?php echo $this->lang->line('masjid_details');?></li>
- <li><?php echo $this->lang->line('masjid_address');?></li>
- <li><?php echo $this->lang->line('bank_details');?></li>
- <li><?php echo $this->lang->line('masjid_timings');?></li>
- <li><?php echo $this->lang->line('masjid_pictures');?></li>
- </ul>
- <!-- fieldsets -->
- <fieldset class="field_class">
- <h2 class="fs-title"><?php echo $this->lang->line('masjid_list');?></h2>
- <div class="col-sm-12">
- <div class="form-group">
- <label for="masjid_name" class="bmd-label-floating"><?php echo $this->lang->line('masjid_name');?></label>
- <input type="text" name="masjid_name" class="form-control" id="masjid_name" required="required" />
- </div>
- </div>
- <div class="col-sm-12">
- <div class="form-group">
- <label for="seating_capacity" class="bmd-label-floating"><?php echo $this->lang->line('seating_capacity');?></label>
- <input type="number" name="seating_capacity" class="form-control" id="seating_capacity" required="required"/>
- </div>
- </div>
- <div class="col-sm-12">
- <div class="form-group">
- <label for="main_description" class="bmd-label-floating"><?php echo $this->lang->line('main_description');?></label>
- <input type="text" name="main_description" class="form-control" id="main_description" required="required"/>
- </div>
- </div>
- <div class="col-sm-6">
- <div class="form-group" >
- <label for="user_id" class="bmd-label-floating"><?php echo $this->lang->line('added_by');?></label>
- <select class="dropdown-primary form-control" name="user_id" id="user_id">
- <option value="" disabled ><?php echo $this->lang->line('select_one');?></option>
- <?php
- foreach ($user_data as $key => $value) {
- echo '<option value="'.$value['id'].'">'.$value['first_name'].''.$value['last_name'].'</option>';
- }
- ?>
- </select>
- <!-- <label for="exampleInputEmail1" class="bmd-label-floating">Status</label>
- <input type="user" class="form-control" id="exampleInputEmail1"> -->
- </div>
- </div>
- <div class="col-sm-6">
- <div class="form-group">
- <label for="maslak" class="bmd-label-floating"><?php echo $this->lang->line('maslak');?></label>
- <select class="dropdown-primary form-control" name="maslak" id="maslak" required="required">
- <option value="" disabled ><?php echo $this->lang->line('maslak');?></option>
- <option value="<?php echo $this->lang->line('sunni');?>"><?php echo $this->lang->line('sunni');?></option>
- <option value="<?php echo $this->lang->line('shia');?>"><?php echo $this->lang->line('shia');?></option>
- <option value="<?php echo $this->lang->line('hanfi');?>"><?php echo $this->lang->line('hanfi');?></option>
- <option value="<?php echo $this->lang->line('maliki');?>"><?php echo $this->lang->line('maliki');?></option>
- <option value="<?php echo $this->lang->line('shafi');?>"><?php echo $this->lang->line('shafi');?></option>
- <option value="<?php echo $this->lang->line('hanbali');?>"><?php echo $this->lang->line('hanbali');?></option>
- <option value="<?php echo $this->lang->line('barelvi');?>"><?php echo $this->lang->line('barelvi');?></option>
- <option value="<?php echo $this->lang->line('deobandi');?>"><?php echo $this->lang->line('deobandi');?></option>
- <option value="<?php echo $this->lang->line('ahle_hadith');?>"><?php echo $this->lang->line('ahle_hadith');?></option>
- <option value="<?php echo $this->lang->line('salafi');?>"><?php echo $this->lang->line('salafi');?></option>
- <option value="<?php echo $this->lang->line('wahhabi');?>"><?php echo $this->lang->line('wahhabi');?></option>
- <option value="<?php echo $this->lang->line('tableeghi');?>"><?php echo $this->lang->line('tableeghi');?></option>
- <option value="<?php echo $this->lang->line('jamat_e_islami');?>"><?php echo $this->lang->line('jamat_e_islami');?></option>
- <option value="<?php echo $this->lang->line('bohra');?>"><?php echo $this->lang->line('bohra');?></option>
- <option value="<?php echo $this->lang->line('islamaili');?>"><?php echo $this->lang->line('islamaili');?></option>
- <option value="<?php echo $this->lang->line('sufi');?>"><?php echo $this->lang->line('sufi');?></option>
- <option value="<?php echo $this->lang->line('zahiri');?>"><?php echo $this->lang->line('zahiri');?></option>
- <option value="<?php echo $this->lang->line('ibadi');?>"><?php echo $this->lang->line('ibadi');?></option>
- <option value="<?php echo $this->lang->line('kalam');?>"><?php echo $this->lang->line('kalam');?></option>
- <option value="<?php echo $this->lang->line('ashari');?>"><?php echo $this->lang->line('ashari');?></option>
- <option value="<?php echo $this->lang->line('maturidi');?>"><?php echo $this->lang->line('maturidi');?></option>
- <option value="<?php echo $this->lang->line('athari');?>"><?php echo $this->lang->line('athari');?></option>
- <option value="<?php echo $this->lang->line('mutazili');?>"><?php echo $this->lang->line('mutazili');?></option>
- <option value="<?php echo $this->lang->line('jahmiyyah');?>"><?php echo $this->lang->line('jahmiyyah');?></option>
- <option value="<?php echo $this->lang->line('ahmadiyya');?>"><?php echo $this->lang->line('ahmadiyya');?></option>
- <option value="<?php echo $this->lang->line('ikhwani');?>"><?php echo $this->lang->line('ikhwani');?></option>
- </select>
- </div>
- </div>
- <!-- Switch -->
- <div class="col-sm-6">
- <div class="form-group">
- <label for="ladies_arrangement" class="bmd-label-floating"><?php echo $this->lang->line('ladies_arrangement');?></label>
- <select class="dropdown-primary form-control" name="ladies_arrangement" id="ladies_arrangement">
- <option value="" disabled ><?php echo $this->lang->line('ladies_arrangement');?></option>
- <option value="1" selected><?php echo $this->lang->line('yes');?></option>
- <option value="2"><?php echo $this->lang->line('no');?></option>
- </select>
- </div>
- </div>
- <div class="col-sm-6">
- <label for="status" class="bmd-label-floating"><?php echo $this->lang->line('status');?></label>
- <select class="dropdown-primary form-control" name="status" id="status">
- <option value="" disabled ><?php echo $this->lang->line('status');?></option>
- <option value="2" selected><?php echo $this->lang->line('active');?></option>
- <option value="1"><?php echo $this->lang->line('pending');?></option>
- </select>
- </div>
- <!-- Disabled Switch -->
- <div class="clearfix"></div>
- <input type="button" name="next" class="next action-button" value="Next"/>
- </fieldset>
- <fieldset class="field_class hidden">
- <h2 class="fs-title"><?php echo $this->lang->line('masjid_address');?></h2>
- <h3 class="fs-subtitle"></h3>
- <div class="col-sm-12">
- <div class="form-group">
- <label for="contact_person" class="bmd-label-floating"><?php echo $this->lang->line('contact_person');?></label>
- <input type="text" name="contact_person" class="form-control" id="contact_person"/>
- </div>
- </div>
- <div class="col-sm-6">
- <div class="form-group">
- <label for="mobile" class="bmd-label-floating"><?php echo $this->lang->line('phone');?></label>
- <input type="tel" name="mobile" class="form-control" id="mobile" required="required"/>
- </div>
- </div>
- <div class="col-sm-6">
- <div class="form-group">
- <label for="email_id" class="bmd-label-floating"><?php echo $this->lang->line('email');?></label>
- <input type="email" name="email_id" class="form-control" id="email_id"/>
- </div>
- </div>
- <div class="col-sm-6">
- <div class="form-group">
- <label for="door_no" class="bmd-label-floating"><?php echo $this->lang->line('door_no');?></label>
- <input type="text" name="door_no" class="form-control" id="door_no" required="required"/>
- </div>
- </div>
- <div class="col-sm-6">
- <div class="form-group">
- <label for="landmark" class="bmd-label-floating"><?php echo $this->lang->line('landmark');?></label>
- <input type="text" name="landmark" class="form-control" id="landmark" required="required"/>
- </div>
- </div>
- <div class="col-sm-12">
- <div class="form-group">
- <label for="street_name" class="bmd-label-floating"><?php echo $this->lang->line('street_name');?></label>
- <input type="text" name="street_name" class="form-control" id="street_name" required="required"/>
- </div>
- </div>
- <div class="col-sm-12">
- <div class="form-group">
- <label for="address" class="bmd-label-floating"><?php echo $this->lang->line('address');?></label>
- <input type="text" name="address" class="form-control" id="address" required="required"/>
- </div>
- </div>
- <div class="col-sm-12">
- <div class="map_canvas"></div><div class="search_map">
- <input id="geocomplete" type="text" placeholder="Type in an address" />
- <span class="search_icon find_geo"><i class="fa fa-search"></i></span></div>
- </div>
- <!-- <input type="text" name="landmark" placeholder="Landmark" value=""> -->
- <div class="col-sm-6">
- <div class="form-group">
- <label for="latitude" class="bmd-label-floating"><?php echo $this->lang->line('latitude');?></label>
- <input type="text" name="latitude" class="form-control" id="latitude" required="required"/>
- </div>
- </div>
- <!-- <input type="text" name="latitude" placeholder="Latitude" value=""> -->
- <div class="col-sm-6">
- <div class="form-group">
- <label for="longitude" class="bmd-label-floating"><?php echo $this->lang->line('longitude');?></label>
- <input type="text" name="longitude" class="form-control" id="longitude" required="required"/>
- </div>
- </div>
- <!-- <input type="text" name="longitude" placeholder="Longitude" value=""> -->
- <input type="button" name="previous" class="previous action-button" value="Previous" />
- <input type="button" name="next" class="next action-button" value="Next" />
- </fieldset>
- <fieldset class="field_class hidden">
- <h2 class="fs-title"><?php echo $this->lang->line('bank_details');?></h2>
- <h3 class="fs-subtitle"></h3>
- <div class="col-sm-12">
- <div class="form-group">
- <label for="account_no" class="bmd-label-floating"><?php echo $this->lang->line('account_number');?></label>
- <input type="number" name="account_no" class="form-control" id="account_no"/>
- </div>
- </div>
- <!-- <input type="text" name="account_no" placeholder="Account Number" /> -->
- <div class="col-sm-12">
- <div class="form-group">
- <label for="bank_name" class="bmd-label-floating"><?php echo $this->lang->line('bank_name');?></label>
- <input type="text" name="bank_name" class="form-control" id="bank_name"/>
- </div>
- </div>
- <!-- <input type="text" name="bank_name" placeholder="Bank Name" /> -->
- <div class="col-sm-12">
- <div class="form-group">
- <label for="bank_branch" class="bmd-label-floating"><?php echo $this->lang->line('branch_name');?></label>
- <input type="text" name="bank_branch" class="form-control" id="bank_branch" />
- </div>
- </div>
- <!-- <input type="text" name="branch_name" placeholder="Branch Name" /> -->
- <div class="col-sm-12">
- <div class="form-group">
- <label for="bank_ifsc" class="bmd-label-floating"><?php echo $this->lang->line('ifsc_code');?></label>
- <input type="text" name="bank_ifsc" class="form-control" id="bank_ifsc"/>
- </div>
- </div>
- <input type="button" name="previous" class="previous action-button" value="Previous" />
- <input type="button" name="next" class="next action-button" value="Next" />
- </fieldset>
- <fieldset class="field_class hidden">
- <h2 class="fs-title"><?php echo $this->lang->line('masjid_timings');?></h2>
- <div class="clearfix"></div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="salah_time1" class="bmd-label-floating"><?php echo $this->lang->line('salah');?></label>
- <input type="text" name="salah_time1" value="fajar" class="form-control" id="salah_time1" required="required" readonly />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="azan_time1" class="bmd-label-floating"/><?php echo $this->lang->line('azan_time');?></label>
- <input type="text" class="prayer" name="azan_time1" id="azan_time1" required />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="prayer_time1" class="bmd-label-floating"/><?php echo $this->lang->line('prayer_time');?></label>
- <input type="text" class="prayer" name="prayer_time1" id="prayer_time1" required />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="salah_time2" class="bmd-label-floating"><?php echo $this->lang->line('salah');?></label>
- <input type="text" name="salah_time2" value="<?php echo $this->lang->line('zohar');?>" class="form-control" id="salah_time2" required="required" readonly/>
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="azan_time2" class="bmd-label-floating"/><?php echo $this->lang->line('azan_time');?></label>
- <input type="text" class="prayer" id="azan_time2" name="azan_time2" required />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="prayer_time2" class="bmd-label-floating"/><?php echo $this->lang->line('prayer_time');?></label>
- <input type="text" class="prayer" name="prayer_time2" id="prayer_time2" required />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="salah_time3" class="bmd-label-floating"><?php echo $this->lang->line('salah');?></label>
- <input type="text" name="salah_time3" value="<?php echo $this->lang->line('asar');?>" class="form-control" id="salah_time3" required="required" readonly/>
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="azan_time3" class="bmd-label-floating"/><?php echo $this->lang->line('azan_time');?></label>
- <input type="text" class="prayer" id="azan_time3" name="azan_time3" class="azan_time" required />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="prayer_time3" class="bmd-label-floating"/><?php echo $this->lang->line('prayer_time');?></label>
- <input type="text" class="prayer" name="prayer_time3" id="prayer_time3" required />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="salah_time4" class="bmd-label-floating"><?php echo $this->lang->line('salah');?></label>
- <input type="text" name="salah_time4" value="<?php echo $this->lang->line('maghrib');?>" class="form-control" id="salah_time4" required="required" readonly/>
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="azan_time4" class="bmd-label-floating"/><?php echo $this->lang->line('azan_time');?></label>
- <input type="text" class="prayer" name="azan_time4" id="azan_time4" required />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="prayer_time4" class="bmd-label-floating"/><?php echo $this->lang->line('prayer_time');?></label>
- <input type="text" class="prayer" name="prayer_time4" id="prayer_time4" required />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="salah_time5" class="bmd-label-floating"><?php echo $this->lang->line('salah');?></label>
- <input type="text" name="salah_time5" value="<?php echo $this->lang->line('ishaa');?>" class="form-control" id="salah_time5" required="required" readonly/>
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="azan_time5" class="bmd-label-floating"/><?php echo $this->lang->line('azan_time');?></label>
- <input type="text" class="prayer" id="azan_time5" name="azan_time5" class="azan_time" required />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="prayer_time5" class="bmd-label-floating"/><?php echo $this->lang->line('prayer_time');?></label>
- <input type="text" class="prayer" id="prayer_time5" name="prayer_time5" required />
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="salah_time6" class="bmd-label-floating"><?php echo $this->lang->line('salah');?></label>
- <input type="text" name="salah_time6" value="<?php echo $this->lang->line('jumuah');?>" class="form-control" id="salah_time6" required="required" readonly/>
- </div>
- </div>
- <div class="col-sm-4">
- <div class="form-group">
- <label for="azan_time6" class="bmd-label-floating"/><?php echo $this->lang->line('azan_time');?></label>
- <input type="text" class="prayer" id="azan_time6" name="azan_time6" required />
- </div>
- </div>
- <div class="col-sm-3">
- <div class="form-group">
- <label for="prayer_time6" class="bmd-label-floating"/><?php echo $this->lang->line('prayer_time');?></label>
- <input type="text" class="prayer" name="prayer_time6" id="prayer_time6" required />
- </div>
- </div>
- <div class="field_wrapper">
- <div class="col-sm-1">
- <div class="form-group">
- <a href="javascript:void(0);" class="add_input_button" title="Add field"><i class="material-icons" value="Add Field">add_circle</i></a>
- </div></div></div>
- <div class="clearfix"></div>
- <input type="button" name="previous" class="previous action-button" value="Previous" />
- <input type="button" name="next" class="next action-button" value="Next" />
- </fieldset>
- <fieldset class="field_class hidden">
- <h2 class="fs-title"><?php echo $this->lang->line('masjid_pictures');?></h2>
- <h3 class="fs-subtitle"></h3>
- <div class="col-sm-12">
- <div class="dropzone2" id="myDropzone">
- </div>
- <div class="clearfix"></div>
- </div>
- <br/>
- <div class="clearfix"></div>
- <input type="button" name="previous" class="previous action-button" value="Previous" />
- <input type="submit" name="submit" data-edit_masjid="" class="btn_post action-button" value="submit" />
- </fieldset>
- <div class="clearfix"></div>
- </form>
- </div>
- </div>
- </div>
- </div>
- <script src="<?= base_url('assets/js/dropzone.js') ?>"></script>
- <script type="text/javascript">
- // new things added
- $(document).ready(function(){
- var max_fields = 10;
- var add_input_button = $('.add_input_button');
- var field_wrapper = $('.field_wrapper');
- var current_field_count = $("input[name^='prayer_time']").last().attr('id').replace('prayer_time','');
- current_field_count=+1;
- var new_field_html = '<div>'+
- '<input type="text" name="salah_time'+current_field_count+'" id="salah_time'+current_field_count+'" class="col-sm-4" value="" placeholder="Salah"/>'+
- '<input type="text" name="azan_time'+current_field_count+'" id="azan_time'+current_field_count+'" class="col-sm-4 prayer" value="" placeholder="Azan Time"/>'+
- '<input type="text" name="prayer_time'+current_field_count+'" id="prayer_time'+current_field_count+'" class="col-sm-3 prayer" value="" placeholder="Prayer Time"/>'+
- '<a href="javascript:void(0);" class="remove_input_button" title="Remove field"><i class="material-icons">clear</i></a></div>';
- var input_count = 1;
- // Add button dynamically
- $(add_input_button).click(function(){
- if(input_count < max_fields){
- input_count++;
- $(field_wrapper).append(new_field_html);
- }
- });
- // Remove dynamically added button
- $(field_wrapper).on('click', '.remove_input_button', function(e){
- e.preventDefault();
- $(this).parent('div').remove();
- input_count--;
- });
- });
- // end new things
- jQuery(document).ready(function()
- {
- jQuery(".add_masjid_form").on("submit",function(e)
- {
- e.preventDefault();
- });
- function reset_masjid() {
- jQuery(".add_masjid_form").find(".field_class").removeAttr("style");
- jQuery(".add_masjid_form").find(".field_class:first-child").css({"display": "block"," left":" 0%"," opacity": "1", "transform": "scale(1)", "position": "relative"});
- jQuery(".add_masjid_form").find(".field_class").addClass("hidden");
- jQuery(".add_masjid_form").find("#progressbar li").removeClass("active");
- jQuery(".add_masjid_form").find("#progressbar li:first-child").addClass("active");
- jQuery(".add_masjid_form").find(".field_class:first-child").removeClass("hidden");
- }
- var response;
- $.validator.addMethod(
- "uniqueUserName",
- function(value, element) {
- $.ajax({
- type: "POST",
- url: "<?php echo base_url().'admin/email_check';?>",
- data: {"email":value,"table":"users"},
- success: function(msg)
- {
- //If username exists, set response to true
- if(msg == "true")
- {
- response = true;
- }
- else
- {
- response = false;
- }
- }
- });
- return response;
- },
- "Username is Already Taken"
- );
- //jQuery time
- var current_fs, next_fs, previous_fs; //fieldsets
- var left, opacity, scale; //fieldset properties which we will animate
- var animating; //flag to prevent quick multi-click glitches
- var $validator = jQuery(".add_masjid_form").validate({
- submitHandler: function(form) {
- jQuery('.popup_loader').css({"display":"block"});
- }
- });
- jQuery(".add_masjid_form").on("click",".next",function(){
- var $valid = jQuery(".add_masjid_form").valid();
- if(!$valid){
- $validator.focusInvalid();
- }
- else
- {
- if(animating) return false;
- animating = true;
- current_fs = $(this).parent();
- next_fs = $(this).parent().next();
- jQuery(".field_class").addClass("hidden")
- next_fs.removeClass("hidden");
- //activate next step on progressbar using the index of next_fs
- $("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active");
- //show the next fieldset
- next_fs.show();
- //hide the current fieldset with style
- current_fs.animate({opacity: 0}, {
- step: function(now, mx) {
- //as the opacity of current_fs reduces to 0 - stored in "now"
- //1. scale current_fs down to 80%
- scale = 1 - (1 - now) * 0.2;
- //2. bring next_fs from the right(50%)
- left = (now * 50)+"%";
- //3. increase opacity of next_fs to 1 as it moves in
- opacity = 1 - now;
- current_fs.css({
- 'transform': 'scale('+scale+')',
- 'position': 'relative'
- });
- next_fs.css({'left': left, 'opacity': opacity});
- },
- duration: 800,
- complete: function(){
- current_fs.hide();
- animating = false;
- },
- //this comes from the custom easing plugin
- easing: 'easeInOutBack'
- });
- }
- });
- $(".previous").click(function(){
- if(animating) return false;
- animating = true;
- current_fs = $(this).parent();
- previous_fs = $(this).parent().prev();
- jQuery(".field_class").addClass("hidden")
- previous_fs.removeClass("hidden");
- //de-activate current step on progressbar
- $("#progressbar li").eq($("fieldset").index(current_fs)).removeClass("active");
- //show the previous fieldset
- previous_fs.show();
- //hide the current fieldset with style
- current_fs.animate({opacity: 0}, {
- step: function(now, mx) {
- //as the opacity of current_fs reduces to 0 - stored in "now"
- //1. scale previous_fs from 80% to 100%
- scale = 0.8 + (1 - now) * 0.2;
- //2. take current_fs to the right(50%) - from 0%
- left = ((1-now) * 50)+"%";
- //3. increase opacity of previous_fs to 1 as it moves in
- opacity = 1 - now;
- current_fs.css({'left': left});
- previous_fs.css({'transform': 'scale('+scale+')', 'opacity': opacity});
- },
- duration: 800,
- complete: function(){
- current_fs.hide();
- animating = false;
- },
- //this comes from the custom easing plugin
- easing: 'easeInOutBack'
- });
- });
- $(".submit").click(function(){
- return false;
- })
- jQuery("#msform").on("submit",function(e)
- {
- e.preventDefault();
- });
- // $('.prayer').bootstrapMaterialDatePicker({ date: false });
- $(document).on("focus", ".prayer", function(){
- $(this).bootstrapMaterialDatePicker({
- date: false,
- shortTime: false,
- format: 'HH:mm'
- });
- });
- $(".dtp-buttons").click(function ()
- {
- if( $('#azan_time1').val().length != 0 && $('#prayer_time1').val().length != 0) {
- var startTime = $('#azan_time1').val();
- var endTime = $('#prayer_time1').val();
- if (startTime >= endTime)
- {
- alert('End time always greater then start time.');
- $('#prayer_time1').val('')
- }
- }
- if( $('#azan_time2').val().length != 0 && $('#prayer_time2').val().length != 0) {
- var startTime = $('#azan_time2').val();
- var endTime = $('#prayer_time2').val();
- if (startTime >= endTime)
- {
- alert('End time always greater then start time.');
- $('#prayer_time2').val('')
- }
- }
- if( $('#azan_time3').val().length != 0 && $('#prayer_time3').val().length != 0) {
- var startTime = $('#azan_time3').val();
- var endTime = $('#prayer_time3').val();
- if (startTime >= endTime)
- {
- alert('End time always greater then start time.');
- $('#prayer_time3').val('')
- }
- }
- if( $('#azan_time4').val().length != 0 && $('#prayer_time4').val().length != 0) {
- var startTime = $('#azan_time4').val();
- var endTime = $('#prayer_time4').val();
- if (startTime >= endTime)
- {
- alert('End time always greater then start time.');
- $('#prayer_time4').val('')
- }
- }
- if( $('#azan_time5').val().length != 0 && $('#prayer_time5').val().length != 0) {
- var startTime = $('#azan_time5').val();
- var endTime = $('#prayer_time5').val();
- if (startTime >= endTime)
- {
- alert('End time always greater then start time.');
- $('#prayer_time5').val('')
- }
- }
- if( $('#azan_time6').val().length != 0 && $('#prayer_time6').val().length != 0) {
- var startTime = $('#azan_time6').val();
- var endTime = $('#prayer_time6').val();
- if (startTime >= endTime)
- {
- alert('End time always greater then start time.');
- $('#prayer_time6').val('')
- }
- }
- });
- var url = '<?php echo base_url();?>';//$('.content-header').attr('rel');
- var table = $('.user_table').DataTable({
- dom: 'lfBrtip',
- buttons: [
- 'copy', 'excel', 'pdf', 'print'
- ],
- "processing": true,
- "serverSide": false,
- "aoColumnDefs" : [ {
- "bSortable" : true,
- "aTargets" : [ "sorting_disabled" ]
- } ],
- "order": [
- [1, 'asc']
- ],
- "ajax": url+"admin/active_masjid_list",
- "sPaginationType": "full_numbers",
- "language": {
- "search": "_INPUT_",
- "searchPlaceholder": "Search",
- "paginate": {
- "next": '<i class="fa fa-angle-right"></i>',
- "previous": '<i class="fa fa-angle-left"></i>',
- "first": '<i class="fa fa-angle-double-left"></i>',
- "last": '<i class="fa fa-angle-double-right"></i>'
- }
- },
- "iDisplayLength": 10,
- "aLengthMenu": [[10, 25, 50, 100,500,-1], [10, 25, 50,100,500,"All"]]
- });
- var table2 = $('.user_table_pending').DataTable({
- dom: 'lfBrtip',
- buttons: [
- 'copy', 'excel', 'pdf', 'print'
- ],
- "processing": true,
- "serverSide": false,
- "aoColumnDefs" : [ {
- "bSortable" : true,
- "aTargets" : [ "sorting_disabled" ]
- } ],
- "order": [
- [1, 'asc']
- ],
- "ajax": url+"admin/non_active_masjid_list",
- "sPaginationType": "full_numbers",
- "language": {
- "search": "_INPUT_",
- "searchPlaceholder": "Search",
- "paginate": {
- "next": '<i class="fa fa-angle-right"></i>',
- "previous": '<i class="fa fa-angle-left"></i>',
- "first": '<i class="fa fa-angle-double-left"></i>',
- "last": '<i class="fa fa-angle-double-right"></i>'
- }
- },
- "iDisplayLength": 10,
- "aLengthMenu": [[10, 25, 50, 100,500,-1], [10, 25, 50,100,500,"All"]]
- });
- jQuery("input[name='mobile']").intlTelInput({
- // allowDropdown: false,
- // autoHideDialCode: false,
- // autoPlaceholder: "off",
- // dropdownContainer: "body",
- // excludeCountries: ["us"],
- // formatOnDisplay: false,
- // geoIpLookup: function(callback) {
- // $.get("http://ipinfo.io", function() {}, "jsonp").always(function(resp) {
- // var countryCode = (resp && resp.country) ? resp.country : "";
- // callback(countryCode);
- // });
- // },
- // hiddenInput: "full_number",
- // initialCountry: "auto",
- // localizedCountries: { 'de': 'Deutschland' },
- // nationalMode: false,
- // onlyCountries: ['us', 'gb', 'ch', 'ca', 'do'],
- // placeholderNumberType: "MOBILE",
- // preferredCountries: ['cn', 'jp'],
- // separateDialCode: true,
- utilsScript: "<?php echo base_url();?>assets/js/utils.js"
- });
- var removed_list = [];
- var edit_masjid = '';
- var myDropzone = new Dropzone("div#myDropzone", {
- url: "<?php echo base_url().'admin/add_masjid';?>",
- autoProcessQueue: false,
- uploadMultiple: true,
- parallelUploads: 100,
- maxFiles: 100,
- acceptedFiles: "image/*",
- init: function () {
- var submitButton = document.querySelector(".btn_post");
- var wrapperThis = this;
- jQuery(document).on("click",".btn_post", function() {
- $this = jQuery(this);
- jQuery('.popup_loader').css({"display":"block"});
- edit_masjid = jQuery($this).attr('data-edit_masjid');
- if(wrapperThis.processQueue())
- {
- $(".add_masjid_form").valid();
- }
- else
- {
- if(myDropzone.getUploadingFiles().length <= 0)
- {
- var formDatas = new FormData(),
- params = jQuery(".add_masjid_form").serializeArray();
- $.each(params, function(i, val) {
- formDatas.append(val.name, val.value);
- });
- var edit_m = jQuery($this).attr('data-edit_masjid');
- formDatas.append("edit_masjid",edit_m);
- formDatas.append('removed_list',JSON.stringify(removed_list));
- jQuery.ajax({
- url:"<?php echo base_url().'admin/add_masjid';?>",
- data: formDatas,
- dataType:"JSON",
- cache: false,
- contentType: false,
- processData: false,
- method: 'POST',
- type: 'POST',
- success: function(response){
- jQuery('.popup_loader').css({"display":"none"});
- jQuery('#exampleModal').modal("hide");
- $.notify({
- title: '<strong><?php echo $this->lang->line('success');?></strong>',
- message: "<?php echo $this->lang->line('data_inserted_sucessfully');?>"
- },{
- type: 'success'
- });
- jQuery(".add_masjid_form")[0].reset();
- table.ajax.reload();
- table2.ajax.reload();
- }
- });
- }
- }
- });
- jQuery("body").on("click",".edit_btn", function() {
- reset_masjid();
- jQuery('.popup_loader').css({"display":"block"});
- edit_masjid = jQuery(this).attr('data-id');
- $this = jQuery(this);
- $.ajax({
- url:'<?php echo site_url('admin/get_masjiddata'); ?>',
- type: 'POST',
- data: {"edit_masjid" : edit_masjid},
- dataType:"json",
- success: function(response){
- jQuery('.popup_loader').css({"display":"none"});
- populate('.add_masjid_form',response['masjid']);
- populate('.add_masjid_form',response['timings']);
- jQuery(".btn_post").attr("data-edit_masjid",edit_masjid);
- jQuery('#exampleModal').modal('show');
- var files_data = JSON.parse(response['file_data']);
- myDropzone.emit("reset");
- myDropzone.removeAllFiles(true);
- removed_list = [];
- $.each(files_data, function(key,value){
- var mockFile = { name: value.name, size: value.size, url: value.thumb};
- //myDropzone.options.addedfile.call(myDropzone, mockFile);
- // myDropzone.options.thumbnail.call(myDropzone, mockFile, value.thumb);
- mockFile.isMock = true;
- mockFile.status = Dropzone.ADDED;
- mockFile.accepted = true;
- myDropzone.emit("success", mockFile);
- myDropzone.emit("addedfile", mockFile);
- myDropzone.emit("complete", mockFile);
- myDropzone.emit("thumbnail", mockFile, mockFile.url);
- myDropzone.files.push(mockFile);
- });
- }
- });
- });
- this.on('sendingmultiple', function (data, xhr, formData) {
- var id_ports = edit_masjid;
- formData.append('edit_masjid', id_ports);
- formData.append('removed_list',JSON.stringify(removed_list));
- var params = jQuery(".add_masjid_form").serializeArray();
- $.each(params, function(i, val) {
- formData.append(val.name, val.value);
- });
- });
- this.on('removedfile', function (data, xhr, formData)
- {
- removed_list.push(data.name);
- });
- this.on("complete", function (file) {
- jQuery('.popup_loader').css({"display":"none"});
- table.ajax.reload();
- table2.ajax.reload();
- });
- }
- });
- function populate(frm, data) {
- $.each(data, function(key, value){
- $('#'+key, frm).val(value);
- });
- }
- jQuery(document).on("click",".delete_btn",function()
- {
- var delete_id = jQuery(this).attr('data-id');
- bootbox.confirm("<?php echo $this->lang->line('delete_confirmation');?>",
- function(result){
- if(result)
- {
- jQuery('.popup_loader').css({"display":"block"});
- $.ajax({
- url: "<?php echo base_url().'admin/delete_masjid';?>",
- type: 'POST',
- data:{"delete_id":delete_id},
- success: function(response) {
- jQuery('.popup_loader').css({"display":"none"});
- $.notify({
- title: '<strong><?php echo $this->lang->line('success');?></strong>',
- message: "<?php echo $this->lang->line('data_deleted_sucessfully');?>"
- },{
- type: 'success'
- });
- table.ajax.reload();
- table2.ajax.reload();
- }
- });
- }
- });
- });
- jQuery(".btn_add").on("click",function()
- {
- jQuery(".btn_post").attr("data-edit_masjid",'');
- reset_masjid();
- jQuery(".add_masjid_form")[0].reset();
- });
- });
- </script>
- <script src="<?php echo site_url('assets/js/jquery.geocomplete.js');?>"></script>
- <script>
- jQuery(document).ready(function(){
- var curr_latt;
- var curr_lang;
- getLocation();
- function getLocation() {
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(function(position) {
- showPosition(position.coords);
- },
- function(failure) {
- $.getJSON('https://ipinfo.io/geo', function(response) {
- var loc = response.loc.split(',');
- var coords = {
- latitude: loc[0],
- longitude: loc[1]
- };
- showPosition(coords);
- });
- });
- } else {
- $.getJSON('https://ipinfo.io/geo', function(response) {
- var loc = response.loc.split(',');
- var coords = {
- latitude: loc[0],
- longitude: loc[1]
- };
- showPosition(coords);
- });
- }
- }
- function showPosition(position) {
- curr_latt= position.latitude;
- curr_lang= position.longitude;
- $(".add_masjid_form").find("input[name=latitude]").val(curr_latt);
- $(".add_masjid_form").find("input[name=longitude]").val(curr_lang);
- }
- jQuery('.next').on('click',function()
- {
- $(".add_masjid_form").find("#geocomplete").geocomplete({
- map: ".map_canvas",
- details: ".add_masjid_form",
- detailsAttribute: "data-geo",
- location: [curr_latt, curr_lang],
- types: ["geocode","establishment"],
- mapOptions: {
- zoom: 18,
- disableDefaultUI: true,
- zoomControl: true,
- zoomControlOptions: {
- style: google.maps.ZoomControlStyle.SMALL
- }
- },
- markerOptions: {
- animation: google.maps.Animation.DROP,
- draggable: true,
- flat: true,
- }
- });
- });
- $("#geocomplete").bind("geocode:dragged", function(event, latLng){
- $(".add_masjid_form").find("input[name=latitude]").val(latLng.lat());
- $(".add_masjid_form").find("input[name=longitude]").val(latLng.lng());
- $("#reset").show();
- });
- $("#geocomplete").bind("geocode:click", function(event, latLng){
- $(".add_masjid_form").find("input[name=latitude]").val(latLng.lat());
- $(".add_masjid_form").find("input[name=longitude]").val(latLng.lng());
- $("#geocomplete").trigger("geocode");
- $("#reset").show();
- });
- $("#reset").click(function(){
- $("#geocomplete").geocomplete("resetMarker");
- $("#reset").hide();
- return false;
- });
- $(".find_geo").click(function(){
- $("#geocomplete").trigger("geocode");
- }).click();
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement