<?php

include('libraryPHP/site_config.php');

include('libraryPHP/session_check_url.php');





?>



<!DOCTYPE html>

<html lang="en">



<head>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">

    <title><?php echo $appName ?> | <?php echo $pageTitle ?></title>



    <!-- App favicon -->



    <?php echo $appFaviconHtml ?>

    <!-- theme css start -->

    <?php include("commoncss.php"); ?>

    <!-- theme css end -->


    <style>
        ul {

            list-style-type: none;

        }
    </style>



</head>



<body>



    <!-- Main Wrapper -->

    <div class="main-wrapper">



        <!-- Header start  -->

        <?php include("header.php"); ?>

        <!-- /Header end -->



        <!-- Sidebar -->

        <?php include("sidebar.php"); ?>

        <!-- /Sidebar -->



        <!-- Page Wrapper -->

        <div class="page-wrapper">



            <div class="content container-fluid">



                <!-- Page Header -->

                <div class="page-header">

                    <div class="row">

                        <div class="col">

                            <h3 class="page-title">Manage Contents</h3>

                            <ul class="breadcrumb">

                                <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li>

                                <li class="breadcrumb-item active">Manage Contents</li>

                            </ul>

                        </div>

                    </div>

                </div>

                <!-- /Page Header -->
  <div class="row">
                               <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 mb-30">

                        <div class="card-box height-100-p overflow-hidden">

                            <div class="profile-tab height-100-p">

                                <div class="tab height-100-p">

                                    <ul class="nav nav-tabs customtab" role="tablist">

                                       <li class="nav-item">
                                            <a class="nav-link active" data-toggle="tab" href="#about" role="tab">About Us</a>
                                        </li>

                                        <li class="nav-item">
                                            <a class="nav-link" data-toggle="tab" href="#terms" role="tab">Terms & Conditions</a>
                                        </li>

                                        <li class="nav-item">
                                            <a class="nav-link" data-toggle="tab" href="#policy" role="tab">Privacy Policy</a>
                                        </li>

                                      

                                        <li class="nav-item">
                                            <a class="nav-link" data-toggle="tab" href="#message" role="tab">Share Message</a>
                                        </li>

                                        <li class="nav-item">
                                            <a class="nav-link" data-toggle="tab" href="#android_url" role="tab">Android App Url</a>
                                        </li>

                                        <li class="nav-item">
                                            <a class="nav-link" data-toggle="tab" href="#ios_url" role="tab">iOS App Url</a>
                                        </li>

                                      <!--    <li class="nav-item">
                                            <a class="nav-link" data-toggle="tab" href="#ios_url1" role="tab">Community Guidelines</a>
                                        </li> -->

                                         
                                  </ul>

                              </br>

                            </br>

                          <div class="tab-content">

                              <div class="tab-pane fade show active" id="about" role="tabpanel">

                                    <div class="profile">

                                        <form  method="post" id="form_about_us">
                                          <?php

                                          //echo "on line 2021=";print_r($getEditData);
                                                $content_id = 0;
                                                $content = '';
                                                
                                                foreach($getEditData as $key => $value) {
                                                    if($value['content_type'] == 0){
                                                        $content_id = $value['content_id'];
                                                        $content = $value['content'];
                                                        $content_1 = $value['content_1'];
                                                    }
                                                }
                                            ?>


                                                          <!--  <label class="btn btn-primary ml-5">
                                                                <input type="radio" name="language3" value="english" onclick="english_lang()" checked>&nbsp;User
                                                            </label>


                                                             <label class="btn btn-primary">
                                                                <input type="radio" name="language3" value="gujrati" onclick="gujrati_lang()">&nbsp;Charm
                                                            </label> -->


                                            <input type="hidden" id="content_id_about_us" value="<?php echo $content_id; ?>">

                                            <ul class="row">

                                            <li class="col-md-12">

                                               <div style="padding: 15px;" class="eng_div">

                                            <div class="html-editor pd-20 card-box mb-30">                                    

                                            <textarea class="form-control" name="about_us" placeholder="Enter text ..."><?php echo $content; ?></textarea>

                                            <span id="editorlocation" style="color:red"></span>

                                            </div>
                                            </div>



                                               <div style="padding: 15px;display:none;" class="gujarati_div">

                                            <div class="html-editor pd-20 card-box mb-30">                                    

                                            <textarea class="form-control" name="about_us_g" placeholder="Enter text ..."><?php echo $content_1; ?></textarea>

                                            <span id="editorlocationg" style="color:red"></span>

                                            </div>
                                            </div>  



                                          </br>

                                            <div class="form-group mb-0-">

                                            <button class="btn btn-primary" type="submit" name="about_btn">Update</button>

                                            </div>

                                          </li>

                                        </ul>

                                    </form>

                                </div>

                            </div>    


                               

                         <!-- About Tab End -->
                        <div class="tab-pane fade" id="terms" role="tabpanel">

                            <div class="profile">

                            <form  method="post" id="form_terms_condition">

                            <?php
                                    $content_id = 0;
                                    $content = '';
                                    
                                    foreach ($getEditData as $key => $value) {
                                        if($value['content_type'] == 2){
                                            $content_id = $value['content_id'];
                                            $content = $value['content'];
                                            $content_1 = $value['content_1'];
                                        }
                                    }
                                ?>

                               <!--  <label class="btn btn-primary ml-5">
                                                                <input type="radio" name="language4" value="english" onclick="english_lang4()" checked>&nbsp;User
                                                            </label>


                                                             <label class="btn btn-primary">
                                                                <input type="radio" name="language4" value="gujrati" onclick="gujrati_lang4()">&nbsp;Charm 
                                                            </label> -->
                                <input type="hidden" id="content_id_terms_condition"  value="<?php echo $content_id; ?>">

                                  <ul class="row">

                                    <li class="col-md-12">


                                        <div style="padding: 15px;" class="eng_div4">  
                                        <div class="html-editor pd-20 card-box mb-30">                                          

                                          <textarea class="form-control" name="editor1" placeholder="Enter text ..."><?php echo $content; ?></textarea>
                                           <span id="editorlocation1" style="color:red"></span>

                                      </div>
                                    </div>

                                     <div style="padding: 15px;display:none;" class="gujarati_div4">

                                       <div class="html-editor pd-20 card-box mb-30">                                          

                                          <textarea class="form-control" name="editorg1" placeholder="Enter text ..."><?php echo $content_1; ?></textarea>
                                           <span id="editorlocationg1" style="color:red"></span>

                                      </div>
                                       

                                     </div>


                                            </br>

                                              <div class="form-group mb-0">

                                              <button class="btn btn-primary" type="submit" name="terms_btn">Update</button>

                                          </div>

                                      </li>

                                  </ul>

                              </form>

                          </div>

                      </div>  

                  <!-- end terms and conditions -->
                <div class="tab-pane fade" id="policy" role="tabpanel">

                    <div class="profile">

                       <form  method="post" id="form_privacy_policy">

                        <?php
                            $content_id = 0;
                            $content = '';
                            
                            foreach ($getEditData as $key => $value) {
                                if($value['content_type'] == 1){
                                    $content_id = $value['content_id'];
                                    $content = $value['content'];
                                    $content_1 = $value['content_1'];
                                }
                            }
                        ?>

                          <!-- <label class="btn btn-primary ml-5">
                                                                <input type="radio" name="language5" value="english" onclick="english_lang5()" checked>&nbsp;User
                                                            </label>


                                                             <label class="btn btn-primary">
                                                                <input type="radio" name="language5" value="gujrati" onclick="gujrati_lang5()">&nbsp;Charm
                                                            </label> -->
                        
                          <input type="hidden" id="content_id_privacy_policy"  value="<?php echo $content_id; ?>">

                              <ul class="row">

                                  <li class="col-md-12"> 


                                     <div style="padding: 15px;" class="eng_div5">  
                                        <div class="html-editor pd-20 card-box mb-30">                                          

                                           <textarea class="form-control" name="editor2" placeholder="Enter text ..."><?php echo $content; ?></textarea>
                                           <span id="editorlocation2" style="color:red"></span>

                                      </div>
                                    </div>

                                     <div style="padding: 15px;display:none;" class="gujarati_div5">

                                       <div class="html-editor pd-20 card-box mb-30">                                          

                                         
                                      <textarea class="form-control" name="editorg2" placeholder="Enter text ..."><?php echo $content_1; ?></textarea>
                                           <span id="editorlocationg2" style="color:red"></span>

                                      </div>
                                       

                                     </div>

                                     

                                      </br>

                                      <div class="form-group mb-0">

                                      <button class="btn btn-primary" type="submit" name="policy_btn">Update</button>

                                      </div>

                                      </li>

                                      </ul>

                                    </form>

                                </div>

                            </div>  

                            <!-- end of privacy policy -->

                        <!-- cancle policy start-->

                         <div class="tab-pane fade" id="message" role="tabpanel">

                              <div class="profile">

                               <!--  <label class="btn btn-primary ml-5">
                                                                <input type="radio" name="language7" value="english" onclick="english_lang7()" checked>&nbsp;User
                                                            </label>


                                                             <label class="btn btn-primary">
                                                                <input type="radio" name="language7" value="gujrati" onclick="gujrati_lang7()">&nbsp;Charm 
                                                            </label> -->


                                <form role="form" method="post" id="share_message" style="padding: 25px;">
                                    <?php
                                        $content_id = 0;
                                        $content = '';
                                        
                                        foreach ($getEditData as $key => $value) {
                                            if($value['content_type'] == 5){
                                                $content_id = $value['content_id'];
                                                $content = $value['content'];
                                                $content_1 = $value['content_1'];
                                            }
                                        }
                                    ?>                       
                                    <input type="hidden" id="content_id_share_msg"  value="<?php echo $content_id;?>">

                                     <div style="padding: 15px;" class="eng_div7">  

                                    <ul class="row">

                                      <li class="col-md-12"> 

                                        <div class="form-group">

                                           <label>Message</label>

                                            <textarea class="form-control"  id="share_msg" name="share_msg"rows="3"><?php echo $content;  ?></textarea>                

                                        </div>
                                       

                                       
                                            <div class="form-group mb-0">

                                            <button class="btn btn-primary" type="submit" name="message_btn">Update</button>

                                            </div>
                                             </li>
                                      </ul>
                                    </div>

                                            <div style="padding: 15px;display:none;" class="gujarati_div7">
                                              <ul>
                                                <li>
                                        <div class="form-group">

                                           <label>Message(Charm)</label>

                                            <textarea class="form-control"  id="share_msg_1" name="share_msg_1"rows="3"><?php echo $content_1;  ?></textarea>                

                                        </div>                                              

                                            <div class="form-group mb-0">

                                            <button class="btn btn-primary" type="submit" name="message_btn_1">Update</button>

                                            </div>

                                        </li>

                                    </ul>
                                  </div>

                                </form>

                            </div>




                        </div>

                           <div class="tab-pane fade " id="ios_url1" role="tabpanel">

                                    <div class="profile">

                                        <form  method="post" id="form_about_us2">
                                          <?php

                                          //echo "on line 2021=";print_r($getEditData);
                                                $content_id = 0;
                                                $content = '';
                                                
                                                foreach($getEditData as $key => $value) {
                                                    if($value['content_type'] == 23){
                                                        $content_id = $value['content_id'];
                                                        $content = $value['content'];
                                                        $content_1 = $value['content_1'];
                                                    }
                                                }
                                            ?>


                                                          <!--  <label class="btn btn-primary ml-5">
                                                                <input type="radio" name="language3" value="english" onclick="english_lang()" checked>&nbsp;User
                                                            </label>


                                                             <label class="btn btn-primary">
                                                                <input type="radio" name="language3" value="gujrati" onclick="gujrati_lang()">&nbsp;Charm
                                                            </label> -->


                                            <input type="hidden" id="content_id_about_us2" value="<?php echo $content_id; ?>">

                                            <ul class="row">

                                            <li class="col-md-12">

                                               <div style="padding: 15px;" class="eng_div">

                                            <div class="html-editor pd-20 card-box mb-30">                                    

                                            <textarea class="form-control" name="about_us2" placeholder="Enter text ..."><?php echo $content; ?></textarea>

                                            <span id="editorlocation2" style="color:red"></span>

                                            </div>
                                            </div>



                                               



                                          </br>

                                            <div class="form-group mb-0-">

                                            <button class="btn btn-primary" type="submit" name="about_btn">Update</button>

                                            </div>

                                          </li>

                                        </ul>

                                    </form>

                                </div>
                            </div>
                        <!-- mycode -->
                         <div class="tab-pane fade" id="android_url" role="tabpanel">

                              <div class="profile">

                                <form role="form" method="post" id="and_app_url_id" style="padding: 25px;">
                                    <?php
                                        $content_id = 0;
                                        $content = '';
                                        
                                        foreach ($getEditData as $key => $value) {
                                            if($value['content_type'] == 4){
                                                $content_id = $value['content_id'];
                                                $content = $value['content'];
                                                $content_1 = $value['content_1'];
                                            }
                                        }
                                    ?>

                                     <!-- <label class="btn btn-primary">

                                    <input type="radio" name="language8" value="english" onclick="english_lang8()" checked>&nbsp;User 
                                                            </label>


                                                             <label class="btn btn-primary">
                                                                <input type="radio" name="language8" value="gujrati" onclick="gujrati_lang8()">&nbsp;Charm
                                                            </label> -->
                       
                                    <input type="hidden" id="content_id_and_app_url"  value="<?php echo $content_id;?>">


                                      <div style="padding: 15px;" class="eng_div8"> 
                                    <ul class="row">

                                      <li class="col-md-12"> 

                                        <div class="form-group">

                                           <label>Android App Url</label>

                                           <input type="text" class="form-control" value="<?php echo $content;  ?>" id="and_app_url" name="and_app_url">

                                           <!--  <textarea class="form-control"  id="and_app_url" name="and_app_url"rows="3"><?php //echo $content;  ?></textarea>   -->              

                                        </div>                                              

                                            <div class="form-group mb-0">

                                            <button class="btn btn-primary" type="submit" name="and_app_btn">Update</button>

                                            </div>
                                          </ul>
                                        </li>
                                      </div>

                                      <div style="padding: 15px;display:none;" class="gujarati_div8">
                                        <div class="form-group">

                                           <label>Android App Url(Charm)</label>

                                            <!-- <textarea class="form-control"  id="and_app_btn_1" name="and_app_btn_1"rows="3"><?php //echo $content_1;  ?></textarea> -->

                                             <input type="text" class="form-control" value="<?php echo $content_1;  ?>" id="and_app_url_1" name="and_app_url_1">                

                                        </div>                                              

                                            <div class="form-group mb-0">

                                            <button class="btn btn-primary" type="submit" name="and_app_btn_1">Update</button>

                                            </div>

                                          </div>

                                       

                                </form>

                            </div>




                        </div>




                        <!-- mycode end-->


                         <div class="tab-pane fade" id="android_url" role="tabpanel">

                              <div class="profile">

                                <form role="form" method="post" id="contact_form" style="padding: 25px;">
                                     <?php
                            $content_id = 0;
                            $content = '';
                            
                            foreach ($getEditData as $key => $value) {
                                if($value['content_type'] == 6){
                                    $content_id = $value['content_id'];
                                    $content = $value['content'];
                                  
                                }
                            }

                            foreach ($getEditData as $key => $value) {
                                if($value['content_type'] == 7){
                                    $content_id_1 = $value['content_id'];
                                    $content_1 = $value['content'];
                                    
                                }
                            }
                        ?>                 
                                    <input type="hidden" id="content_id_form_url1" name="content_id_form_url[]" value="<?php echo $content_id;?>">
                                    <input type="hidden" id="content_id_form_url" name="content_id_form_url[]"  value="<?php echo $content_id_1;?>">

                                    <ul class="row">

                                      <li class="col-md-12"> 
                                             <div class="form-group">

                                          <label>Email</label>

                                             <input type="text"  class="form-control" id="email" name="email" value="<?php echo $content; ?>" placeholder="Please Enter Email">
                                               <label class="err_forgtemail mt-1"></label>


                                            </div>
                                           


                                            <div class="form-group">

                                          <label>Mobile Number</label>

                                              <div class="input-group mb-3">
                                           <div class="input-group-prepend">
                                          <span class="input-group-text">+91</span>
                                              </div>
                                        <input type="number" class="form-control" placeholder="Enter mobile number" id="mobile" name="mobile" value="<?php echo $content_1; ?>">
                                         </div>
                                         <label id="mobile-error" class="error" for="mobile"></label>

                                            </div>                                            

                                            <div class="form-group mb-0">

                                            <button class="btn btn-primary" type="submit" name="contact_btn">Update</button>

                                            </div>

                                        </li>

                                    </ul>

                                </form>

                            </div>


                            

                        </div>
                

                  <!-- Share Message Tab End -->            

