Example #1
0
 /**
  * Общение с коллегами
  *
  * @param string $msg - сообщение
  */
 public function send($msg)
 {
     if ($msg == "Farmer: Tomato complete...") {
         $this->cannery->money -= 10000;
         $this->farmer->money += 10000;
         $this->cannery->makeKetchup($this->farmer->getTomato());
     } else {
         if ($msg == "Cannery: Ketchup complete...") {
             $this->shop->money -= 15000;
             $this->cannery->money += 15000;
             $this->shop->sellKetchup($this->cannery->getKetchup());
         }
     }
 }
Example #2
0
 public static function getOptions()
 {
     $model = Farmer::model()->findAll();
     $arr = array();
     foreach ($model as $r) {
         $arr[$r->farmer_id] = $r->farmer_name;
     }
     return $arr;
 }
 public static function init()
 {
     if (!self::$initiated) {
         // Were initiating
         self::$initiated = true;
         // Add the wordpress hooks
         self::init_hooks();
         // Register custom post type
         self::register_custom_post_type_album();
         // Register custom files
         self::register_custom_plugin_files();
         // Add custom meta box to post type album
         self::add_meta_box_albums();
     }
 }
Example #4
0
 function actionFarmerDelete($id)
 {
     $this->checkLogin();
     Farmer::model()->deleteByPk((int) $id);
     $this->redirect(array('FarmerIndex'));
 }
Example #5
0
echo Yii::t('lang', 'input_from_the_field');
?>
</label>
					<?php 
echo $form->dropdownList($model, 'from_branch_id', $branchOptions, array('class' => 'form-control', 'style' => 'width: 200px'));
?>
				</div>
				
				<div>
					<!-- farmer_id -->
					<label for=""><?php 
echo Yii::t('lang', 'purchased_from');
?>
</label>
					<?php 
echo $form->dropdownList($model, 'farmer_id', Farmer::getOptions(), array('class' => 'form-control', 'style' => 'width: 400px'));
?>
				</div>
				
				<div>
					<?php 
$importPay = BillImport::getImportPay();
$payStatus = BillImport::getPayStatus();
?>
					
					<!-- bill_import_pay -->
					<label for=""><?php 
echo Yii::t('lang', 'payment');
?>
</label>
					<?php