<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
   <!-- Content Header (Page header) -->
   <section class="content-header mb_9">
      <h1>General Setting</h1>
   </section>
   <!-- Main content -->
   <section class="content">
      <div class="settings_wrapper">
         <ul class="nav nav-tabs">
            <li><a class="active" data-toggle="tab" href="#tab1">Theme Settings</a></li>
            <li><a data-toggle="tab" href="#tab2">API Settings</a></li>
            <li><a data-toggle="tab" href="#tab3">Language</a></li>
         </ul>
         <div class="tab-content">
            <div id="tab1" class="tab-pane fade show active">
               <div class="settings_Sections mb_20 border_bottom">
                  <h3>Logo Settings</h3>
						<form role="form" id="hdlGeneralForm" data-target="admin/create_general">
                            <div class="box-body">
                                <div class="row">
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"> 					
                                        <div class="form-group">
                                            <label for="logoTitle">Site Title</label>
                                            <input type ="hidden" id="farm_action" value="admin/create_general">
                                            <input type="text" class="form-control" id="logoTitle" name="logoTitle" placeholder="Site Title" value="<?php if(!empty($logoData)){ echo $logoData[0]['logoTitle'];} ?>" required autocomplete="off">
                                        </div>
                                    </div>
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                        <div class="form-group">
                                            <label for="LogoImage">Logo Image</label>
                                            <div class="priview_thumb">
											  <input class="form-control" type='file' id="logo_Image" name="LogoImage"/>
											  <span>Preferred size 512px*512px.</span>
											  <span class="priview_thumb_img">
												<a href="" data-toggle="modal" data-target="#wholeSaleBigImg" ><img id="priLogoImage" src="<?php if(!empty($logoData[0]['logoImage'])){ echo base_url('assets/uploads/').$logoData[0]['logoImage'];} ?>" alt="" class="prev_thumb"/></a>
											  </span>
										    </div>
                                        </div>
                                    </div> 
                                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                        <div class="form-group">
                                            <label for="HeaderLogo">Header Logo</label>
                                            <div class="priview_thumb">
											  <input class="form-control" type='file' id="HeaderLogo" name="HeaderLogo"/>
											  <span>Preferred size 50px*50px.</span>
											  <span class="priview_thumb_img">
												<a href="" data-toggle="modal" data-target="#HeaderLogo" ><img id="priHeaderLogo" src="<?php if(!empty($logoData[0]['headerLogo'])){ echo base_url('assets/uploads/').$logoData[0]['headerLogo'];} ?>" alt="" class="prev_thumb"/></a>
											  </span>
										    </div>
                                        </div>
                                    </div> 
                                </div>
                            </div>
               </div>
               <div class="settings_Sections">
                  <div>
                        <div class="box-footer text-center">
                           <input type="hidden" id="Loginid" name="Loginid" value="<?php if(!empty($logoData[0]['logoId'])){ echo $logoData[0]['logoId'];}else{ echo "1";} ?>">
                           <button type="submit" class="btn btn-primary" id="GeneralCreate">Submit</button>
                        </div>
                     </form>
                  </div>
               </div>
            </div>
            <div id="tab2" class="tab-pane fade">
               <div class="settings_Sections">
                  <h3>API Settings</h3>
                  <div>
                    <form role="form" id="hdlApiForm" data-target="admin/create_api">
                        <div class="box-body">
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> 							
                                    <div class="form-group">
                                        <label for="smsApi">SMS API</label>
                                        <input type ="hidden" id="farm_action_api" value="admin/create_api">
                                        <input type="text" class="form-control" id="smsApi" name="smsApi" value="<?php if(!empty($apiData[0]['value_text'])){ echo $apiData[0]['value_text'];}?>" placeholder="SMS API" required autocomplete="off">
                                    </div>
                                </div>
                                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                    <div class="form-group">
                                        <p>Help Text <a href="https://msg91.com/communications-api/" target="_blank">Where to find API Key?</a></p>
                                    </div>
                                </div> 
                            </div>
                        </div>
                        <div class="box-footer text-center">
                            <input type="hidden" id="ApiUpdateId" name="ApiUpdateId" value="<?php if(!empty($apiData[0]['uniq_id'])){ echo $apiData[0]['uniq_id'];}?>">
                            <button type="submit" class="btn btn-primary" id="GeneralApiCreate">Submit</button>
                        </div>
                    </form>  
                  </div>
               </div>
            </div>
             <div id="tab3" class="tab-pane fade">
               <div class="settings_Sections">
                  <h3>Choose Language</h3>
                  <div>
                      <div class="row">
                            <div class="col-lg-12 col-md-12 col-sm-12 col-12">
                                <form role="form" action="<?php echo base_url();?>admin/updatelanguages" method="post" id="languageForm">
                                    <div class="box-body">
                                        <div class="row">
                                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> 							
                                                <div class="form-group">
                                                    <label>Site language</label>
                                                    <?php $langArr = explode(',',$this->ts_functions->getsettings('languageoption','text')); ?>
                    								<select class="form-control" name="weblanguage_text">
                    									<?php 
                    									 for($i=0;$i<count($langArr);$i++) {
                    									  $selected = ( $this->ts_functions->getsettings('weblanguage','text') == $langArr[$i] ) ? 'selected' : '' ;
                    									  echo '<option '.$selected.' value="'.$langArr[$i].'">'.$langArr[$i].'</option>';
                    									}?>
                    								</select>
                                                     <p class="mt-1">To see the effect of language change you have to restart the app in your Android and Ios device</p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="box-footer">
                                        <button type="submit" class="btn btn-primary hdl_select_language">Update</button>
                                    </div>
                                </form> 
                            </div> 
                            <div class="col-lg-6 col-md-12 col-sm-12 col-12">
                               <form role="form" action="<?php echo base_url(); ?>admin/updatelanguages" method="post" id="addlanguageForm">
                                    <div class="box-body mt-2">
                                        <div class="row">
                                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                                <div class="form-group">
                                                    <label>Add New Language</label>
                                                    <input type="hidden" id="existinglanguage" value="<?php echo $this->ts_functions->getsettings('languageoption','text');?>">
                                                    <input type="text" class="form-control" name="addnewlanguage" id="addnewlanguage">
                                                    <p class="mt-1">Should be in lower case</p>
                                                </div>
                                            </div> 
                                        </div>
                                    </div>
                                    <div class="box-footer">
                                        <button type="submit" class="btn btn-primary hdl_add_language">Add Language</button>
                                         <!--<a onclick="updateSettings('languageSettings')" class="btn btn-primary">Add Language</a>-->
                                    </div>
                                </form> 
                            </div> 
                             <div class="col-lg-6 col-md-12 col-sm-12 col-12">
                                <form role="form" id="">
                                    <div class="box-body mt-2">
                                        <div class="row">
                                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> 							
                                                <div class="form-group">
                                                    <label>Delete language</label>
                                                    <?php $langArr = explode(',',$this->ts_functions->getsettings('languageoption','text')); ?>
                    								<select class="form-control" id="lan_to_delete">
                    									<?php for($i=0;$i<count($langArr);$i++) {
                    									echo '<option value="'.$langArr[$i].'">'.$langArr[$i].'</option>';
                    									}?>
                    								</select>
                                                     <p class="mt-1">Selected language will be deleted</p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="box-footer">
                                        <button type="submit" class="btn btn-primary hdl_delete_language">Delete</button>
                                    </div>
                                </form>  
                            </div> 
                        </div>
                  </div>
               </div>
            </div>
         </div>
      </div>
      
   </section>
   <!-- /.content -->
</div>
<!-- /.content-wrapper -->