<!--                   <div class="tab-pane fade" id="android_url" role="tabpanel">

                      <div class="profile">

                        <form role="form" id="android_app_url" method="post" style="padding: 25px;">
                        <?php
                            $content_id = 0;
                            $content = '';
                            
                            foreach ($getEditData as $key => $value) {
                                if($value['content_type'] == 4){
                                    $content_id = $value['content_id'];
                                    $content = $value['content'];
                                }
                            }
                        ?>
                 
                                <input type="hidden" id="content_id_android_url"  value="<?php echo $content_id;?>">

                                  <ul class="row">

                                    <li class="col-md-12">                                 

                                      <div class="form-group">

                                        <label>Android App Url</label>

                                     
                                        <input type="text" class="form-control" id="android_appurl" name="android_appurl" value="<?php echo $content; ?>" placeholder="Android App URL">

                                        </div>                                              

                                        <div class="form-group mb-0">

                                        <button class="btn btn-primary" type="submit" name="appurl_btn">Update</button>

                                        </div>

                                    </li>

                                </ul>

                            </form>

                        </div>

                    </div>
 -->
                  <!-- android App Url end -->
                <div class="tab-pane fade" id="ios_url" role="tabpanel">

                    <div class="profile">

                   <form role="form" method="post" id="ios_app_url_id" style="padding: 25px;">
                                    <?php
                                        $content_id = 0;
                                        $content = '';
                                        
                                        foreach ($getEditData as $key => $value) {
                                            if($value['content_type'] == 3){
                                                $content_id = $value['content_id'];
                                                $content = $value['content'];
                                                $content_1 = $value['content_1'];
                                            }
                                        }
                                    ?>

                                 <!--     //<label class="btn btn-primary"> -->

                                   <!--  <input type="radio" name="language9" value="english" onclick="english_lang9()" checked>&nbsp;User 
                                                            </label>


                                                             <label class="btn btn-primary">
                                                                <input type="radio" name="language9" value="gujrati" onclick="gujrati_lang9()">&nbsp;Charm 
                                                            </label> -->
                       
                                    <input type="hidden" id="content_id_ios_app_url"  value="<?php echo $content_id;?>">


                                      <div style="padding: 15px;" class="eng_div9"> 
                                    <ul class="row">

                                      <li class="col-md-12"> 

                                        <div class="form-group">

                                           <label>iOS App Url</label>

                                           <input type="text" class="form-control" value="<?php echo $content;  ?>" id="ios_app_url" name="ios_app_url">

                                           <!--  <textarea class="form-control"  id="and_app_url" name="and_app_url"rows="3"><?php //echo $content;  ?></textarea>   -->              

                                        </div>                                              

                                            <div class="form-group mb-0">

                                            <button class="btn btn-primary" type="submit" name="and_app_btn">Update</button>

                                            </div>
                                          </ul>
                                        </li>
                                      </div>

                                      <div style="padding: 15px;display:none;" class="gujarati_div9">
                                        <div class="form-group">

                                           <label>iOS App Url(Charm)</label>

                                            <!-- <textarea class="form-control"  id="and_app_btn_1" name="and_app_btn_1"rows="3"><?php //echo $content_1;  ?></textarea> -->

                                             <input type="text" class="form-control" value="<?php echo $content_1;  ?>" id="ios_app_url_1" name="ios_app_url_1">                

                                        </div>                                              

                                            <div class="form-group mb-0">

                                            <button class="btn btn-primary" type="submit" name="and_app_btn_1">Update</button>

                                            </div>

                                          </div>

                                       

                                </form>

                                  </div>

                                </div>
                                        <!-- ios app url end -->
                                    </div>

                                </div>


                <!-- start write start -->

              
                <?php include('commonjs.php')?>
