 <!-- <script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script> -->
 <!-- <script src="https://cdn.ckeditor.com/4.15.1/standard/ckeditor.js"></script> -->
 <script>
     // tinymce.init({
     //     selector: 'textarea'
     // });
 </script>


 <div class="row align-items-center">
     <div class="col-sm-6">
         <div class="page-title-box">
             <h4 class="font-size-18">Company settings</h4>
             <ol class="breadcrumb mb-0">
                 <li class="breadcrumb-item"><a href="<?php echo base_url(); ?>settings/company_settings/">Edit company settings</a>
                 </li>

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

     <div class="col-sm-6">
         <div class="float-right d-none d-md-block">
             <a class="btn btn-primary waves-effect waves-light" href="<?php echo base_url(); ?>settings/company_settings/">
                 <i class="mdi mdi-plus mr-2"></i> View Settings
             </a>
         </div>
     </div>
 </div>

 <?php
    if ($this->session->flashdata('alert_success')) {
    ?>
     <div class="alert alert-success alert-dismissible fade show" role="alert">
         <button type="button" class="close" data-dismiss="alert" aria-label="Close">
             <span aria-hidden="true">×</span>
         </button>
         <strong>Success!</strong> <?php echo $this->session->flashdata('alert_success'); ?>
     </div>
 <?php
        $this->session->unset_userdata('alert_success');
    }

    if ($this->session->flashdata('alert_danger')) {
    ?>
     <div class="alert alert-danger alert-dismissible fade show" role="alert">
         <button type="button" class="close" data-dismiss="alert" aria-label="Close">
             <span aria-hidden="true">×</span>
         </button>
         <strong>Error!</strong> <?php echo $this->session->flashdata('alert_danger'); ?>
     </div>
 <?php
        $this->session->unset_userdata('alert_danger');
    }

    if ($this->session->flashdata('alert_warning')) {
    ?>
     <div class="alert alert-warning alert-dismissible fade show" role="alert">
         <button type="button" class="close" data-dismiss="alert" aria-label="Close">
             <span aria-hidden="true">×</span>
         </button>
         <strong>Warning!</strong> <?php echo $this->session->flashdata('alert_warning'); ?>
     </div>
 <?php
    }
    if (validation_errors()) {
    ?>
     <div class="alert alert-danger alert-dismissible fade show" role="alert">
         <button type="button" class="close" data-dismiss="alert" aria-label="Close">
             <span aria-hidden="true">×</span>
         </button>
         <?php echo validation_errors(); ?>
     </div>
 <?php
    }
    ?>

 <div class="row">
     <div class="col-lg-12">
         <div class="card">
             <div class="card-body">
                 <h4 class="card-title"> <?php echo $default['company_name']; ?></h4><br>

                 <form action="<?php echo base_url(); ?>settings/company_settings/edit/<?php echo $default['id']; ?>" method="post" enctype="multipart/form-data">
                     <div class="row">
                         <div class="col-lg-6">
                             <div class="form-group">
                                 <label class="required">Company Name</label>
                                 <input name="company_name" id="company_name" type="text" class="form-control" placeholder="Enter company name" value="<?php echo (isset($_POST['company_name'])) ? $_POST['company_name'] : $default['company_name']; ?>" autofocus>
                             </div>



                             
                                        <!-- <div class="col-md-2 form-group">
                                        <label>Image</label><span class="mandatory"></span>                            
                                        <img src="" width="120px" />
                                                </div>  -->



                             <div class="form-group">
                                 <label class="required">Brand Name</label>
                                 <input name="brand_name" id="brand_name" type="text" class="form-control" placeholder="Enter brand name" value="<?php echo (isset($_POST['brand_name'])) ? $_POST['brand_name'] : $default['brand_name']; ?>" autofocus>
                             </div>

                             <div class="form-group">
                                 <label class="required">Email Address</label>
                                 <input name="company_email" id="company_email" type="email" class="form-control" placeholder="Enter email address" value="<?php echo (isset($_POST['company_email'])) ? $_POST['company_email'] : $default['company_email']; ?>">
                             </div>

              
                             <div class="form-group">
                                 <label class="required">Phone Number</label>
                                 <input name="company_phone_number" id="company_phone_number" type="text" class="form-control" placeholder="Enter phone number" value="<?php echo (isset($_POST['company_phone_number'])) ? $_POST['company_phone_number'] : $default['company_phone_number']; ?>">
                             </div>

                  
                             <div class="form-group">
                                 <label class="required">GSTIN</label>
                                 <input name="company_gstin" id="company_gstin" type="text" class="form-control" placeholder="Enter GSTIN" value="<?php echo (isset($_POST['company_gstin'])) ? $_POST['company_gstin'] : $default['company_gstin']; ?>">
                             </div>
                           
                         

                             <div class="form-group">
                                 <label class="required">Address</label>
                                 <textarea name="company_address" id="company_address" type="text" class="form-control" placeholder="Enter the address"><?php echo (isset($_POST['company_address'])) ? $_POST['company_address'] : $default['company_address']; ?></textarea>
                             </div>
                             <div class="form-group">
                                 <label class="required">Pincode</label>
                                 <input name="pincode" id="pincode" type="text" class="form-control" placeholder="Enter Pincode" value="<?php echo (isset($_POST['pincode'])) ? $_POST['pincode'] : $default['pincode']; ?>">
                             </div>
                            


                         </div>

                         <div class="col-lg-6">

                         <div class="form-group">
                                 <label class="required">Company Logo</label>
                                 <img src="<?= $default['company_logo'] ?>" width="145" height="100" class="rounded m-1" alt="No image" />
                                 <input name="logo" id="logo" type="file" class="form-control">
                                 <input type="hidden" name="old_file" value="<?php echo $default['company_logo']; ?>" class="form-control" />
                             </div>

                            
                           
                            <div class="form-group">
                                <label class="required">Corban Copy(Cc)</label>
                                <input name="email_cc" id="email_cc" type="email" class="form-control"  placeholder="Enter Cc Email Address"  value="<?php echo (isset($_POST['company_email']))?$_POST['email_cc']: $default['email_cc'];; ?>">
                            </div>

                             <div class="form-group">
                                 <label class="required">PAN Number</label>
                                 <input name="company_pan" id="company_pan" type="text" class="form-control" placeholder="Enter PAN number" value="<?php echo (isset($_POST['company_pan'])) ? $_POST['company_pan'] : $default['company_pan']; ?>">
                             </div>
                          

            

                        
                             <div class="form-group">
                                 <label class="required">City</label>
                                 <input name="city" id="city" type="text" class="form-control" placeholder="Enter City" value="<?php echo (isset($_POST['city'])) ? $_POST['city'] : $default['city']; ?>">
                             </div>
                             
                             <div class="form-group">
                                 <label class="required">State</label>
                                 <input name="state" id="state" type="text" class="form-control" placeholder="Enter State" value="<?php echo (isset($_POST['state'])) ? $_POST['state'] : $default['state']; ?>">
                             </div>
                        
                             



                         </div>
                     </div>
                     <div class="form-group mb-0">
                         <div>
                             <button name="submit" type="submit" class="btn btn-primary waves-effect waves-light mr-1">
                                 Submit
                             </button>
                             <a href="<?php echo base_url(); ?>settings/company_settings" class="btn btn-secondary waves-effect">Cancel </a>
                         </div>
                     </div>
                 </form>

             </div>
         </div>
     </div>
 </div>
 <style type="text/css">
     .required:after {
         content: " *" !important;
         color: red !important;
     }
 </style>

 <script>
     $(function() {
         $("#addMore").click(function(e) {
             e.preventDefault();
             $("#fieldList").append(
                 '<div class="form-group"> <label class="required">Bank Name</label> <input name="bank_name[]" id="bank_name" type="text" class="form-control" placeholder="Bank Name"> </div><div class="form-group"> <label class="required">Account Number</label> <input name="account_number[]" id="account_number" type="text" class="form-control" placeholder="Account Number"></div>'
             );
         });
     });
 </script>
 <script>
     $('.contents').richText({
         // text formatting
         bold: true,
         italic: true,
         underline: true,

         // text alignment
         leftAlign: true,
         centerAlign: true,
         rightAlign: true,
         justify: true,

         // lists
         ol: true,
         ul: true,

         // title
         heading: true,

         // fonts
         fonts: true,
         fontList: ["Arial",
             "Arial Black",
             "Comic Sans MS",
             "Courier New",
             "Geneva",
             "Georgia",
             "Helvetica",
             "Impact",
             "Lucida Console",
             "Tahoma",
             "Times New Roman",
             "Verdana"
         ],
         fontColor: true,
         fontSize: true,

         // uploads
         imageUpload: true,
         fileUpload: true,

         // media
         <
         a href = "https://www.jqueryscript.net/tags.php?/video/" > video < /a>Embed: true,

         // link
         urls: true,

         // tables
         table: true,

         // code
         removeStyles: true,
         code: true,

         // colors
         colors: [],

         // dropdowns
         fileHTML: '',
         imageHTML: '',

         // translations
         translations: {
             'title': 'Title',
             'white': 'White',
             'black': 'Black',
             'brown': 'Brown',
             'beige': 'Beige',
             'darkBlue': 'Dark Blue',
             'blue': 'Blue',
             'lightBlue': 'Light Blue',
             'darkRed': 'Dark Red',
             'red': 'Red',
             'darkGreen': 'Dark Green',
             'green': 'Green',
             'purple': 'Purple',
             'darkTurquois': 'Dark Turquois',
             'turquois': 'Turquois',
             'darkOrange': 'Dark Orange',
             'orange': 'Orange',
             'yellow': 'Yellow',
             'imageURL': 'Image URL',
             'fileURL': 'File URL',
             'linkText': 'Link text',
             'url': 'URL',
             'size': 'Size',
             'responsive': '<a href="https://www.jqueryscript.net/tags.php?/Responsive/">Responsive</a>',
             'text': 'Text',
             'openIn': 'Open in',
             'sameTab': 'Same tab',
             'newTab': 'New tab',
             'align': 'Align',
             'left': 'Left',
             'justify': 'Justify',
             'center': 'Center',
             'right': 'Right',
             'rows': 'Rows',
             'columns': 'Columns',
             'add': 'Add',
             'pleaseEnterURL': 'Please enter an URL',
             'videoURLnotSupported': 'Video URL not supported',
             'pleaseSelectImage': 'Please select an image',
             'pleaseSelectFile': 'Please select a file',
             'bold': 'Bold',
             'italic': 'Italic',
             'underline': 'Underline',
             'alignLeft': 'Align left',
             'alignCenter': 'Align centered',
             'alignRight': 'Align right',
             'addOrderedList': 'Add ordered list',
             'addUnorderedList': 'Add unordered list',
             'addHeading': 'Add Heading/title',
             'addFont': 'Add font',
             'addFontColor': 'Add font color',
             'addFontSize': 'Add font size',
             'addImage': 'Add image',
             'addVideo': 'Add video',
             'addFile': 'Add file',
             'addURL': 'Add URL',
             'addTable': 'Add table',
             'removeStyles': 'Remove styles',
             'code': 'Show HTML code',
             'undo': 'Undo',
             'redo': 'Redo',
             'close': 'Close'
         },

         // privacy
         youtubeCookies: false,

         // dev settings
         useSingleQuotes: false,
         height: 0,
         heightPercentage: 0,
         id: "",
         class: "",
         useParagraph: false,
         maxlength: 0,

         // callback function after init
         callback: undefined
     });
 </script>

 <script>
     CKEDITOR.replace('terms_condition');
 </script>