

<?php

$countrieslist = new WA_MySQLi_RS("countrieslist",$cmctrfdb,0);

$countrieslist->setQuery("SELECT * FROM countries  ORDER BY countries.namecountry");

$countrieslist->execute();

?>

<form action="" method="post" name="formcompany" class="was-validated">

<div class="form-row">

                                            <div class="col-md-4 mb-3">

                                                <label for="companyname_company"><?php echo $companynametitle; ?></label>

                                                <input type="text" class="form-control" id="companyname_company" name="companyname_company" placeholder="<?php echo $companynametitle; ?>" value="<?php echo $companyData["companyname_company"]; ?>" required>

                                            </div>

                                            <div class="col-md-5 mb-3">

                                                <label for="companyaddress"><?php echo $companyaddresstitle; ?></label>

                                                <input type="text" class="form-control" id="companyaddress" name="companyaddress" placeholder="<?php echo $companyaddresstitle; ?>" value="<?php echo $companyData["address_company"]; ?>" required="">

                                            </div>

                                            <div class="col-md-3 mb-3">

                                                <label for="piva"><?php echo $pivatitle; ?></label>

                                                <div class="input-group">

                                                    <input type="text" class="form-control is-invalid" id="piva" name="piva" placeholder="<?php echo $pivatitle; ?>" aria-describedby="inputGroupPrepend3" value="<?php echo $companyData["piva_company"]; ?>" required="">

                                                </div>

                                            </div>

                                        </div>

                                        <div class="form-row">

                                            <div class="col-md-5 mb-3">

                                                <label for="city"><?php echo $citytitle; ?></label>

                                                <input type="text" class="form-control" id="city" name="city" placeholder="<?php echo $citytitle; ?>" value="<?php echo $companyData["city_company"]; ?>" required="">

                                            </div>

                                            <div class="col-md-4 mb-3">

                                                <label for="country"><?php echo $countrytitle; ?></label>

                                                <select class="form-control" name="country" id="country">

                                                                <option value="" required="" <?php if (!(strcmp("", ($companyData["country_company"])))) {echo "selected=\"selected\"";} ?>>Seleziona</option>

                                                                <?php

$wa_startindex = 0;

while(!$countrieslist->atEnd()) {

  $wa_startindex = $countrieslist->Index;

?>            

                                                                <option value="<?php echo($countrieslist->getColumnVal("idcountries")); ?>"<?php if (!(strcmp($countrieslist->getColumnVal("idcountries"), ($companyData["country_company"])))) {echo "selected=\"selected\"";} ?>><?php echo($countrieslist->getColumnVal("namecountry")); ?></option>

                                                                                  <?php

  $countrieslist->moveNext();

}

$countrieslist->moveFirst(); //return RS to first record

unset($wa_startindex);

unset($wa_repeatcount);

?>                                                     

                                                        </select>

                                            </div>

                                        

                                            

                                            <div class="col-md-3 mb-3">

                                                <label for="cap"><?php echo $captitle; ?></label>

                                                <div class="input-group">

                                                    <input type="text" class="form-control" id="cap" name="cap" placeholder="<?php echo $captitle; ?>" aria-describedby="inputGroupPrepend3" value="<?php echo $companyData["zip_company"]; ?>" required="">

                                                </div>

                                            </div>

                                        </div>

    

											<div class="form-row">





                                            <div class="col-md-3 mb-3">

                                                <label for="telephone"><?php echo $telephonetitlecompany; ?></label>

                                                <input type="text" class="form-control" id="telephone" name="telephone" placeholder="<?php echo $telephonetitle; ?>" value="<?php echo $companyData["telephone_company"]; ?>" required="">

                                            </div>

                                            <div class="col-md-3 mb-3">

                                                <label for="email"><?php echo $emailtitlecompany; ?></label>

                                                <input type="text" class="form-control" id="email" name="email" placeholder="<?php echo $emailtitle; ?>" value="<?php echo $companyData["email_company"]; ?>" required="">

                                            </div>

                                            </div>

												

												<div class="form-row">

													<div class="col-md-3 mb-3">

                                                <label for="contactname"><?php echo $contactnametitle; ?></label>

                                                <div class="input-group">

                                                    <input type="text" class="form-control" id="contactname" name="contactname" placeholder="<?php echo $contactnametitle; ?>" aria-describedby="inputGroupPrepend3" value="<?php echo $companyData["maincontactname_company"]; ?>" required="">

                                                </div>

                                            </div>

											<div class="col-md-3 mb-3">

                                                <label for="contactsurname"><?php echo $contactsurnametitle; ?></label>

                                                <div class="input-group">

                                                    <input type="text" class="form-control" id="contactsurname" name="contactsurname" placeholder="<?php echo $contactsurnametitle; ?>" aria-describedby="inputGroupPrepend3" value="<?php echo $companyData["maincontactsurname_company"]; ?>" required="">

                                                </div>

                                            </div>

                                            <div class="col-md-3 mb-3">

                                                <label for="telephonemain"><?php echo $telephonetitlecontact; ?></label>

                                                <input type="text" class="form-control" id="telephonemain" name="telephonemain" placeholder="<?php echo $telephonetitle; ?>" value="<?php echo $companyData["maincontactphone_company"]; ?>" required="">

                                            </div>

                                            <div class="col-md-3 mb-3">

                                                <label for="emailmain"><?php echo $emailtitlecontact; ?></label>

                                                <input type="text" class="form-control" id="emailmain" name="emailmain" placeholder="<?php echo $emailtitle; ?>" value="<?php echo $companyData["maincontactmail_company"]; ?>" required="">

                                            </div></div>

												

												

												<input type="hidden" id="formname" name="formname" value="Y">

                                                <input type="hidden" id="edited" name="edited" value="Y">

                                        <br>



                                        <button class="btn btn-gradient-primary" type="submit"><?php echo $updateformtitle; ?></button>

										

                                        </form>