Ejemplo n.º 1
0
 public function actionStatinvest()
 {
     $stru = new Structure();
     //$debut= new Dat; $fin = new Dat;
     $MaterielInformatique = null;
     $TerrainsDeConstruction = null;
     $MaterielAutomobile = null;
     $MobilierDeBureau = null;
     $total = 0;
     $prix = 0;
     $MaterielInformatique = 0;
     //	if  (($stru->load(Yii::$app->request->post())) &&   ($debut->load(Yii::$app->request->post()))
     //	  &&    ($fin->load(Yii::$app->request->post()))     ) {
     if ($stru->load(Yii::$app->request->post())) {
         $Fami452 = Famille::find()->where(['codecomptecomptable' => "218452"])->all();
         foreach ($Fami452 as $f452) {
             $codfam = $f452->codefamille;
             $SousFam = Sousfamille::find()->where(['codefamille' => $codfam])->all();
             foreach ($SousFam as $souFamillle) {
                 $codSouFam = $souFamillle->codesousfamille;
                 $biens = Bien::find()->where(['codesousfamille' => $codSouFam])->all();
                 foreach ($biens as $bien) {
                     $prix = $bien->prixachat;
                     $MaterielInformatique = $MaterielInformatique + $prix;
                 }
             }
         }
         //traiter 2eme compte
         $Fami2110 = Famille::find()->where(['codecomptecomptable' => "2110"])->all();
         foreach ($Fami2110 as $f2110) {
             $codfam = $f2110->codefamille;
             $SousFam = Sousfamille::find()->where(['codefamille' => $codfam])->all();
             foreach ($SousFam as $souFamillle) {
                 $codSouFam = $souFamillle->codesousfamille;
                 $biens = Bien::find()->where(['codesousfamille' => $codSouFam])->all();
                 foreach ($biens as $bien) {
                     $prix = $bien->prixachat;
                     $TerrainsDeConstruction = $TerrainsDeConstruction + $prix;
                 }
             }
         }
         //traiter 3eme compte
         $Fami218440 = Famille::find()->where(['codecomptecomptable' => "218440"])->all();
         foreach ($Fami218440 as $f218440) {
             $codfam = $f218440->codefamille;
             $SousFam = Sousfamille::find()->where(['codefamille' => $codfam])->all();
             foreach ($SousFam as $souFamillle) {
                 $codSouFam = $souFamillle->codesousfamille;
                 $biens = Bien::find()->where(['codesousfamille' => $codSouFam])->all();
                 foreach ($biens as $bien) {
                     $prix = $bien->prixachat;
                     $MaterielAutomobile = $MaterielAutomobile + $prix;
                 }
             }
         }
         //traiter 4eme compte
         $Fami218450 = Famille::find()->where(['codecomptecomptable' => "218450"])->all();
         foreach ($Fami218450 as $f218450) {
             $codfam = $f218450->codefamille;
             $SousFam = Sousfamille::find()->where(['codefamille' => $codfam])->all();
             foreach ($SousFam as $souFamillle) {
                 $codSouFam = $souFamillle->codesousfamille;
                 $biens = Bien::find()->where(['codesousfamille' => $codSouFam])->all();
                 foreach ($biens as $bien) {
                     $prix = $bien->prixachat;
                     $MobilierDeBureau = $MobilierDeBureau + $prix;
                 }
             }
         }
         $total = $MaterielInformatique + $TerrainsDeConstruction + $MaterielAutomobile + $MobilierDeBureau;
     }
     return $this->render('statInvest', ['stru' => $stru, 'MaterielInformatique' => $MaterielInformatique, 'TerrainsDeConstruction' => $TerrainsDeConstruction, 'MaterielAutomobile' => $MaterielAutomobile, 'MobilierDeBureau' => $MobilierDeBureau, 'total' => $total]);
 }
Ejemplo n.º 2
0
                         
                   
            
                         
</div>
                    
                         
                     
      <div class="col-lg-12">
      
     
                        <div class="col-lg-6">
                        <label  class="col-lg-3 control-label">Sous famille:</label>
                        
                                 <?php 
echo $form->field($soufamille, 'designationsousfamille', ['horizontalCssClasses' => ['wrapper' => 'col-sm-3']])->dropDownList(ArrayHelper::map(Sousfamille::find()->asArray()->all(), 'designationsousfamille', 'designationsousfamille'), ['prompt' => '----------Choisir une sous-famille ----------'])->label(false);
?>
                        
                    </div> 
                    
             <div class="col-lg-6">
                          <label  class="col-lg-3 control-label">Date commande:</label>
                      <?php 
echo $form->field($cmd, 'datecmd')->widget(DatePicker::className(), ['template' => '{addon}{input}', 'clientOptions' => ['autoclose' => true, 'format' => 'dd/mm/yyyy']])->label(false);
?>
                    </div>
                 
      
      </div>