setQuery("SELECT contacts.idcontacts, contacts.kindofcontacts, contacts.idtrf FROM contacts WHERE contacts.idtrf='$idtrf'"); $auditcontactcheck->execute(); if (empty($auditcontactcheck->getColumnVal("idcontacts"))) { if (!empty($companyData["idcompany"])) { $companyid = $companyData["idcompany"]; } else { $companyid = ""; } if (!empty($companyData["companyname_company"])) { $companyname = $companyData["companyname_company"]; } else { $companyname = ""; } if (!empty($companyData["piva_company"])) { $companypiva = $companyData["piva_company"]; } else { $companypiva = ""; } if (!empty($companyData["address_company"])) { $companyaddress = $companyData["address_company"]; } else { $companyaddress = ""; } if (!empty($companyData["city_company"])) { $companycity = $companyData["city_company"]; } else { $companycity = ""; } if (!empty($companyData["zip_company"])) { $companycap = $companyData["zip_company"]; } else { $companycap = ""; } if (!empty($companyData["country_company"])) { $companycountry = $companyData["country_company"]; } else { $companycountry = ""; } if (!empty($companyData["telephone_company"])) { $companytelephone = $companyData["telephone_company"]; } else { $companytelephone = ""; } if (!empty($companyData["email_company"])) { $companyemail = $companyData["email_company"]; } else { $companyemail = ""; } if (!empty($companyData["maincontactname_company"])) { $companycontactname = $companyData["maincontactname_company"]; } else { $companycontactname = ""; } if (!empty($companyData["maincontactsurname_company"])) { $companycontactsurname = $companyData["maincontactsurname_company"]; } else { $companycontactsurname = ""; } $InsertQuery = new WA_MySQLi_Query($cmctrfdb); $InsertQuery->Action = "insert"; $InsertQuery->Table = "contacts"; $InsertQuery->bindColumn("kindofcontacts", "s", "audit", "WA_DEFAULT"); $InsertQuery->bindColumn("companyname", "s", "$companyname", "WA_DEFAULT"); $InsertQuery->bindColumn("piva", "s", "$companypiva", "WA_DEFAULT"); $InsertQuery->bindColumn("address", "s", "$companyaddress", "WA_DEFAULT"); $InsertQuery->bindColumn("city", "s", "$companycity", "WA_DEFAULT"); $InsertQuery->bindColumn("cap", "s", "$companycap", "WA_DEFAULT"); $InsertQuery->bindColumn("country", "s", "$companycountry", "WA_DEFAULT"); $InsertQuery->bindColumn("telephone", "s", "$companytelephone", "WA_DEFAULT"); $InsertQuery->bindColumn("email", "s", "$companyemail", "WA_DEFAULT"); $InsertQuery->bindColumn("contactname", "s", "$companycontactname", "WA_DEFAULT"); $InsertQuery->bindColumn("contactsurname", "s", "$companycontactsurname", "WA_DEFAULT"); $InsertQuery->bindColumn("idtrf", "i", "$idtrf", "WA_DEFAULT"); $InsertQuery->bindColumn("companyid", "i", "$companyid", "WA_DEFAULT"); $InsertQuery->saveInSession(""); $InsertQuery->execute(); $InsertGoTo = ""; if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : ""; $InsertQuery->redirect($InsertGoTo); } ?> Action = "insert"; $InsertQuery->Table = "contacts"; $InsertQuery->bindColumn("kindofcontacts", "s", "$kindofcontacts", "WA_DEFAULT"); $InsertQuery->bindColumn("companyid", "s", "$idcompany", "WA_DEFAULT"); $InsertQuery->bindColumn("tempcode", "s", "$tempcode", "WA_DEFAULT"); $InsertQuery->saveInSession(""); $InsertQuery->execute(); $InsertGoTo = ""; if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : ""; $InsertQuery->redirect($InsertGoTo); } ?> setQuery("SELECT dpicode FROM auditdpi WHERE auditdpi.idtrfdetails='$idtrf' ORDER BY dpicode DESC LIMIT 1"); $ndpicode->execute(); if (!empty($ndpicode->getColumnVal("dpicode"))) { $lastdpicode = $ndpicode->getColumnVal("dpicode"); $lastdpicode = $lastdpicode + 1; } else { $lastdpicode = "1"; } $InsertQuery = new WA_MySQLi_Query($cmctrfdb); $InsertQuery->Action = "insert"; $InsertQuery->Table = "auditdpi"; $InsertQuery->bindColumn("idtrfdetails", "i", "" . ((isset($_POST["idtrf"])) ? $_POST["idtrf"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("idcertificate", "i", "" . ((isset($_POST["certtypen"])) ? $_POST["certtypen"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("certificatenumber", "s", "" . ((isset($_POST["certififcatenumber"])) ? $_POST["certififcatenumber"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("issuebycimac", "s", "" . ((isset($_POST["issueby"])) ? $_POST["issueby"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("moduleselection", "s", "" . ((isset($_POST["modulesel"])) ? $_POST["modulesel"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("dpicode", "i", "" . $lastdpicode . "", "WA_DEFAULT"); $InsertQuery->saveInSession(""); $InsertQuery->execute(); $InsertGoTo = ""; if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : ""; $InsertQuery->redirect($InsertGoTo); } ?> setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'"); $trfnumberfinal->execute(); $idcertn = $trfnumberfinal->getColumnVal("idcertification"); $idcertificate = $idcertn; $idarticletype = $trfnumberfinal->getColumnVal("idarticletype"); ?>