ok

Mini Shell

Direktori : /home2/selectio/public_html/tnpsctestbatch.com/admin/
Upload File :
Current File : /home2/selectio/public_html/tnpsctestbatch.com/admin/standard-add.php

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



<div class="content-wrapper" style="background:white;">
        <div class="clearfix"></div>

<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div>
                <div class="box-header">
                    <h3 class="box-title"><b>Add New Standard: </b></h3>
                </div>
                <div class="box-body">
                    <div class="col-lg-12">
                        
                        
                        
    <div id="content-div">
        <form action="" id="add_standard_form" enctype="multipart/form-data" method="post" accept-charset="utf-8">
            
            <div class="row">
                <div class="col-md-4">
                    <div class="form-group">
                        <label class="required" for="file">Select Subject</label>                                    
                        <select name="subject" id="subject" class="form-control tip select2">
                            <option>-- Select Subject --</option>
                            <?php 
                                $statement = $pdo->prepare("SELECT * FROM tbl_subject");
                                $statement->execute();
                                $result = $statement->fetchAll(PDO::FETCH_ASSOC);
                                foreach($result as $subject){
                            ?>
                            
                            <option value="<?=$subject['id']?>"><?=$subject['subject_name']?></option>
                            
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <label class="required" for="file">Standard</label>                                    
                        <select name="standard[]" id="standard[]" class="form-control tip select2">
                            <option value="">-- Select Standard --</option>
                            <option value="6th Standard">6th Standard </option>
                            <option value="7th Standard">7th Standard </option>
                            <option value="8th Standard">8th Standard </option>
                            <option value="9th Standard">9th Standard </option>
                            <option value="10th Standard">10th Standard </option>
                            <option value="11th Standard">11th Standard </option>
                            <option value="12th Standard">12th Standard </option>
                        </select>
                   
                   
                    </div>
                </div>
                <div class="col-md-4">
                    <span id="add_row" class="btn btn-success" style="margin-top: 7%;background: #6bc5fa;font-weight: 800;border: 1px solid beige;border-radius: 20px;">
                        <i class="bi bi-plus"></i>Add Row
                    </span>
                </div>
            </div>
            <div id="add_subject_row"></div>
            
            
            
            <div class="col-md-12" style="display: flex;justify-content: center;margin-top: 3%;">
                    <div class="form-group">
                        <input type="submit" id="add_standard" name="add_standard" value="Add Standard"  class="btn btn-success" />
                    </div>
                </div>
            
        </form>
    </div>

<div id="loading-div"  style="display: none;">
    <img src="images/gif/successfull.gif" style="margin-left: 37%;width: 25%;padding-bottom: 5%;">
</div>

<div class="form-group" style="text-align:center;">
    <a href="standard-add.php"><button class="btn btn-primary" ><i class="fa fa-refresh"></i> Reset Form</button></a>
    <a href="standard-details.php"><button class="btn btn-warning" ><i class="fa fa-chevron-left"></i> Back to List</button></a>
 </div>
                    
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</section>

<script>
    $(document).on('click', '.remove_class', function() {
        $(this).closest('.row').remove();
    });
    
    
$('#add_row').on('click', function() {
    var row = `<div class="row">
                <div class="col-md-4" style="margin-left: 362px;">
                    <div class="form-group">
                        <label class="required" for="file">Standard</label>                                    
                        <select name="standard[]" id="standard[]" class="form-control tip select2">
                            <option value="">-- Select Standard --</option>
                            <option value="6th Standard">6th Standard </option>
                            <option value="7th Standard">7th Standard </option>
                            <option value="8th Standard">8th Standard </option>
                            <option value="9th Standard">9th Standard </option>
                            <option value="10th Standard">10th Standard </option>
                            <option value="11th Standard">11th Standard </option>
                            <option value="12th Standard">12th Standard </option>
                        </select>
                    </div>
                </div>
                
                <span  class="remove_class btn btn-danger" style="font-weight: 800;border: 1px solid beige;border-radius: 20px;margin-top: 25px;">Delete Row</span>
                            
            </div>`;
            
        $("#add_subject_row").append(row);
});
</script>

<script>

    $('#add_standard_form').on('submit', function(e){
        console.log("Click And Form Working");
      
            e.preventDefault();
            $('#loading-div').show();
            $('#content-div').hide();
            var formData = new FormData(this);
            formData.append('type', 'add_standard_form');
                $.ajax({
                url: 'add-api/add-standard-form.php',
                type: 'post',
                dataType: 'json',
                data: formData,
                cache: false,
                contentType: false,
                processData: false,
                enctype: 'multipart/form-data',
                success: function (response) {
                    if(response['status']==200){
                         alert(response['message']);
                         
                         
                         $("#add_shifts .close").click();
                         
                         
                         $('#shift_add_form').trigger("reset");
                         emp_datas();
                         $('#loading-div').hide();
                         $('#content-div').show();
                    }else{
                        alert(response['message']);
                        $('#loading-div').hide();
                        $('#content-div').show();
                    }
                    
                   
                }
            });
                
    });
</script>


<?php include "footer.php";?>

Zerion Mini Shell 1.0