diff --git a/admin/templates/shop-payment-method/view-list.php b/admin/templates/shop-payment-method/view-list.php index 08d9c01..23961f5 100644 --- a/admin/templates/shop-payment-method/view-list.php +++ b/admin/templates/shop-payment-method/view-list.php @@ -2,7 +2,8 @@ global $gdb; foreach ( $this -> apilo_payment_types_list as $payment_type ) { - $payment_types[ $payment_type['id'] ] = $payment_type['name']; + if ( isset( $payment_type['name'] ) && isset( $payment_type['id'] ) ) + $payment_types[ $payment_type['id'] ] = $payment_type['name']; } // sellasist payment methods $sellasist_payment_types_list = []; diff --git a/libraries/grid/ajax.php b/libraries/grid/ajax.php index 56e203e..0d3214e 100644 --- a/libraries/grid/ajax.php +++ b/libraries/grid/ajax.php @@ -1,9 +1,11 @@ exec('INSERT INTO "' . $table . '" (' . implode(', ', $columns) . ') VALUES (' . implode($values, ', ') . ')'); + $this->exec('INSERT INTO "' . $table . '" (' . implode(', ', $columns) . ') VALUES (' . implode(', ',$values) . ')'); $lastId[] = $this->pdo->lastInsertId(); } diff --git a/libraries/grid/grid.php b/libraries/grid/grid.php index f77c6e5..0b477ad 100644 --- a/libraries/grid/grid.php +++ b/libraries/grid/grid.php @@ -145,7 +145,7 @@ class grid 'server' => $this -> gdb_opt['server'], 'username' => $this -> gdb_opt['username'], 'password' => $this -> gdb_opt['password'], - 'port' => $this -> gdb_opt['port'], + 'port' => isset( $this -> gdb_opt['port'] ) ? $this -> gdb_opt['port'] : 3306, 'charset' => 'utf8' ] ); } @@ -437,6 +437,7 @@ class grid public function getDataSummary() { + $summary = []; $where = self::getWhereCondition(); if ( is_array( $this -> summary ) ) foreach ( $this -> summary as $key ) @@ -511,7 +512,7 @@ class grid public function saveElement( $values ) { - if ( !$values[ $this -> id ] ) + if ( !isset( $values[ $this -> id ] ) or !$values[ $this -> id ] ) { unset( $values[ $this -> id ] ); return $this -> connectToDb() -> insert( $this -> table, $values ); diff --git a/libraries/grid/js/grid.js b/libraries/grid/js/grid.js index 75f3a7c..bd3c5bb 100644 --- a/libraries/grid/js/grid.js +++ b/libraries/grid/js/grid.js @@ -631,7 +631,7 @@ jQuery( 'body' ).on( 'click', '#g-save, #g-edit-save', function() data: { gtable: gtable, - values: JSON.stringify( values ), + values: JSON.stringify( formattedValues ), a: 'gsave' }, beforeSend: function() diff --git a/libraries/grid/templates/edit.php b/libraries/grid/templates/edit.php index 2f7289c..3985f72 100644 --- a/libraries/grid/templates/edit.php +++ b/libraries/grid/templates/edit.php @@ -17,19 +17,19 @@ if ( $ce['type'] == 'text' ):?>