<?php require_once('../auth/auth.php');require_once('../auth/function.php');
$gettype=$_GET['type'];


   $custom_field= mysqli_query($conn,"SELECT customer FROM custom_field WHERE coid='$coid' LIMIT 1 ") or die(mysqli_error($conn));
      $rowcf= mysqli_fetch_assoc ($custom_field);
   
      $p=$rowcf['customer'];
      function input_check($ap)
      {
       if (strpos($GLOBALS['p'], $ap) !== false) { return 1;} 
      }
    $custom_prefix_query= mysqli_query($conn,"SELECT customer_prefix FROM custom_prefix WHERE coid ='$coid'  LIMIT 1 ") or die (mysql_error());
 $rowpp= mysqli_fetch_assoc ($custom_prefix_query);
      $customer_prefix= $rowpp['customer_prefix'];
      ?>
<section class="content">
  <div class="row">
    <div class="col-md-12">
      <div class="card card-primary card-outline direct-chat direct-chat-primary shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
        <div class="card-header" style="padding: 3px 8px;">
          <h3 class="card-title"> <?php echo language(280); ?>
          </h3>
          <div class="card-tools m-0">
             <button type="button" class="btn btn-tool" onclick="pagecall('../voucher/pay_voucher_index.php','#mview');" data-card-widget="remove" data-dismiss="modal" >
            <i class="fas fa-times"></i>
            </button>
          </div>
        </div>
        <div class="card-body">

          
                    <form id="ac_newadd" action="#" method="post" autocomplete="off">
                        <input type="hidden" name="invoice" value="<?php echo invoice("OP");?>" required>
                        <div class="card-body">
                            <div class="col-md-12">
                                <div class="row mt-2">

                                    <div class="col-md-2"> </div>
                                   <div class="col-md-3">
                                    <div class="form-group">
                                     <label> </label> 

                                    <button type="button" class="mt-3 btn btn-xs btn-success text-white" onclick="pagecall('../accounts/add_new_accounts.php?getacno=customer'+'&type=<?php echo $gettype ?>','#mdview');"> <i class="fa fa-arrow-left"></i>  Simple </button>

                                   <button type="button" class="mt-3 btn btn-xs btn-danger text-white" onclick="pagecall('../accounts/add_new_accounts.php?getac=customer'+'&type=<?php echo $gettype ?>','#mdview');">  More Info <i class="fa fa-plus"></i> </button>
                                </div>
                                    </div>
                  





                                    <div class="col-md-5">
                                        <div class="form-group">
                                            <label><?php echo 'Selected Group';?> </label> <b class="text-danger"> * </b>
                                              <select name="ac_g_catid" id="ac_g_catid" class="form-control select2 input_box" style="width: 100%;" required="true"> 
                                              	<option value="" >Please Selected Group</option>
                                                    <?php 

                                                  if ($_GET['getac']=='customer') {
                                                        $sub_catagory= mysqli_query($conn,"SELECT * FROM ac_sub_g_category  WHERE coid='$coid' AND g_type in('su-deb','su-cre') ") or die (mysqli_error($conn));
                                                     }else{
                                                      $sub_catagory= mysqli_query($conn,"SELECT * FROM ac_sub_g_category  WHERE coid='$coid' AND g_type in('su-deb','su-cre','bank','du-adv','stl','owner','dr-inc','in-inc','dr-exp','sl-exp','in-exp')  ") or die (mysqli_error($conn));
                                                     }


                                                        while($rsub= mysqli_fetch_assoc($sub_catagory)){
                                                            $ac_s_catid =   $rsub["ac_s_catid"];
                                                            $acgroup= mysqli_fetch_assoc(mysqli_query($conn,"SELECT ac_s_cat_name FROM ac_sub_category WHERE ac_s_catid='$ac_s_catid'  LIMIT 1"))['ac_s_cat_name'];

                                                          echo '<option value='.$rsub["ac_g_catid"].'>'.$rsub["ac_g_cat_name"].' '.'('.$acgroup.') </option>';
                                                        }?> 
			                                 </select>
			                            </div>
                                    </div>






                                     <div class="col-md-2"> </div>
                          <div class="col-md-4">
                              <div class="form-group">
                                 <label>
                                    <?php if(isset($_GET['getac'])){
                                           echo language(164).'/';
                                           echo  language(134);
                                    }else{
                                            echo language(215);
                                    } ?>
                                    <b class="text-danger"> *</b></label>
                                 <input type="text" name="ac_name"  class="form-control form-control-sm inputselect" style="text-align:left;" required="true">
                              </div>
                           </div>
                           <div class="col-md-2">
                              <div class="form-group">
                                 <label><?php echo language(110);?> <b class="text-danger"> *</b></label>
                                 <input type="text" name="alias_name" value="N/A" class="form-control form-control-sm inputselect"  style="text-align:left;" required="true">
                              </div>
                           </div>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(111);?> <b class="text-danger"> <span id="number-availability-status"></span> *</b></label>
                                 <input type="number" name="ac_number" id="cus_ac_number"  onBlur="checkenumberAvailability()" class="form-control form-control-sm inputselect" style="text-align:left;" required="true">
                              </div>
                           </div>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(112);?> </label>
                                 <input type="email"  name="ac_email"  class="form-control form-control-sm inputselect">
                              </div>
                           </div>
                           
                        <?php if (isset($_GET['getac'])){?>
                        <?php if(input_check('s_address')==1){ ?>
                           <div class="col-md-4">
                              <div class="form-group">
                                 <label><?php echo language(113);?><b class="text-danger"> *</b>  </label>
                                 <select name="divisions" id="divisions" onchange="divisionsList();" class="form-control" required="true">
                                    <option disabled selected>Select Division</option>
                                    <option value="Barishal">Barishal</option>
                                    <option value="Chattogram">Chattogram</option>
                                    <option value="Dhaka">Dhaka</option>
                                    <option value="Khulna">Khulna</option>
                                    <option value="Mymensingh">Mymensingh</option>
                                    <option value="Rajshahi">Rajshahi</option>
                                    <option value="Rangpur">Rangpur</option>
                                    <option value="Sylhet">Sylhet</option>
                                 </select>
                              </div>
                           </div>
                           <div class="col-md-4">
                              <div class="form-group">
                                 <label> <?php echo language(114);?> <b class="text-danger"> *</b> </label>
                                 <select  id="distr" name="distr" onchange="thanaList();" class="form-control" required="true">
                                 </select>
                              </div>
                           </div>
                           <div class="col-md-4">
                              <div class="form-group">
                                 <label>  <?php echo language(115);?>  <b class="text-danger"> *</b> </label>
                                 <select  id="polic_sta" name="polic_sta"  class="form-control" required="true">
                                 </select>
                              </div>
                           </div>
                            <?php } }  ?>
                           
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label> 
                                    <?php if (@$_GET['getac']=='customer'){
                                           echo language(116);
                                    }else{
                                            echo language(150);
                                    } ?>
                                  <b class="text-danger"> *</b></label>
                                 <input name="ac_details" class="form-control form-control-sm inputselect" required="true" >
                              </div>
                           </div>

                       <?php if (isset($_GET['getac'])){?>


                           <?php if(input_check('nid')==1){ ?>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(117);?></label> 
                                 <input type="number" name="ac_nid" class="form-control form-control-sm inputselect">
                              </div>
                           </div>
                           <?php } ?>
                           
                            <?php
                              $ac_query= mysqli_query($conn,"SELECT `acid` FROM accounts WHERE  acid ORDER BY acid DESC  ") or die (mysqli_error($conn));
                                   $row_ac=mysqli_fetch_array($ac_query);
                                     $aacid =$row_ac['acid']+1;
                                     $get_outlet= $customer_prefix.'-'.$aacid;
                            ?>
                              <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(118);?>  <b class="text-danger"> <span id="outlet-availability-status"></span> *</b></label>
                                 <input type="text" name="out_it" id="outlet_id" value="<?php echo $get_outlet;?>"  onBlur="checkeoutletAvailability()" class="form-control form-control-sm inputselect"  required="true">
                              </div>
                           </div>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(119);?><b class="text-danger"> *</b>  </label>
                                 <select name="customer_type"  class="form-control" required="true">
                                    <option value="retail">Retail</option>
                                    <option value="ws">WholeSaler</option>
                                    <option value="distri">Dristributor</option>
                                    <option value="emi">EMI (installment) </option>
                                    <option value="B2B">B2B (sales) </option>
                                 </select>
                              </div>
                           </div>
                           <?php if(input_check('discount')==1){ ?>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(88);?> % </label>
                                 <input type="text" name="dis_margin" value="0"  class="form-control form-control-sm inputselect">
                              </div>
                           </div>
                           <?php } ?>
                           <?php if(input_check('cr_limit')==1){ ?>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(120);?> </label>
                                 <input type="text" name="crlimit"  class="form-control form-control-sm inputselect"  value="0">
                              </div>
                           </div>
                           <?php } ?>
                           <?php if(input_check('bank_info')==1){ ?>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(121);?> </label>
                                 <dt id="show1" style="float: right;"></dt>
                                 <select name="bankid"  class="form-control">
                                    <option></option>
                                    <?php 
                                       $accat1= mysqli_query($conn,"SELECT acid,ac_name,ac_alise,ac_number,balance FROM accounts LEFT JOIN ac_sub_g_category ON(accounts.gcatid=ac_sub_g_category.ac_g_catid) WHERE accounts.coid='$coid' AND bid='$bid' AND brid='$brid' AND active=1 AND g_type IN('bank')") or die (mysqli_error($conn));
                                       while($acat1= mysqli_fetch_assoc($accat1)){
                                        echo '<option value='.$acat1["acid"].'>'.$acat1["ac_name"]."-".$acat1["ac_number"].' '.'('.$acat1["ac_alise"].')</option>';
                                       }?>  
                                 </select>
                              </div>
                           </div>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(122);?></label>
                                 <input type="number" title="Banking And Financial Services Certificate." name="bfsc_code"  class="form-control form-control-sm inputselect">
                              </div>
                           </div>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(123);?></label>
                                 <input type="text" name="bbr_name" title="Banking And Financial Services Certificate." class="form-control form-control-sm inputselect">
                              </div>
                           </div>
                           <?php } ?>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(124);?> <b class="text-danger"> *</b>  </label>
                                 <select name="areaid"  class="form-control">
                                 <?php 
                                    $em_Route= mysqli_query($conn,"SELECT * FROM route_area  WHERE coid='$coid' AND bid='$bid' AND brid='$brid' ") or die (mysqli_error($conn));
                                    while($rot= mysqli_fetch_assoc($em_Route)){
                                      echo '<option value='.$rot["roid"].'>'.$rot["route_name"]."-".$rot["road_name"].' </option>';
                                    }?> 
                                 </select>
                              </div>
                           </div>
                           <?php if(input_check('vatno')==1){ ?>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(125);?> </label>
                                 <select  id="vatno" name="vatno"  class="form-control">
                                    <option value="0" >N/A</option>
                                 </select>
                              </div>
                           </div>
                           <?php  } ?>


                           
                           <?php if(input_check('currency')==1){ ?>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(126);?> <b class="text-danger"> *</b>  </label>
                                 <select name="currency"  class="form-control">
                                    <option value=""></option>
                                    <option value="AED">United Arab Emirates dirham</option>
                                    <option value="AFN">Afghan afghani</option>
                                    <option value="ALL">Albanian lek</option>
                                    <option value="AMD">Armenian dram</option>
                                    <option value="AOA">Angolan kwanza</option>
                                    <option value="ARS">Argentine peso</option>
                                    <option value="AUD">Australian dollar</option>
                                    <option value="AWG">Aruban florin</option>
                                    <option value="AZN">Azerbaijani manat</option>
                                    <option value="BAM">Bosnia and Herzegovina convertible mark</option>
                                    <option value="BBD">Barbadian dollar</option>
                                    <option selected="selected" value="BDT">Bangladeshi taka</option>
                                    <option value="BGN">Bulgarian lev</option>
                                    <option value="BHD">Bahraini dinar</option>
                                    <option value="BIF">Burundian franc</option>
                                    <option value="BMD">Bermudian dollar</option>
                                    <option value="BND">Brunei dollar</option>
                                    <option value="BOB">Bolivian boliviano</option>
                                    <option value="BRL">Brazilian real</option>
                                    <option value="BSD">Bahamian dollar</option>
                                    <option value="BTN">Bhutanese ngultrum</option>
                                    <option value="BWP">Botswana pula</option>
                                    <option value="BYR">Belarusian ruble</option>
                                    <option value="BZD">Belize dollar</option>
                                    <option value="CAD">Canadian dollar</option>
                                    <option value="CDF">Congolese franc</option>
                                    <option value="CHF">Swiss franc</option>
                                    <option value="CLP">Chilean peso</option>
                                    <option value="CNY">Chinese yuan</option>
                                    <option value="COP">Colombian peso</option>
                                    <option value="CRC">Costa Rican colón</option>
                                    <option value="CUP">Cuban convertible peso</option>
                                    <option value="CVE">Cape Verdean escudo</option>
                                    <option value="CZK">Czech koruna</option>
                                    <option value="DJF">Djiboutian franc</option>
                                    <option value="DKK">Danish krone</option>
                                    <option value="DOP">Dominican peso</option>
                                    <option value="DZD">Algerian dinar</option>
                                    <option value="EGP">Egyptian pound</option>
                                    <option value="ERN">Eritrean nakfa</option>
                                    <option value="ETB">Ethiopian birr</option>
                                    <option value="EUR">Euro</option>
                                    <option value="FJD">Fijian dollar</option>
                                    <option value="FKP">Falkland Islands pound</option>
                                    <option value="GBP">British pound</option>
                                    <option value="GEL">Georgian lari</option>
                                    <option value="GHS">Ghana cedi</option>
                                    <option value="GMD">Gambian dalasi</option>
                                    <option value="GNF">Guinean franc</option>
                                    <option value="GTQ">Guatemalan quetzal</option>
                                    <option value="GYD">Guyanese dollar</option>
                                    <option value="HKD">Hong Kong dollar</option>
                                    <option value="HNL">Honduran lempira</option>
                                    <option value="HRK">Croatian kuna</option>
                                    <option value="HTG">Haitian gourde</option>
                                    <option value="HUF">Hungarian forint</option>
                                    <option value="IDR">Indonesian rupiah</option>
                                    <option value="ILS">Israeli new shekel</option>
                                    <option value="IMP">Manx pound</option>
                                    <option value="INR">Indian rupee</option>
                                    <option value="IQD">Iraqi dinar</option>
                                    <option value="IRR">Iranian rial</option>
                                    <option value="ISK">Icelandic króna</option>
                                    <option value="JEP">Jersey pound</option>
                                    <option value="JMD">Jamaican dollar</option>
                                    <option value="JOD">Jordanian dinar</option>
                                    <option value="JPY">Japanese yen</option>
                                    <option value="KES">Kenyan shilling</option>
                                    <option value="KGS">Kyrgyzstani som</option>
                                    <option value="KHR">Cambodian riel</option>
                                    <option value="KMF">Comorian franc</option>
                                    <option value="KPW">North Korean won</option>
                                    <option value="KRW">South Korean won</option>
                                    <option value="KWD">Kuwaiti dinar</option>
                                    <option value="KYD">Cayman Islands dollar</option>
                                    <option value="KZT">Kazakhstani tenge</option>
                                    <option value="LAK">Lao kip</option>
                                    <option value="LBP">Lebanese pound</option>
                                    <option value="LKR">Sri Lankan rupee</option>
                                    <option value="LRD">Liberian dollar</option>
                                    <option value="LSL">Lesotho loti</option>
                                    <option value="LTL">Lithuanian litas</option>
                                    <option value="LVL">Latvian lats</option>
                                    <option value="LYD">Libyan dinar</option>
                                    <option value="MAD">Moroccan dirham</option>
                                    <option value="MDL">Moldovan leu</option>
                                    <option value="MGA">Malagasy ariary</option>
                                    <option value="MKD">Macedonian denar</option>
                                    <option value="MMK">Burmese kyat</option>
                                    <option value="MNT">Mongolian tögrög</option>
                                    <option value="MOP">Macanese pataca</option>
                                    <option value="MRO">Mauritanian ouguiya</option>
                                    <option value="MUR">Mauritian rupee</option>
                                    <option value="MVR">Maldivian rufiyaa</option>
                                    <option value="MWK">Malawian kwacha</option>
                                    <option value="MXN">Mexican peso</option>
                                    <option value="MYR">Malaysian ringgit</option>
                                    <option value="MZN">Mozambican metical</option>
                                    <option value="NAD">Namibian dollar</option>
                                    <option value="NGN">Nigerian naira</option>
                                    <option value="NIO">Nicaraguan córdoba</option>
                                    <option value="NOK">Norwegian krone</option>
                                    <option value="NPR">Nepalese rupee</option>
                                    <option value="NZD">New Zealand dollar</option>
                                    <option value="OMR">Omani rial</option>
                                    <option value="PAB">Panamanian balboa</option>
                                    <option value="PEN">Peruvian nuevo sol</option>
                                    <option value="PGK">Papua New Guinean kina</option>
                                    <option value="PHP">Philippine peso</option>
                                    <option value="PKR">Pakistani rupee</option>
                                    <option value="PLN">Polish złoty</option>
                                    <option value="PRB">Transnistrian ruble</option>
                                    <option value="PYG">Paraguayan guaraní</option>
                                    <option value="QAR">Qatari riyal</option>
                                    <option value="RON">Romanian leu</option>
                                    <option value="RSD">Serbian dinar</option>
                                    <option value="RUB">Russian ruble</option>
                                    <option value="RWF">Rwandan franc</option>
                                    <option value="SAR">Saudi riyal</option>
                                    <option value="SBD">Solomon Islands dollar</option>
                                    <option value="SCR">Seychellois rupee</option>
                                    <option value="SDG">Singapore dollar</option>
                                    <option value="SEK">Swedish krona</option>
                                    <option value="SGD">Singapore dollar</option>
                                    <option value="SHP">Saint Helena pound</option>
                                    <option value="SLL">Sierra Leonean leone</option>
                                    <option value="SOS">Somali shilling</option>
                                    <option value="SRD">Surinamese dollar</option>
                                    <option value="SSP">South Sudanese pound</option>
                                    <option value="STD">São Tomé and Príncipe dobra</option>
                                    <option value="SVC">Salvadoran colón</option>
                                    <option value="SYP">Syrian pound</option>
                                    <option value="SZL">Swazi lilangeni</option>
                                    <option value="THB">Thai baht</option>
                                    <option value="TJS">Tajikistani somoni</option>
                                    <option value="TMT">Turkmenistan manat</option>
                                    <option value="TND">Tunisian dinar</option>
                                    <option value="TOP">Tongan paʻanga</option>
                                    <option value="TRY">Turkish lira</option>
                                    <option value="TTD">Trinidad and Tobago dollar</option>
                                    <option value="TWD">New Taiwan dollar</option>
                                    <option value="TZS">Tanzanian shilling</option>
                                    <option value="UAH">Ukrainian hryvnia</option>
                                    <option value="UGX">Ugandan shilling</option>
                                    <option value="USD">United States dollar</option>
                                    <option value="UYU">Uruguayan peso</option>
                                    <option value="UZS">Uzbekistani som</option>
                                    <option value="VEF">Venezuelan bolívar</option>
                                    <option value="VND">Vietnamese đồng</option>
                                    <option value="VUV">Vanuatu vatu</option>
                                    <option value="WST">Samoan tālā</option>
                                    <option value="XAF">Central African CFA franc</option>
                                    <option value="XCD">East Caribbean dollar</option>
                                    <option value="XOF">West African CFA franc</option>
                                    <option value="XPF">CFP franc</option>
                                    <option value="YER">Yemeni rial</option>
                                    <option value="ZAR">South African rand</option>
                                    <option value="ZMW">Zambian kwacha</option>
                                    <option value="ZWL">Zimbabwean dollar</option>
                                 </select>
                              </div>
                           </div>
                            <?php } ?>

                           <?php if(input_check('p_terms')==1){ ?>
                           <div class="col-md-3">
                              <div class="form-group">
                                 <label><?php echo language(127);?>  <b class="text-danger"> *</b>  </label>
                                 <select name="p_terms"  _last="0" class="form-control">
                                    <option value="1">Cash Only</option>
                                    <option value="2">Due 15th Of the Following Month</option>
                                    <option value="3">Due By End Of The Following Month</option>
                                    <option value="4">Payment due within 10 days</option>
                                    <option value="5">Prepaid</option>
                                 </select>
                              </div>
                           </div>
                           <?php } ?>


<?php } ?>
                          
