public function listServicesAction()
 {
     $rows = array();
     $services = Service::getServices();
     foreach ($services as $service) {
         $tmp = array();
         $tmp['id'] = $service['id'];
         $tmp['data'][] = $service['name'];
         $tmp['data'][] = $service['status'];
         $rows[] = $tmp;
     }
     $memcache = Zend_Registry::get('memcache');
     $serviceNominal = $memcache->get(Service::SERVICE_NOMINAL);
     $rows[0]['userdata']['serviceNominal'] = $serviceNominal;
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct(array('rows' => $rows));
 }
Esempio n. 2
0
/services/DB.php?FLAG=DELSELECT">
                    <table class="table table-striped table-bordered table-hover" id="sample_1">
                    <thead>
                    <tr>
                        <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/></th>
                        <th>Service Name</th>
                        <th>Price</th>
                        <th>Service Time</th>
                        <th>Description</th>
                        <th>Date Created</th>
                        <th>Action</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php 
$results = Service::getServices();
if (count($results) > 0) {
    for ($index = 0; $index < count($results); $index++) {
        $rows = $results[$index];
        ?>
                        <tr class="<?php 
        echo ($index + 1) % 2 == 0 ? 'even' : 'odd';
        ?>
 gradeX">
                            <td> <input  name="delete[]" type="checkbox" id="delete[]" value="<?php 
        echo $rows['id'];
        ?>
" class="checkboxes" /> </td>
                            <td><?php 
        echo $general->subStr($rows['servicename'], 60);
        ?>
Esempio n. 3
0
    }
    public function pharmacyDownload($args)
    {
        $daily = 0;
        // default to full sync
        if (isset($args[0])) {
            $daily = (int) $args[0];
        }
        $ret = Pharmacy::activateDownload($daily);
        if (strlen($ret['error']) > 0) {
            // error
            echo $ret['error'];
            return false;
        }
        $filename = Pharmacy::downloadPharmacy($ret['downloadUrl'], $ret['cookieFile']);
        $counter = Pharmacy::loadPharmacy($filename);
        return true;
    }
}
set_error_handler(create_function('$errno,$errstr', 'return true;'));
$script = ScriptService::getInstance();
$methodName = trim($argv[1]);
if (method_exists($script, $methodName)) {
    echo 'Processing ' . $methodName . '... ';
    $script->{$methodName}(array_slice($argv, 2));
    Service::getServices();
    // set nominal service
    echo 'done.' . PHP_EOL;
} else {
    die("Argument {$methodName} is invalid.\n");
}