oc-content/themes/veronika/functions.php
// UPDATE THEME COLS ON ITEM POST-EDIT
UPDATE THEME COLS ON ITEM POST-EDIT
UPDATE THEME COLS ON ITEM POST - EDIT
function veronika_update_fields( $item ) {
  if(Params::existParam('sSold')) {
    $fields = array(
      's_phone' => Params::getParam('sPhone'),
      'i_condition' => Params::getParam('sCondition'),
      'i_transaction' => Params::getParam('sTransaction'),
      'i_sold' => (Params::getParam('sSold') == 'on' ? 1 : Params::getParam('sSold'))
    );
  } else {
    $fields = array(
      's_phone' => Params::getParam('sPhone'),
      'i_condition' => Params::getParam('sCondition'),
      'i_transaction' => Params::getParam('sTransaction')
    );
  }
  Item::newInstance()->dao->update(DB_TABLE_PREFIX.'t_item_veronika', $fields, array('fk_i_item_id' => $item['pk_i_id']));
}
function veronika_update_fields ( $ item ) { if ( Params :: existParam ( 'sSold' ) ) { $ fields = array ( 's_phone' => Params :: getParam ( 'sPhone' ) , 'i_condition' => Params :: getParam ( 'sCondition' ) , 'i_transaction' => Params :: getParam ( 'sTransaction' ) , 'i_sold' => ( Params :: getParam ( 'sSold' ) == 'on' ? 1 : Params :: getParam ( 'sSold' ) ) ) ; } else { $ fields = array ( 's_phone' => Params :: getParam ( 'sPhone' ) , 'i_condition' => Params :: getParam ( 'sCondition' ) , 'i_transaction' => Params :: getParam ( 'sTransaction' ) ) ; } Item :: newInstance ( ) -> dao -> update ( DB_TABLE_PREFIX . 't_item_veronika' , $ fields , array ( 'fk_i_item_id' => $ item [ 'pk_i_id' ] ) ) ; }
UPDATE THEME COLS ON ITEM POST-EDIT
UPDATE THEME COLS ON ITEM POST - EDIT
//$sql = sprintf("UPDATE %s SET s_phone = '%s'  WHERE pk_i_id = %d", DB_TABLE_PREFIX.'t_item', '1234', 1); //Item::newInstance()->dao->query($sql); //Item::newInstance()->dao->update(DB_TABLE_PREFIX.'t_item', $fields, array('pk_i_id' => $item['pk_i_id']));