</div>
<hr style="border-top: 2px solid red;">

<div class="row">


                                    <div class="col-md-3">
                                        <div class="form-group">
                                            <center><label><?php echo language(129);?></label></center>
                                            <input type="number" name="balance" step="0.001" class="form-control form-control-sm" style="text-align:center;">
                                        </div>
                                    </div>
                                    <div class="col-md-3">
                                        <div class="form-group">
                                            <label><?php echo language(130);?></label>
                                            <select name="ttype" id="ttype" class="form-control select2" style="width: 100%;">
                                                <option selected="selected" value="+"> <?php echo language(217);?> (+)</option>
                                                <option value="-"> <?php echo language(218);?> (-)</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-md-3">
                                        <div class="form-group">
                                            <center><label><?php echo language(131);?></label> <b class="text-danger"> * </b> </center>
                                            <input type="text" name="opdate" class="form-control form-control-sm" onmouseover="lcdate(this)" style="text-align:center;" readonly="true" required="true" value="<?php echo $date;?>">
                                        </div>
                                    </div>

                                    <div class="col-md-3">
                                        <div class="form-group" style="margin-top:19px;">
                                         <div class="custom-control custom-checkbox">
                                            <input name="sendsms" class="custom-control-input" type="checkbox" id="customCheckbox2" value="yes">
                                            <label for="customCheckbox2" class="custom-control-label"><?php echo language(132);?></label>
                                         </div>
                                        </div>
                                   </div>







                                </div>
                            </div>
                        </div>
                        <center>
                        <div class="card-footer" style="padding: 8px 5px;">
                            <button type="submit" id="saveddd" class="btn btn-success btn-xs"><?php echo language(23);?></button>
                            <button type="reset" class="btn btn-secondary btn-xs"><?php echo language(24);?></button>
                        </div>
                        </center>
                    </form>

        </div>
      </div>
    </div>
  </div>
