<?php require_once('../auth/auth.php');?>
<?php  
$getcoid=$_GET['comid'];
$company_query= mysqli_query($conn,"SELECT * FROM company WHERE coid ='$getcoid' LIMIT 1 ") or die (mysql_error());
 $rowco= mysqli_fetch_assoc ($company_query);
?>
<section class="content">
    <div class="container-fluid">
        <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: 5px 8px;"><h3 class="card-title"><?php echo language(25);?></h3> <div class="card-tools"> <button type="button" class="btn btn-tool" data-card-widget="remove"> <i class="fas fa-times"></i>  </button> </div>
                   </div>
                <form id="company_form" action="#" method="post" autocomplete="off">
                   <input type="hidden" name="newreg" required="true">
                    <div class="card-body">
                       <div class="col-md-12">
                           <div class="row mt-2">
                                <div class="col-md-4">
                                    <div class="form-group">
                                      <label><?php echo language(321);?> <b class="text-danger"> *</b></label>
                                      <?php if($coid>1){  ?>
                                      <input type="text"  value="<?php echo $rowco['co_name'];?>"  class="form-control form-control-sm  " readonly="true"  required="true">
                                      <?php  }else{  ?>
                                      <input type="text" name="co_name" col_name="co_name" value="<?php echo $rowco['co_name'];?>"  company_id="<?php echo $getcoid;?>" class="form-control form-control-sm  onlive"  required="true">
                                      <?php  } ?>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                  <div class="form-group">
                                     <label><?php echo language(322);?> <b class="text-danger"> *</b></label>
                                     <input type="text" name="owner_name" col_name="owner_name" value="<?php echo $rowco['owner_name'];?>" company_id="<?php echo $getcoid;?>" class="form-control form-control-sm  onlive" required="true">
                                  </div>
                                </div>
                           <div class="col-md-4">
                              <div class="form-group">
                                <label> <?php echo language(111);?> <b class="text-danger"> *</b></label>
                                 <input type="number" name="co_phone" col_name="co_phone" value="<?php echo $rowco['co_phone'];?>" company_id="<?php echo $getcoid;?>" class="form-control form-control-sm  onlive" required="true">
                              </div>
                           </div>
                            <div class="col-md-4">
                              <div class="form-group">
                                <label> <?php echo language(112);?> <b class="text-danger"> *</b></label>
                                 <input type="text" name="co_email" col_name="co_email" value="<?php echo $rowco['co_email'];?>" company_id="<?php echo $getcoid;?>" class="form-control form-control-sm  onlive" required="true">
                              </div>
                           </div>
                           
                            <div class="col-md-4">
                              <div class="form-group">
                                <label> <?php echo language(370);?> <b class="text-danger"> *</b></label>
                                 <input type="text" name="tinpass" col_name="tinpass" value="<?php echo $rowco['tinpass'];?>" company_id="<?php echo $getcoid;?>" class="form-control form-control-sm  onlive" required="true">
                              </div>
                           </div>
                           
                              <div class="col-md-4">
                              <div class="form-group">
                                <label> <?php echo language(116);?> <b class="text-danger"> *</b></label>
                                 <input type="text" name="co_address" col_name="co_address" value="<?php echo $rowco['co_address'];?>" company_id="<?php echo $getcoid;?>" class="form-control form-control-sm  onlive" required="true">
                              </div>
                           </div>
                           
                        <div class="col-md-4">
                              <div class="form-group">
                                <label> <?php echo language(117);?> <b class="text-danger"> *</b></label>
                                 <input type="text" name="nid" col_name="nid" value="<?php echo $rowco['nid'];?>" company_id="<?php echo $getcoid;?>" class="form-control form-control-sm  onlive" required="true">
                              </div>
                           </div>
                           
                           
                           
                           
                           
                           
                           
                           
                             <!-- part one  -->
                           <div class="col-md-4">
                              <div class="form-group">
                                 <label><?php echo language(126);?></label>
                                 <select name="currency" col_name="currency" company_id="<?php echo $getcoid;?>" class="form-control onlive"  required="true">
                                    <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 value="৳">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>
                           
                           
                           
                            <div class="col-md-4">
                              <div class="form-group">
                                 <label><?php echo language(393);?> </label>
                                 <select name="decimaltk" col_name="decimaltk" company_id="<?php echo $getcoid;?>" class="form-control onlive"  required="true">
                                     <option value="<?php echo $rowco['decimaltk'];?>">
                                          
                                     <?php if($rowco['decimaltk']==0){
                                         echo "Round Figar";
                                     }else if($rowco['decimaltk']==1){
                                         echo "Decimal 00.1";
                                     }else if($rowco['decimaltk']==2){
                                         echo "Decimal 00.12";
                                     }else if($rowco['decimaltk']==3){
                                         echo "Decimal 00.123";
                                     }
                                     ?>
                                     
                                     </option>
                                    <option value="0">Round Figar</option>
                                    <option value="1">Decimal 00.1</option>
                                    <option value="2">Decimal  00.12</option>
                                    <option value="3">Decimal  00.123</option>
                                 </select>
                              </div>
                           </div>
                           
                             <div class="col-md-4">
                              <div class="form-group">
                                 <label><?php echo language(427);?> </label>
                                 <select name="decimalitem" col_name="decimalitem" company_id="<?php echo $getcoid;?>" class="form-control onlive"  required="true">
                                     <option value="<?php echo $rowco['decimalitem'];?>">
                                          
                                     <?php if($rowco['decimalitem']==0){
                                         echo "Round Figar";
                                     }else if($rowco['decimalitem']==1){
                                         echo "Decimal 00.1";
                                     }else if($rowco['decimalitem']==2){
                                         echo "Decimal 00.12";
                                     }else if($rowco['decimalitem']==3){
                                         echo "Decimal 00.123";
                                     }
                                     ?>
                                     
                                     </option>
                                    <option value="0">Round Figar</option>
                                    <option value="1">Decimal 00.1</option>
                                    <option value="2">Decimal  00.12</option>
                                    <option value="3">Decimal  00.123</option>
                                 </select>
                              </div>
                           </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
</div>
</section>

<script type="text/javascript">
  $(document).ready(function() {
        $("select").select2();
    $(".onlive").on('input change', function(){
      up_company_id = $(this).attr("company_id");
      col_name = $(this).attr("col_name");
      col_value = $(this).val();
      $.ajax({
        type: "POST",
        url: "../company_setup/company_db.php",
        data: ({up_company_id: up_company_id,col_name: col_name,col_value:col_value}),
        cache:false,
      });
    });
  });
</script>










