Jump to content

[SOLVED] Fatal error: Call to undefined function


thomhart11

Recommended Posts

Hi to all !

 

After an upgrade from PHP4.x to PHP5.2 with Apache 2.2 and an Oracle 10g database in the back i am not anymore able to do INSERTS, UPDATES to the database. DELETE and SELECTS are working fine.

 

Thanks in advance for the support. Thomas

 

Error message:

 

db_select(Exec): INSERT INTO message (div, text, anrisstext, title, globalshow, created, mnr) values('IM ', '', 'TEXT TEST', 'TITLA TEST', NULL, sysdate, 326)

Fatal error: Call to undefined function col_one_end() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\messages\edit.php on line 89

 

The edit.php:

 

<?

$RELATIVE_ROOT="../"; // must be

 

// require_once ($RELATIVE_ROOT."inc/login.inc.php");

require_once ($RELATIVE_ROOT."connection.inc.php");

 

/* Parameteruebergabe:

    none: create new message

    edit=id: edit message

    delete=id: delete this message

   

    id=create&datafields... : perform an insert

    id=<number>&data....: perform an update

*/

 

    if ($id || $delete) {

       

        if ($delete) {

            db_select("delete from message where mnr=$delete");

       

        } else {

            db_update("message","mnr",$id=="create"?-1:$id,

                array(div=>$division,text,anrisstext,title),array(globalshow),

                array(created=>"sysdate"))    ;

        }

           

        db_commit();

       

        header("Location: ../start/main.php?div=$division");

       

        /* box_start();

        echo " <P>Danke.</P> ";

        box_end();

 

        if (!$delete) {

            box_start("100%","Ansicht","ffffff");

       

            $m=new singlemessage($HTTP_GET_VARS,"ffffff");

            $m->draw(1);

       

            box_end();

        } // if delete

       

        */

       

    } else {  ////////////////////////// FROMULAR DARSTELLEN /////////////////////7

   

require_once ($RELATIVE_ROOT."inc/design.inc.php");

require_once ($RELATIVE_ROOT."widget/messages/singlemessage.inc.php");

require_once ($RELATIVE_ROOT."widget/messages/editmessage.inc.php");

 

?>   

    <html>

    <head>

    <title>JNJ Intranet Create Message</title>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

   

    </head>

<? col_one_start();

   

        box_start("100%","Anlegen","ffffff");

        ?> <BR>Soll kein "mehr..."-Button in der Message-übersicht erscheinen, so schreiben Sie den ganzen Text ins "Anriss"-Feld und lassen Sie bitte das Text-Feld leer.<BR> <?

       

       

        if (!$edit) {

            $m=new editmessage(array(id=>"create",datum=>db_singlevalue("select sysdate from dual")));

            box_hr("","ffffff");

        } else {

            box_hr();

            $res=db_select("select * from message where mnr=$edit");

            $r=db_row($res);

            if (!$r) die ("cant fetch message with id = $edit");

            $m=new editmessage(array(id=>$r[mnr], datum=>$r[created],

                        division=>$r[div], title=>$r[title], text=>$r[text],

                        anrisstext=>$r[anrisstext], globalshow=>$r[globalshow]));

            ?>

            <form><div align=right><input type=button value="Message loeschen" onclick="document.location='<? echo $SCRIPT_NAME ?>?delete=<? echo $edit ?>'"></div><?

            box_hr("","ffffff");

            echo "</form>";

        }

       

        $m->draw();

        box_end();

 

    } // if $msg

?>

   

   

<? col_one_end(); ?>

 

<? //include_once ("../start/right.php"); ?>

<P>

</body>

</html>

 

your missing the function

col_one_end();

 

or post the

connection.inc.php,

inc/design.inc.php,

widget/messages/singlemessage.inc.php

widget/messages/editmessage.inc.php

file

 

which ever one holds that function

 

remember remove any passwords before posting

in this file i am able to insert and I think the function col_one_end() works:

 

file /blackborad/edit.php:

 

<?

$RELATIVE_ROOT="../"; // must be

 

require_once ($RELATIVE_ROOT."connection.inc.php");

require_once ($RELATIVE_ROOT."inc/rights.inc.php");

 

/* Parameteruebergabe:

none: create new message

edit=id: edit message

delete=id: delete this message

 

id=create&datafields... : perform an insert

id=<number>&data....: perform an update

*/

 

if ($id || $delete) {

 

if ($delete) {

db_select("delete from blackboard where bnr=$delete");

 

} else {

db_update("blackboard","bnr",$id=="create"?-1:$id,

array(text,subject=>$title,

perskurz=>rights_get("bb_manager")&&$id!="create"?

db_singlevalue("select perskurz

from blackboard

where bnr=$id"):

$LOGIN_UID),array(bbtnr=>$bbtype),

array(created=>"sysdate"));

}

 

db_commit();

 

/* box_start();

echo " <P>Danke.</P> ";

box_end();

 

if (!$delete) {

box_start("180","Ansicht","ffffff");

   

$m=new singlebulletin($HTTP_GET_VARS,"ffffff");

$m->draw();

 

box_end();

} // if delete */

header("location: index.php?selection=".($bbtype?$bbtype:$selection));

exit();

 

} else {  //////////////// Edit teil

 

require_once ($RELATIVE_ROOT."inc/design.inc.php");

require_once ($RELATIVE_ROOT."widget/blackboard/singlebulletin.inc.php");

require_once ($RELATIVE_ROOT."widget/blackboard/editbulletin.inc.php");

?>

<html>

<head>

<title>JNJ Intranet Create BB-Message</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

 

</head>

<? col_one_start() ;

 

 

if (!$edit) {

// data: bbtype,text,subject,created,username,email

$m=new editbulletin(array(bbtype=>$selection,id=>"create",created=>db_singlevalue("select sysdate from dual")));

} else {

$res=db_select("select * from blackboard where bnr=$edit");

$r=db_row($res);

if (!$r) die ("cant fetch message with id = $edit");

$m=new editbulletin(array(id=>$r[bnr], created=>$r[created],

bbtype=>$r[bbtnr], title=>$r[subject], text=>$r[text],

username=>$r[vorname]." ".$r[nachname], email=>$r));

 

box_start("350","Aktueller Eintrag","ffffff"); ?>

<table border=0 cellspacing=0 cellpadding=0 width=100%>

<TR><TD align=left><form><div class=text>Bitte

löschen Sie inaktuelle Einträge wieder</div></TD>

<TD><input type=button value="Eintrag löschen" onclick="document.location='<? echo $SCRIPT_NAME ?>?delete=<? echo $edit ?>'"></TD>

</TR></table><?

box_end();

echo "</form>";

}

 

box_start("350",$edit?"Editieren":"Anlegen","ffffff");

$m->width=350;

$m->draw();

box_end();

 

} // if $msg

?>

 

<? col_one_end(); ?>

 

</body>

</html>

 

 

here the other files:

 

file connection.inc.php:

 

/* connection-include (fuer alle DB-Seiten)

* sample by atrox 2001

*/

 

$DB_HOST="jnjchspora03";

$DB_USER="user";

$DB_PASSWD="password";

// username + passwort changed

$DB_NAME="(DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = JNJCHSPORA03.eu.jnj.com)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = oradb)

    )

  )";

$DB_CONN=0;

$DBORA_LOWERCOL=1; // oracle: spaltennamen in kleinbuchstaben

 

include_once($RELATIVE_ROOT."inc/dbmisc.inc.php");

include_once($RELATIVE_ROOT."inc/dbora.inc.php");

// include($RELATIVE_ROOT."inc/dbmysql.inc.php");

 

db_open();

 

?>

 

file: inc/design.inc.php:

 

<?

// design funktionen fuer das jeweils aktuelle layout

 

echo '<link rel="stylesheet" type="text/css" href="'.$RELATIVE_ROOT.'stylesheet.css">';

 

require_once ($RELATIVE_ROOT."inc/design/misc.inc.php");

require_once ($RELATIVE_ROOT."inc/design/box.inc.php");

require_once ($RELATIVE_ROOT."inc/design/col.inc.php");

require_once ($RELATIVE_ROOT."inc/design/grid.inc.php");

 

?>

 

file widget/messages/singlemessage.inc.php:

 

<?php

/* single message

* zeichnet entweder eine kleine MEssagebox mit Anrisstext und "mehr" link, oder

* die volle Nachricht.

* Maintainer: atrox

*

*/

 

require_once ($RELATIVE_ROOT."widget/widget.inc.php");

require_once ($RELATIVE_ROOT."inc/forms.inc.php");

 

class singlemessage extends Widget

{

var $d;

var $bgcolor;

 

function singlemessage ($data,$bgcolor="")

{

$this->d = $data;

$this->bgcolor = $bgcolor;

}

 

 

function draw ($full=0,$morelink="",$editurl="",$deleteurl="")

{

$d=$this->d; $bgcolor=$this->bgcolor;

echo "<table width=".($this->width?$this->width:"100%")." xbgcolor=$bgcolor border=0 cellspacing=0 cellpadding=0>\n";

echo "<tr>";

echo "<td colspan=2 align=left bgcolor=\"cccccc\" Xclass=\"msgdiv\">";

echo "  <table cellspacing=0 cellpadding=0 border=0 width=\"100%\"><TR><td width=50 height=16> </TD><TD class=msgdiv align=left>$d[division]</TD>";

echo "  <TD class=msgdiv align=right width=100>".$d[datum]."</TD></TR></TABLE>";

echo "</TD></TR>\n";

echo "<TR><TD rowspan=3 width=70>";

pixel(70,1);

echo "</TD>";

echo "<td align=left bgcolor=\"$bgcolor\" class=\"msgtitle\" style=\"padding-top:5px\">";

echo $d[title]?$d[title]:" ";

// echo "</TD></TR>\n<TD>";

// pixel("100%",6);

echo "</TD></TR>\n<TD width=100% align=left bgcolor=\"$bgcolor\" class=\"msgtext\">";

box_spacer(5);

 

if (!$full || (!$d[text]&&$d[anrisstext])) { // volle nachricht anzeigen , oder nur anrisstext ?

echo $d[anrisstext]."</td></TR>\n";

if ($editurl || $d[text] ) {

echo "<TR><TD><table cellspacing=0 cellpadding=0 border=0 width=100%>";

if ($editurl) {

echo "<TD align=left class=msgmore valign=bottom style=\"padding-bottom:5px\">";

editbutton($editurl);

if ($deleteurl) deletebutton($deleteurl);

echo "</TD>";

}

if ($d[text]) {

echo "<td align=right bgcolor=\"$bgcolor\" class=\"msgmore\" style=\"padding-bottom:5px; padding-right:10px\">";

$morelink=$morelink?$morelink:form_selflink(array(msg=>$d[id]));

echo '<A HREF="'.$morelink.'" class=msgmore>mehr infos ></A></TD></TR>'."\n";

}

echo "</TR></TD></table>";

}

} else {

echo $d[text]."</td></TR>\n";

if ($editurl) {

echo "<TR><TD align=left class=msgmore style=\"padding-top:8px\" >";

editbutton($editurl);

if ($deleteurl) deletebutton($deleteurl);

echo "</TD>";

}

}

?></td>

</tr>

</table><?

}

}

 

?>

 

file: widget/messages/editmessage.inc.php:

 

<?php

/* edit message

* ermoeglicht das editieren einer einfachen message (derzeit noch ohne bild)

*

* Maintainer: atrox

*

*/

 

require_once ($RELATIVE_ROOT."widget/widget.inc.php");

require_once ($RELATIVE_ROOT."widget/htmledit/htmledit.inc.php");

/* require ($RELATIVE_ROOT."inc/forms.inc.php"); */

 

class editmessage extends Widget

{

var $d;

 

function editmessage ($data)

{

$this->d = $data;

}

 

 

// werte: division,datum,title,anrisstext,text,divallowed

function draw ($action="")

{

$d=$this->d; $bgcolor=$this->bgcolor;

$action=$action?$action:form_selflink();

echo "<table width=".($this->width?$this->width:"100%")." Xbgcolor=\"$bgcolor\" border=0 cellspacing=0 cellpadding=0>\n";

?><tr>

<td rowspan=4 width=15></TD>

<td align=left vlign=top><?

// form action="<xx? echo $action ?xx>" name=em onSubmit="return checkform(this);">

form_start("em",$action);

form_fieldname("Division");

?>

<select name=division size=1><DIV class=msgtext>

<? if ($divallowed) { // only this one div allowed ?>

<option value="<? echo $divallowed ?>"><? echo db_singlevalue("select divtxt from divisions where div=".db_quote($divallowed)) ?></option>

<? } else { // all divisions allowed ?>

<? $res=db_select("select * from division order by divtxt");

while ($r=db_row($res)) {

echo "<OPTION VALUE=\"$r[div]\" ".

($d[division]==$r[div]?"selected":"")

.">$r[divtxt]</option>";

}

?>

<!-- <option value="" <? echo $d[division]?"":"selected" ?>  >- CORPORATE -</A> -->

<option value="" <? echo $d[division]?"":"selected"?>

<? } //  if else divallowed ?>

</select></TD>

<td align=right valign=top><? form_fieldname("Datum");?>

<DIV style=msgtext><? echo $d[datum] ?></TD>

</TR>

<tr>

<td colspan=2 align=left><?

form_fieldname("Titel");

form_text("title",$d[title],60,100,5);

?></TD>

</TR>

<tr>

<td Xcolspan=2 align=left>

<?

form_fieldname("Anrisstext");

$h=new htmledit("em","anrisstext",60,4,$d[anrisstext]);

$h->draw();

?>

</TD>

</TR>

<tr>

<td xcolspan=2 align=left>

<?

form_fieldname("Text",false,"optional");

  $h=new htmledit("em","text",60,16,$d[text]);

  $h->draw();

  ?>

<? /* <TEXTAREA cols=30 rows=20 name=text><-rem-?

echo $d[text] ?-rem-></textarea></TD> */ ?>

</TD>

</TR>

 

<TR>

<td colspan=2 class=msgtext align=center height=25>

<? form_hiddenvalue("id",$d[id]); ?>

<? box_start(100); ?><P ALIGN=center>

<input type=submit value="Senden"></P>

<? box_end(); ?>

</TD>

</TR>

</table><? form_end();

}

}

 

