コード例 #1
0
 function attributeNote($id_Station, $id_Etudiant, array $inputs, $id_Enseignant)
 {
     $id_Examen = Station::whereIdStation($id_Station)->first()->id_Examen;
     $id_Session = Examen::whereIdExamen($id_Examen)->first()->id_Session;
     $id_Note_Examen = $this->createNoteExamen($id_Examen, $id_Session, $id_Etudiant);
     $arrayStatus = $this->createNoteStation($id_Note_Examen, $id_Station, $id_Enseignant);
     $id_Banque = Station::whereIdStation($id_Station)->first()->id_Banque;
     $items = Item::whereIdBanque($id_Banque)->get();
     if (count($items) != count($inputs)) {
         return response()->json(['status' => 0], 200);
     } else {
         if ($arrayStatus['status'] == 1) {
             $id_Note_Station = $arrayStatus['id_Note_Station'];
             $i = 0;
             foreach ($items as $item) {
                 $this->createItemNote($item->id_Item, $id_Note_Station, $inputs[$i]);
                 $i++;
             }
             return 1;
         } else {
             return 2;
             //Note Station existe
         }
     }
 }
コード例 #2
0
ファイル: ExamenNegocio.php プロジェクト: rolion/taller1
 public function getPreguntasExamen($id)
 {
     $preguntas = null;
     $examen = Examen::findOne($id);
     if ($examen != null) {
         $preguntas = $examen->preguntas;
     }
     return $preguntas;
 }
コード例 #3
0
ファイル: ExamenSearch.php プロジェクト: altair141/videoClub
 public function excel($params)
 {
     $query = Examen::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => array('pageSize' => 10000)]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'monto' => $this->monto]);
     $query->andFilterWhere(['like', 'descripcion', $this->descripcion])->andFilterWhere(['like', 'observaciones', $this->observaciones]);
     return $dataProvider;
 }
コード例 #4
0
ファイル: InscripcionNegocio.php プロジェクト: rolion/taller1
 public function inscripcionPorLlave($model)
 {
     $llave = Llave::find()->where(['llave' => $model->llave])->one();
     if ($llave != null && !empty($llave)) {
         $examen = \app\models\Examen::findOne($model->id_examen);
         $inscripcion = new InscripcionExamen();
         $persona = Yii::$app->user->identity->idPersona;
         if ($persona->id_colegio == $llave->id_colegio) {
             $inscripcion->fecha_inscripcion = date('Y-m-d H:i:s');
             $inscripcion->eliminado = 0;
             if ($inscripcion->save(false)) {
                 $inscripcion->link('idAlumno', $persona);
                 $inscripcion->link('idExamen', $examen);
                 $inscripcion->link('idLlave', $llave);
                 return true;
             }
             return false;
         }
         return false;
     }
     return false;
 }
コード例 #5
0
ファイル: Pregunta.php プロジェクト: rolion/taller1
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdExamen()
 {
     return $this->hasOne(Examen::className(), ['id' => 'id_examen']);
 }
コード例 #6
0
 public function getDescripcionExamen()
 {
     $examen = Examen::find()->where(['id' => $this->examen_id])->one();
     return $examen->descripcion;
 }
コード例 #7
0
 public function actionGetDatosExamen($reservaId)
 {
     // find the zip code from the locations table
     $reserva = Reserva::findOne($reservaId);
     $hora = Hora::findOne($reserva->hora_medica_id);
     $exSolicitados = HoraExamenSolicitado::find()->where(['hora_id' => $hora->id])->all();
     foreach ($exSolicitados as $i => $exSolicitado) {
         $examen = Examen::findOne($exSolicitado->examen_id);
         $examenes[$i] = $examen;
     }
     echo Json::encode($examenes);
 }
コード例 #8
0
ファイル: _form.php プロジェクト: altair141/videoClub
                            <button type="button" class="remove-item btn btn-danger btn-xs"><i class="glyphicon glyphicon-minus"></i></button>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="panel-body">
                        <?php 
    // necessary for update action.
    if (!$modelExamen->isNewRecord) {
        echo Html::activeHiddenInput($modelExamen, "[{$i}]id");
    }
    ?>
                        <div class="row">
                            <div class="col-sm-6">
                                
                                <?php 
    $data = ArrayHelper::map(Examen::find()->all(), 'id', 'InfoExamen');
    ?>
        
                                    <?php 
    echo $form->field($modelExamen, "[{$i}]examen_id")->widget(Select2::classname(), ['data' => $data, 'options' => ['placeholder' => 'Seleccionar Examen...'], 'pluginOptions' => ['width' => '300px', 'disabled' => !$model->isNewRecord]]);
    ?>
                            </div>
                        </div><!-- .row -->
                    </div>
                </div>
            <?php 
}
?>
            </div>
            <?php 
