当前位置: 首页>>代码示例>>PHP>>正文


PHP Countries::model方法代码示例

本文整理汇总了PHP中Countries::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Countries::model方法的具体用法?PHP Countries::model怎么用?PHP Countries::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Countries的用法示例。


在下文中一共展示了Countries::model方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadModel

 public function loadModel($id)
 {
     $model = Countries::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
开发者ID:josemanuel3dx,项目名称:TestYii,代码行数:8,代码来源:CountriesController.php

示例2: actionEnabled

 public function actionEnabled($id)
 {
     $model = Countries::model()->findByPk($id);
     if ($model->status == 1) {
         $model->status = 0;
     } else {
         $model->status = 1;
     }
     $model->save();
     $this->redirect(array("index"));
 }
开发者ID:marcozta,项目名称:yii-facilito,代码行数:11,代码来源:CountriesController.php

示例3:

                        <td><strong><?php 
echo Yii::t('teachersportal', 'Office State');
?>
</strong></td>
                        <td><?php 
echo $employee->office_state;
?>
</td>
                      </tr>
                      <tr>
                        <td><strong><?php 
echo Yii::t('teachersportal', 'Office Country');
?>
  </strong></td>
                        <td><?php 
$count = Countries::model()->findByAttributes(array('id' => $employee->office_country_id));
if (count($count) != 0) {
    echo $count->name;
}
?>
</td>
                        <td><strong><?php 
echo Yii::t('teachersportal', 'Office Pin');
?>
</strong></td>
                        <td><?php 
echo $employee->office_pin_code;
?>
</td>
                      </tr>
                      <tr>
开发者ID:akilraj1255,项目名称:rajeshwari,代码行数:31,代码来源:profile.php

示例4: array

                    <td>&nbsp;</td>
                    <td valign="top">
						<?php 
echo $form->textField($model, 'pin_code', array('size' => 15, 'maxlength' => 255));
?>
                        <?php 
echo $form->error($model, 'pin_code');
?>
                    </td>
                    <td>&nbsp;</td>
                    <td valign="top">
						<?php 
//echo $form->textField($model,'country_id');
?>
                        <?php 
echo $form->dropDownList($model, 'country_id', CHtml::listData(Countries::model()->findAll(), 'id', 'name'), array('style' => 'width:140px;', 'empty' => 'Select Country'));
?>
                        <?php 
echo $form->error($model, 'country_id');
?>
                    </td>
                </tr>
                <tr>
                    <td colspan="5">&nbsp;</td>
                </tr>
                <tr>
                    <td valign="bottom"><?php 
echo $form->labelEx($model, Yii::t('students', 'phone1'));
?>
</td>
                    <td>&nbsp;</td>
开发者ID:SoftScape,项目名称:open-school-CE,代码行数:31,代码来源:_form.php

示例5: ucfirst

                            <td style="text-align:left; padding-left:5px;">
								<?php 
if ($guard->office_address_line1 != NULL) {
    echo ucfirst($guard->office_address_line1) . '<br />';
}
if ($guard->office_address_line2 != NULL) {
    echo ucfirst($guard->office_address_line2) . '<br />';
}
if ($guard->city != NULL) {
    echo ucfirst($guard->city) . '<br />';
}
if ($guard->state != NULL) {
    echo ucfirst($guard->state) . '<br />';
}
if ($guard->country_id != NULL) {
    $country = Countries::model()->findByAttributes(array('id' => $guard->country_id));
    echo ucfirst($country->name) . '<br />';
}
if ($guard->office_address_line1 == NULL and $guard->office_address_line2 == NULL and $guard->city == NULL and $guard->state == NULL and $guard->country_id == NULL) {
    echo '-';
}
?>
							</td>
                        </tr>
                
                    </table>
                    </div>
                </div>
    	</td>
	</tr>
</table>
开发者ID:SoftScape,项目名称:open-school-CE,代码行数:31,代码来源:view.php

示例6: array

?>
</td>
  </tr>
  <tr>
  	<td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><?php 
echo $form->labelEx($model, 'office_country_id');
?>
		</td>
    <td><?php 
echo $form->dropDownList($model, 'office_country_id', CHtml::listData(Countries::model()->findAll(), 'id', 'name'), array('empty' => 'Select Country'));
?>
		<?php 
echo $form->error($model, 'office_country_id');
?>
</td>
    <td><?php 
echo $form->labelEx($model, 'office_pin_code');
?>
		</td>
    <td><?php 
echo $form->textField($model, 'office_pin_code', array('size' => 25, 'maxlength' => 255));
?>
		<?php 
echo $form->error($model, 'office_pin_code');
?>
开发者ID:akilraj1255,项目名称:rajeshwari,代码行数:31,代码来源:_form1.php

示例7: array

                <?php 
echo $form->textField($model, 'telephone', array('class' => 'form-control'));
?>
                <?php 
echo $form->error($model, 'telephone');
?>
            </div>
        </div>

        <div class="form-group">
            <?php 
echo $form->labelEx($model, 'country', array('class' => 'col-sm-offset-2 col-sm-2'));
?>
            <div class="col-sm-4">
                <?php 
$list = CHtml::listData(Countries::model()->findAll(array('order' => 'country')), 'id', 'country');
?>
                <?php 
echo $form->dropDownList($model, 'country', $list, array('class' => 'form-control', 'empty' => 'Select Country', 'style' => 'text-transform: capitalize'));
?>
                <?php 
echo $form->error($model, 'country');
?>
            </div>
        </div>

        <div class="form-group">
            <?php 
echo $form->labelEx($model, 'state', array('class' => 'col-sm-offset-2 col-sm-2'));
?>
            <div class="col-sm-4">
开发者ID:djeyakumar,项目名称:aircpit,代码行数:31,代码来源:employerRegistration.php

示例8: actionUpdate

 /**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id the ID of the model to be updated
  */
 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Guardians'])) {
         $old_model = $model->attributes;
         $model->attributes = $_POST['Guardians'];
         if ($model->save()) {
             if ($_REQUEST['std'] == NULL) {
                 $student = Students::model()->findByAttributes(array('id' => $_REQUEST['sid']));
                 $student->saveAttributes(array('parent_id' => $_REQUEST['id']));
                 //echo $_REQUEST['id'].'/'.$student->first_name; exit;
                 $this->redirect(array('addguardian', 'id' => $_REQUEST['sid'], 'gid' => $_REQUEST['id']));
             }
             // Saving to activity feed
             $results = array_diff_assoc($_POST['Guardians'], $old_model);
             // To get the fields that are modified.
             //print_r($old_model);echo '<br/><br/>';print_r($_POST['Students']);echo '<br/><br/>';print_r($results);echo '<br/><br/>'.count($results);echo '<br/><br/>';
             foreach ($results as $key => $value) {
                 if ($key != 'updated_at') {
                     if ($key == 'country_id') {
                         $value = Countries::model()->findByAttributes(array('id' => $value));
                         $value = $value->name;
                         $old_model_value = Countries::model()->findByAttributes(array('id' => $old_model[$key]));
                         $old_model[$key] = $old_model_value->name;
                     }
                     //echo $key.'-'.$model->getAttributeLabel($key).'-'.$value.'-'.$old_model[$key].'<br/>';
                     //Adding activity to feed via saveFeed($initiator_id,$activity_type,$goal_id,$goal_name,$field_name,$initial_field_value,$new_field_value)
                     ActivityFeed::model()->saveFeed(Yii::app()->user->Id, '15', $model->id, ucfirst($model->first_name) . ' ' . ucfirst($model->last_name), $model->getAttributeLabel($key), $old_model[$key], $value);
                 }
             }
             //END saving to activity feed
             $this->redirect(array('students/view', 'id' => $_REQUEST['std']));
         }
     }
     $this->render('update', array('model' => $model));
 }
