Ejemplo n.º 1
0
Archivo: index.php Proyecto: zwq/unpei
<?php 
$this->widget('bootstrap.widgets.TbButton', array('label' => '加入黑名单', 'type' => 'primary', 'size' => 'small', 'id' => 'black'));
?>
&nbsp;&nbsp;&nbsp;&nbsp;
<?php 
//$this->widget('bootstrap.widgets.TbButton', array(
//    'label' => '导出用户',
//    'type' => 'primary', // null, 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
//    'size' => 'small', // null, 'large', 'small' or 'mini'
//    'id' => 'importout',
//        // 'url'=>Yii::app()->createUrl('/admin/importoutexcel')
//));
?>
&nbsp;&nbsp;&nbsp;&nbsp;
<?php 
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'user-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'ajaxUpdate' => false, 'columns' => array(array('class' => 'CCheckBoxColumn', 'headerHtmlOptions' => array('width' => '33px'), 'checkBoxHtmlOptions' => array('name' => 'selectdel[]'), 'selectableRows' => '2'), array('name' => 'ID', 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->ID),array("admin/update","id"=>$data->ID))', 'filter' => false), array('name' => 'UserName', 'type' => 'raw', 'value' => '$data->UserName'), array('name' => 'OrganName', 'type' => 'raw', 'value' => '$data->organ->OrganName'), array('name' => 'Identity', 'value' => 'Organ::itemAlias("Identity",$data->organ->Identity)', 'filter' => Organ::itemAlias("Identity")), array('name' => 'Type', 'value' => 'Organ::itemAlias("usertype",$data->organ->Type)', 'filter' => Organ::itemAlias("usertype")), array('name' => 'Email', 'type' => 'raw', 'value' => '$data->organ->Email'), array('name' => 'Recommend', 'type' => 'raw', 'value' => '$data->organ->Recommend', 'filter' => false), array('name' => 'organ.CreateTime', 'value' => 'date("Y/m/d H:i:s", $data->organ->CreateTime)', 'filter' => false), array('name' => 'Phone', 'value' => '$data->organ->Phone'), array('name' => 'IsFreeze', 'value' => 'Organ::itemAlias("freeze",$data->organ->IsFreeze)', 'filter' => Organ::itemAlias('freeze')), array('name' => 'Status', 'value' => 'Organ::itemAlias("UserStatus",$data->organ->Status)', 'filter' => Organ::itemAlias("UserStatus")), array('name' => 'organ.AllAddress', 'value' => 'Area::getCity($data->organ->Province).Area::getCity($data->organ->City).Area::getCity($data->organ->Area).$data->organ->Address', 'filter' => false), array('class' => 'CButtonColumn', 'template' => '{account}', 'viewButtonOptions' => array('title' => '查看子账户'), 'buttons' => array('account' => array('label' => '', 'options' => array('class' => 'icon-user', 'title' => '查看子账户'), 'visible' => 'true', 'url' => 'Yii::app()->createUrl("admin/account", array("id"=>$data->ID))'))), array('header' => '操作', 'class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{view}{update}{delete}', 'buttons' => array('delete' => array('label' => '', 'visible' => 'true', 'click' => 'function(){
                          var bool=confirm("您确定要删除吗");
                         if(bool==false)
                         {
                          return false;
                         }
                          $.ajax({
                              url: $(this).attr("href"),
                              type:"POST",
                              data:{YII_CSRF_TOKEN: $("input[name=YII_CSRF_TOKEN]").val()},
                              dataType:"JSON",
                              success:function(data)
                              {
                                if(data.res==0){
                                 alert(data.message);
                                 location.reload;
Ejemplo n.º 2
0
Archivo: view.php Proyecto: zwq/unpei
<?php

$this->breadcrumbs = array('会员列表' => array('admin'), $model->UserName);
$this->menu = array(array('label' => '创建会员', 'icon' => 'plus', 'url' => array('create')), array('label' => '修改会员', 'icon' => 'pencil', 'url' => array('update', 'id' => $user->ID)), array('label' => '删除会员', 'icon' => 'trash', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->ID), 'confirm' => 'Are you sure to delete this item?')), array('label' => '管理会员', 'icon' => 'cog', 'url' => array('admin')), array('label' => '会员列表', 'icon' => 'list', 'url' => array('/admin/admin')));
?>
<h1><?php 
echo '查看会员' . ' "' . $user->UserName . '"';
?>
</h1>

<?php 
$attributes = array('ID', 'OrganName', 'Email');
array_push($attributes, array('name' => 'Phone', 'value' => $model->Phone), array('name' => 'Type', 'value' => Organ::itemAlias("usertype", $model->Type)), array('name' => 'IsFreeze', 'value' => Organ::itemAlias('freeze', $model->IsFreeze)), array('name' => 'IsBlack', 'value' => Organ::itemAlias('IsBlack', $model->IsBlack)));
array_push($attributes, array('name' => 'Status', 'value' => Organ::itemAlias("UserStatus", $model->Status)), array('name' => 'Identity', 'value' => Organ::itemAlias("Identity", $model->Identity)), array('name' => 'AllAddress', 'value' => Area::getCity($model->Province) . Area::getCity($model->City) . Area::getCity($model->Area) . $model->Address), array('name' => 'Recommend'));
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => $attributes));
Ejemplo n.º 3
0
Archivo: _form.php Proyecto: zwq/unpei
<label for="User_password" class="control-label">确认密码</label>
<?php 
echo $form->passwordField($model, 'verifyPassword', array('value' => $model->PassWord));
echo $form->error($model, 'verifyPassword', array('class' => 'help-block', 'style' => 'color:#B94A48'));
?>

<?php 
echo $form->textFieldRow($organ, 'OrganName');
echo $form->textFieldRow($organ, 'Email', array('prepend' => '@', 'style' => 'width:180px;'));
echo $form->textFieldRow($organ, 'Phone');
echo $form->dropDownListRow($organ, 'Identity', Organ::itemAlias('Identity'), array('empty' => '请选择机构类型'));
?>

<?php 
echo $form->dropDownListRow($organ, 'Status', Organ::itemAlias('UserStatus'));
echo $form->dropDownListRow($organ, 'Type', Organ::itemAlias('usertype'));
$res = Organ::model()->findAll('Identity=:iden', array(':iden' => 2));
echo $form->labelEx($organ, 'RecomID');
echo Chtml::dropDownList('Organ[Recommend]', !empty($organ['Recommend']) ? $organ['Recommend'] : '', CHtml::listData($res, 'OrganName', 'OrganName'), array('class' => 'width90 select', 'id' => 'recm', 'empty' => '请选择推荐人'));
?>
<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 = $organ->isNewRecord ? '' : $organ->Province;
echo Chtml::dropDownList('Organ[Province]', $organ->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 = $organ->isNewRecord ? '' : $organ->City;
if (!$organ->isNewRecord) {
    $city_data = Area::model()->findAll("ParentID=:parent_id", array(":parent_id" => $organ->Province));
    $city = CHtml::listData($city_data, "ID", "Name");
Ejemplo n.º 4
0
Archivo: black.php Proyecto: zwq/unpei
if (Yii::app()->user->hasFlash('success')) {
    ?>
  
<div class="successmessage" id='message'>
<?php 
    echo Yii::app()->user->getFlash('success');
    ?>
  
</div>
<?php 
}
$this->widget('bootstrap.widgets.TbButton', array('label' => '批量移除', 'type' => 'primary', 'size' => 'small', 'id' => 'delblack'));
?>
&nbsp;&nbsp;&nbsp;&nbsp;
<?php 
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'user-grid', 'dataProvider' => $model->black(), 'filter' => $model, 'ajaxUpdate' => false, 'columns' => array(array('class' => 'CCheckBoxColumn', 'headerHtmlOptions' => array('width' => '33px'), 'checkBoxHtmlOptions' => array('name' => 'selectdel[]'), 'selectableRows' => '2'), array('name' => 'ID', 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->ID),array("admin/update","id"=>$data->ID))', 'filter' => false), array('name' => 'UserName', 'type' => 'raw', 'value' => '$data->user->UserName'), array('name' => 'OrganName', 'type' => 'raw', 'value' => 'CHtml::link(UHtml::markSearch($data,"OrganName"),array("admin/view","id"=>$data->ID))'), array('name' => 'Identity', 'value' => 'Organ::itemAlias("Identity",$data->Identity)', 'filter' => Organ::itemAlias("Identity")), array('name' => 'Type', 'value' => 'Organ::itemAlias("usertype",$data->Type)', 'filter' => Organ::itemAlias("usertype")), array('name' => 'Email', 'type' => 'raw', 'value' => 'CHtml::link(UHtml::markSearch($data,"Email"), "mailto:".$data->Email)'), array('name' => 'CreateTime', 'value' => 'date("Y/m/d H:i:s", $data->CreateTime)', 'filter' => false), array('name' => 'Phone', 'value' => '$data->Phone'), array('name' => 'IsFreeze', 'value' => 'Organ::itemAlias("freeze",$data->IsFreeze)', 'filter' => Organ::itemAlias('freeze')), array('name' => 'Status', 'value' => 'Organ::itemAlias("UserStatus",$data->Status)', 'filter' => Organ::itemAlias("UserStatus")), array('name' => 'AllAddress', 'value' => 'Area::getCity($data->Province).Area::getCity($data->City).Area::getCity($data->Area).$data->Address', 'filter' => false), array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{view}{delete}', 'buttons' => array('delete' => array('label' => '移除黑名单', 'url' => 'Yii::app()->createUrl("/admin/deleteblack", array("id"=>$data->ID))'))))));
?>
<input type="hidden" name="YII_CSRF_TOKEN" value="<?php 
echo Yii::app()->request->csrfToken;
?>
" />
<script type="text/javascript">
$('#delblack').click(function(){
    var data=new Array();
    $("input:checkbox[name='selectdel[]']:checked").each(function (){
    	 if(this.value!='')
		  	 {
                data.push($(this).val());
        }
});
    var crowid=data.join(',');