</section>
<script>
    $(document).ready(function() {
    $("select").select2();
    $('#ac_g_catid,#ttype').select2({
        dropdownParent: $('#ac_newadd')
    });

    $('#ac_newadd').on('submit', function(e){
    $('#saveddd').prop('disabled', true);
    $('#saveddd').html('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> '+'Loading...');
    e.preventDefault();  
    $.post("../accounts/add_new_accounts_db.php",$(this).serialize(),function(data){
    $('#ac_newadd')[0].reset();
    $('#saveddd').prop('disabled', false);
    $('.modal').modal('hide');
<?php if(@$gettype=='payment'){ ?>
         pagecall('../voucher/pay_voucher_index.php','#mview');
 <?php } elseif(@$gettype=='received'){?>
      $.post('../voucher/re_voucher_index.php',{},function(res){
                $('#mview').html(res);
             }); 
<?php } elseif(@$gettype=='ERSL'  || 'INSL'){?>             
              $.post('../sales/cus_select.php?sltype='+'<?php echo $gettype ?>',{},function(res){
                $('#salmview').html(res);
             });    
<?php } ?>
    toastr.success(Showing, yourdata);
     });
    });
   });  
</script>
<script type="text/javascript">
   function checkenumberAvailability() {
      jQuery.ajax({
         url: "../duplicate_check/number_check.php",
         data:'cus_ac_number='+$("#cus_ac_number").val(),
         type: "POST",
         success:function(data){
         $("#number-availability-status").html(data);
         },
         error:function (){}
      });
   }
</script>

<script type="text/javascript">
   function checkeoutletAvailability() {
      jQuery.ajax({
         url: "../duplicate_check/number_check.php",
         data:'outlet_id='+$("#outlet_id").val(),
         type: "POST",
         success:function(data){
         $("#outlet-availability-status").html(data);
         },
         error:function (){}
      });
   }
</script>