开发者ID:akilraj1255,项目名称:rajeshwari,代码行数:43,代码来源:GuardiansController.php

示例9:

     echo $model->home_address_line1 . "<br />";
 }
 ?>
             <?php 
 if ($model->home_address_line2 != NULL) {
     echo $model->home_address_line2 . "<br />";
 }
 ?>
             <?php 
 if ($model->home_city != NULL) {
     echo $model->home_city . "<br />";
 }
 ?>
             <?php 
 if ($model->home_country_id != NULL) {
     $count = Countries::model()->findByAttributes(array('id' => $model->home_country_id));
     if (count($count) != 0) {
         echo $count->name . "<br>";
     }
 }
 ?>
             <?php 
 if ($model->home_pin_code != NULL) {
     echo $model->home_pin_code . "<br />";
 }
 ?>
         </td>
     </tr>
     
     <tr>
        <td class="listbx_subhdng odd"><?php 
开发者ID:SoftScape,项目名称:open-school-CE,代码行数:31,代码来源:print.php

示例10: getMenuCountries

 public function getMenuCountries()
 {
     $countries = Countries::model()->findAll("status=?", array(1));
     return CHtml::listData($countries, "id", "selectName");
 }
开发者ID:marcozta,项目名称:yii-facilito,代码行数:5,代码来源:Users.php

