28require
'../../main.inc.php';
36$table =
GETPOST(
'table',
'alpha');
50if (preg_match(
'/mysql/i', $conf->db->type)) {
51 $sql =
"SHOW TABLE STATUS LIKE '".$db->escape($table).
"'";
53} elseif ($conf->db->type ==
'pgsql') {
54 $sql =
"SELECT conname,contype FROM pg_constraint";
59 print $langs->trans(
"FeatureNotAvailableWithThisDatabaseDriver");
61 $resql = $db->query($sql);
63 $num = $db->num_rows($resql);
66 $row = $db->fetch_row($resql);
73 $cons = explode(
";", $row[14]);
75 foreach ($cons as $cc) {
76 $cx = preg_replace(
"/\)\sREFER/",
"", $cc);
77 $cx = preg_replace(
"/\(`/",
"", $cx);
78 $cx = preg_replace(
"/`\)/",
"", $cx);
79 $cx = preg_replace(
"/`\s/",
"", $cx);
81 $val = explode(
"`", $cx);
83 $link[trim($val[0])][0] = (isset($val[1]) ? $val[1] :
'');
84 $link[trim($val[0])][1] = (isset($val[2]) ? $val[2] :
'');
90 print
'<table class="noborder">';
91 print
'<tr class="liste_titre">';
92 print
'<td>'.$langs->trans(
"Fields").
'</td><td>'.$langs->trans(
"Type").
'</td><td>'.$langs->trans(
"Index").
'</td>';
97 print
'<td>'.$langs->trans(
"FieldsLinked").
'</td>';
101 $sql =
"SHOW FULL COLUMNS IN ".$db->escape($table);
103 $resql = $db->query($sql);
105 $num = $db->num_rows($resql);
108 $row = $db->fetch_row($resql);
109 print
'<tr class="oddeven">';
110 print
"<td>".$row[0].
"</td>";
111 print
"<td>".$row[1].
"</td>";
112 print
"<td>".$row[3].
"</td>";
113 print
"<td>".(empty($row[4]) ?
'' : $row[4]).
"</td>";
114 print
"<td>".(empty($row[5]) ?
'' : $row[5]).
"</td>";
115 print
"<td>".(empty($row[6]) ?
'' : $row[6]).
"</td>";
116 print
"<td>".(empty($row[7]) ?
'' : $row[7]).
"</td>";
118 print
"<td>".(isset($link[$row[0]][0]) ? $link[$row[0]][0] :
'').
".";
119 print (isset($link[$row[0]][1]) ? $link[$row[0]][1] :
'').
"</td>";
121 print
'<!-- ALTER ALTER TABLE '.$table.
' MODIFY '.$row[0].
' '.$row[1].
' COLLATE utf8_unicode_ci; -->';
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.