"); echo (""); echo (""); echo (""); //*** MENU SYSTEM NEW STYLE ---------------------------------------------------- $update = "activ"; //Comment to delete, Default not set //$back = "activ"; //Selects the type of Stop button. Preferably back $stop = "activ"; //Selects the type of Stop button. Preferably back include ("/var/www/html/robotigs/mobile/menu.php"); //Mobile menu top bar $txlkey = $txltmp; //*** SHOW ALL SELECTABLE LANGUAGES and their contents as editable ------------ $qry = ("SELECT tblsystext.txtname, tblsyslanguage.lanid FROM tblsystext LEFT JOIN tblsyslanguage ON tblsystext.recordid = tblsyslanguage.lanid WHERE tblsystext.lanid = $koekje[2] AND tblsystext.txlid = 1 AND tblsyslanguage.rstid = 2 ORDER BY tblsystext.txtname ASC ;"); $result = pg_query($con1, $qry); if ( !function_exists('version_compare') || version_compare( phpversion(), '5', '<' ) ) include("/var/www/html/ckeditor/ckeditor_php4.php") ; else include("/var/www/html/ckeditor/ckeditor_php5.php") ; echo (""); while($row = pg_fetch_array($result)){ //Do for every language found $lanname = $row[0]; $lanid = $row[1]; echo (""); $tmp = check_if_record_exists($con1, $txltmp, $lanid, $reckey, $koekje[0]); echo (""); } //End of while, done for every language found echo ("
"); if ($koekje[2]==$lanid){ echo("$lanname "); }else{ echo("$lanname "); } echo (""); echo (""); echo (""); echo (" "); //Show pencil as button $CKEditor = new CKEditor(); //echo $CKEditor->textarea("field1", "

Initial value.

"); //echo ("

"); echo (""); //*** HELP SYSTEM NEW STYLE ---------------------------------------------------- $help_wdw = 11; //The hlptxt from blue question button, txlkey = 29 //include ("/var/www/html/robotigs/mobile/help.php"); //Mobile help bar echo (""); echo (""); //////////////////////////////////////////////////////////////////////////////// function check_if_record_exists($conid, $txlkey, $lankey, $reckey, $usrkey){ //If records exists return its name value //Else create a new record $txtid = 0; $qry=("SELECT * FROM tblsystext WHERE txlid=$txlkey AND lanid=$lankey AND recordid=$reckey ;"); $result = pg_query($conid, $qry); //This should result in 1 record found if (!$result) { echo "Error in check_if_record_exists
$qry

"; } while($row = pg_fetch_array($result)){ //Make the fields accesible foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } } if ($txtid>0){ return "$txtname"; }else{ $nextkey = alldf_rtr_tblsystext_nextkey($conid); $txt=("NA$nextkey"); $qry2=("INSERT INTO tblsystext (txtid , txtname , txlid , lanid , recordid, memo , rstid , cid , cdate , mid , mdate )VALUES ($nextkey , '$txt' , $txlkey , $lankey , $reckey , '' , 2 , $usrkey , 'now()' , $usrkey , 'now()' );"); $result2 = pg_query($conid, $qry2); if (!$result2) { echo ("NOT created in alldf_text_record_exist
$qry2

"); }else{ return "$txt"; } } return "Nok should not come here"; } //////////////////////////////////////////////////////////////////////////////// function alldf_rtr_tblsystext_nextkey($conid){ $qry=("SELECT * FROM tblsystext ORDER BY txtid DESC ;"); $result = pg_query($conid, $qry); if (!$result) { echo "Error in alldf_rtr_tblsystext_nextkey
$qry

"; } $arr = pg_fetch_array ($result, 0); $txtid = $arr[0]; $txtid++; return $txtid; } ?>