<?php include_once('extrajs.php') ?>
    <script type="text/javascript">
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
        <script src="https://cdn.ckeditor.com/4.16.0/standard/ckeditor.js"></script>
        
  <script type="text/javascript">

     CKEDITOR.replace('about_us');  
     CKEDITOR.replace('about_us_g');  
   
     $("#form_about_us").submit( function(e) {
     
     var messageLength = CKEDITOR.instances['about_us'].getData().replace(/<[^>]*>/gi,'').length;  
     var messageLength = CKEDITOR.instances['about_us_g'].getData().replace(/<[^>]*>/gi,'').length;  
   
     if( !messageLength ) {
         $('#editorlocation').text('Please enter about us');
          $('#editorlocationg').text('Please enter about us');
         e.preventDefault();
     }else{
        $('#editorlocation').text("");
         $('#editorlocationg').text("");
        var content_id = $('#content_id_about_us').val();
        var content = CKEDITOR.instances['about_us'].getData();
        var content_1 = CKEDITOR.instances['about_us_g'].getData();
         // alert(content);
        var link = URLAPI+'common_controller.php';
        //var data=$(form).serialize();
        var data = {
            action:'edit_content',
            content_id:content_id,
            content:content,
            content_1:content_1,
        };
    
        var messsage = msgLoading.blankMessage[language];
        console.log('messsage',messsage);
    
        apiRequest.post(link, data, messsage).then(function(obj){
            console.log('obj',obj);
            if(obj.success === true) {
    
               //------------ Operation Message --------------------
                var title = msgTitleOperation.aboutAddedd[language];
                var messsage = obj.msg[language];
               // msgSuccessErrorHtml.success(title, messsage, msgSuccessErrorHtmlSelector);
                        //------------ Operation Message End--------------------
                        swal({
                            // title: title,
                            text: title,
                            icon: "success", //error, success, info
                            button: "Ok",
                        }).then((value) => {
                            window.location.href="#";
                        });
                //------------ Operation Message End--------------------
           
                return true;
            } else {
                //------------ Operation Message --------------------
                var title = msgTitleOperation.aboutAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.error(title, messsage, msgSuccessErrorHtmlSelector);   
                swal_alert(title,messsage,"#","error");
                //------------ Operation Message End--------------------
            }
        },function(err){
            console.log('err',err);
            //alert('Server not responde');
    
            //------------ Operation Message --------------------
            var title = msgTitleOperation.errorOnServer[language];
            var messsage = msgOperations.errorOnServer[language];
            msgSuccessErrorHtml.warning(title, messsage, msgSuccessErrorHtmlSelector);
            //------------ Operation Message End--------------------
            return false;
        });
    
        return false;
    
     }
    });                      

    CKEDITOR.replace( 'editor1' );
    CKEDITOR.replace( 'editorg1' );

    $("#form_terms_condition").submit( function(e) {
    
    var messageLength = CKEDITOR.instances['editor1'].getData().replace(/<[^>]*>/gi, '').length;
    var messageLength = CKEDITOR.instances['editorg1'].getData().replace(/<[^>]*>/gi, '').length;
   
    if(messageLength==0) {
         $('#editorlocation1').text('Please enter Terms & Conditions');
         $('#editorlocationg1').text('Please enter Terms & Conditions');
         e.preventDefault();
    }else{
        $('#editorlocation1').text("");
        $('#editorlocationg1').text("");
        var content_id = $('#content_id_terms_condition').val();
        var content = CKEDITOR.instances['editor1'].getData();
        var content_1 = CKEDITOR.instances['editorg1'].getData();
    
        var link = URLAPI+'common_controller.php';
        //var data=$(form).serialize();
        var data = {
            action:'edit_content',
            content_id:content_id,
            content:content,
            content_1:content_1,
        };
    
        var messsage = msgLoading.blankMessage[language];
        console.log('messsage',messsage);
    
        apiRequest.post(link, data, messsage).then(function(obj){
            console.log('obj',obj);
            if(obj.success === true) {
    
               //------------ Operation Message --------------------
                var title = msgTitleOperation.termsAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.success(title, messsage, msgSuccessErrorHtmlSelector);
                        //------------ Operation Message End--------------------
                        swal({
                            // title: title,
                             text: title,
                            icon: "success", //error, success, info
                            button: "Ok",
                        }).then((value) => {
                            window.location.href="#";
                        });
                //------------ Operation Message End--------------------
           
                return true;
            } else {
                //------------ Operation Message --------------------
                var title = msgTitleOperation.aboutAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.error(title, messsage, msgSuccessErrorHtmlSelector);   
                swal_alert(title,messsage,"#","error");
                //------------ Operation Message End--------------------
            }
        },function(err){
            console.log('err',err);
            //alert('Server not responde');
    
            //------------ Operation Message --------------------
            var title = msgTitleOperation.errorOnServer[language];
            var messsage = msgOperations.errorOnServer[language];
            msgSuccessErrorHtml.warning(title, messsage, msgSuccessErrorHtmlSelector);
            //------------ Operation Message End--------------------
            return false;
        });
    
        return false;
    
     }
    });

    CKEDITOR.replace( 'editor2' );
    CKEDITOR.replace( 'editorg2' );

    $("#form_privacy_policy").submit( function(e) {
       
     var messageLength = CKEDITOR.instances['editor2'].getData().replace(/<[^>]*>/gi, '').length;
     var messageLength = CKEDITOR.instances['editorg2'].getData().replace(/<[^>]*>/gi, '').length;

     if( messageLength==0 ) {

         $('#editorlocation2').text(msgValidation.emptyPrivacyPolicy[language]);
         $('#editorlocationg2').text(msgValidation.emptyPrivacyPolicy[language]);

         e.preventDefault();

     }else{
        $('#editorlocation2').text("");
        $('#editorlocationg2').text("");
        var content_id = $('#content_id_privacy_policy').val();
        var content = CKEDITOR.instances['editor2'].getData();
        var content_1 = CKEDITOR.instances['editorg2'].getData();
    
        var link = URLAPI+'common_controller.php';
        //var data=$(form).serialize();
        var data = {
            action:'edit_content',
            content_id:content_id,
            content:content,
            content_1:content_1,
        };
    
        var messsage = msgLoading.blankMessage[language];
        console.log('messsage',messsage);
    
        apiRequest.post(link, data, messsage).then(function(obj){
            console.log('obj',obj);
            if(obj.success === true) {
    
               //------------ Operation Message --------------------
                var title = msgTitleOperation.privacyAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.success(title, messsage, msgSuccessErrorHtmlSelector);
                        //------------ Operation Message End--------------------
                        swal({
                            // title: title,
                            text: title,
                            icon: "success", //error, success, info
                            button: "Ok",
                        }).then((value) => {
                            window.location.href="#";
                        });
                //------------ Operation Message End--------------------
           
                return true;
            } else {
                //------------ Operation Message --------------------
                var title = msgTitleOperation.privacyAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.error(title, messsage, msgSuccessErrorHtmlSelector);   
                swal_alert(title,messsage,"#","error");
                //------------ Operation Message End--------------------
            }
        },function(err){
            console.log('err',err);
            //alert('Server not responde');
    
            //------------ Operation Message --------------------
            var title = msgTitleOperation.errorOnServer[language];
            var messsage = msgOperations.errorOnServer[language];
            msgSuccessErrorHtml.warning(title, messsage, msgSuccessErrorHtmlSelector);
            //------------ Operation Message End--------------------
            return false;
        });
    
        return false;
    
     }
    });

    
                        


   
 $("#share_message").validate({
    rules: {
    
     share_msg: {
        required: true,
       
      
    },
    
    },
    messages: {
    share_msg: {
                required: msgValidation.emptySharemsg[language],
              
               
    },
    },
    submitHandler: function(form) {
    // $('#editor3').hide();
        var content_id = $('#content_id_share_msg').val();
        var content = $('#share_msg').val();
        var content_1 = $('#share_msg_1').val();
    
        var link = URLAPI+'common_controller.php';
        //var data=$(form).serialize();
        var data = {
            action:'edit_content',
            content_id:content_id,
            content:content,
            content_1:content_1,
        };
    
        var messsage = msgLoading.blankMessage[language];
        console.log('messsage',messsage);
    
        apiRequest.post(link, data, messsage).then(function(obj){
            console.log('obj',obj);
            if(obj.success === true) {
    
               //------------ Operation Message --------------------
                var title = msgTitleOperation.shareMessageAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.success(title, messsage, msgSuccessErrorHtmlSelector);
                        //------------ Operation Message End--------------------
                        swal({
                            // title: title,
                            text: title,
                            icon: "success", //error, success, info
                            button: "Ok",
                        }).then((value) => {
                            window.location.href="#";
                        });
                //------------ Operation Message End--------------------
             
                return true;
            } else {
                //------------ Operation Message --------------------
                var title = msgTitleOperation.shareAppAndroidAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.error(title, messsage, msgSuccessErrorHtmlSelector);    
                swal_alert(title,messsage,"#","error");
                //------------ Operation Message End--------------------
            }
        },function(err){
            console.log('err',err);
            //alert('Server not responde');
    
            //------------ Operation Message --------------------
            var title = msgTitleOperation.errorOnServer[language];
            var messsage = msgOperations.errorOnServer[language];
            msgSuccessErrorHtml.warning(title, messsage, msgSuccessErrorHtmlSelector);
            //------------ Operation Message End--------------------
            return false;
        });
    
        return false;
    }
    }); 


