<?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['aadhaarpdf'])){
    $name_to_aadhaar = mysqli_real_escape_string($ahk_conn,$_POST['name_to_aadhaar']);
    $aadhaarpdf = mysqli_real_escape_string($ahk_conn,$_POST['aadhaarpdf']);
    $dl_pdf = mysqli_real_escape_string($ahk_conn,$_POST['dl_pdf']);
    $voter_photo = mysqli_real_escape_string($ahk_conn,$_POST['voter_photo']);
    $rasan_to_aadhar_pdf = mysqli_real_escape_string($ahk_conn,$_POST['rasan_to_aadhar_pdf']);
    $biometric_issues = mysqli_real_escape_string($ahk_conn,$_POST['biometric_issues']);
    $dl_no = mysqli_real_escape_string($ahk_conn,$_POST['dl_no']);
    $complaint_aadhaar = mysqli_real_escape_string($ahk_conn,$_POST['complaint_aadhaar']);
    $gadi_no = mysqli_real_escape_string($ahk_conn,$_POST['gadi_no']);
    $rasan_card = mysqli_real_escape_string($ahk_conn,$_POST['rasan_card']);
    $aadhaar_no = mysqli_real_escape_string($ahk_conn,$_POST['aadhaar_no']);
    $pan_pdf = mysqli_real_escape_string($ahk_conn,$_POST['pan_pdf']);
    $covid_1_dose = mysqli_real_escape_string($ahk_conn,$_POST['covid_1_dose']);
    $aadhaar_pdf = mysqli_real_escape_string($ahk_conn,$_POST['aadhaar_pdf']);
    $covid_1_2_dose = mysqli_real_escape_string($ahk_conn,$_POST['covid_1_2_dose']);
    $pan_no = mysqli_real_escape_string($ahk_conn,$_POST['pan_no']);
    $e_nsdl = mysqli_real_escape_string($ahk_conn,$_POST['e_nsdl']);
    $p_nsdl = mysqli_real_escape_string($ahk_conn,$_POST['p_nsdl']);
    $limitcross_fee = mysqli_real_escape_string($ahk_conn,$_POST['limitcross_fee']);
    $dl_gf_instant = mysqli_real_escape_string($ahk_conn,$_POST['dl_gf_instant']);
    $pan_manual = mysqli_real_escape_string($ahk_conn,$_POST['pan_manual']);
    $ayushman_fee = mysqli_real_escape_string($ahk_conn,$_POST['ayushman_fee']);
    $nsdl_pdf_fee = mysqli_real_escape_string($ahk_conn,$_POST['nsdl_pdf_fee']);
    $aadhaaar_advance_fee = mysqli_real_escape_string($ahk_conn,$_POST['aadhaaar_advance_fee']);
    $aadhar_manual_fee = mysqli_real_escape_string($ahk_conn,$_POST['aadhar_manual_fee']);
    $instant_pan_manual_fee = mysqli_real_escape_string($ahk_conn,$_POST['instant_pan_manual_fee']);
    $voter_photo = mysqli_real_escape_string($ahk_conn,$_POST['voter_photo']);
    $certificate_apply = mysqli_real_escape_string($ahk_conn,$_POST['certificate_apply']);

    $update  = mysqli_query($ahk_conn,"UPDATE pricing SET price='$aadhaarpdf' WHERE service_name='aadhaarpdf'");
    $update  = mysqli_query($ahk_conn,"UPDATE pricing SET price='$dl_pdf' WHERE service_name='dl_pdf'");
    $update  = mysqli_query($ahk_conn,"UPDATE pricing SET price='$voter_photo' WHERE service_name='voter_photo'");
    $update  = mysqli_query($ahk_conn,"UPDATE pricing SET price='$rasan_card' WHERE service_name='rasan_card'");
    $update  = mysqli_query($ahk_conn,"UPDATE pricing SET price='$dl_no' WHERE service_name='dl_no'");
    $update  = mysqli_query($ahk_conn,"UPDATE pricing SET price='$complaint_aadhaar' WHERE service_name='complaint_aadhaar'");
    $update  = mysqli_query($ahk_conn,"UPDATE pricing SET price='$gadi_no' WHERE service_name='gadi_no'");
    $update  = mysqli_query($ahk_conn,"UPDATE pricing SET price='$biometric_issues' WHERE service_name='biometric_issues'");
    $update  = mysqli_query($ahk_conn,"UPDATE pricing SET price='$rasan_to_aadhar_pdf' WHERE service_name='rasan_to_aadhar_pdf'");
    $update1 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$aadhaar_no' WHERE service_name='aadhaar_no'");
    $update2 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$pan_pdf' WHERE service_name='pan_pdf'");
    $update2 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$aadhaar_pdf' WHERE service_name='aadhaar_pdf'");
    $update2 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$covid_1_2_dose' WHERE service_name='covid_1_2_dose'");
    $update2 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$covid_1_dose' WHERE service_name='covid_1_dose'");
    $update3 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$pan_no' WHERE service_name='pan_no'");
    $update4 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$e_nsdl' WHERE service_name='e_nsdl'");
    $update5 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$p_nsdl' WHERE service_name='p_nsdl'");
    $update6 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$name_to_aadhaar' WHERE service_name='name_to_aadhaar'");
    $update7 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$limitcross_fee' WHERE service_name='limitcross_fee'");
    $update8 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$dl_gf_instant' WHERE service_name='dl_gf_instant'");
    $update9 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$pan_manual' WHERE service_name='pan_manual'");
    $update10 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$ayushman_fee' WHERE service_name='ayushman_fee'");
    $update11 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$nsdl_pdf_fee' WHERE service_name='nsdl_pdf_fee'");
    $update12 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$aadhaaar_advance_fee' WHERE service_name='aadhaaar_advance_fee'");
    $update13 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$aadhar_manual_fee' WHERE service_name='aadhar_manual_fee'");
    $update14 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$instant_pan_manual_fee' WHERE service_name='instant_pan_manual_fee'");
    $update15 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$voter_photo' WHERE service_name='voter_photo'");
    $update16 = mysqli_query($ahk_conn,"UPDATE pricing SET price='$certificate_apply' WHERE service_name='certificate_apply'");
    if($update && $update1 && $update2 && $update3  && $update4  && $update5 && $update6 && $update7 && $update8 && $update9 && $update10 && $update11 && $update12 && $update13 && $update14 && $update15 && $update16){
        ?>
        <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
    }
}
?>