示例11:

echo Yii::t('employees', 'Home Country');
?>
</td>
    <td class="subhdng_nrmal"><?php 
$count = Countries::model()->findByAttributes(array('id' => $model->home_country_id));
if (count($count) != 0) {
    echo $count->name;
}
?>
</td>
    <td class="listbx_subhdng"><?php 
echo Yii::t('employees', 'Office Country');
?>
</td>
    <td class="subhdng_nrmal"><?php 
$count_1 = Countries::model()->findByAttributes(array('id' => $model->office_country_id));
if (count($count_1) != 0) {
    echo $count_1->name;
}
?>
	</td>
  </tr>
  <tr>
    <td class="listbx_subhdng"><?php 
echo Yii::t('employees', 'Home PIN');
?>
</td>
    <td class="subhdng_nrmal"><?php 
echo $model->home_pin_code;
?>
</td>
开发者ID:akilraj1255,项目名称:rajeshwari,代码行数:31,代码来源:address.php

示例12: actionUpdate

 /**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id the ID of the model to be updated
  */
 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     $settings = UserSettings::model()->findByAttributes(array('user_id' => Yii::app()->user->id));
     if ($settings != NULL) {
         $date1 = date($settings->displaydate, strtotime($model->joining_date));
         $date2 = date($settings->displaydate, strtotime($model->date_of_birth));
     }
     $model->joining_date = $date1;
     $model->date_of_birth = $date2;
     if (isset($_POST['Employees'])) {
         $old_model = $model->attributes;
         // For activity feed
         $model->attributes = $_POST['Employees'];
         if ($model->joining_date) {
             $model->joining_date = date('Y-m-d', strtotime($model->joining_date));
         }
         if ($model->date_of_birth) {
             $model->date_of_birth = date('Y-m-d', strtotime($model->date_of_birth));
         }
         if ($file = CUploadedFile::getInstance($model, 'photo_data')) {
             $model->photo_file_name = $file->name;
             $model->photo_content_type = $file->type;
             $model->photo_file_size = $file->size;
             $model->photo_data = file_get_contents($file->tempName);
         }
         if ($model->save()) {
             // Saving to activity feed
             $results = array_diff_assoc($_POST['Employees'], $old_model);
             // To get the fields that are modified.
             //print_r($old_model);echo '<br/><br/>';print_r($_POST['Students']);echo '<br/><br/>';print_r($results);echo '<br/><br/>'.count($results);echo '<br/><br/>';
             foreach ($results as $key => $value) {
                 if ($key != 'updated_at') {
                     if ($key == 'gender') {
                         if ($value == 'F') {
                             $value = 'Female';
                         } else {
                             $value = 'Male';
                         }
                         if ($old_model[$key] == 'F') {
                             $old_model[$key] = 'Female';
                         } else {
                             $old_model[$key] = 'Male';
                         }
                     } elseif ($key == 'employee_category_id') {
                         $value = EmployeeCategories::model()->findByAttributes(array('id' => $value));
                         $value = ucfirst($value->name);
                         $old_model_value = EmployeeCategories::model()->findByAttributes(array('id' => $old_model[$key]));
                         $old_model[$key] = ucfirst($old_model_value->name);
                     } elseif ($key == 'employee_position_id') {
                         $value = EmployeePositions::model()->findByAttributes(array('id' => $value));
                         $value = ucfirst($value->name);
                         $old_model_value = EmployeePositions::model()->findByAttributes(array('id' => $old_model[$key]));
                         $old_model[$key] = ucfirst($old_model_value->name);
                     } elseif ($key == 'employee_department_id') {
                         $value = EmployeeDepartments::model()->findByAttributes(array('id' => $value));
                         $value = ucfirst($value->name);
                         $old_model_value = EmployeeDepartments::model()->findByAttributes(array('id' => $old_model[$key]));
                         $old_model[$key] = ucfirst($old_model_value->name);
                     } elseif ($key == 'employee_grade_id') {
                         $value = EmployeeGrades::model()->findByAttributes(array('id' => $value));
                         $value = ucfirst($value->name);
                         $old_model_value = EmployeeGrades::model()->findByAttributes(array('id' => $old_model[$key]));
                         $old_model[$key] = ucfirst($old_model_value->name);
                     } elseif ($key == 'nationality_id' or $key == 'country_id') {
                         $value = Countries::model()->findByAttributes(array('id' => $value));
                         $value = $value->name;
                         $old_model_value = Countries::model()->findByAttributes(array('id' => $old_model[$key]));
                         $old_model[$key] = $old_model_value->name;
                     }
                     //echo $key.'-'.$model->getAttributeLabel($key).'-'.$value.'-'.$old_model[$key].'<br/>';
                     //Adding activity to feed via saveFeed($initiator_id,$activity_type,$goal_id,$goal_name,$field_name,$initial_field_value,$new_field_value)
                     ActivityFeed::model()->saveFeed(Yii::app()->user->Id, '24', $model->id, ucfirst($model->first_name) . ' ' . ucfirst($model->middle_name) . ' ' . ucfirst($model->last_name), $model->getAttributeLabel($key), $old_model[$key], $value);
                 }
             }
             //END saving to activity feed
             $this->redirect(array('update2', 'id' => $model->id));
         }
     }
     $this->render('update', array('model' => $model));
 }
