<style>
    .edit-mode {
        display: none;
    }
</style>

<main>
    <div class="container-fluid main-container">
        <div class="row my-3">
            <div class="col-md-6 title-box">
                <div class="section-header">
                    <!--<p>WHAT WE DO</p>-->
                    <h1>Company Details</h1>
                </div>
            </div>
            <div class="col-md-6">
                <!--<a href="https://polymertubing.in/Shubham_Codes/evergrowsolutions/services.php">-->
                <!--    <button class="btn view-btn">View More</button>-->
                <!--</a>-->
            </div>
        </div>
        <form action="company-details.php" method="post">
            <!--<div class="row">
                <div class="col-md-6">
                    <div class="form-group mb-3">
                        <label for="txt_cmpname" class="form-label">Company Name</label>
                        <input id="txt_cmpname" class="form-control" type="text" placeholder="Enter Company Name" aria-label=".form-control-sm example">
                    </div>
                    <div class="form-group mb-3">
                        <label for="txt_hallno" class="form-label">Hall No.</label>
                        <input id="txt_hallno" class="form-control" type="text" placeholder="Hall No" aria-label=".form-control-sm example">
                    </div>
                </div>   
                <div class="col-md-6">
                    <div class="form-group mb-3">
                        <label for="txt_cmptype" class="form-label">Company Type</label>    
                        <select id="txt_cmptype" class="form-select" aria-label="Default select example">
                            <option value="1" selected>Proprietorship</option>
                            <option value="2">HUF</option>    
                            <option value="3">LLP</option>
                            <option value="4">Partnership</option>
                            <option value="5">Private Ltd.</option>
                            <option value="6">Public Ltd.</option>
                        </select>
                    </div>
                    <div class="form-group mb-3">
                        <label for="txt_stallno" class="form-label">Stall No.</label>
                        <input id="txt_stallno" class="form-control" type="text" placeholder="Stall No" aria-label=".form-control-sm example">
                    </div>
                </div>
            </div>-->
            
            <div class="row">
                <div class="card overviwe-card mb-3">
                    <div class="card-body">     
                        <div class="row">
                            <div class="col-md-12 mb-3">     
                                <h5 class="mb-2 title2">Company Information</h5>      
                                <!--<small class="small-b">Please fill the following forms to complete your Profile.</small>-->
                            </div>
                            <div class="col-md-6">
                                <div class="form-group mb-3">
                                    <label for="txt_cmpname" class="form-label">Company Name :</label>
                                    <p class="view-mode"><?php echo $company_name;?></p>
                                    <input id="txt_cmpname" name="txt_cmpname" class="form-control edit-mode" type="text" placeholder="Enter Company Name" aria-label=".form-control-sm example" value="<?php echo $company_name;?>">
                                </div>
                                <div class="form-group mb-3">
                                    <label for="txt_hallno" class="form-label">Hall No. :</label>
                                    <p class="view-mode"><?php echo $hall_no;?></p>
                                    <input id="txt_hallno" name="txt_hallno" class="form-control edit-mode" type="text" placeholder="Hall No" aria-label=".form-control-sm example" value="<?php echo $hall_no;?>">
                                </div>
                                <!--<div class="form-group mb-3">
                                    <label for="txt_user" class="form-label">User Name</label>
                                    <input id="txt_user" name="txt_user" class="form-control" type="text" placeholder="Enter User Name" aria-label=".form-control-sm example">
                                </div>-->
                            </div>   
                            <div class="col-md-6">
                                <div class="form-group mb-3">
                                    <label for="txt_cmptype" class="form-label">Company Type :</label>
                                    <p class="view-mode"><?php echo $company_type;?></p>
                                    <select id="txt_cmptype" name="txt_cmptype" class="form-select edit-mode" aria-label="Default select example">
                                        <option  value="Proprietorship" <?php echo ($company_type == 'Proprietorship') ? 'selected':'' ?> >Proprietorship</option>
                                        <option value="HUF" <?php echo ($company_type == 'HUF') ? 'selected':'' ?> >HUF</option>    
                                        <option value="LLP" <?php echo ($company_type == 'LLP') ? 'selected':'' ?> >LLP</option>
                                        <option value="Partnership" <?php echo ($company_type == 'Partnership') ? 'selected':'' ?> >Partnership</option>
                                        <option value="Private" <?php echo ($company_type == 'Private') ? 'selected':'' ?> >Private Ltd.</option>
                                        <option value="Public" <?php echo ($company_type == 'Public') ? 'selected':'' ?> >Public Ltd.</option>
                                    </select>
                                </div>
                                <div class="form-group mb-3">
                                    <label for="txt_stallno" class="form-label">Stall No. :</label>
                                    <p class="view-mode"><?php echo $stall_no;?></p>
                                    <input id="txt_stallno" name="txt_stallno" class="form-control edit-mode" type="text" placeholder="Stall No" aria-label=".form-control-sm example" value="<?php echo $stall_no;?>">
                                </div>
                                <!--<div class="form-group mb-3">
                                    <label for="txt_password" class="form-label">User Password</label>
                                    <input id="txt_password" name="txt_password" class="form-control" type="text" placeholder="Enter Passowrd" aria-label=".form-control-sm example">
                                </div>-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="row">
                <div class="card overviwe-card mb-3">
                    <div class="card-body">     
                        <div class="row">
                            <div class="col-md-12 mb-3">     
                                <h5 class="mb-2 title2">Company Contact</h5>      
                                <!--<small class="small-b">Please fill the following forms to complete your Profile.</small>-->
                            </div>
                            <div class="col-md-6">
                                <div class="form-group mb-3">
                                    <label for="txt_cmpemail" class="form-label">Email Id :</label>
                                    <p class="view-mode"><?php echo $company_email?></p>
                                    <input id="txt_cmpemail" name="txt_cmpemail" class="form-control edit-mode" type="text" placeholder="Enter Email Id" aria-label=".form-control-sm example" value="<?php echo $company_email;?>">
                                </div>
                                <div class="form-group mb-3">
                                    <label for="txt_whatsapp" class="form-label">Whatsapp No for Alert :</label>
                                    <p class="view-mode"><?php echo $whatsapp_no?></p>
                                    <input id="txt_whatsapp" name="txt_whatsapp" class="form-control edit-mode" type="text" placeholder="Enter WhatsApp No" aria-label=".form-control-sm example" value="<?php echo $whatsapp_no;?>">
                                </div>
                            </div>   
                            <div class="col-md-6">
                                <div class="form-group mb-3">
                                    <label for="txt_phone" class="form-label">Phone No. :</label>
                                    <p class="view-mode"><?php echo $phone_no?></p>
                                    <input id="txt_phone" name="txt_phone" class="form-control edit-mode" type="text" placeholder="Enter Phone No" aria-label=".form-control-sm example" value="<?php echo $phone_no;?>">
                                </div>
                                <div class="form-group mb-3">
                                    <label for="txt_website" class="form-label">Website :</label>
                                    <p class="view-mode"><?php echo $website?></p>
                                    <input id="txt_website" name="txt_website" class="form-control edit-mode" type="text" placeholder="Website" aria-label=".form-control-sm example" value="<?php echo $website;?>">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="row">
                <div class="card overviwe-card mb-3">
                    <div class="card-body">     
                        <div class="row">
                            <div class="col-md-12 mb-3">     
                                <h5 class="mb-2 title2">Tax Identification Numbers</h5>      
                                <!--<small class="small-b">Please fill the following forms to complete your Profile.</small>-->
                            </div>
                            <div class="col-md-6">
                                <div class="form-group mb-3">
                                    <label for="txt_cmpgst" class="form-label">GST No. :</label>
                                    <p class="view-mode"><?php echo $gst_no?></p>
                                    <input id="txt_cmpgst" name="txt_cmpgst" class="form-control edit-mode" type="text" placeholder="Enter GST No" aria-label=".form-control-sm example" value="<?php echo $gst_no;?>">
                                </div>
                                <div class="form-group mb-3">
                                    <label for="txt_cmptan" class="form-label">TAN No. :</label>
                                    <p class="view-mode"><?php echo $tan_no?></p>
                                    <input id="txt_cmptan" name="txt_cmptan" class="form-control edit-mode" type="text" placeholder="Enter TAN No" aria-label=".form-control-sm example" value="<?php echo $tan_no;?>">
                                </div>
                            </div>   
                            <div class="col-md-6">
                                <div class="form-group mb-3">
                                    <label for="txt_cmppan" class="form-label">PAN No. :</label>
                                    <p class="view-mode"><?php echo $pan_no?></p>
                                    <input id="txt_cmppan" name="txt_cmppan" class="form-control edit-mode" type="text" placeholder="Enter PAN No" aria-label=".form-control-sm example" value="<?php echo $pan_no;?>">
                                </div>
                                <div class="form-group mb-3">
                                    <label for="txt_cmpcin" class="form-label">CIN No. :</label>
                                    <p class="view-mode"><?php echo $cin_no?></p>
                                    <input id="txt_cmpcin" name="txt_cmpcin" class="form-control edit-mode" type="text" placeholder="Enter CIN No." aria-label=".form-control-sm example" value="<?php echo $cin_no;?>">
                                </div>
                            </div>
                            <div class="col-md-12 d-flex justify-content-end">
                                <button type="button" id="cancelBtn" class="btn btn-danger me-2 edit-mode">Cancel</button>
                                <input name="btn-edit" type="submit" class="btn btn-success edit-mode" value="Submit">
                                <button type="button" id="editBtn" class="btn btn-primary ms-2 view-mode">Edit</button>      
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    
    <script>
        document.getElementById('editBtn').addEventListener('click', function () {
        
            // Hide text
            document.querySelectorAll('.view-mode').forEach(el => {
                el.style.display = 'none';
            });
        
            // Show inputs
            document.querySelectorAll('.edit-mode').forEach(el => {
                el.style.display = 'block';
            });
        
        });
        document.getElementById('cancelBtn').addEventListener('click', function () {
        
            // Hide text
            document.querySelectorAll('.view-mode').forEach(el => {
                el.style.display = 'block';
            });
        
            // Show inputs
            document.querySelectorAll('.edit-mode').forEach(el => {
                el.style.display = 'none';
            });
        
        });
    </script>

</main>