DynamicFormWidget::end();
コード例 #9
0
ファイル: _form.php プロジェクト: rolion/taller1
<div class="pregunta-form">

    <?php 
$form = ActiveForm::begin(['id' => 'dynamic-form', 'options' => ['enctype' => 'multipart/form-data']]);
?>

    <?php 
echo $form->field($model, 'nro_pregunta')->textInput();
?>
    <?php 
echo $form->field($model, 'descripcion_pregunta')->textarea(['rows' => 6]);
?>
    

    <?php 
echo $form->field($model, 'id_examen')->dropDownList(ArrayHelper::map(Examen::find()->where(['eliminado' => 0])->all(), 'id', 'nombre'), ['prompt' => 'seleccione el examen']);
?>

    <?php 
echo $form->field($model, 'file')->fileInput();
?>

    <?php 
echo $form->field($model, 'id_area')->dropDownList(ArrayHelper::map(Area::find()->where(['eliminado' => 0])->all(), 'id', 'nombre'), ['prompt' => 'Seleccione el area']);
?>
    <?php 
echo $form->field($model, 'id_tipo')->radioList(ArrayHelper::map(\app\models\Tipo::find()->all(), 'id', 'nombre'))->label(false);
?>
    
    
    <div class="row">
コード例 #10
0
 /**
  * Updates an existing RceExamen model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $model = $this->findModel($id);
     $modelsPago = $model->pagos;
     $modelsBitacora = $model->bitacoras;
     $modelsExamenes = $model->rceExamenExamens;
     foreach ($modelsExamenes as $modelExamen) {
         $examen = Examen::find()->where(['id' => $modelExamen->examen_id])->one();
         $modelExamen->descripcion = $examen->descripcion;
         $modelExamen->observaciones = $examen->observaciones;
     }
     if ($model->load(Yii::$app->request->post())) {
         $oldIDsPago = ArrayHelper::map($modelsPago, 'id', 'id');
         $modelsPago = Model::createMultiple(Pago::classname(), $modelsPago);
         Model::loadMultiple($modelsPago, Yii::$app->request->post());
         $deletedIDsPago = array_diff($oldIDsPago, array_filter(ArrayHelper::map($modelsPago, 'id', 'id')));
         $oldIDsExamen = ArrayHelper::map($modelsExamenes, 'id', 'id');
         $modelsExamenes = Model::createMultiple(Examen::classname(), $modelsExamenes);
         Model::loadMultiple($modelsExamenes, Yii::$app->request->post());
         $deletedIDsExamen = array_diff($oldIDsExamen, array_filter(ArrayHelper::map($modelsExamenes, 'id', 'id')));
         // validate all models
         $valid = $model->validate();
         $valid = Model::validateMultiple($modelsPago) && $valid;
         $valid = Model::validateMultiple($modelsBitacora) && $valid;
         $valid = Model::validateMultiple($modelsExamenes) && $valid;
         if ($valid) {
             $transaction = \Yii::$app->db->beginTransaction();
             try {
                 if ($flag = $model->save(false)) {
                     if (!empty($deletedIDsPago)) {
                         Pago::deleteAll(['id' => $deletedIDsPago]);
                     } else {
                         if (!empty($deletedIDsBitacora)) {
                             Bitacora::deleteAll(['id' => $deletedIDsBitacora]);
                         } else {
                             if (!empty($deletedIDsREE)) {
                                 RceExamenExamen::deleteAll(['id' => $deletedIDsREE]);
                             }
                         }
                     }
                     foreach ($modelsPago as $modelPago) {
                         $modelPago->rce_examen_id = $model->id;
                         if (!($flag = $modelPago->save(false))) {
                             $transaction->rollBack();
                             break;
                         }
                     }
                     foreach ($modelsBitacora as $modelBitacora) {
                         $modelBitacora->rce_examen_id = $model->id;
                         if (!($flag = $modelBitacora->save(false))) {
                             $transaction->rollBack();
                             break;
                         }
                     }
                     $reserva = Reserva::find()->where(['id' => $model->reserva_id])->one();
                     $hora = Hora::find()->where(['id' => $reserva->hora_medica_id])->one();
                     $examenes = HoraExamenSolicitado::find()->where(['hora_id' => $hora->id])->all();
                     for ($i = 0; $i < count($examenes); ++$i) {
                         $examen = Examen::find()->where(['id' => $examenes[$i]->examen_id])->one();
                         $modelsExamenes[$i] = new RceExamenExamen();
                         $modelsExamenes[$i]->rce_examen_id = $model->id;
                         $modelsExamenes[$i]->examen_id = $examenes[$i]->examen_id;
                         $modelsExamenes[$i]->monto_a_pagar = $examen->monto;
                         if (!($flag = $modelsExamenes[$i]->save(false))) {
                             $transaction->rollBack();
                             break;
                         }
                     }
                 }
                 if ($flag) {
                     $transaction->commit();
                     return $this->redirect(['view', 'id' => $model->id]);
                 }
             } catch (Exception $e) {
                 $transaction->rollBack();
             }
         }
     }
     return $this->render('update', ['model' => $model, 'modelsPago' => empty($modelsPago) ? [new Pago()] : $modelsPago, 'modelsBitacora' => empty($modelsBitacora) ? [new Bitacora()] : $modelsBitacora, 'modelsExamenes' => empty($modelsExamenes) ? [new RceExamenExamen()] : $modelsExamenes]);
 }
コード例 #11
0
 public function getInfoExamen($examenId)
 {
     return Examen::where('id_Examen', '=', $examenId)->first();
 }
コード例 #12
0
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function show($sessionId = null)
 {
     $examens = Examen::join('Stage', 'Examen.id_Stage', '=', 'Stage.id_Stage')->where('id_Session', '=', $sessionId)->get();
     return view('examenViewPublic')->with('sessionId', $sessionId)->with('examens', $examens);
 }
コード例 #13
0
ファイル: ExamenController.php プロジェクト: rolion/taller1
 /**
  * Finds the Examen model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Examen the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Examen::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #14
0
ファイル: _form.php プロジェクト: altair141/videoClub
/* @var $model app\models\RceExamenExamen */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="rce-examen-examen-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'rce_examen_id')->dropDownList(ArrayHelper::map(RceExamen::find()->all(), 'id', 'DatosRce'), ['prompt' => 'Seleccionar RCE Examen', 'style' => 'width:300px']);
?>

    <?php 
