<?php
include('../includes/session.php');
include('../includes/config.php');
if(checkAdmin($udata['type']) == false){
    ?>
    <script>
        window.location='index.php';
    </script>
    <?php
    die();
}
include('../template/ahkweb/pricing.php');
if(isset($_POST['Aadhar_pdf_fee'])){
    $Aadhar_pdf_fee = mysqli_real_escape_string($ahk_conn,$_POST['Aadhar_pdf_fee']);
    $eid_to_pdf_fee = mysqli_real_escape_string($ahk_conn,$_POST['eid_to_pdf_fee']);
    $name_to_aadhaar = mysqli_real_escape_string($ahk_conn,$_POST['name_to_aadhaar']);
    $genrate_eid_price = mysqli_real_escape_string($ahk_conn,$_POST['genrate_eid_price']);
    $ration_aadhar_fee = mysqli_real_escape_string($ahk_conn,$_POST['ration_aadhar_fee']);
    $aadhar_manual_fee = mysqli_real_escape_string($ahk_conn,$_POST['aadhar_manual_fee']);
    $aadhaaar_advance_fee = mysqli_real_escape_string($ahk_conn,$_POST['aadhaaar_advance_fee']);
    $Airtel_pass_fee = mysqli_real_escape_string($ahk_conn,$_POST['Airtel_pass_fee']);
    $Fino_pass_fee = mysqli_real_escape_string($ahk_conn,$_POST['Fino_pass_fee']);
    $Ippb_pass_fee = mysqli_real_escape_string($ahk_conn,$_POST['Ippb_pass_fee']);
    $ll_fee = mysqli_real_escape_string($ahk_conn,$_POST['ll_fee']);
    $Dl_pdf_fee = mysqli_real_escape_string($ahk_conn,$_POST['Dl_pdf_fee']);
    $Ration_pdf_fee = mysqli_real_escape_string($ahk_conn,$_POST['Ration_pdf_fee']);
    $rc_vehical_fee = mysqli_real_escape_string($ahk_conn,$_POST['rc_vehical_fee']);
    $Voter_advance_fee = mysqli_real_escape_string($ahk_conn,$_POST['Voter_advance_fee']);
    $v_mobile_link = mysqli_real_escape_string($ahk_conn,$_POST['v_mobile_link']);
    $voter_org_fee = mysqli_real_escape_string($ahk_conn,$_POST['voter_org_fee']);
    $Covia_1_2_fee = mysqli_real_escape_string($ahk_conn,$_POST['Covia_1_2_fee']);
    $Covia_1_2_Batch_fee = mysqli_real_escape_string($ahk_conn,$_POST['Covia_1_2_Batch_fee']);
    $Birth_legend_fee = mysqli_real_escape_string($ahk_conn,$_POST['Birth_legend_fee']);
    $ayushman_price = mysqli_real_escape_string($ahk_conn,$_POST['ayushman_price']);
    $pan_no = mysqli_real_escape_string($ahk_conn,$_POST['pan_no']);
    $pan_details_fee = mysqli_real_escape_string($ahk_conn,$_POST['pan_details_fee']);
    $instant_pan_manual_fee = mysqli_real_escape_string($ahk_conn,$_POST['instant_pan_manual_fee']);

    $update = mysqli_query($ahk_conn,"UPDATE pricing SET price='$Aadhar_pdf_fee' WHERE service_name='Aadhar_pdf_fee'");
    $update23 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$eid_to_pdf_fee' WHERE service_name='eid_to_pdf_fee'");
    $update22 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$name_to_aadhaar' WHERE service_name='name_to_aadhaar'");
    $update1 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$genrate_eid_price' WHERE service_name='genrate_eid_price'");
    $update2 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$ration_aadhar_fee' WHERE service_name='ration_aadhar_fee'");
    $update3 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$aadhar_manual_fee' WHERE service_name='aadhar_manual_fee'");
    $update4 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$aadhaaar_advance_fee' WHERE service_name='aadhaaar_advance_fee'");
    $update5 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$Airtel_pass_fee' WHERE service_name='Airtel_pass_fee'");
    $update6 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$Fino_pass_fee' WHERE service_name='Fino_pass_fee'");
    $update7 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$Ippb_pass_fee' WHERE service_name='Ippb_pass_fee'");
    $update8 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$ll_fee' WHERE service_name='ll_fee'");
    $update9 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$Dl_pdf_fee' WHERE service_name='Dl_pdf_fee'");
    $update10 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$Ration_pdf_fee' WHERE service_name='Ration_pdf_fee'");
    $update11 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$rc_vehical_fee' WHERE service_name='rc_vehical_fee'");
    $update12 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$Voter_advance_fee' WHERE service_name='Voter_advance_fee'");
    $update13 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$v_mobile_link' WHERE service_name='v_mobile_link'");
    $update14 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$voter_org_fee' WHERE service_name='voter_org_fee'");
    $update15 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$Covia_1_2_fee' WHERE service_name='Covia_1_2_fee'");
    $update16 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$Covia_1_2_Batch_fee' WHERE service_name='Covia_1_2_Batch_fee'");
    $update17 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$Birth_legend_fee' WHERE service_name='Birth_legend_fee'");
    $update18 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$ayushman_price' WHERE service_name='ayushman_price'");
    $update19 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$pan_no' WHERE service_name='pan_no'");
    $update20 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$pan_details_fee' WHERE service_name='pan_details_fee'");
    $update21 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$instant_pan_manual_fee' WHERE service_name='instant_pan_manual_fee'");
    if($update && $update1 && $update2 && $update3  && $update4  && $update5 && $update6 && $update7 && $update8 && $update9 && $update10 && $update11 && $update12 && $update13 && $update14 && $update15 && $update16 && $update17 && $update18 && $update19 && $update20 && $update21 && $update22 && $update23){
        ?>
        <script>
        $(function(){
            Swal.fire(
                'Price Updated Successfully',
                '',
                'success'
            )
        })
        setTimeout(() => {
            window.location='';
        }, 1200);
    </script>
    <?php
    }else{
        ?>
        <script>
        $(function(){
            Swal.fire(
                'Price Not Updated',
                '',
                'error'
            )
        })
    </script>
    <?php
    }
}
?>