2013-06-30 22:11:25 +02:00
< ? php
2015-03-22 21:18:25 +01:00
//define("NOLOGIN",1); // This means this output page does not require to be logged.
2021-02-19 15:06:36 +01:00
//if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
//if (!defined('NOREQUIREDB')) define('NOREQUIREDB', '1');
2021-02-26 18:58:34 +01:00
if ( ! defined ( 'NOREQUIRESOC' )) {
define ( 'NOREQUIRESOC' , '1' );
}
2021-02-19 15:06:36 +01:00
//if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
2021-02-26 18:58:34 +01:00
if ( ! defined ( 'NOSTYLECHECK' )) {
define ( 'NOSTYLECHECK' , '1' ); // Do not check style html tag into posted data
}
if ( ! defined ( 'NOCSRFCHECK' )) {
define ( 'NOCSRFCHECK' , '1' ); // Do not check anti CSRF attack test
}
if ( ! defined ( 'NOTOKENRENEWAL' )) {
define ( 'NOTOKENRENEWAL' , '1' ); // Do not check anti POST attack test
}
2021-02-19 15:06:36 +01:00
//if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
//if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
//if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
2021-02-26 18:58:34 +01:00
if ( ! defined ( " NOLOGIN " )) {
define ( " NOLOGIN " , '1' ); // If this page is public (can be called outside logged session)
}
2013-06-30 22:11:25 +02:00
require '../../main.inc.php' ;
2015-01-14 19:10:48 +01:00
2021-11-24 20:53:17 +01:00
// Security
2015-05-07 10:32:20 +02:00
if ( $dolibarr_main_prod ) {
2021-12-06 12:12:04 +01:00
accessforbidden ( 'Access forbidden when $dolibarr_main_prod is set to 1' );
2013-06-30 22:11:25 +02:00
}
2015-01-14 19:10:48 +01:00
2014-07-27 20:31:11 +02:00
2015-05-17 19:37:37 +02:00
2021-11-24 20:53:17 +01:00
/*
* View
*/
2015-05-17 19:37:37 +02:00
2021-11-24 20:53:17 +01:00
$form = new Form ( $db );
2015-05-17 19:37:37 +02:00
2021-11-24 20:53:17 +01:00
$usedolheader = 1 ; // 1 = Test inside a dolibarr page, 0 = Use hard coded header
2013-10-21 13:43:31 +02:00
2014-07-27 20:31:11 +02:00
// HEADER
//--------
2021-02-26 18:58:34 +01:00
if ( empty ( $usedolheader )) {
2014-07-27 20:31:11 +02:00
header ( " Content-type: text/html; charset=UTF8 " );
2022-07-11 20:18:03 +02:00
// Security options
header ( " X-Content-Type-Options: nosniff " ); // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on)
header ( " X-Frame-Options: SAMEORIGIN " ); // Frames allowed only if on same domain (stop some XSS attacks)
2015-03-22 21:18:25 +01:00
?>
<! DOCTYPE HTML PUBLIC " -//W3C//DTD HTML 4.01 Transitional//EN " " http://www.w3.org/TR/html4/loose.dtd " >
< html >
< head >
< meta name = " robots " content = " noindex,nofollow " />
< meta name = " author " content = " Dolibarr Development Team " >
< title > Test page </ title >
<!-- Includes for JQuery ( Ajax library ) -->
2017-12-20 20:18:41 +01:00
< link rel = " stylesheet " type = " text/css " href = " <?php echo DOL_URL_ROOT ?>/includes/jquery/css/base/jquery-ui.css " />
2016-11-08 15:55:44 +01:00
<!-- < link rel = " stylesheet " type = " text/css " href = " <?php echo DOL_URL_ROOT ?>/includes/jquery/plugins/datatables/media/css/jquery.dataTables.css " /> -->
2020-04-10 10:59:32 +02:00
< link rel = " stylesheet " type = " text/css " title = " default " href = " <?php echo DOL_URL_ROOT ?>/theme/eldy/style.css.php<?php echo ( $_GET["dol_use_jmobile"] == 1) ? '?dol_use_jmobile=1&dol_optimize_smallscreen=1' : ''; ?> " />
2015-03-22 21:18:25 +01:00
<!-- Includes JS for JQuery -->
2015-07-06 16:48:10 +02:00
< script type = " text/javascript " src = " <?php echo DOL_URL_ROOT ?>/includes/jquery/js/jquery.min.js " ></ script >
2017-03-29 11:18:03 +02:00
<!-- migration fixes for removed Jquery functions -->
< script type = " text/javascript " src = " <?php echo DOL_URL_ROOT ?>/includes/jquery/js/jquery-migrate.min.js " ></ script >
2015-03-22 21:18:25 +01:00
< script type = " text/javascript " src = " <?php echo DOL_URL_ROOT ?>/includes/jquery/plugins/tablednd/jquery.tablednd.0.6.min.js " ></ script >
2016-11-08 15:55:44 +01:00
<!-- < script type = " text/javascript " src = " <?php echo DOL_URL_ROOT ?>/includes/jquery/plugins/datatables/media/js/jquery.dataTables.js " ></ script > -->
2016-06-09 01:33:26 +02:00
< script type = " text/javascript " src = " <?php echo DOL_URL_ROOT ?>/includes/jquery/plugins/select2/select2.min.js?version=4.0.0-beta " ></ script >
2015-03-22 21:18:25 +01:00
</ head >
< body style = " padding: 10px; " >
< ? php
2020-05-21 15:05:19 +02:00
} else {
2020-04-10 10:59:32 +02:00
$arraycss = array ();
$arrayjs = array ();
2020-03-23 15:54:02 +01:00
/*
2016-11-08 15:55:44 +01:00
$arraycss = array ( '/includes/jquery/plugins/datatables/media/css/jquery.dataTables.css' ,
'/includes/jquery/plugins/datatables/extensions/Buttons/css/buttons.dataTables.min.css' ,
'/includes/jquery/plugins/datatables/extensions/ColReorder/css/colReorder.dataTables.min.css'
);
$arrayjs = array ( '/includes/jquery/plugins/datatables/media/js/jquery.dataTables.js' ,
'/includes/jquery/plugins/datatables/extensions/Buttons/js/dataTables.buttons.js' ,
'/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.colVis.min.js' ,
'/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.html5.min.js' ,
'/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.flash.min.js' ,
'/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.print.min.js' ,
'/includes/jquery/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.min.js' ,
'/includes/jszip/jszip.min.js' ,
'/includes/pdfmake/pdfmake.min.js' ,
'/includes/pdfmake/vfs_fonts.js'
);
2021-02-26 18:58:34 +01:00
*/
2017-07-30 20:43:18 +02:00
2019-01-27 11:55:16 +01:00
llxHeader ( '' , '' , '' , '' , 0 , 0 , $arrayjs , $arraycss );
2014-07-27 20:31:11 +02:00
}
// CONTENT
//---------
?>
2016-10-05 00:35:32 +02:00
< h2 >
2014-11-15 00:57:31 +01:00
This page is a sample of page using tables . It is designed to make test with < br >
2021-02-19 15:37:42 +01:00
</ h2 >
< div class = " wordbreak " >
2015-12-15 09:32:09 +01:00
- css ( add parameter & amp ; theme = newtheme to test another theme or edit css of current theme ) < br >
2016-11-08 15:55:44 +01:00
- jmobile ( add parameter < a href = " <?php echo $_SERVER["PHP_SELF"] .'?dol_use_jmobile=1&dol_optimize_smallscreen=1'; ?> " > dol_use_jmobile = 1 & amp ; dol_optimize_smallscreen = 1 </ a > and switch to small screen < 570 to enable with emulated jmobile ) < br >
2015-05-22 14:28:02 +02:00
- no javascript / usage for bind people ( add parameter < a href = " <?php echo $_SERVER["PHP_SELF"] .'?nojs=1'; ?> " > nojs = 1 </ a > to force disable javascript ) < br >
2013-10-21 13:43:31 +02:00
- tablednd < br >
2021-02-19 15:37:42 +01:00
</ div >
2013-10-17 18:37:08 +02:00
2014-07-27 20:31:11 +02:00
2016-06-09 01:33:26 +02:00
< br >< hr >< br > Example 0 a : Table with div + div + div containg a select that should be overflowed and truncated => Use this to align text or form < br >
2014-07-27 20:31:11 +02:00
2013-12-02 22:31:02 +01:00
< div class = " tagtable centpercent " >
< div class = " tagtr " >
2014-11-15 00:57:31 +01:00
< div class = " tagtd maxwidthonsmartphone " style = " overflow: hidden; white-space: nowrap; " > <!-- If you remove max - width , the jmobile overflow does not work -->
2016-11-08 15:55:44 +01:00
< select name = " hidedetails " class = " centpercentonsmartphone " >< option > aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa </ option >< option > gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd </ option ></ select >
2013-12-02 22:31:02 +01:00
</ div >
2014-11-15 00:57:31 +01:00
< div class = " tagtd maxwidthonsmartphone " style = " overflow: hidden; white-space: nowrap; " > <!-- If you remove max - width , the jmobile overflow does not work -->
2016-11-08 15:55:44 +01:00
< select name = " hidedetails " class = " centpercentonsmartphone " >< option > aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa </ option >< option > gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd </ option ></ select >
2013-12-02 22:31:02 +01:00
</ div >
</ div >
</ div >
2014-07-27 20:31:11 +02:00
< br >< hr >< br > Example 0 b : Table with div + form + div containg a select that should be overflowed and truncated => Use this to align text or form < br >
2013-12-02 22:31:02 +01:00
< div class = " tagtable centpercent " >
< form action = " xxx " method = " POST " class = " tagtr " >
2014-04-22 00:04:31 +02:00
< div class = " tagtd maxwidthonsmartphone " style = " overflow: hidden; white-space: nowrap; " > <!-- If you remove max - width , the jmobile overflow does not work -->
2016-11-08 15:55:44 +01:00
< select name = " hidedetails " class = " centpercentonsmartphone " >< option > aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa </ option >< option > gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd </ option ></ select >
2013-12-02 22:31:02 +01:00
</ div >
2014-11-15 00:57:31 +01:00
< div class = " tagtd maxwidthonsmartphone " style = " overflow: hidden; white-space: nowrap; " > <!-- If you remove max - width , the jmobile overflow does not work -->
2016-11-08 15:55:44 +01:00
< select name = " hidedetails " class = " centpercentonsmartphone " >< option > aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa </ option >< option > gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd </ option ></ select >
2013-12-02 22:31:02 +01:00
</ div >
</ form >
</ div >
2014-07-27 20:31:11 +02:00
< br >< hr >< br > Example 0 c : Table with table + tr + td containg a select that should be overflowed and truncated => Use this to align text or form < br >
2013-12-02 22:31:02 +01:00
< table class = " centpercent " >
2021-02-26 18:58:34 +01:00
< tr >
< td class = " tagtd maxwidthonsmartphone " style = " overflow: hidden; white-space: nowrap; " > <!-- If you remove max - width , the jmobile overflow does not work -->
2016-11-08 15:55:44 +01:00
< select name = " hidedetails " class = " centpercentonsmartphone " >< option > aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa </ option >< option > gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd </ option ></ select >
2021-02-26 18:58:34 +01:00
</ td >
< td class = " tagtd maxwidthonsmartphone " style = " overflow: hidden; white-space: nowrap; " > <!-- If you remove max - width , the jmobile overflow does not work -->
2016-11-08 15:55:44 +01:00
< select name = " hidedetails " class = " centpercentonsmartphone " >< option > aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa </ option >< option > gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd </ option ></ select >
2021-02-26 18:58:34 +01:00
</ td >
</ tr >
2013-10-26 21:17:18 +02:00
</ table >
2014-07-27 20:31:11 +02:00
2015-05-17 18:34:52 +02:00
< br >< hr >< br > Example 1 : Standard table / thead / tbody / tr / th - td ( no class pair / impair on td ) => Use this if you need the drag and drop for lines or for long result tables < br >
2015-03-22 21:26:13 +01:00
2017-07-30 20:43:18 +02:00
2021-11-29 15:09:18 +01:00
< script type = " text/javascript " >
2016-06-09 01:33:26 +02:00
/* jQuery ( document ) . ready ( function () {
$ ( document ) . ready ( function () {
2021-02-26 18:58:34 +01:00
var table = $ ( '#tablelines3' ) . DataTable ( {
scrollY : " 300px " ,
scrollX : true ,
scrollCollapse : true ,
paging : false ,
fixedColumns : {
leftColumns : 1 ,
rightColumns : 1
}
} );
2016-06-09 01:33:26 +02:00
} );
}); */
</ script >
2017-07-30 20:43:18 +02:00
2013-10-26 21:17:18 +02:00
< ? php
2015-05-03 20:07:16 +02:00
include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php' ;
2020-04-10 10:59:32 +02:00
$productspecimen = new Product ( $db );
2015-05-03 20:07:16 +02:00
$productspecimen -> initAsSpecimen ();
2021-02-19 15:06:36 +01:00
$object = $productspecimen ;
2015-05-03 20:07:16 +02:00
2020-04-10 10:59:32 +02:00
$sortfield = 'aaa' ;
$sortorder = 'ASC' ;
$tasksarray = array ( 1 , 2 , 3 ); // To force having several lines
$tagidfortablednd = 'tablelines3' ;
2021-02-26 18:58:34 +01:00
if ( ! empty ( $conf -> use_javascript_ajax )) {
include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php' ;
}
2020-04-10 10:59:32 +02:00
$nav = '' ;
2021-12-11 13:17:31 +01:00
$nav .= '<form name="dateselect" action="' . $_SERVER [ " PHP_SELF " ] . '?mode=show_peruser' . $param . '">' ;
2021-02-26 18:58:34 +01:00
if ( $actioncode || GETPOSTISSET ( 'actioncode' )) {
$nav .= '<input type="hidden" name="actioncode" value="' . $actioncode . '">' ;
}
if ( $status || GETPOSTISSET ( 'status' )) {
$nav .= '<input type="hidden" name="status" value="' . $status . '">' ;
}
if ( $filter ) {
$nav .= '<input type="hidden" name="filter" value="' . $filter . '">' ;
}
if ( $filtert ) {
$nav .= '<input type="hidden" name="filtert" value="' . $filtert . '">' ;
}
if ( $socid ) {
$nav .= '<input type="hidden" name="socid" value="' . $socid . '">' ;
}
if ( $showbirthday ) {
$nav .= '<input type="hidden" name="showbirthday" value="1">' ;
}
if ( $pid ) {
$nav .= '<input type="hidden" name="projectid" value="' . $pid . '">' ;
}
if ( $type ) {
$nav .= '<input type="hidden" name="type" value="' . $type . '">' ;
}
if ( $usergroup ) {
$nav .= '<input type="hidden" name="usergroup" value="' . $usergroup . '">' ;
}
2020-04-10 10:59:32 +02:00
$nav .= $form -> selectDate ( $dateselect , 'dateselect' , 0 , 0 , 1 , '' , 1 , 0 );
$nav .= ' <input type="submit" name="submitdateselect" class="button" value="' . $langs -> trans ( " Refresh " ) . '">' ;
$nav .= '</form>' ;
$limit = 10 ;
2021-02-19 15:37:42 +01:00
print_barre_liste ( 'Title of my list' , 12 , $_SERVER [ " PHP_SELF " ], '' , '' , '' , 'Text in middle' , 20 , 500 , '' , 0 , $nav , '' , $limit , 0 , 0 , 1 );
2015-10-09 12:30:16 +02:00
2020-04-10 10:59:32 +02:00
$moreforfilter .= '<div class="divsearchfield">' ;
2021-02-19 15:37:42 +01:00
$moreforfilter .= $langs -> trans ( 'This is a select list for a filter A (no combo forced)' ) . ': ' ;
2020-04-10 10:59:32 +02:00
$cate_arbo = array ( 'field1' => 'value1a into the select list A' , 'field2' => 'value2a' );
2021-02-19 15:37:42 +01:00
$moreforfilter .= $form -> selectarray ( 'search_aaa' , $cate_arbo , '' , 1 , 0 , 0 , '' , 0 , 0 , 0 , '' , 'maxwidth300' , 0 ); // List with no js combo
2020-04-10 10:59:32 +02:00
$moreforfilter .= '</div>' ;
2015-06-08 15:07:37 +02:00
2020-04-10 10:59:32 +02:00
$moreforfilter .= '<div class="divsearchfield">' ;
2021-02-19 15:37:42 +01:00
$moreforfilter .= $langs -> trans ( 'This is a select list for a filter B (auto combo)' ) . ': ' ;
2020-04-10 10:59:32 +02:00
$cate_arbo = array ( 'field1' => 'value1b into the select list B' , 'field2' => 'value2b' );
2021-02-19 15:37:42 +01:00
$moreforfilter .= $form -> selectarray ( 'search_bbb' , $cate_arbo , '' , 1 , 0 , 0 , '' , 0 , 0 , 0 , '' , 'maxwidth300' , - 1 ); // List with js combo auto
2020-04-10 10:59:32 +02:00
$moreforfilter .= '</div>' ;
2015-06-08 15:07:37 +02:00
2020-04-10 10:59:32 +02:00
$moreforfilter .= '<div class="divsearchfield">' ;
2021-02-19 15:37:42 +01:00
$moreforfilter .= $langs -> trans ( 'This is a select list for a filter C (combo forced)' ) . ': ' ;
2020-04-10 10:59:32 +02:00
$cate_arbo = array ( 'field1' => 'value1c into the select list C' , 'field2' => 'value2c' );
2021-02-19 15:37:42 +01:00
$moreforfilter .= $form -> selectarray ( 'search_ccc' , $cate_arbo , '' , 1 , 0 , 0 , '' , 0 , 0 , 0 , '' , 'maxwidth300' , 1 ); // List with js combo forced
2020-04-10 10:59:32 +02:00
$moreforfilter .= '</div>' ;
2015-06-08 15:07:37 +02:00
2020-04-10 10:59:32 +02:00
$moreforfilter .= '<div class="divsearchfield">' ;
2021-02-19 15:37:42 +01:00
$moreforfilter .= $langs -> trans ( 'This is a select list for a filter D (combo forced)' ) . ': ' ;
2020-04-10 10:59:32 +02:00
$cate_arbo = array ( 'field1' => 'value1d into the select list D' , 'field2' => 'value2d' );
2021-02-19 15:37:42 +01:00
$moreforfilter .= $form -> selectarray ( 'search_ddd' , $cate_arbo , '' , 1 , 0 , 0 , '' , 0 , 0 , 0 , '' , 'maxwidth300' , 1 ); // List with js combo forced
2020-04-10 10:59:32 +02:00
$moreforfilter .= '</div>' ;
2015-06-08 15:07:37 +02:00
2021-02-26 18:58:34 +01:00
if ( ! empty ( $moreforfilter )) {
2020-03-23 15:54:02 +01:00
print '<div class="liste_titre liste_titre_bydiv centpercent">' ;
print $moreforfilter ;
2020-04-10 10:59:32 +02:00
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'printFieldPreListTitle' , $parameters ); // Note that $action and $object may have been modified by hook
2020-03-23 15:54:02 +01:00
print $hookmanager -> resPrint ;
print '</div>' ;
2015-06-08 15:07:37 +02:00
}
2015-10-09 12:30:16 +02:00
2015-06-08 15:07:37 +02:00
?>
2017-07-30 20:43:18 +02:00
2020-04-10 10:59:32 +02:00
< table class = " stripe row-border order-column centpercent tagtable liste<?php echo $moreforfilter ? " listwithfilterbefore " : " " ; ?> " id = " tablelines3 " >
2016-06-09 01:33:26 +02:00
< thead >
2015-03-22 21:26:13 +01:00
< tr class = " liste_titre " >
2019-01-27 11:55:16 +01:00
< ? php print getTitleFieldOfList ( $langs -> trans ( 'title1' ), 0 , $_SERVER [ " PHP_SELF " ], 'aaa' , '' , '' , 'align="left"' , $sortfield , $sortorder ); ?>
2021-02-19 15:06:36 +01:00
< ? php print getTitleFieldOfList ( $langs -> trans ( 'title2' ), 0 , $_SERVER [ " PHP_SELF " ], 'bbb' , '' , '' , 'align="center"' , $sortfield , $sortorder ); ?>
< ? php print getTitleFieldOfList ( $langs -> trans ( 'title3' ), 0 , $_SERVER [ " PHP_SELF " ], 'ccc' , '' , '' , 'align="right"' , $sortfield , $sortorder ); ?>
2015-03-22 21:26:13 +01:00
</ tr >
2016-06-09 01:33:26 +02:00
</ thead >
< tbody >
2021-02-19 15:06:36 +01:00
< tr class = " pair " >< td >< ? php echo $productspecimen -> getNomUrl ( 1 ); ?> </td><td class="center">b1</td><td class="tdlineupdown right">c1</td></tr>
< tr class = " impair nowrap " >< td > a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 </ td >< td align = " center " > b2 </ td >< td class = " tdlineupdown right " > c2 </ td ></ tr >
< tr class = " pair " >< td > a3 </ td >< td class = " center " > b3 </ td >< td class = " tdlineupdown right " > c3 </ td ></ tr >
2016-06-09 01:33:26 +02:00
</ tbody >
2015-12-15 09:32:09 +01:00
</ table >
2016-06-09 01:33:26 +02:00
2015-03-22 21:26:13 +01:00
< br >
2013-06-30 22:11:25 +02:00
2017-07-30 20:43:18 +02:00
<!--
2016-11-26 12:21:50 +01:00
< br >< hr >< br > Example 1 b : Table using tags : table / thead / tbody / tr / th - td + dataTable => Use this for short result tables < br >
2013-06-30 22:11:25 +02:00
< script type = " text/javascript " >
$ ( document ) . ready ( function (){
2021-02-26 18:58:34 +01:00
$ ( '#idtableexample2' ) . dataTable ( {
< ? php
2020-04-10 10:59:32 +02:00
if ( $optioncss == 'print' ) {
2021-02-26 18:58:34 +01:00
print '\'dom\': \'lfrtip\',' ;
2020-03-23 15:54:02 +01:00
} else {
print '\'dom\': \'Blfrtip\',' ;
}
?>
2021-02-26 18:58:34 +01:00
" colReorder " : true ,
2016-03-15 11:57:53 +01:00
'buttons' : [
2021-02-26 18:58:34 +01:00
'colvis' , 'copy' , 'csv' , 'excel' , 'pdf' , 'print'
],
2014-07-27 20:31:11 +02:00
" sPaginationType " : " full_numbers " ,
2016-03-15 11:57:53 +01:00
" lengthMenu " : [[ 10 , 25 , 50 , 100 , - 1 ], [ 10 , 25 , 50 , 100 , " <?php echo $langs->trans ('All'); ?> " ]],
2014-07-27 20:31:11 +02:00
" oLanguage " : {
2016-03-15 11:57:53 +01:00
" sLengthMenu " : " <?php echo $langs->trans ('Show'); ?> _MENU_ <?php echo $langs->trans ('Entries'); ?> " ,
" sSearch " : " <?php echo $langs->trans ('Search'); ?>: " ,
" sZeroRecords " : " <?php echo $langs->trans ('NoRecordsToDisplay'); ?> " ,
" sInfoEmpty " : " <?php echo $langs->trans ('NoEntriesToShow'); ?> " ,
" sInfoFiltered " : " (<?php echo $langs->trans ('FilteredFrom'); ?> _MAX_ <?php echo $langs->trans ('TotalEntries'); ?>) " ,
" sInfo " : " <?php echo $langs->trans ('Showing'); ?> _START_ <?php echo $langs->trans ('To'); ?> _END_ <?php echo $langs->trans ('WTOf'); ?> _TOTAL_ <?php echo $langs->trans ('Entries'); ?> " ,
2014-07-27 20:31:11 +02:00
" oPaginate " : {
2016-03-15 11:57:53 +01:00
" sFirst " : " <?php echo $langs->transnoentities ('First'); ?> " ,
" sLast " : " <?php echo $langs->transnoentities ('Last'); ?> " ,
" sPrevious " : " <?php echo $langs->transnoentities ('Previous'); ?> " ,
" sNext " : " <?php echo $langs->transnoentities ('Next'); ?> "
2014-07-27 20:31:11 +02:00
}
},
" aaSorting " : [[ 0 , 'desc' ]],
/* To use in ajax mode
2016-03-15 11:57:53 +01:00
" bProcessing " : true ,
" stateSave " : true ,
2014-07-27 20:31:11 +02:00
" bServerSide " : true ,
2016-03-15 11:57:53 +01:00
" sAjaxSource " : " ../ajax.php " ,
" aoColumnDefs " : [
2021-02-26 18:58:34 +01:00
{ " bSortable " : false , " aTargets " : [ 2 , 3 , 4 ] }
],
2014-07-27 20:31:11 +02:00
*/
2021-02-26 18:58:34 +01:00
})
2013-06-30 22:11:25 +02:00
});
</ script >
2016-11-26 12:21:50 +01:00
-->
2013-10-21 13:43:31 +02:00
2016-11-26 12:21:50 +01:00
< br >< hr >< br > Example 2 : Table using tags : div . tagtable + ( div | form ) . tagtr + div [ . tagtd ] => Use this for tables that need to have a different form for each line , but AVOID IT if possible ( drag and drop of lines does not work for this case , also height of title can ' t be forced to a minimum ) < br >< br >
2015-03-22 21:26:13 +01:00
2013-10-21 13:43:31 +02:00
2013-10-26 21:17:18 +02:00
< ? php
2020-04-10 10:59:32 +02:00
$tasksarray = array ( 1 , 2 , 3 ); // To force having several lines
$tagidfortablednd = 'tablelines' ;
2021-02-26 18:58:34 +01:00
if ( ! empty ( $conf -> use_javascript_ajax )) {
include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php' ;
}
2013-10-21 13:43:31 +02:00
?>
2016-11-26 12:21:50 +01:00
< div class = " tagtable centpercent liste_titre_bydiv " id = " tablelines " >
2021-02-26 18:58:34 +01:00
< div class = " tagtr liste_titre " >
< div class = " tagtd " > Title A < input type = " hidden " name = " cartitem " value = " 3 " ></ div >
< div class = " tagtd " > title B </ div >
< div class = " tagtd " > title C </ div >
< div class = " tagtd " > title D </ div >
</ div >
< div class = " pair tagtr " >
< div class = " tagtd " > line4 < input type = " hidden " name = " cartitem " value = " 3 " ></ div >
< div class = " tagtd " > dfsdf </ div >
< div class = " tagtd " >< input name = " count " value = " 4 " class = " maxwidth50 " ></ div >
< div class = " tagtd tdlineupdown " > bbbb </ div >
</ div >
< div class = " impair tagtr " >
< div class = " tagtd " > line5 < input type = " hidden " name = " cartitemb " value = " 3 " ></ div >
< div class = " tagtd " > dfsdf </ div >
< div class = " tagtd " >< input name = " countb " value = " 4 " class = " maxwidth50 " ></ div >
< div class = " tagtd tdlineupdown " > bbbb </ div >
</ div >
< div class = " pair tagtr " >
< div class = " tagtd " > line6 < input type = " hidden " name = " cartitem " value = " 3 " ></ div >
< div class = " tagtd " > jghjgh </ div >
< div class = " tagtd " > 5 </ div >
< div class = " tagtd tdlineupdown " > lll </ div >
</ div >
2015-03-22 21:26:13 +01:00
<!-- Using form into div make Firefox crazy ( page loading does not end ) -->
<!-- < form class = " liste_titre " method = " POST " action = " 1.php " >
2021-02-26 18:58:34 +01:00
< div > line1 < input type = " hidden " name = " cartitem " value = " 1 " ></ div >
< div >< label >< input type = " checkbox " name = " hidedetails " value = " 2 " > A checkbox inside a cell </ label ></ div >
< div >< input name = " count " value = " 4 " ></ div >
< div >< input type = " submit " name = " count2 " class = " button noshadow " value = " aaa " ></ div >
</ form >
< form class = " impair " method = " POST " action = " 2.php " >
< div > line2 < input type = " hidden " name = " cartitem " value = " 2 " ></ div >
< div >< select name = " hidedetails " >< option > aaaaaaaaaaaaaaafd sf sf gfd gfd gs fgdf gaaaa </ option >< option > gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd </ option ></ select ></ div >
< div >< input name = " countb " value = " 4 " ></ div >
< div class = " tdlineupdown " >< input type = " submit " value = " xxx " class = " button " ></ div >
</ form >-->
2015-03-22 21:26:13 +01:00
</ div >
2013-10-21 13:43:31 +02:00
2014-07-27 20:31:11 +02:00
< ? php
2021-02-26 18:58:34 +01:00
if ( ! empty ( $usedolheader )) {
2014-07-27 20:31:11 +02:00
llxFooter ();
} else { ?>
2013-06-30 22:11:25 +02:00
</ body >
2014-07-27 20:31:11 +02:00
< ? php } ?>
2015-05-07 10:32:20 +02:00
</ html >