echo $form->field($model, 'examen_id')->dropDownList(ArrayHelper::map(Examen::find()->all(), 'id', 'descripcion'), ['prompt' => 'Seleccionar Examen', 'style' => 'width:300px']);
?>

    <?php 
echo $form->field($model, 'monto_a_pagar')->textInput(['style' => 'width:300px']);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Ingresar RCE Examen Examen' : 'Actualizar', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>
コード例 #15
0
ファイル: _form.php プロジェクト: rolion/taller1
                         <button type="button" class="add-item btn btn-success btn-xs"><i class="glyphicon glyphicon-plus"></i></button>
                         <button type="button" class="remove-item btn btn-danger btn-xs"><i class="glyphicon glyphicon-minus"></i></button>
                     </div>
                     <div class="clearfix"></div>
                 </div>
                 <div class="panel-body">
                     <?php 
 // necessary for update action.
 if (!$modelsInscripcion->isNewRecord) {
     echo Html::activeHiddenInput($modelsInscripcion, "[{$i}]id");
 }
 ?>
                     <div class="row">
                         <div class="col-sm-6">
                              <?php 
 echo $form->field($modelsInscripcion, "[{$i}]id_examen")->dropDownList(ArrayHelper::map(Examen::find()->all(), 'id', 'nombre'), ['prompt' => 'seleccione el examen']);
 ?>
                             
                         </div>
                     </div>
                    
                     <div class="row">
                         <div class="col-sm-6">
                             <?php 
 echo $form->field($modelsInscripcion, "[{$i}]costo")->textInput();
 ?>
                         </div>
                         
                     </div><!-- .row --> 
                 </div>
             </div>