Action = "insert"; $InsertQuery->Table = "contacts"; $InsertQuery->bindColumn("idtrf", "i", $_GET['idtrf'], "WA_DEFAULT"); $InsertQuery->bindColumn("kindofcontacts", "s", "audit", "WA_DEFAULT"); $InsertQuery->bindColumn("companyid", "i", $idcompany, "WA_DEFAULT"); // Inserisci il nuovo record vuoto $InsertQuery->saveInSession(""); $InsertQuery->execute(); // Ottieni l'ultimo ID inserito usando l'oggetto di connessione $new_contact_id = $cmctrfdb->insert_id; // Reindirizza al popup per modificare il nuovo contatto header("Location: contactpopaudit.php?kindcontacts=audit&idtrf=" . $_GET['idtrf'] . "&idcontacts=" . $new_contact_id); exit; } ?> Action = "insert"; $InsertQuery->Table = "contacts"; $InsertQuery->bindColumn("idtrf", "i", "$idtrf", "WA_DEFAULT"); $InsertQuery->bindColumn("kindofcontacts", "s", "audit", "WA_DEFAULT"); // Inserisci un nuovo record vuoto con i campi necessari $InsertQuery->saveInSession(""); $InsertQuery->execute(); // Ottieni l'id del nuovo contatto $new_contact_id = $InsertQuery->getLastInsertID(); // Reindirizza al popup di modifica per il nuovo contatto header("Location: contactpopaudit.php?kindcontacts=audit&idtrf=$idtrf&idcontacts=$new_contact_id"); exit; } ?> setQuery("SELECT * FROM countries ORDER BY countries.namecountry"); $countrylist->execute(); ?> setQuery("SELECT * FROM contacts WHERE contacts.companyname='$compname'"); $searchctdetail->execute(); // Popola i valori del contatto dai risultati della query $companynamet = !empty($searchctdetail->getColumnVal("companyname")) ? $searchctdetail->getColumnVal("companyname") : ""; $piva = !empty($searchctdetail->getColumnVal("piva")) ? $searchctdetail->getColumnVal("piva") : ""; $address = !empty($searchctdetail->getColumnVal("address")) ? $searchctdetail->getColumnVal("address") : ""; $city = !empty($searchctdetail->getColumnVal("city")) ? $searchctdetail->getColumnVal("city") : ""; $cap = !empty($searchctdetail->getColumnVal("cap")) ? $searchctdetail->getColumnVal("cap") : ""; $country = !empty($searchctdetail->getColumnVal("country")) ? $searchctdetail->getColumnVal("country") : ""; $telephone = !empty($searchctdetail->getColumnVal("telephone")) ? $searchctdetail->getColumnVal("telephone") : ""; $email = !empty($searchctdetail->getColumnVal("email")) ? $searchctdetail->getColumnVal("email") : ""; $contactname = !empty($searchctdetail->getColumnVal("contactname")) ? $searchctdetail->getColumnVal("contactname") : ""; $contactsurname = !empty($searchctdetail->getColumnVal("contactsurname")) ? $searchctdetail->getColumnVal("contactsurname") : ""; // Recupera i nuovi campi da GET o POST (se presenti) $projectperson = !empty($searchctdetail->getColumnVal("projectperson")) ? $searchctdetail->getColumnVal("projectperson") : ""; $salesperson = !empty($searchctdetail->getColumnVal("salesperson")) ? $searchctdetail->getColumnVal("salesperson") : ""; $productionperson = !empty($searchctdetail->getColumnVal("productionperson")) ? $searchctdetail->getColumnVal("productionperson") : ""; $csperson = !empty($searchctdetail->getColumnVal("csperson")) ? $searchctdetail->getColumnVal("csperson") : ""; $qualityperson = !empty($searchctdetail->getColumnVal("qualityperson")) ? $searchctdetail->getColumnVal("qualityperson") : ""; $purchaseperson = !empty($searchctdetail->getColumnVal("purchaseperson")) ? $searchctdetail->getColumnVal("purchaseperson") : ""; $activities = !empty($searchctdetail->getColumnVal("activities")) ? $searchctdetail->getColumnVal("activities") : ""; $otheractivities = !empty($searchctdetail->getColumnVal("otheractivities")) ? $searchctdetail->getColumnVal("otheractivities") : ""; $otheractivitiesperson = !empty($searchctdetail->getColumnVal("otheractivitiesperson")) ? $searchctdetail->getColumnVal("otheractivitiesperson") : ""; $languageforaudit = !empty($searchctdetail->getColumnVal("languageforaudit")) ? $searchctdetail->getColumnVal("languageforaudit") : ""; $outsourcing_process = !empty($searchctdetail->getColumnVal("outsourcing_process")) ? $searchctdetail->getColumnVal("outsourcing_process") : ""; // Aggiornamento del database $UpdateQuery = new WA_MySQLi_Query($cmctrfdb); $UpdateQuery->Action = "update"; $UpdateQuery->Table = "contacts"; // Colonne per l'aggiornamento $UpdateQuery->bindColumn("companyname", "s", $companynamet, "WA_DEFAULT"); $UpdateQuery->bindColumn("piva", "s", $piva, "WA_DEFAULT"); $UpdateQuery->bindColumn("address", "s", $address, "WA_DEFAULT"); $UpdateQuery->bindColumn("city", "s", $city, "WA_DEFAULT"); $UpdateQuery->bindColumn("cap", "s", $cap, "WA_DEFAULT"); $UpdateQuery->bindColumn("country", "s", $country, "WA_DEFAULT"); $UpdateQuery->bindColumn("telephone", "s", $telephone, "WA_DEFAULT"); $UpdateQuery->bindColumn("email", "s", $email, "WA_DEFAULT"); $UpdateQuery->bindColumn("contactname", "s", $contactname, "WA_DEFAULT"); $UpdateQuery->bindColumn("contactsurname", "s", $contactsurname, "WA_DEFAULT"); // Nuovi campi $UpdateQuery->bindColumn("projectperson", "s", $projectperson, "WA_DEFAULT"); $UpdateQuery->bindColumn("salesperson", "s", $salesperson, "WA_DEFAULT"); $UpdateQuery->bindColumn("productionperson", "s", $productionperson, "WA_DEFAULT"); $UpdateQuery->bindColumn("csperson", "s", $csperson, "WA_DEFAULT"); $UpdateQuery->bindColumn("qualityperson", "s", $qualityperson, "WA_DEFAULT"); $UpdateQuery->bindColumn("purchaseperson", "s", $purchaseperson, "WA_DEFAULT"); $UpdateQuery->bindColumn("activities", "s", $activities, "WA_DEFAULT"); $UpdateQuery->bindColumn("otheractivities", "s", $otheractivities, "WA_DEFAULT"); $UpdateQuery->bindColumn("otheractivitiesperson", "s", $otheractivitiesperson, "WA_DEFAULT"); $UpdateQuery->bindColumn("languageforaudit", "s", $languageforaudit, "WA_DEFAULT"); $UpdateQuery->bindColumn("outsourcing_process", "s", $outsourcing_process, "WA_DEFAULT"); // Filtro per ID del contatto $UpdateQuery->addFilter("idcontacts", "=", "i", $idcontacts); $UpdateQuery->execute(); // Reindirizzamento $UpdateGoTo = ""; if (function_exists("rel2abs")) { $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : ""; } $UpdateQuery->redirect($UpdateGoTo); } ?> Action = "update"; $UpdateQuery->Table = "contacts"; // Colonne per l'aggiornamento $UpdateQuery->bindColumn("companyname", "s", "$companynamet", "WA_DEFAULT"); $UpdateQuery->bindColumn("piva", "s", "$piva", "WA_DEFAULT"); $UpdateQuery->bindColumn("address", "s", "$address", "WA_DEFAULT"); $UpdateQuery->bindColumn("city", "s", "$city", "WA_DEFAULT"); $UpdateQuery->bindColumn("cap", "s", "$cap", "WA_DEFAULT"); $UpdateQuery->bindColumn("country", "s", "$country", "WA_DEFAULT"); $UpdateQuery->bindColumn("telephone", "s", "$telephone", "WA_DEFAULT"); $UpdateQuery->bindColumn("email", "s", "$email", "WA_DEFAULT"); $UpdateQuery->bindColumn("contactname", "s", "$contactname", "WA_DEFAULT"); $UpdateQuery->bindColumn("contactsurname", "s", "$contactsurname", "WA_DEFAULT"); // Nuovi campi $UpdateQuery->bindColumn("projectperson", "s", "$projectperson", "WA_DEFAULT"); $UpdateQuery->bindColumn("salesperson", "s", "$salesperson", "WA_DEFAULT"); $UpdateQuery->bindColumn("productionperson", "s", "$productionperson", "WA_DEFAULT"); $UpdateQuery->bindColumn("csperson", "s", "$csperson", "WA_DEFAULT"); $UpdateQuery->bindColumn("qualityperson", "s", "$qualityperson", "WA_DEFAULT"); $UpdateQuery->bindColumn("purchaseperson", "s", "$purchaseperson", "WA_DEFAULT"); $UpdateQuery->bindColumn("activities", "s", "$activities", "WA_DEFAULT"); $UpdateQuery->bindColumn("otheractivities", "s", "$otheractivities", "WA_DEFAULT"); $UpdateQuery->bindColumn("otheractivitiesperson", "s", "$otheractivitiesperson", "WA_DEFAULT"); $UpdateQuery->bindColumn("languageforaudit", "s", "$languageforaudit", "WA_DEFAULT"); $UpdateQuery->bindColumn("outsourcing_process", "s", "$outsourcing_process", "WA_DEFAULT"); $UpdateQuery->addFilter("idcontacts", "=", "i", "" . ($idcontacts) . ""); $UpdateQuery->execute(); // Reindirizzamento $UpdateGoTo = ""; if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : ""; $UpdateQuery->redirect($UpdateGoTo); } ?> setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'"); $trfnumberfinal->execute(); ?> getColumnVal("idcertification"); $idcert = $trfnumberfinal->getColumnVal("idcertification"); ?> setQuery("SELECT * FROM certificationtype WHERE certificationtype.idcertificationtype='$idcert'"); $certname->execute(); ?> setQuery("SELECT * FROM contacts WHERE contacts.idtrf='$idtrf'"); $contactdatacheck->execute(); $contactlist = array(); ?> atEnd()) { $wa_startindex = $contactdatacheck->Index; ?> getColumnVal("kindofcontacts"); ?> moveNext(); } $contactdatacheck->moveFirst(); //return RS to first record unset($wa_startindex); unset($wa_repeatcount); ?> TRF CIMAC