开发者ID:akilraj1255,项目名称:rajeshwari,代码行数:88,代码来源:EmployeesController.php

示例13: array

  </tr>
 
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle"><?php 
echo $form->labelEx($model, Yii::t('employees', 'nationality_id'));
?>
</td>
    <td valign="middle"><?php 
echo $form->dropDownList($model, 'nationality_id', CHtml::listData(Countries::model()->findAll(), 'id', 'name'), array('style' => 'width:140px;'));
?>
		<?php 
echo $form->error($model, 'nationality_id');
?>
</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  
</table>
</div>
</div>
<div class="formCon" style=" background:#EDF1D1; border:0px #c4da9b solid; color:#393; background:#EDF1D1 url(images/green-bg.png); border:0px #c4da9b solid; color:#393;  ">
开发者ID:SoftScape,项目名称:open-school-CE,代码行数:30,代码来源:_form_old.php

示例14: array

    <td><?php 
echo $form->textField($model, 'pin_code', array('size' => 30, 'maxlength' => 255));
?>
		<?php 
echo $form->error($model, 'pin_code');
?>
</td>
    <td><?php 
echo $form->labelEx($model, 'country_id');
?>
</td>
    <td><?php 
//echo $form->textField($model,'country_id');
?>
        <?php 
echo $form->dropDownList($model, 'country_id', CHtml::listData(Countries::model()->findAll(), 'id', 'name'));
?>
		<?php 
echo $form->error($model, 'country_id');
?>
</td>
  </tr>
  <tr>
    <td><?php 
echo $form->labelEx($model, 'phone1');
?>
</td>
    <td><?php 
echo $form->textField($model, 'phone1', array('size' => 30, 'maxlength' => 255));
?>
		<?php 
开发者ID:SoftScape,项目名称:open-school-CE,代码行数:31,代码来源:_form.php

