application/models/Mileagechoice_model.php
/**
     * Creates or modifies an Mileage choice object.
     */
Creates or modifies an Mileage choice object.
Creates or modifies an Mileage choice object .
public function store($post) {        
        $now = date('Y-m-d h:i:s');
        $mileagechoice = ($post['mileagechoice_id']==0 ? R::dispense('mileagechoice') : R::load('mileagechoice', $post['mileagechoice_id']));
        $mileagechoice->mileage_choice = $post['mileage_choice'];
        if($post['mileagechoice_id']==0) {
            $mileagechoice->created = $now;
            $mileagechoice->created_by = $_SESSION['user_id'];
        } else {
            $mileagechoice->modified = $now;
            $mileagechoice->modified_by = $_SESSION['user_id'];
        }
        R::store($mileagechoice);
    }
public function store ( $ post ) { $ now = date ( 'Y-m-d h:i:s' ) ; $ mileagechoice = ( $ post [ 'mileagechoice_id' ] == 0 ? R :: dispense ( 'mileagechoice' ) : R :: load ( 'mileagechoice' , $ post [ 'mileagechoice_id' ] ) ) ; $ mileagechoice -> mileage_choice = $ post [ 'mileage_choice' ] ; if ( $ post [ 'mileagechoice_id' ] == 0 ) { $ mileagechoice -> created = $ now ; $ mileagechoice -> created_by = $ _SESSION [ 'user_id' ] ; } else { $ mileagechoice -> modified = $ now ; $ mileagechoice -> modified_by = $ _SESSION [ 'user_id' ] ; } R :: store ( $ mileagechoice ) ; }
Creates or modifies an Mileage choice object.
Creates or modifies an Mileage choice object .