コード例 #1
0
/**
 * Run action for virtual machine
 */
function _actions_vm($action)
{
    global $_ONAPPVARS, $_LANG;
    $action = $_ONAPPVARS['action'];
    if (!is_null($action)) {
        switch ($action) {
            case 'create':
                _action_vm_create();
                break;
            case 'unlock':
                $_ONAPPVARS['vm']->unlock();
                break;
            case 'build':
                _action_update_res();
                $_ONAPPVARS['vm']->build();
                break;
            case 'rebuild':
                rebuild();
                break;
            case 'start':
                _action_update_res();
                $_ONAPPVARS['vm']->startup();
                break;
            case 'stop':
                $_ONAPPVARS['vm']->shutdown();
                break;
            case 'reboot':
                _action_update_res();
                $_ONAPPVARS['vm']->reboot();
                break;
            case 'delete':
                _action_vm_delete();
                break;
            case 'reset_pass':
                $_ONAPPVARS['vm']->reset_password();
                break;
            case 'rebuild_network':
                $_ONAPPVARS['vm']->rebuild_network();
                break;
            default:
                $_ONAPPVARS['error'] = sprintf($_LANG["onappactionnotfound"], $action);
                break;
        }
    }
    unset($_ONAPPVARS['action']);
    if (isset($_ONAPPVARS['vm']) && !is_null($_ONAPPVARS['vm']->error)) {
        $_ONAPPVARS['error'] = is_array($_ONAPPVARS['vm']->error) ? implode('.<br>', $_ONAPPVARS['vm']->error) : $_ONAPPVARS['vm']->error;
    } elseif (isset($_ONAPPVARS['vm']) && !is_null($_ONAPPVARS['vm']->_obj->error)) {
        $_ONAPPVARS['error'] = is_array($_ONAPPVARS['vm']->_obj->error) ? implode('.<br>', $_ONAPPVARS['vm']->_obj->error) : $_ONAPPVARS['vm']->_obj->error;
    }
    if (!isset($_ONAPPVARS['error'])) {
        redirect(ONAPP_FILE_NAME . "?page=productdetails&id=" . $_ONAPPVARS['id']);
    } else {
        productdetails();
    }
}
コード例 #2
0
                                    </tr>
                                    <tr>
                                        <td><small></small></td>
                                        <td><small>' . $row['nutri_facts'] . '</small></td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>';
        }
    } else {
        $store = "no store";
    }
}
?>
<div class="container">
    <div class="block-header">
        <h2>GROCERY APP<small>Product Details</small></h2>
    </div>                   
    <div class="card">                        
        <div class="card-body card-padding">
            <div id="storeinfo" class="contacts clearfix row">
               <?php 
productdetails();
?>
            </div>
        </div>
    </div>
</div>  
<?php 
require_once 'footer.php';