He creado una nueva clase TDashboard, a continuacion dejo un ejemplo de como se usa.
La clase TDashboard trabaja en conjunto con las nuevas clases : TSection, TFooter y TIcon.
Esta clase tiene algo muy novedoso, y es que se pueden llamar tanto funciones en PHP como en JAVASCRIPT desde el menu,
pues es cierto funciona de manera perfecta.increible verdad ?
A continuacion pongo el codigo del ejemplo :
Código: Seleccionar todo
<?php
include( 'config.php' );
include( TWEB_PATH . 'core.php' );
include( TWEB_PATH . 'core.dashboard.php' );
include( TWEB_PATH . 'core.section.php' );
$oWeb = new TWeb( "TEST TSIDEBAR" );
$oWeb->lAwesome = true;
$oWeb->SetIcon( IMAGE_PATH . 'tweb.png' );
$oWeb->AddCss( CSS_PATH . 'dicoms.css' );
$oWeb->Activate();
$oWnd = new TWindow( 'main', 5, 12, '98%', '95%' );
$oMenu = new TDashboard( $oWnd, 'sidemenu', 5, 5, 200, 200, null );
$oMenu->fontSize = '16px';
$oMenu->Header();
$oMenu->TitleHeader( "DICOMS PANAMA, C.A", 'red' );
$oMenu->ButtonHeader( "Salir", "salir()", "12px", "#241d1d", "#14a1bd" );
$oMenu->ImageMenu( 'simage', './images/user.png' );
$oMenu->TitleMenu( 'DICOMS PANAMA', 'black', '#00e6b8' );
$oMenu->ColorNormalMenu( 'black', '#ccffff' );
$oMenu->ColorOverMenu( 'black', '#00ace6' );
$oMenu->ColorFocusMenu( 'withe', '#0000cc' );
$oMenu->itemHome( "inicio", "PanelHome" );
$oMenu->addMenu( "clientes", "fa fa-folder", "Panel1", ["TEST DE DASHBOARD"], ITEM_PHP );
$oMenu->addMenu( "vendedores", "fa fa-folder", "Panel2", null, ITEM_PHP );
$oSub = $oMenu->addMenu( "Reportes", "fas fa-cart-arrow-down" );
$oMenu->addSubmenu( $oSub, "Fechas", "fab fa-amazon-pay", "msgitem('fechas')");
$oMenu->addSubmenu( $oSub, "Cartas", "fab fa-amazon", "msgitem('cartas')");
$oSub = $oMenu->addMenu( "Juegos", "fab fa-amazon" );
$oMenu->addSubmenu( $oSub, "Domino", "fab fa-amazon", "msgitem('domino')");
$oMenu->addSubmenu( $oSub, "Damas Chinas", "fab fa-amazon", "msgitem('damas')");
$oMenu->Footer( "footer", "PanelFooter", [ "Derechos Reservados Albeiro Valencia / TVALWEB" ], "custom-footer" );
$oWnd->Activate();
$oWeb->End();
//------------------------------
function PanelHome() {
$oPanel = new TSection( __FUNCTION__, 54, 250, '60%', '95%', 'white' );
$saldocxc ='9293.88';
$saldocxp ='15009.01';
$oDiv = new TPanel( $oPanel, 'div-btns', 10, 10, '100%', 150 );
$oBtn = new Tbutton($oDiv, 'boton1',10,10,'CUENTAS<br>POR COBRAR<br>SALDO ACTUAL<br>'.$saldocxc, '', 200, 100 ) ;
$oBtn->SetColor( 'white', '#2ecc71' );
$oBtn = new Tbutton($oDiv, 'boton2',10,250,'CUENTA POR PAGAR<br>SALDO ACTUAL<br>'.$saldocxp , '', 200, 100 ) ;
$oBtn->SetColor( 'white', '#e74c3c' );
$oBtn = new Tbutton($oDiv, 'boton3',10,510,'INVENTARIO<br>HOY', '', 200, 100 ) ;
$oBtn->SetColor( 'white', '#5dade2' );
$oTable = new TDataTable( $oPanel, 'myTable', 120, 5, '95%', '80%' );
$oCol = $oTable->AddCol( 'factura' , 'DOCUMENTO' );
$oCol = $oTable->AddCol( 'cliente', 'CLIENTED', null, AL_LEFT, '' );
$oCol = $oTable->AddCol( 'monto' , 'MONTO', 'N€ ', AL_RIGHT );
$oCol->lTotal = true;
$oTable->PageLength( 10 );
$oTable->Paging( true );
$oTable->ScrollY( "300px" );
$oTable->ScrollX( true );
$oTable->BtnsExportHide();
$oTable->FilterHide();
$oPanel->Activate();
}
//------------------------------
function Panel1( $params ) {
$oPanel = new TSection( __FUNCTION__, 52, 300, 300, 300, 'blue' );
$oGet = new TGet( $oPanel, "get1", 10, 10, '', 150, 30 );
$oGet->cPlaceHolder = 'Usuario';
$oSay = new TSay( $oPanel, 'say1', 40, 10, $params, 200, 30 );
$oPanel->Activate();
}
//------------------------------
function Panel2() {
$oPanel = new TSection( __FUNCTION__, 52, 300, 300, 300, 'green' );
$oGet = new TGet( $oPanel, "get2", 10, 10, '', 150, 30 );
$oGet->cPlaceHolder = 'Password';
$oGet = new TGet( $oPanel, "get3", 40, 10, '', 150, 30 );
$oGet->cPlaceHolder = 'Direccion';
$oPanel->Activate();
}
//------------------------------
function PanelFooter( $cAutor ) {
$oPanel = new TFooter( '95%', 0, '100%', '50px' );
new TSay( $oPanel, 'say-footer', 5, 10, $cAutor, 365, 30 );
new TIcon( $oPanel, null, "testIcon()", 5, 400, null, '#e7eeef', 'black' );
$oPanel->Activate();
}
?>
<script>
var data = [
{ factura : '00001', cliente : 'dicoms 1', monto : 350.25 },
{ factura : '00002', cliente : 'dicoms 2', monto : 160.75 },
{ factura : '00003', cliente : 'dicoms 3', monto : 200.25 },
{ factura : '00004', cliente : 'dicoms 4', monto : 60.15 }
]
$(function() {
let obj = new TDisplay();
console.log("device width : ", obj.getWidth() );
console.log("device height : ", obj.getHeight() );
if ( obj.getWidth() <= 768 ) {
obj.setClass( "PanelHome", "dicoms" );
}
let oCtrl = new TControl();
let oGrid = oCtrl.GetControl("myTable");
oGrid.SetData(data);
});
function msgitem( msg ) {
JMsgInfo(msg);
}
function testIcon() {
JMsgInfo("Test Icon Footer");
}
function salir() {
JMsgInfo("Logout del dashboard ...");
}
</script>