Пример #1
0
 public function actionDeletecategory()
 {
     if ($_GET['id']) {
         CustomerCategory::model()->deleteByPk($_GET['id']);
     }
     echo true;
 }
Пример #2
0
echo CHtml::hiddenField('contact_user_id', '', array('class' => 'width64 input contact_user_id'));
echo CHtml::button('选择', array('class' => 'btn-small', 'id' => 'choose'));
?>
	</div>
	<div class="form-row">
	<?php 
echo CHtml::label('客户类型:', '', array('class' => 'label'));
echo CHtml::dropDownList('customertype', '', array('A' => 'A', 'B' => 'B', 'C' => 'C'), array('class' => 'width118 select customertype', 'empty' => '请选择'));
echo CHtml::label('合作类型:', '', array('class' => 'label'));
echo CHtml::dropDownList('cooperationtype', '', array('A' => 'A', 'B' => 'B', 'C' => 'C'), array('class' => 'width118 select cooperationtype', 'empty' => '请选择'));
?>
	</div>
	<div class="form-row">
	<?php 
echo CHtml::label('客户类别:', '', array('class' => 'label'));
$state_data = CustomerCategory::model()->findAll("user_Id=:user_Id", array(":user_Id" => Yii::app()->user->id));
$state = CHtml::listData($state_data, "category", "category");
echo CHtml::dropDownList('customercategory', '', $state, array('class' => 'width118 select customercategory', 'empty' => '请选择'));
echo CHtml::link('&nbsp;*&nbsp;添加客户类别', array('contact/customerCategory'), array('style' => 'color:green;margin-left:38px;'));
?>
	</div>
	<div class="form-row">
	<?php 
$state_data = Area::model()->findAll("grade=:grade", array(":grade" => 1));
$state = '';
$state = CHtml::listData($state_data, "id", "name");
$s_default = $model->isNewRecord ? '' : $model->province;
echo CHtml::label('地  址:', '', array('class' => 'label'));
echo CHtml::dropDownList('province', '', $state, array('class' => 'width118 select checkbox-add province', 'empty' => '请选择省份', 'ajax' => array('type' => 'GET', 'url' => Yii::app()->request->baseUrl . '/Common/dynamiccities', 'update' => '#city', 'data' => 'js:"province="+jQuery(this).val()')));
$c_default = $model->isNewRecord ? '' : $model->city;
if (!$model->isNewRecord) {