application/models/Equipmentunit_model.php
/**
     * Creates or modifies an equipment unit object.
     */
Creates or modifies an equipment unit object.
Creates or modifies an equipment unit object .
public function store($post) {        
        $now = date('Y-m-d h:i:s');
        $equipmentunit = ($post['equipmentunit_id']==0 ? R::dispense('equipmentunit') : R::load('equipmentunit', $post['equipmentunit_id']));
        $equipmentunit->equipmentmodel_id = $post['equipmentmodel_id'];
        $equipmentunit->unit_number = $post['unit_number'];
        $equipmentunit->track_type = $post['track_type'];
        $equipmentunit->person_responsible = implode("|", $post['person_responsible']);
        $equipmentunit->fluids_tracked = implode("|", $post['fluids_tracked']);
        $equipmentunit->active = $post['active'];
        if($post['equipmentunit_id']==0) {
            $equipmentunit->created = $now;
            $equipmentunit->created_by = $_SESSION['user_id'];
        } else {
            $equipmentunit->modified = $now;
            $equipmentunit->modified_by = $_SESSION['user_id'];
        }
        R::store($equipmentunit);
    }
public function store ( $ post ) { $ now = date ( 'Y-m-d h:i:s' ) ; $ equipmentunit = ( $ post [ 'equipmentunit_id' ] == 0 ? R :: dispense ( 'equipmentunit' ) : R :: load ( 'equipmentunit' , $ post [ 'equipmentunit_id' ] ) ) ; $ equipmentunit -> equipmentmodel_id = $ post [ 'equipmentmodel_id' ] ; $ equipmentunit -> unit_number = $ post [ 'unit_number' ] ; $ equipmentunit -> track_type = $ post [ 'track_type' ] ; $ equipmentunit -> person_responsible = implode ( " | " , $ post [ 'person_responsible' ] ) ; $ equipmentunit -> fluids_tracked = implode ( " | " , $ post [ 'fluids_tracked' ] ) ; $ equipmentunit -> active = $ post [ 'active' ] ; if ( $ post [ 'equipmentunit_id' ] == 0 ) { $ equipmentunit -> created = $ now ; $ equipmentunit -> created_by = $ _SESSION [ 'user_id' ] ; } else { $ equipmentunit -> modified = $ now ; $ equipmentunit -> modified_by = $ _SESSION [ 'user_id' ] ; } R :: store ( $ equipmentunit ) ; }
Creates or modifies an equipment unit object.
Creates or modifies an equipment unit object .