$("#and_app_url_id").validate({
    rules: {
    
     and_app_url: {
        required: true,
       
      
    },
    and_app_url_1:{
      required:true,
    },
    
    },
    messages: {
    and_app_url: {
                required: "Please enter android app url",
              
               
    },
    and_app_url_1: {
                required: "Please enter android app url",
              
               
    },
    },
    submitHandler: function(form) {
    // $('#editor3').hide();
        var content_id = $('#content_id_and_app_url').val();
        var content = $('#and_app_url').val();
        var content_1 = $('#and_app_url_1').val();
    
        var link = URLAPI+'common_controller.php';
        //var data=$(form).serialize();
        var data = {
            action:'edit_content',
            content_id:content_id,
            content:content,
            content_1:content_1,
        };
    
        var messsage = msgLoading.blankMessage[language];
        console.log('messsage',messsage);
    
        apiRequest.post(link, data, messsage).then(function(obj){
            console.log('obj',obj);
            if(obj.success === true) {
    
               //------------ Operation Message --------------------
                var title = "Android App Url Updated Successfully";
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.success(title, messsage, msgSuccessErrorHtmlSelector);
                        //------------ Operation Message End--------------------
                        swal({
                            // title: title,
                            text: title,
                            icon: "success", //error, success, info
                            button: "Ok",
                        }).then((value) => {
                            window.location.href="#";
                        });
                //------------ Operation Message End--------------------
             
                return true;
            } else {
                //------------ Operation Message --------------------
                var title = msgTitleOperation.shareAppAndroidAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.error(title, messsage, msgSuccessErrorHtmlSelector);    
                swal_alert(title,messsage,"#","error");
                //------------ Operation Message End--------------------
            }
        },function(err){
            console.log('err',err);
            //alert('Server not responde');
    
            //------------ Operation Message --------------------
            var title = msgTitleOperation.errorOnServer[language];
            var messsage = msgOperations.errorOnServer[language];
            msgSuccessErrorHtml.warning(title, messsage, msgSuccessErrorHtmlSelector);
            //------------ Operation Message End--------------------
            return false;
        });
    
        return false;
    }
    });  


