setQuery("SELECT * FROM `trf-details` ORDER BY `trf-details`.trfnumber DESC LIMIT 1"); $lasttrfnumber->execute();?> getColumnVal("trfnumber"); $nextnumber=$lastnumber+1; ?> setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.tempcode='$tempcode'"); $tempcodesearch->execute(); } ?> getColumnVal("idtrfdetails"))) { $dateintrf=date('Y-m-d'); $cother=$_SESSION["certotherclientsession"]; $InsertQuery = new WA_MySQLi_Query($cmctrfdb); $InsertQuery->Action = "insert"; $InsertQuery->Table = "`trf-details`"; $InsertQuery->bindColumn("trfnumber", "i", "$nextnumber", "WA_DEFAULT"); $InsertQuery->bindColumn("idcompany", "i", "$idcompany", "WA_DEFAULT"); $InsertQuery->bindColumn("iduser", "i", "$iduserlogin", "WA_DEFAULT"); $InsertQuery->bindColumn("idcertification", "i", "$certtype", "WA_DEFAULT"); $InsertQuery->bindColumn("previousreportnumber", "s", "$previousrepnumber", "WA_DEFAULT"); $InsertQuery->bindColumn("tempcode", "s", "$tempcode", "WA_DEFAULT"); $InsertQuery->bindColumn("notificatedorganismname", "s", "$notificatedorganismname", "WA_DEFAULT"); $InsertQuery->bindColumn("dateintrf", "s", "$dateintrf", "WA_DEFAULT"); $InsertQuery->bindColumn("otherclient", "s", "$cother", "WA_DEFAULT"); $InsertQuery->saveInSession(""); $InsertQuery->execute(); $InsertGoTo = ""; $InsertQuery->redirect($InsertGoTo); $tempcodesearch2 = new WA_MySQLi_RS("tempcodesearch",$cmctrfdb,1); $tempcodesearch2->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.tempcode='$tempcode'"); $tempcodesearch2->execute(); $idtrf=$tempcodesearch2->getColumnVal("idtrfdetails"); $code="1"; $InsertQuery = new WA_MySQLi_Query($cmctrfdb); $InsertQuery->Action = "insert"; $InsertQuery->Table = "wheretrfstep"; $InsertQuery->bindColumn("idtrf", "i", "$idtrf", "WA_DEFAULT"); $InsertQuery->bindColumn("code", "i", "$code", "WA_DEFAULT"); $InsertQuery->saveInSession(""); $InsertQuery->execute(); $InsertGoTo = ""; $InsertQuery->redirect($InsertGoTo); $code="2"; $InsertQuery = new WA_MySQLi_Query($cmctrfdb); $InsertQuery->Action = "insert"; $InsertQuery->Table = "wheretrfstep"; $InsertQuery->bindColumn("idtrf", "i", "$idtrf", "WA_DEFAULT"); $InsertQuery->bindColumn("code", "i", "$code", "WA_DEFAULT"); $InsertQuery->saveInSession(""); $InsertQuery->execute(); $InsertGoTo = ""; $InsertQuery->redirect($InsertGoTo); }} ?> setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.tempcode='$tempcode'"); $trfnumberfinal->execute(); $idtrf=$trfnumberfinal->getColumnVal("idtrfdetails"); $idcertn=$trfnumberfinal->getColumnVal("idcertification"); } else { $trfnumberfinal = new WA_MySQLi_RS("trfnumberfinal",$cmctrfdb,1); $trfnumberfinal->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'"); $trfnumberfinal->execute(); $idcertn=$trfnumberfinal->getColumnVal("idcertification"); } ?>