Browse Source

Zuzu

master
Evgeny Gagua 3 years ago
parent
commit
e3bf32d92d
  1. 16
      lib/controller/getWidthTable.php
  2. 4
      lib/controller/getWidthTableEditor.php
  3. 7
      lib/javascript/jsapi_dynamic/mojo_settings.js

16
lib/controller/getWidthTable.php

@ -11,13 +11,27 @@
$MR = floatval( $ZZ[0]['max_range'] ); $MR = floatval( $ZZ[0]['max_range'] );
$Data['totalCount'] = count( $RR ); $Data['totalCount'] = count( $RR );
$Data['rows'] = array(); $Data['rows'] = array();
$PR = array();
foreach( $RR as $R ){ foreach( $RR as $R ){
$CC[0] = intval( $R['id'] ); $CC[0] = intval( $R['id'] );
$CC[1] = intval( $R['width_k'] ); $CC[1] = intval( $R['width_k'] );
$CC[2] = intval( $R['range_k'] ); $CC[2] = intval( $R['range_k'] );
$CC[3] = intval( ( $MR * $CC[2] ) / 100.0 ); $CC[3] = intval( ( $MR * $CC[2] ) / 100.0 );
$Data['rows'][] = $CC;
if( count( $PR )){
$ZZ = array();
$ZZ[0] = $PR[0];
$ZZ[1] = $PR[1];
$ZZ[2] = $PR[2] . '-' . $CC[2];
$ZZ[3] = $PR[3] . '-' . $CC[3];
$Data['rows'][] = $ZZ;
};
$PR = $CC;
}; };
$ZZ[0] = $PR[0];
$ZZ[1] = $PR[1];
$ZZ[2] = $PR[2] . '-100';
$ZZ[3] = $PR[3] . '-' . $MR;
$Data['rows'][] = $ZZ;
echo json_encode( $Data ); echo json_encode( $Data );
} else { } else {
echo "{ 'totalCount': 0, 'rows':[] }"; echo "{ 'totalCount': 0, 'rows':[] }";

4
lib/controller/getWidthTableEditor.php

@ -53,10 +53,10 @@
type: 'int' type: 'int'
},{ },{
name: 'range', name: 'range',
type: 'int'
type: 'string'
},{ },{
name: 'range_m', name: 'range_m',
type: 'int'
type: 'string'
}], }],
baseParams:{ baseParams:{
UID: {$UserID}, UID: {$UserID},

7
lib/javascript/jsapi_dynamic/mojo_settings.js

@ -98,8 +98,8 @@ var targetWidthTable_store = new Ext.data.ArrayStore({
fields: [ fields: [
{name: 'id', type: 'int' }, {name: 'id', type: 'int' },
{name: 'width', type: 'int'}, {name: 'width', type: 'int'},
{name: 'range', type: 'int'},
{name: 'range_m', type: 'int'}
{name: 'range', type: 'sting'},
{name: 'range_m', type: 'sting'}
] ]
}); });
var cWTRowSelected = null; var cWTRowSelected = null;
@ -109,7 +109,8 @@ var widthTableSelModel_ops = {
listeners: { listeners: {
rowselect: function( sm, row, rec ) { rowselect: function( sm, row, rec ) {
cWTRowSelected = rec.data.id; cWTRowSelected = rec.data.id;
Ext.getCmp('del_btn_width_table').enable();
//todo
//Ext.getCmp('del_btn_width_table').enable();
} }
} }
}; };

Loading…
Cancel
Save