$("#ios_app_url_id").validate({
    rules: {
    
     ios_app_url: {
        required: true,
       
      
    },
    ios_app_url_1:{
      required:true,
    },
    
    },
    messages: {
    ios_app_url: {
                required: "Please enter iOS app url",
              
               
    },
    ios_app_url_1: {
                required: "Please enter iOS app url",
              
               
    },
    },
    submitHandler: function(form) {
    // $('#editor3').hide();
        var content_id = $('#content_id_ios_app_url').val();
        var content = $('#ios_app_url').val();
        var content_1 = $('#ios_app_url_1').val();
    
        var link = URLAPI+'common_controller.php';
        //var data=$(form).serialize();
        var data = {
            action:'edit_content',
            content_id:content_id,
            content:content,
            content_1:content_1,
        };
    
        var messsage = msgLoading.blankMessage[language];
        console.log('messsage',messsage);
    
        apiRequest.post(link, data, messsage).then(function(obj){
            console.log('obj',obj);
            if(obj.success === true) {
    
               //------------ Operation Message --------------------
                var title = "iOS App Url Updated Successfully";
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.success(title, messsage, msgSuccessErrorHtmlSelector);
                        //------------ Operation Message End--------------------
                        swal({
                            // title: title,
                            text: title,
                            icon: "success", //error, success, info
                            button: "Ok",
                        }).then((value) => {
                            window.location.href="#";
                        });
                //------------ Operation Message End--------------------
             
                return true;
            } else {
                //------------ Operation Message --------------------
                var title = msgTitleOperation.shareAppAndroidAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.error(title, messsage, msgSuccessErrorHtmlSelector);    
                swal_alert(title,messsage,"#","error");
                //------------ Operation Message End--------------------
            }
        },function(err){
            console.log('err',err);
            //alert('Server not responde');
    
            //------------ Operation Message --------------------
            var title = msgTitleOperation.errorOnServer[language];
            var messsage = msgOperations.errorOnServer[language];
            msgSuccessErrorHtml.warning(title, messsage, msgSuccessErrorHtmlSelector);
            //------------ Operation Message End--------------------
            return false;
        });
    
        return false;
    }
    });  


  $("#android_app_url").validate({
    rules: {
    
     android_appurl: {
        required: true,
        minlength: 3,
        maxlength: 500,
        url:true,
    },
    
    },
    messages: {
    android_appurl: {
                required: msgValidation.emptyAndroidUrl[language],
                minlength: msgValidation.validMinLength[language],
                maxlength: msgValidation.validUrlMaxLength[language],
    },
    },
    submitHandler: function(form) {
    // $('#editor3').hide();
        var content_id = $('#content_id_android_url').val();
        var content = $('#android_appurl').val();
    
        var link = URLAPI+'common_controller.php';
        //var data=$(form).serialize();
        var data = {
            action:'edit_content',
            content_id:content_id,
            content:content,
        };
    
        var messsage = msgLoading.blankMessage[language];
        console.log('messsage',messsage);
    
        apiRequest.post(link, data, messsage).then(function(obj){
            console.log('obj',obj);
            if(obj.success === true) {
    
               //------------ Operation Message --------------------
                var title = msgTitleOperation.shareAppAndroidAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.success(title, messsage, msgSuccessErrorHtmlSelector);
                        //------------ Operation Message End--------------------
                        swal({
                            // title: title,
                            text: title,
                            icon: "success", //error, success, info
                            button: "Ok",
                        }).then((value) => {
                            window.location.href="#";
                        });
                //------------ Operation Message End--------------------
             
                return true;
            } else {
                //------------ Operation Message --------------------
                var title = msgTitleOperation.shareAppAndroidAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.error(title, messsage, msgSuccessErrorHtmlSelector);    
                swal_alert(title,messsage,"#","error");
                //------------ Operation Message End--------------------
            }
        },function(err){
            console.log('err',err);
            //alert('Server not responde');
    
            //------------ Operation Message --------------------
            var title = msgTitleOperation.errorOnServer[language];
            var messsage = msgOperations.errorOnServer[language];
            msgSuccessErrorHtml.warning(title, messsage, msgSuccessErrorHtmlSelector);
            //------------ Operation Message End--------------------
            return false;
        });
    
        return false;
    }
    });  


    $("#ios_app_url").validate({
    rules: {
    
     ios_appurl: {
        required: true,
        minlength: 3,
        maxlength: 500,
        url: true,
    },
    
    },
    messages: {
    ios_appurl: {
         required: msgValidation.emptyIosUrl[language],
         minlength: msgValidation.validMinLength[language],
         maxlength: msgValidation.validUrlMaxLength[language],
    },
    },
    submitHandler: function(form) {
     // $('#editor3').hide();
        var content_id = $('#content_id_ios_url').val();
        var content = $('#ios_appurl').val();
    
        var link = URLAPI+'common_controller.php';
        //var data=$(form).serialize();
        var data = {
            action:'edit_content',
            content_id:content_id,
            content:content,
        };
    
        var messsage = msgLoading.blankMessage[language];
        console.log('messsage',messsage);
    
        apiRequest.post(link, data, messsage).then(function(obj){
            console.log('obj',obj);
            if(obj.success === true) {
    
               //------------ Operation Message --------------------
                var title = msgTitleOperation.shareAppIosAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.success(title, messsage, msgSuccessErrorHtmlSelector);
                        //------------ Operation Message End--------------------
                        swal({
                            // title: title,
                           text: title,
                            icon: "success", //error, success, info
                            button: "Ok",
                        }).then((value) => {
                            window.location.href="#";
                        });
                //------------ Operation Message End--------------------
            
                return true;
            } else {
                //------------ Operation Message --------------------
                var title = msgTitleOperation.shareAppIosAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.error(title, messsage, msgSuccessErrorHtmlSelector); 
                swal_alert(title,messsage,"#","error");
                //------------ Operation Message End--------------------
            }
        },function(err){
            console.log('err',err);
            //alert('Server not responde');
    
            //------------ Operation Message --------------------
            var title = msgTitleOperation.errorOnServer[language];
            var messsage = msgOperations.errorOnServer[language];
            msgSuccessErrorHtml.warning(title, messsage, msgSuccessErrorHtmlSelector);
            //------------ Operation Message End--------------------
            return false;
        });
    
        return false;
    }
    }); 



    $("#contact_form").validate({
    rules: {
    
    email: {
              required: true,
              minlength: 3,
              maxlength: 50,
              email: false,
              
            },

            mobile:{
              required:true,
              minlength:10,
              maxlength:10,

            },
            
    
    },
    messages: {
   email: {
              required: msgValidation.emptyEmail[language],
              minlength: msgValidation.validMinLength[language],
              maxlength: msgValidation.validMaxLength[language],
             
             },
              mobile:{
              required:"Please enter mobile number",
              minlength:'minimum 10 digits required',
              maxlength:'maximum 10 digits allowed',

            },
    },
    submitHandler: function(form) {

      var email_get = $('#email').val();
             $('.err_forgtemail').html('');
             if(validateEmail(email_get)==false){
              $('.err_forgtemail').append('<span class="error" style=" color:#FF0000;  display: inline-block;position: absolute;font-size: 14px;font-weight: 700;padding-top: 3px; margin-bottom:5px;">'+msgValidation.validEmail[language]+'</span>');
              return false;
            }
     // $('#editor3').hide();

     var values = [];
$("input[name='content_id_form_url[]']").each(function() {
    values.push($(this).val());
});
        var content_id = values;
        var content = $('#email').val();
        var content_1 = $('#mobile').val();
    
        var link = URLAPI+'common_controller.php';
        //var data=$(form).serialize();
        var data = {
            action:'edit_content_contact',
            content_id:content_id,
            content:content,
            content_1:content_1,
        };
    
        var messsage = msgLoading.blankMessage[language];
        console.log('messsage',messsage);
    
        apiRequest.post(link, data, messsage).then(function(obj){
            console.log('obj',obj);
            if(obj.success === true) {
    
               //------------ Operation Message --------------------
                var title = msgTitleOperation.contactusAdded[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.success(title, messsage, msgSuccessErrorHtmlSelector);
                        //------------ Operation Message End--------------------
                        swal({
                            // title: title,
                           text: title,
                            icon: "success", //error, success, info
                            button: "Ok",
                        }).then((value) => {
                            window.location.href="#";
                        });
                //------------ Operation Message End--------------------
            
                return true;
            } else {
                //------------ Operation Message --------------------
                var title = msgTitleOperation.shareAppIosAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.error(title, messsage, msgSuccessErrorHtmlSelector); 
                swal_alert(title,messsage,"#","error");
                //------------ Operation Message End--------------------
            }
        },function(err){
            console.log('err',err);
            //alert('Server not responde');
    
            //------------ Operation Message --------------------
            var title = msgTitleOperation.errorOnServer[language];
            var messsage = msgOperations.errorOnServer[language];
            msgSuccessErrorHtml.warning(title, messsage, msgSuccessErrorHtmlSelector);
            //------------ Operation Message End--------------------
            return false;
        });
    
        return false;
    }
    }); 



</script>

<script type="text/javascript">

        function english_lang(){

            $(".eng_div").show();

            $(".gujarati_div").hide();

        }

        function gujrati_lang(){

            $(".gujarati_div").show();

            $(".eng_div").hide();
         }

        function english_lang4(){

            $(".eng_div4").show();

            $(".gujarati_div4").hide();

        }

        function gujrati_lang4(){

            $(".gujarati_div4").show();

            $(".eng_div4").hide();

        }


        function english_lang5(){

            $(".eng_div5").show();

            $(".gujarati_div5").hide();

        }

        function gujrati_lang5(){

            $(".gujarati_div5").show();

            $(".eng_div5").hide();

        }

        function english_lang7(){

            $(".eng_div7").show();

            $(".gujarati_div7").hide();

        }

        function gujrati_lang7(){

            $(".gujarati_div7").show();

            $(".eng_div7").hide();

        }

        function english_lang8(){

            $(".eng_div8").show();

            $(".gujarati_div8").hide();

        }

        function gujrati_lang8(){

            $(".gujarati_div8").show();

            $(".eng_div8").hide();

        }

        function english_lang9(){

            $(".eng_div9").show();

            $(".gujarati_div9").hide();

        }

        function gujrati_lang9(){

            $(".gujarati_div9").show();

            $(".eng_div9").hide();

        }


         CKEDITOR.replace('about_us2');  
     CKEDITOR.replace('about_us_g');  
   
     $("#form_about_us2").submit( function(e) {
     
     var messageLength = CKEDITOR.instances['about_us2'].getData().replace(/<[^>]*>/gi,'').length;  
     var messageLength = CKEDITOR.instances['about_us_g'].getData().replace(/<[^>]*>/gi,'').length;  
   
     if( !messageLength ) {
         $('#editorlocation2').text('Please enter about us');
          $('#editorlocationg').text('Please enter about us');
         e.preventDefault();
     }else{
        $('#editorlocation2').text("");
         $('#editorlocationg').text("");
        var content_id = $('#content_id_about_us2').val();
        var content = CKEDITOR.instances['about_us2'].getData();
        var content_1 = CKEDITOR.instances['about_us_g'].getData();
         // alert(content);
        var link = URLAPI+'common_controller.php';
        //var data=$(form).serialize();
        var data = {
            action:'edit_content',
            content_id:content_id,
            content:content,
            content_1:content_1,
        };
    
        var messsage = msgLoading.blankMessage[language];
        console.log('messsage',messsage);
    
        apiRequest.post(link, data, messsage).then(function(obj){
            console.log('obj',obj);
            if(obj.success === true) {
    
               //------------ Operation Message --------------------
                var title = 'Community Guideline updated successfully!';
                var messsage = 'Community Guideline updated successfully!';
               // msgSuccessErrorHtml.success(title, messsage, msgSuccessErrorHtmlSelector);
                        //------------ Operation Message End--------------------
                        swal({
                            // title: title,
                            text: title,
                            icon: "success", //error, success, info
                            button: "Ok",
                        }).then((value) => {
                            window.location.href="#";
                        });
                //------------ Operation Message End--------------------
           
                return true;
            } else {
                //------------ Operation Message --------------------
                var title = msgTitleOperation.aboutAddedd[language];
                var messsage = obj.msg[language];
                msgSuccessErrorHtml.error(title, messsage, msgSuccessErrorHtmlSelector);   
                swal_alert(title,messsage,"#","error");
                //------------ Operation Message End--------------------
            }
        },function(err){
            console.log('err',err);
            //alert('Server not responde');
    
            //------------ Operation Message --------------------
            var title = msgTitleOperation.errorOnServer[language];
            var messsage = msgOperations.errorOnServer[language];
            msgSuccessErrorHtml.warning(title, messsage, msgSuccessErrorHtmlSelector);
            //------------ Operation Message End--------------------
            return false;
        });
    
        return false;
    
     }
    });               

</script>
    </script>            
           
</body>



</html>