示例15: actionUpdate

 /**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id the ID of the model to be updated
  */
 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     $settings = UserSettings::model()->findByAttributes(array('user_id' => Yii::app()->user->id));
     if ($settings != NULL) {
         $date1 = date($settings->displaydate, strtotime($model->admission_date));
         $date2 = date($settings->displaydate, strtotime($model->date_of_birth));
     }
     $model->admission_date = $date1;
     $model->date_of_birth = $date2;
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Students'])) {
         $old_model = $model->attributes;
         // For activity feed
         $model->attributes = $_POST['Students'];
         if ($model->admission_date) {
             $model->admission_date = date('Y-m-d', strtotime($model->admission_date));
         }
         if ($model->date_of_birth) {
             $model->date_of_birth = date('Y-m-d', strtotime($model->date_of_birth));
         }
         if ($file = CUploadedFile::getInstance($model, 'photo_data')) {
             $model->photo_file_name = $file->name;
             $model->photo_content_type = $file->type;
             $model->photo_file_size = $file->size;
             $model->photo_data = file_get_contents($file->tempName);
         }
         if ($model->save(false)) {
             // Saving to activity feed
             $results = array_diff_assoc($_POST['Students'], $old_model);
             // To get the fields that are modified.
             //print_r($old_model);echo '<br/><br/>';print_r($_POST['Students']);echo '<br/><br/>';print_r($results);echo '<br/><br/>'.count($results);echo '<br/><br/>';
             foreach ($results as $key => $value) {
                 if ($key != 'updated_at') {
                     if ($key == 'batch_id') {
                         $value = Batches::model()->findByAttributes(array('id' => $value));
                         $value = $value->name . '-' . $value->course123->course_name;
                         $old_model_value = Batches::model()->findByAttributes(array('id' => $old_model[$key]));
                         $old_model[$key] = $old_model_value->name . '-' . $old_model_value->course123->course_name;
                     } elseif ($key == 'gender') {
                         if ($value == 'F') {
                             $value = 'Female';
                         } else {
                             $value = 'Male';
                         }
                         if ($old_model[$key] == 'F') {
                             $old_model[$key] = 'Female';
                         } else {
                             $old_model[$key] = 'Male';
                         }
                     } elseif ($key == 'student_category_id') {
                         $value = StudentCategories::model()->findByAttributes(array('id' => $value));
                         $value = $value->name;
                         $old_model_value = StudentCategories::model()->findByAttributes(array('id' => $old_model[$key]));
                         $old_model[$key] = $old_model_value->name;
                     } elseif ($key == 'nationality_id' or $key == 'country_id') {
                         $value = Countries::model()->findByAttributes(array('id' => $value));
                         $value = $value->name;
                         $old_model_value = Countries::model()->findByAttributes(array('id' => $old_model[$key]));
                         $old_model[$key] = $old_model_value->name;
                     }
                     //echo $key.'-'.$model->getAttributeLabel($key).'-'.$value.'-'.$old_model[$key].'<br/>';
                     //Adding activity to feed via saveFeed($initiator_id,$activity_type,$goal_id,$goal_name,$field_name,$initial_field_value,$new_field_value)
                     ActivityFeed::model()->saveFeed(Yii::app()->user->Id, '4', $model->id, ucfirst($model->first_name) . ' ' . ucfirst($model->middle_name) . ' ' . ucfirst($model->last_name), $model->getAttributeLabel($key), $old_model[$key], $value);
                 }
             }
             //END saving to activity feed
             if (defined('EMAIL_ALERT_ADDRESS')) {
                 $name = $model->first_name . " " . $model->last_name;
                 UserModule::sendMail(constant('EMAIL_ALERT_ADDRESS'), UserModule::t("Student details modified : {student_name}", array('{student_name}' => $name)), UserModule::t("Student details has been modified for : {student_name}", array('{student_name}' => $name)));
             }
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('update', array('model' => $model));
 }
开发者ID:akilraj1255,项目名称:rajeshwari,代码行数:82,代码来源:StudentsController.php


注:本文中的Countries::model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。