27 require
'../../main.inc.php';
29 $langs->load(
"admin");
35 $action =
GETPOST(
'action',
'aZ09');
38 if ($action ==
'convert')
40 $sql =
"ALTER TABLE ".$db->escape(
GETPOST(
"table",
"aZ09")).
" ENGINE=INNODB";
43 if ($action ==
'convertutf8')
45 $sql =
"ALTER TABLE ".$db->escape(
GETPOST(
"table",
"aZ09")).
" CHARACTER SET utf8 COLLATE utf8_unicode_ci";
48 if ($action ==
'convertdynamic')
50 $sql =
"ALTER TABLE ".$db->escape(
GETPOST(
"table",
"aZ09")).
" ROW_FORMAT=DYNAMIC;";
66 if (preg_match(
'/mysql/i', $conf->db->type))
68 $sql =
"SHOW TABLE STATUS";
70 } elseif ($conf->db->type ==
'pgsql')
72 $sql =
"SELECT conname, contype FROM pg_constraint;";
74 } elseif ($conf->db->type ==
'mssql')
78 } elseif ($conf->db->type ==
'sqlite' || $conf->db->type ==
'sqlite3')
87 print $langs->trans(
"FeatureNotAvailableWithThisDatabaseDriver");
91 print '<div class="div-table-responsive-no-min">';
92 print '<table class="noborder">';
93 print '<tr class="liste_titre">';
94 print '<td>'.$langs->trans(
"TableName").
'</td>';
95 print '<td colspan="2">'.$langs->trans(
"Type").
'</td>';
96 print '<td>'.$langs->trans(
"Format").
'</td>';
97 print '<td class="right">'.$langs->trans(
"NbOfRecord").
'</td>';
98 print '<td class="right">Avg_row_length</td>';
99 print '<td class="right">Data_length</td>';
100 print '<td class="right">Max_Data_length</td>';
101 print '<td class="right">Index_length</td>';
102 print '<td class="right">Increment</td>';
103 print '<td class="right">Last check</td>';
104 print '<td class="right">Collation</td>';
107 $sql =
"SHOW TABLE STATUS";
109 $resql = $db->query($sql);
112 $num = $db->num_rows(
$resql);
116 $obj = $db->fetch_object(
$resql);
117 print '<tr class="oddeven">';
119 print '<td><a href="dbtable.php?table='.$obj->Name.
'">'.$obj->Name.
'</a></td>';
120 print '<td>'.$obj->Engine.
'</td>';
121 if (isset($obj->Engine) && $obj->Engine ==
"MyISAM") {
122 print '<td><a class="reposition" href="database-tables.php?action=convert&table='.$obj->Name.
'">'.$langs->trans(
"Convert").
' InnoDb</a></td>';
124 print '<td> </td>';
127 print $obj->Row_format;
128 if (isset($obj->Row_format) && (in_array($obj->Row_format, array(
"Compact")))) {
129 print '<br><a class="reposition" href="database-tables.php?action=convertdynamic&table='.$obj->Name.
'">'.$langs->trans(
"Convert").
' Dynamic</a>';
132 print '<td align="right">'.$obj->Rows.
'</td>';
133 print '<td align="right">'.$obj->Avg_row_length.
'</td>';
134 print '<td align="right">'.$obj->Data_length.
'</td>';
135 print '<td align="right">'.$obj->Max_data_length.
'</td>';
136 print '<td align="right">'.$obj->Index_length.
'</td>';
137 print '<td align="right">'.$obj->Auto_increment.
'</td>';
138 print '<td align="right">'.$obj->Check_time.
'</td>';
139 print '<td align="right">'.$obj->Collation;
140 if (isset($obj->Collation) && (in_array($obj->Collation, array(
"utf8mb4_general_ci",
"utf8mb4_unicode_ci",
"latin1_swedish_ci")))) {
141 print '<br><a class="reposition" href="database-tables.php?action=convertutf8&table='.$obj->Name.
'">'.$langs->trans(
"Convert").
' UTF8</a>';
154 print '<div class="div-table-responsive-no-min">';
155 print '<table class="noborder">';
156 print '<tr class="liste_titre">';
157 print '<td>'.$langs->trans(
"TableName").
'</td>';
158 print '<td>Nb of tuples</td>';
159 print '<td>Nb index fetcher.</td>';
160 print '<td>Nb tuples insert</td>';
161 print '<td>Nb tuples modify</td>';
162 print '<td>Nb tuples delete</td>';
165 $sql =
"SELECT relname, seq_tup_read, idx_tup_fetch, n_tup_ins, n_tup_upd, n_tup_del";
166 $sql .=
" FROM pg_stat_user_tables";
168 $resql = $db->query($sql);
171 $num = $db->num_rows(
$resql);
175 $row = $db->fetch_row(
$resql);
176 print '<tr class="oddeven">';
177 print '<td>'.$row[0].
'</td>';
178 print '<td class="right">'.$row[1].
'</td>';
179 print '<td class="right">'.$row[2].
'</td>';
180 print '<td class="right">'.$row[3].
'</td>';
181 print '<td class="right">'.$row[4].
'</td>';
182 print '<td class="right">'.$row[5].
'</td>';
194 print '<div class="div-table-responsive-no-min">';
195 print '<table class="noborder">';
196 print '<tr class="liste_titre">';
197 print '<td>'.$langs->trans(
"TableName").
'</td>';
198 print '<td>'.$langs->trans(
"NbOfRecord").
'</td>';
201 $sql =
"SELECT name, type FROM sqlite_master where type='table' and name not like 'sqlite%' ORDER BY name";
202 $resql = $db->query($sql);
206 while ($row = $db->fetch_row(
$resql)) {
207 $rescount = $db->query(
"SELECT COUNT(*) FROM ".$row[0]);
209 $row_count = $db->fetch_row($rescount);
210 $count = $row_count[0];
215 print '<tr class="oddeven">';
216 print '<td>'.$row[0].
'</td>';
217 print '<td>'.$count.
'</td>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print
Draft customers invoices.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.