Beispiel #1
0
$SESSION = new \Zend_Session_Namespace('internal', true);
if (!isset($SESSION->lang)) {
    $SESSION->lang = DEFAULT_LANGUAGE;
}
\Locale::setDefault($SESSION->lang);
$l10n->setLanguage($SESSION->lang);
//============================================================================================
// Model
//============================================================================================
require 'models/grouping.php';
require 'models/cpu.php';
require 'models/mon.php';
require 'models/per.php';
require 'models/key.php';
require 'models/furniture.php';
$cpu = new Cpu();
$mon = new Monitor();
$per = new Peripheral();
$key = new Key();
$furniture = new Furniture();
$equip = new Grouping();
//============================================================================================
// Load the page requested by the user
//============================================================================================
if (!isset($_GET['page'])) {
    $data = $equip->listItems();
    for ($i = 0; $i < count($data); $i++) {
        $z = $equip->countItems($data[$i]['group_id']);
        $data[$i]['noi'] = $z[0]['count'];
    }
    $employees = $equip->listEmployees();
Beispiel #2
0
 public function visitCpu(Cpu $cpu)
 {
     echo "hello, " . $cpu->getName() . "\n";
 }
 public static function findByNbCoeur($nbCoeur)
 {
     $data = BaseSingleton::select('SELECT cpu.id as id, ' . 'cpu.nb_coeur as nb_coeur, ' . 'cpu.visible as visible ' . ' FROM cpu' . ' WHERE LOWER(cpu.nb_coeur) = LOWER(?)', array('i', &$nbCoeur));
     $cpus = new Cpu();
     if (sizeof($data) > 0) {
         $cpus->hydrate($data[0]);
     } else {
         $cpus = null;
     }
     return $cpus;
 }
Beispiel #4
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Cpu the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Cpu::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Beispiel #5
0
//============================================================================================
// Session, configuration file, localization constructor
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('internal', true);
if (!isset($SESSION->lang)) {
    $SESSION->lang = DEFAULT_LANGUAGE;
}
\Locale::setDefault($SESSION->lang);
$l10n->setLanguage($SESSION->lang);
//============================================================================================
// Model
//============================================================================================
require 'models/cpu.php';
$equip = new Cpu();
//============================================================================================
// Load the page requested by the user
//============================================================================================
if (!isset($_GET['page'])) {
    if (!isset($_GET['status'])) {
        $_GET["status"] = '0';
    }
    if (!isset($_GET['dep'])) {
        $_GET['dep'] = $SESSION->department;
        if ($_GET['dep'] === '8') {
            $cur_dep = '0';
        } else {
            $cur_dep = $_GET['dep'];
        }
    } else {
Beispiel #6
0
                    <div class="col-md-6">
                        <?php 
        echo $form->textFieldGroup($migracion, 'ram_despues', array('wrapperHtmlOptions' => array('class' => 'col-sm-5')));
        ?>
                    </div>

                    <div class="col-md-6">
                        <?php 
        echo $form->textFieldGroup($migracion, 'disco_despues', array('wrapperHtmlOptions' => array('class' => 'col-sm-5')));
        ?>
                    </div>


                    <div class="col-md-6">
                        <?php 
        echo $form->dropDownListGroup($migracion, 'cpu_id_despues', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => CHtml::listData(Cpu::model()->findAll(), 'id', 'procesador', 'marca'), 'htmlOptions' => array('prompt' => 'Seleccione Cpu'))));
        ?>
                    </div>

                    <div class="col-md-6">
                        <?php 
        echo $form->dropDownListGroup($migracion, 'monitor_id_despues', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => CHtml::listData(Monitor::model()->findAll(), 'id', 'modelo', 'marca'), 'htmlOptions' => array('prompt' => 'Seleccione Monitor'))));
        ?>
                    </div>


                </div>
            </div>
        </div>
        <?php 
    }