CONTACT FORM

setQuery("SELECT * FROM contacts WHERE contacts.idcontacts='$idcontacts'"); $contactdata->execute(); $compid = $contactdata->getColumnVal("companyid"); ?> &kindcontactscopy=mycompany&idtrf=&formname=copymycompany&kindcontacts="> &kindcontactscopy=audit&idtrf=&formname=copycontacts&kindcontacts="> &kindcontactscopy=headertest&idtrf=&formname=copycontacts&kindcontacts="> &kindcontactscopy=headercertificate&idtrf=&formname=copycontacts&kindcontacts="> &kindcontactscopy=invoice&idtrf=&formname=copycontacts&kindcontacts=">

" placeholder="" required>
" placeholder="" required>
" placeholder="" required>
" placeholder="" required>
" placeholder="" required>
" placeholder="" required>
" placeholder="" required>
" placeholder="" required>
" placeholder="" required>
" placeholder="">


" pattern="[0-9]+([\,\.][0-9]{1})?" inputmode="decimal">
" pattern="[0-9]+([\,\.][0-9]{1})?" inputmode="decimal">
" pattern="[0-9]+([\,\.][0-9]{1})?" inputmode="decimal">
" pattern="[0-9]+([\,\.][0-9]{1})?" inputmode="decimal">
" pattern="[0-9]+([\,\.][0-9]{1})?" inputmode="decimal">
" pattern="[0-9]+([\,\.][0-9]{1})?" inputmode="decimal">
">
" pattern="[0-9]+([\,\.][0-9]{1})?" inputmode="decimal">

">
">


"> ">
Ex: