00001 <?php
00002
00003 include('../include/init/init.php');
00004
00005
00006 $PgDbConn=pg_connect(
00007 "dbname=".$CONFIG["DB"]['DBNAME'].
00008 " user=".$CONFIG["DB"]['USER'].
00009 " password=".$CONFIG["DB"]['PASSWORD'].
00010 " host=".$CONFIG["DB"]['HOST']
00011 )
00012 or die("Can't connect!");
00013
00014
00015
00016 $table = new Pgtable($PgDbConn, "../conf/pgtbconf.ini");
00017
00018
00019
00020 list($tbSchema, $tbName, $tbPkey)=$table->get_table();
00021
00022
00023 $table->add_table($tbSchema, $tbName, $tbPkey);
00024
00025
00026
00027 switch($tbName){
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 }
00042
00043
00044
00045 $pg_table=$table->switch_actions($tbSchema, $tbName, $tbPkey);
00046
00047
00048
00049 $errors=$table->errors->get();
00050 if($errors)
00051 $errors=array_to_html($errors,0,0);
00052
00053 $messages=$table->messages->get();
00054 if($messages)
00055 $messages=array_to_html($messages,0,0);
00056
00057 $title='Table '.$tbName;
00058
00059 ?>
00060 <html>
00061
00062 <head>
00063 <link rel="stylesheet" type="text/css" href="/css/main.css" />
00064 <title>phpPgWeb: <?=$title?></title>
00065 </head>
00066
00067 <body>
00068 <div id="navigation">
00069 <p class="centrato"><a href="/" title="Home"><h1>phpPgWeb</h1></a></p>
00070 </div>
00071
00072 <p class="titolo"><?=$title?></p>
00073
00074 <form name="pgform" method="POST" enctype="multipart/form-data" action="<?=$_SERVER["PHP_SELF"]?>">
00075
00076 <div id="tbform">
00077 <?=$errors?(" <div id=\"error\">\n".$errors." </div><hr>\n"):'';?>
00078 <?=$messages?(" <div id=\"alert\">\n".$messages." </div><hr>\n"):'';?>
00079 <?=$pg_table["search_bar"]?($pg_table["search_bar"].'<br>'):'';?></p>
00080 <p><table>
00081 <?=$pg_table["table"]?>
00082 </table>
00083 </p>
00084 <br>
00085 <p><?=$pg_table["text"]?><hr><?=$pg_table["submit"]?></p>
00086 </div>
00087
00088 </form>
00089
00090 </body>
00091 </html>