Look at this little code and I'm sure you understand what this can try to do. All is a bit of php and javascript.
Code: Select all
<?php
include ( 'config.php' );
include ( TWEB_PATH . 'core.php' );
include ( TWEB_PATH . 'core.grid.php' );
define ( 'TITLE', 'App Bussines - Movil' );
$oWeb = new TWeb( TITLE );
$oWeb->Activate();
$oFont = new TFont( 'Verdana', 14, true, true, false, CLR_GRAY );
$oWnd = new TWindow( 'main', 0, 0, '100%', '100%' );
$oPanel = new TPanel( $oWnd, 'main_A', 0, 0, '100%', 25, CLR_BLACK );
$oImg = new TImage( $oPanel, null, 5, 5 , 'images/about.png', 16, 16 );
$oSay = new TSay( $oPanel, null, 2, 30, 'App Bussiness' );
$oSay->SetFont( $oFont );
$oPanel = new TPanel( $oWnd, 'main_B', 25, 0, '100%', '100%', CLR_HGRAY );
$oBar = new TBar( $oPanel, 'mybtnbar' );
$oBar->nBtnWidth = 100;
$oBar->AddButton( 'btn1', 'Consulta' , 'Consulta()' , 'images/db.png' );
$oImg = new TImage( $oPanel, 'photo', 97, 10, '', 120, 150 );
$oImg->lZoom = true;
$oImg->SetBorderInset();
$oImg->SetRight( 10, 120 );
new TSay( $oPanel, null, 60, 10, 'Id.', 100 );
$oGet = new TGet( $oPanel, 'my_id', 60, 80, '1' );
$oGet->SetRight( 140 );
$o = new TGroup( $oPanel, null, 90, 10, 'Datos Personales', 0, 160 );
$o->SetRight( 140 );
$oSay = new TSay( $o, 'first' , 30, 10, '' );
$oSay->lBorder = true;
$oSay->SetRight( 10 );
$oSay = new TSay( $o, 'last' , 60, 10, '' );
$oSay->lBorder = true;
$oSay->SetRight( 10 );
$oSay = new TSay( $o, 'street' , 90, 10, '' );
$oSay->lBorder = true;
$oSay->SetRight( 10 );
$oSay = new TSay( $o, 'city' , 120, 10, '', 120 );
$oSay->lBorder = true;
$oSay = new TSay( $o, 'state' , 120, 140, '', 40 );
$oSay->lBorder = true;
$oSay->cAlign = 'center';
$oGrid = new TGrid( $oWnd, 'mygrid', 280, 10, 350, 500 );
$oGrid->SetRight( 10 );
$oGrid->SetBottom( 60 );
$oCol = $oGrid->AddCol( 'fecha' , 'Fecha' , 100 );
$oCol = $oGrid->AddCol( 'service' , 'Servicio' , 150 );
$oCol = $oGrid->AddCol( 'total' , 'Total' , 100 );
$o = new TBar( $oWnd, 'mybtnbar' );
$o->SetBottom( 0, 50 );
$oBtn = $o->AddButton( null, 'Info' , "Info()", 'images/info.png' );
$oBtn->cAlign = 'right';
$oWnd->Activate();
$oWeb->End();
?>
<script>
function Consulta() {
Reset_Data();
var o = new TControl();
var oParam = new Object()
oParam[ 'accion'] = 'refresh'
oParam[ 'id' ] = o.Get( 'my_id' )
MsgServer( 'srv_app_movil.php', Escucha_Consulta, oParam )
}
function Escucha_Consulta( dat ) {
var o = new TControl();
if ( dat.cab ) {
var o = new TControl();
o.Set( 'my_id' , dat.cab.id )
o.Set( 'first' , dat.cab.first )
o.Set( 'last' , dat.cab.last )
o.Set( 'street' , dat.cab.street )
o.Set( 'city' , dat.cab.city )
o.Set( 'state' , dat.cab.state )
o.Set( 'photo' , 'images/data.img/' + dat.cab.photo, 'images/data.img/' + dat.cab.photo )
o.Set( 'mygrid', dat.pos );
} else {
MsgNotify( dat.msg, 'error' )
}
}
function Reset_Data() {
var o = new TControl();
o.Set( 'first' );
o.Set( 'last' );
o.Set( 'street' );
o.Set( 'city' );
o.Set( 'state' );
o.Set( 'photo' );
o.Set( 'mygrid' );
}
function Info(){
var oOptions = new Object();
oOptions[ 'title' ] = 'Información...';
oOptions[ 'centered' ] = true;
oOptions[ 'modal' ] = true;
oOptions[ 'resizable' ] = false;
oOptions[ 'closeOnEscape'] = false;
oOptions[ 'dialogextend'] = false;
TLoadDialog( null, 'tuto_app_version.php', null, oOptions )
}
</script>
Now I would like to run this little code from your Android phone with the following url:
We are a species that always find solutions to our needs. I propose one of them...