Example #1
0
File: view.php Project: zwq/unpei
<?php

$this->breadcrumbs = array('Recommend' => array('index'), $model->Name);
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => array('ID', array('name' => '姓名', 'value' => $model->Name), array('name' => '电话', 'value' => $model->MobPhone), array('name' => '客户类别', 'value' => RecommendList::itemAlias("CompanyType", $model->CompanyType)), array('name' => '邮箱', 'value' => $model->Email), array('name' => '机构名称', 'value' => $model->CompanyName), array('name' => '推荐人', 'value' => RecommendList::showOrganname($model->OrganID)), array('name' => 'Address', 'value' => RecommendList::showAddress($model->Province, $model->City, $model->Area)))));
Example #2
0
File: _form.php Project: zwq/unpei
	<?php 
echo $form->textFieldRow($model, 'MobPhone', array('class' => 'span5'));
?>
        <?php 
echo $form->dropDownListRow($model, 'CompanyType', array(3 => '修理厂'));
?>
        
        <?php 
echo $form->textFieldRow($model, 'Email', array('class' => 'span5', 'prepend' => '@', 'style' => 'width:180px;'));
?>
        <?php 
echo $form->textFieldRow($model, 'CompanyName', array('class' => 'span5'));
?>
        <?php 
$CompanyName = empty($model->OrganID) ? '' : RecommendList::showOrganname($model->OrganID);
echo $form->textFieldRow($model, 'OrganID', array('class' => 'span5', 'value' => $CompanyName));
?>
        <label  class="control-label">地址:</label>
 <?php 
$state_data = Area::model()->findAll("Grade=:grade", array(":grade" => 1));
$state = CHtml::listData($state_data, "ID", "Name");
$s_default = $model->isNewRecord ? '' : $model->Province;
echo Chtml::dropDownList('RecommendList[Province]', $model->Province, $state, array('class' => 'easyui-validatebox width90 select', 'id' => 'province', 'empty' => '请选择省份', 'ajax' => array('type' => 'GET', 'url' => Yii::app()->createUrl('/admin/Dynamiccities'), 'update' => '#city', 'data' => 'js:"province="+jQuery(this).val()')));
//empty since it will be filled by the other dropdown
$c_default = $model->isNewRecord ? '' : $model->City;
if (!$model->isNewRecord) {
    $city_data = Area::model()->findAll("ParentID=:parent_id", array(":parent_id" => $model->Province));
    $city = CHtml::listData($city_data, "ID", "Name");
}
$city_update = $model->isNewRecord ? array() : $city;
Example #3
0
 public function actionDelete()
 {
     $id = $_GET['id'];
     $result = RecommendList::model()->deleteByPK($id);
     $messager = '';
     if ($result > 0) {
         $message = '删除成功';
     } else {
         $message = '删除失败';
     }
     $data = new RecommendList();
     $this->redirect('index', array('message' => $message));
 }