?>

 

 

 

sorry for the code tags..

 

the file with the function: col.inc.php it is included in design.inc.php

 

<?php

// 09.03.01:
// hier geht es _nicht_ um _irgendwelche_ kollumnen! es geht um die zwei
// moeglichen kollumnenaufteilungen die im hauptframe moeglich sind. siehe 
// auch die layouts vom raimund! [atrox]

// 14.03.01: ich habs jetzt doch selbst gemacht, weil ansonsten kuemmert 
// sich keiner darum. [atrox]

/* design/col/design_col  (dejavu?)  .inc.php
* erledigt die einteilung der spalten für die zwei hauptlayout-formen.
* derzeit noch unimplementiert ist die version mit nur zwei spalten.
* creator: atrox
*
*/

function col_left_start($leftmargin=0,$topmargin=0) {
global $RELATIVE_ROOT;
?>
<body bgcolor="#CAE5F4" leftmargin="<? echo $leftmargin ?>"  topmargin="<? echo $topmargin ?>" xmarginwidth="0" xmarginheight="0">


<!-- <table border="0" cellpadding="0" cellspacing="0" width="150">
<tr>
	<td width="10"><img src="../img/sub_top.gif" width="150" height="10" border="0" alt=""></td>
</tr>
<tr>
	<td background="../img/sub_mid.gif">
-->
<?
} // col_left_start()

function col_left_end() {
global $RELATIVE_ROOT;
?>
</body>
</html>
<?
} // col_left_end()


function col_middle_start($bgcolor="cae5f3") {
global $RELATIVE_ROOT;
?>
<!-- middle_col_  -->
<body bgcolor="cae5f3" leftmargin="0" topmargin="0" Xmarginwidth="0" Xmarginheight="0">
<table Xwidth="550" Xwidth="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
       <td width="100%" valign="top" bgcolor="<? echo $bgcolor ?>" class=text>
<?
} // col middle start

function col_middle_end() {
global $RELATIVE_ROOT;
?>
</TD> <!-- ende mitte -->
<?
} // col_middle_end()


function col_right_start() {
global $RELATIVE_ROOT;
?>
   <td width="5"><? pixel(5,10); ?></td>
   <td width="140" valign="top" background=""> <!-- rechts -->
<?	
} // col_right_start()


function col_right_end() {
global $RELATIVE_ROOT;
?>
<? pixel(140,1); ?></TD>
<td width="5"><? pixel(5,10); ?></td>
</TR>
</TABLE>
<?	
} // col_right_end()


// -----------------

function col_one_start($bgcolor="cae5f3") {
global $RELATIVE_ROOT;
?>
<!-- middle_col_  -->
<body  bgcolor="cae5f3" leftmargin="0" topmargin="0" marginwidth="5" marginheight="0">
<div class=text>
<?
} // col one start

function col_one_end() {
global $RELATIVE_ROOT;
?>
</DIV>
</BODY>
</HTML>
<?
} // col_one_end()

 

design.inc.php:

 

<? 
// design funktionen fuer das jeweils aktuelle layout

echo '<link rel="stylesheet" type="text/css" href="'.$RELATIVE_ROOT.'stylesheet.css">';

require_once ($RELATIVE_ROOT."inc/design/misc.inc.php");
require_once ($RELATIVE_ROOT."inc/design/box.inc.php");
require_once ($RELATIVE_ROOT."inc/design/col.inc.php");
require_once ($RELATIVE_ROOT."inc/design/grid.inc.php");

?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.