Ejemplo n.º 1
0
 /**
  * (string) actionIndex : marryList
  * @param $pid personal_id
  * @return string
  */
 public function actionIndex($pid)
 {
     /*Personal*/
     $personal = Personal::getPersonalByPid($pid);
     if (!$personal) {
         die('参数错误..');
     }
     $code1 = $personal->code1;
     $because = $personal->marry;
     $becausedate = $personal->marrydate;
     switch ($because) {
         case '22':
             $becausedate = $personal->zhdate;
             break;
         case '23':
             $becausedate = $personal->fhdate;
             break;
         case '30':
         case '40':
             $becausedate = $personal->lhdate;
             break;
     }
     /*配置参数*/
     $preferences = [];
     $preferencesForDT = [];
     $preferences['marry'] = Preferences::getByClassmark('pmarry');
     $preferences['hkxz'] = Preferences::getByClassmark('chkxz');
     $preferencesForDT['marry'] = Preferences::getByClassmarkForDatatables('pmarry');
     $preferencesForDT['hkxz'] = Preferences::getByClassmarkForDatatables('chkxz');
     return $this->render('index', ['pPrimaryKey' => $personal->id, 'pid' => $pid, 'id' => Marry::generateId($pid), 'code1' => $code1, 'because' => $because, 'becausedate' => $becausedate, 'selfno' => $personal->selfno, 'preferences' => Json::encode($preferences), 'preferencesForDT' => Json::encode($preferencesForDT)]);
 }
Ejemplo n.º 2
0
 public static function send($toEmail, $subject, $template, $data = [], $options = [])
 {
     if (!filter_var($toEmail, FILTER_VALIDATE_EMAIL) || !$subject || !$template) {
         return false;
     }
     $data['subject'] = trim($subject);
     $message = Yii::$app->mailer->compose($template, $data)->setTo($toEmail)->setSubject($data['subject']);
     if (filter_var(Preferences::get('sEmail', 'username'), FILTER_VALIDATE_EMAIL)) {
         $message->setFrom(Preferences::get('sEmail', 'username'));
     }
     if (!empty($options['replyTo']) && filter_var($options['replyTo'], FILTER_VALIDATE_EMAIL)) {
         $message->setReplyTo($options['replyTo']);
     }
     return $message->send();
 }
Ejemplo n.º 3
0
 /**
  * (string) actionDetail : 右侧区域信息
  * @return string
  * @throws NotFoundHttpException
  */
 public function actionDetail()
 {
     //$this->layout = 'bank';
     $id = Yii::$app->request->post('id', '%');
     if ($id == '0' || $id == '@') {
         $id = '%';
     }
     $name = Yii::$app->request->post('name', '计生管理系统');
     $unit = new Unit();
     $p_num = Personal::find()->where(['unit' => $id])->count(1);
     if ($unit->isParent($id) && $p_num <= 0) {
         return $this->renderAjax('_detail', ['parent' => $id, 'parentName' => $name, 'unitcode' => Unit::getMaxunitcode($id), 'isParent' => intval($this->findModel($id)->corpflag) < 5 ? "yes" : "no"]);
     } else {
         $preferences = [];
         $preferences['sex'] = Preferences::getByClassmark('psex');
         $preferences['marry'] = Preferences::getByClassmark('pmarry');
         $preferences['flag'] = Preferences::getByClassmark('pflag');
         $preferences['work1'] = Preferences::getByClassmark('pwork1');
         return $this->renderAjax('/personal/_list', ['parent' => $id, 'parentName' => $name, 'code1' => Personal::getMaxCode(), 'preferences' => Json::encode($preferences)]);
     }
 }
Ejemplo n.º 4
0
 /**
  * (int) actionAdd : 添加 classmark 的 name1
  * @return int
  */
 public function actionAdd()
 {
     $request = Yii::$app->request;
     if ($request->isAjax && $request->isPost) {
         $classmark = $request->post('classmark');
         $name1 = $request->post('name1');
         //清除该`classmark`的缓存
         $key1 = Preferences::CACHE_KEY . $classmark . '_ARRAYDATA_NAME1TONAME1';
         $key2 = Preferences::CACHE_KEY . $classmark . '_ARRAYDATA_NAME1TOCODES';
         Yii::$app->cache->delete($key1);
         Yii::$app->cache->delete($key2);
         //添加
         if (Preferences::set($classmark, $name1, $name1)) {
             return 'success';
         }
     }
     return 'fails';
 }
Ejemplo n.º 5
0
 /**
  * (void) set : 新增或修改指定classmark及codes对应的参数名
  * @static
  * @param $classmark : 参数类型
  * @param $codes : 参数编码
  * @param $name1 : 参数名称
  * @param string $classmarkcn : 中文参数类型
  * @param integer $changemark : 参数修改标识,默认为1
  * @param integer $status : 参数是否启用, 默认为启用(1)
  * @return bool
  * @throws \Exception
  * @throws \yii\db\Exception
  */
 public static function set($classmark, $codes, $name1, $classmarkcn = '', $changemark = 1, $status = 1)
 {
     $trans = self::getDb()->beginTransaction();
     try {
         $preferences = self::find()->where(['classmark' => $classmark, 'codes' => $codes])->one();
         if ($preferences) {
             $preferences->name1 = $name1;
         } else {
             $preferences = new Preferences();
             $preferences->codes = $codes;
             $preferences->name1 = $name1;
             $preferences->classmark = $classmark;
             $preferences->changemark = $changemark;
             $preferences->classmarkcn = $classmarkcn;
             //? $classmarkcn : $classmark;
             $preferences->status = $status;
         }
         if ($preferences->validate()) {
             $preferences->save();
             $trans->commit();
             return true;
             //$returnMsg = '参数类型>>>' . $classmarkcn . '-' . $classmark . '<<<新增或修改>>>'.$name1.'-'.$codes.'<<<成功!';
             //Yii::$app->getSession()->setFlash('success',$returnMsg);
         } else {
             // 验证失败:$errors 是一个包含错误信息的数组
             $trans->rollBack();
             return false;
             //$errors = $preferences->errors;
             //Yii::$app->getSession()->setFlash('danger',\yii\helpers\Json::encode($errors));
         }
     } catch (\Exception $e) {
         $trans->rollBack();
         throw $e;
     }
 }
Ejemplo n.º 6
0
 /**
  * (返回更新的记录数) userPowerUpdate :
  * @param $currentUID   integer 当前登录的用户ID
  * @param $setUID       integer 需要设置单位权限的用户ID
  * @param $permission   integer 字段权限级别
  * @param $id           string  格式:gdjs.pbc_tnam.pbc_cnam
  * @return 返回更新的记录数
  * @throws \yii\db\Exception
  */
 private function userPowerUpdate($currentUID, $setUID, $permission, $id)
 {
     /** @var $result 返回更新的记录数*/
     $result = 0;
     /** @var array $pbc_data [ 0 => 'gdjs', 1 => pbc_tnam, 2 => pbc_cnam ] */
     $pbc_data = explode('.', $id);
     //校验格式,格式不对,返回 0
     if ($pbc_data[0] != 'gdjs' || count($pbc_data) != 3) {
         return $result;
     }
     /** @var string $pbc_tnam 表名 */
     $pbc_tnam = $pbc_data[1];
     /** @var string $pbc_cnam 字段名 */
     $pbc_cnam = $pbc_data[2];
     /** @var $adminRole string 在Preferences中配置,classmark:sSystem */
     $adminRole = Preferences::get('sSystem', 'adminRole');
     //超级管理员
     /** @var $role \yii\rbac\Role[] 当前用户角色数组*/
     $role = Yii::$app->authManager->getRolesByUser(Yii::$app->user->identity->id);
     /** @var $is_admin boolean 是否为超级管理员*/
     $is_admin = array_key_exists($adminRole, $role);
     $SQL = "REPLACE INTO `map_field`(`user_id`, `pbc_tnam`, `pbc_cnam`, `user_power`) " . " SELECT :setUID, :pbc_tnam, :pbc_cnam, :user_power FROM `map_field` " . " WHERE (SELECT COUNT(1) FROM `map_field` WHERE " . " `user_id`=:currentUID AND `pbc_tnam`=:pbc_tnam AND `pbc_cnam`=:pbc_cnam) <= 0 LIMIT 1";
     //超级管理员
     if ($is_admin) {
         $SQL = "REPLACE INTO `map_field`(`user_id`, `pbc_tnam`, `pbc_cnam`, `user_power`) " . " SELECT :setUID, :pbc_tnam, :pbc_cnam, :user_power FROM `map_field` " . " WHERE :currentUID > 0 LIMIT 1";
     }
     $result = Yii::$app->db->createCommand($SQL)->bindValues([':currentUID' => $currentUID, ':setUID' => $setUID, ':pbc_tnam' => $pbc_tnam, ':pbc_cnam' => $pbc_cnam, ':user_power' => $permission])->execute();
     if ($permission == MapField::USER_POWER_ALLOW) {
         //清除完全访问的
         MapField::deleteAll(['user_power' => MapField::USER_POWER_ALLOW]);
     }
     return $result;
 }
Ejemplo n.º 7
0
 public function actionGetFieldConfig()
 {
     //传过来的数据格式为 pbc_tnam.pbc_cnam
     $params = Yii::$app->request->post('params', '');
     $config = [];
     if ($params) {
         $paramArr = explode('.', $params);
         if (count($paramArr) == 2) {
             $pbc_tnam = $paramArr[0];
             $pbc_cnam = $paramArr[1];
             $classmark = ColTable::getClassmark($pbc_tnam, $pbc_cnam);
             $data = $classmark ? Preferences::getByClassmark($classmark) : [];
             if ($pbc_cnam == 'unit') {
                 $data = Unit::getUnitcodeToUnitnameList();
             }
         }
     }
     if (count($data)) {
         foreach ($data as $key => $value) {
             $tmp['id'] = $key;
             $tmp['text'] = $value;
             $config[] = $tmp;
         }
     }
     return count($config) ? Json::encode($config) : '';
 }
Ejemplo n.º 8
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['pbc_tnam', 'pbc_cnam', 'pbc_labl'], 'required'], [['sort_no', 'status', 'created_at', 'updated_at'], 'integer'], [['pbc_tnam', 'pbc_cnam', 'pbc_classmark'], 'string', 'max' => 30], [['pbc_labl'], 'string', 'max' => 80], [['pbc_tnam', 'pbc_cnam'], 'unique', 'targetAttribute' => ['pbc_tnam', 'pbc_cnam'], 'message' => '该表名下的字段名已存在.'], [['pbc_classmark'], 'exist', 'targetClass' => Preferences::className(), 'targetAttribute' => 'classmark']];
 }
Ejemplo n.º 9
0
        if (!$model->new_value) {
            return '';
        }
        $new = explode(',', str_replace(['[', ']', '"'], ['', '', ''], $model->new_value));
        $field = explode(',', str_replace(['[', ']', '"'], ['', '', ''], $model->field));
        $rawModel = new $model->model();
        $table = $rawModel->tableName();
        $display = [];
        foreach ($new as $i => $line) {
            if (in_array($field[$i], ['created_at', 'updated_at', 'created_by', 'updated_by'])) {
                continue;
            }
            $classmark = '';
            $value = '';
            $classmark = \common\populac\models\ColTable::getClassmark($table, $field[$i]);
            $value = \common\populac\models\Preferences::get($classmark, $line);
            $line = $value ? $value : $line;
            $line = '<span class="bg-info text-success">' . $line . '</span>';
            $display[] = $line;
        }
        return '<h4>' . implode('<br>', $display) . '</h4>';
    }, 'contentOptions' => ['width' => '20%'], 'format' => 'raw'];
}
if (empty($columns) || in_array('diff', $columns)) {
    $_columns[] = ['label' => Yii::t('audit', 'Diff'), 'value' => function ($model) {
        /** @var AuditTrail $model */
        return $model->getDiffHtml();
    }, 'format' => 'raw'];
}
if (empty($columns) || in_array('created', $columns)) {
    $_columns[] = ['attribute' => 'created', 'contentOptions' => ['class' => 'text-center', 'style' => ['vertical-align' => 'middle']]];
Ejemplo n.º 10
0
 /**
  * (string) actionSearchList : 多功能查询后的人员列表
  * @return string
  */
 public function actionSearchResult()
 {
     //$this->layout = 'bank';
     $sql = Yii::$app->request->post('sql');
     /*配置参数*/
     $preferences = [];
     $preferences['sex'] = Preferences::getByClassmark('psex');
     $preferences['marry'] = Preferences::getByClassmark('pmarry');
     $preferences['flag'] = Preferences::getByClassmark('pflag');
     $preferences['work1'] = Preferences::getByClassmark('pwork1');
     return $this->renderAjax('_search-list', ['preferences' => Json::encode($preferences), 'sql' => $sql]);
 }
Ejemplo n.º 11
0
                </div>
            </div>
            <div class="row">
                <div class="col-md-4">
                    <?php 
echo $form->field($model, 'postcode')->textInput(['maxlength' => true]);
?>
                </div>
                <div class="col-md-4">
                    <?php 
echo $form->field($model, 'date1')->textInput(['maxlength' => true]);
?>
                </div>
                <div class="col-md-4">
                    <?php 
echo $form->field($model, 'corpflag')->dropDownList(\common\populac\models\Preferences::getByClassmark('ukind'));
?>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-offset-9">
                    <?php 
echo Html::submitButton('保 存', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div>
            <?php 
ActiveForm::end();
?>
Ejemplo n.º 12
0
 * ----------------------------------------------
 * @date: 16-7-1 下午4:16
 * @author: LocoRoco<*****@*****.**>
 * @version:v2016
 * @since:Yii2
 * ----------------------------------------------
 * 程序文件简介:
 * ==============================================
 */
/**
 * @var \mdm\admin\models\User $user 当前用户
 * @var string $avatar 用户头像地址
 */
$user_avatar = \common\populac\models\Preferences::get('sSystem', 'backendUrl') . '/uploads/user/default/user2-160x160.jpg';
if ($avatar) {
    $user_avatar = \common\populac\models\Preferences::get('sSystem', 'backendUrl') . '/uploads/user/avatar/' . $avatar;
}
$this->title = '修改用户头像';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box box-primary">
    <div class="box-body">
        <div class="row">
            <div class="col-md-3">
                <?php 
echo $this->render('@common/views/user/settings/_menu');
?>
            </div>
            <div class="col-md-9">
                <div class="panel panel-info">
                    <div class="panel-heading">
Ejemplo n.º 13
0
 public function notifyUser()
 {
     $settings = Yii::$app->getModule('populac')->activeModules['guestbook']->settings;
     return Mail::send($this->email, $settings['subjectNotifyUser'], $settings['templateNotifyUser'], ['post' => $this, 'link' => str_replace(Preferences::get('sSystem', 'backendUrl'), '', Url::to([$settings['frontendGuestbookRoute']], true))]);
 }
Ejemplo n.º 14
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['code1', 'name1', 'sex', 'birthdate', 'fcode', 'marry', 'unit', 's_date', 'flag', 'memo1', 'selfno', 'childnum', 'mz', 'work1', 'ingoingdate', 'address1', 'hkaddr', 'hkxz', 'e_date', 'checktime'], 'required'], [['marrydate'], 'required', 'when' => function ($model) {
         return $model->marry != '10';
     }, 'whenClient' => "function (attribute, value) {\n                    return \$('#p-marry').val() != '10';\n                }"], [['lhdate'], 'required', 'when' => function ($model) {
         return in_array($model->marry, [Preferences::getCodesByName1('pmarry', '离婚'), Preferences::getCodesByName1('pmarry', '再婚'), Preferences::getCodesByName1('pmarry', '复婚')]);
     }, 'whenClient' => "function (attribute, value) {\n                    return \$.inArray(\$('#p-marry').val(), ['22', '23', '40']) > -1 ;\n                }"], [['zhdate'], 'required', 'when' => function ($model) {
         return $model->marry == '22';
     }, 'whenClient' => "function (attribute, value) {\n                    return \$('#p-marry').val() == '22';\n                }"], [['fhdate'], 'required', 'when' => function ($model) {
         return $model->marry == '23';
     }, 'whenClient' => "function (attribute, value) {\n                    return \$('#p-marry').val() == '23';\n                }"], [['s_date', 'birthdate', 'ingoingdate', 'jobdate', 'marrydate', 'lhdate', 'zhdate', 'fhdate'], 'date', 'format' => 'php:Ymd', 'message' => '日期格式:YYYYMMDD'], [['e_date'], 'number'], [['childnum', 'selfno', 'logout', 'checktime', 'created_by', 'updated_by', 'created_at', 'updated_at'], 'integer'], [['code1'], 'string', 'max' => 36], [['name1', 'tel', 'whcd', 'is_dy', 'title', 'zw', 'ltman', 'lttel', 'cardcode', 'do_man'], 'string', 'max' => 50], [['sex', 'mz', 'marry', 'hkxz', 'work1', 'obect1', 'flag', 'memo1', 'onlysign', 'cztype', 'incity'], 'string', 'max' => 2], [['birthdate', 'marrydate', 'postcode', 'jobdate', 'ingoingdate', 'lhdate', 'zhdate', 'fhdate', 'ltpostcode', 'carddate', 'examinedate', 'feeddate', 'yzdate', 's_date', 'e_date', 'marrowdate', 'leavedate', 'audittime'], 'string', 'max' => 8], [['fcode'], 'string', 'max' => 18, 'min' => 15], [['address1', 'hkaddr', 'ltunit', 'ltaddr', 'fzdw', 'checkunit'], 'string', 'max' => 80], [['grous', 'unit', 'oldunit'], 'string', 'max' => 30], [['picture_name', 'memo2'], 'string', 'max' => 100], [['memo'], 'string', 'max' => 254], [['personal_id'], 'string', 'max' => 60], [['personal_id'], 'unique'], [['unit'], 'exist', 'skipOnError' => true, 'targetClass' => Unit::className(), 'targetAttribute' => ['unit' => 'unitcode']]];
 }
Ejemplo n.º 15
0
 /**
  * (返回更新的记录数) userPowerUpdate :
  * @param $currentUID   integer 当前登录的用户ID
  * @param $setUID       integer 需要设置单位权限的用户ID
  * @param $permission   integer 单位权限级别
  * @param $unitcode     string  单位编码
  * @param int $type             更新类型
  * @return 返回更新的记录数
  * @throws \yii\db\Exception
  */
 private function userPowerUpdate($currentUID, $setUID, $permission, $unitcode, $type = self::UPDATE_SELF)
 {
     /** @var $result 返回更新的记录数*/
     $result = 0;
     /** @var $adminRole string 在Preferences中配置,classmark:sSystem */
     $adminRole = Preferences::get('sSystem', 'adminRole');
     //超级管理员
     /** @var $role \yii\rbac\Role[] 当前用户角色数组*/
     $role = Yii::$app->authManager->getRolesByUser(Yii::$app->user->identity->id);
     /** @var $is_admin boolean 是否为超级管理员*/
     $is_admin = array_key_exists($adminRole, $role);
     $unitlist = $unitcode;
     switch ($type) {
         case self::UPDATE_CHILDLIST:
             $unitlist = Unit::getChildList($unitcode);
             break;
         case self::UPDATE_PARENTLIST:
             $unitlist = Unit::getParentList($unitcode);
             break;
     }
     $SQL = "REPLACE INTO `map_unit`(`user_id`, `unitcode`, `user_power`) " . " SELECT {$setUID}, cur_mu.unitcode, CASE WHEN cur_mu.user_power >= :user_power THEN :user_power ELSE cur_mu.user_power END FROM " . " (SELECT unitcode, user_power FROM `map_unit` WHERE `user_id` = :currentUID AND FIND_IN_SET(unitcode,:unitlist)) cur_mu " . " LEFT JOIN (SELECT unitcode, user_power FROM `map_unit` WHERE `user_id` = :setUID ) set_mu ON (cur_mu.unitcode = set_mu.unitcode) " . " WHERE (set_mu.user_power <= cur_mu.user_power and set_mu.user_power <> :user_power or set_mu.user_power IS NULL)";
     //超级管理员
     if ($is_admin) {
         $SQL = "REPLACE INTO `map_unit`(`user_id`, `unitcode`, `user_power`) " . " SELECT {$setUID}, u.unitcode, {$permission} FROM " . " (SELECT unitcode FROM `unit` WHERE FIND_IN_SET(unitcode,:unitlist)) u " . " LEFT JOIN (SELECT unitcode, user_power FROM `map_unit` WHERE `user_id` = :setUID ) set_mu ON (u.unitcode = set_mu.unitcode) " . " WHERE :currentUID > 0 and (set_mu.user_power <> :user_power or set_mu.user_power IS NULL)";
     }
     $result = Yii::$app->db->createCommand($SQL)->bindValues([':currentUID' => $currentUID, ':user_power' => $permission, ':unitlist' => $unitlist, ':setUID' => $setUID])->execute();
     if ($permission == MapUnit::USER_POWER_DENY) {
         //清除禁止访问的
         MapUnit::deleteAll(['user_power' => MapUnit::USER_POWER_DENY]);
     }
     return $result;
 }
Ejemplo n.º 16
0
    echo $i;
    ?>
" name="value-<?php 
    echo $i;
    ?>
" multiple="multiple" style="width: 100%;">
                                </select>
                            </div>
                            <div class="col-md-1 col-right">
                                <?php 
    echo \kartik\widgets\Select2::widget(['name' => 'right-' . $i, 'theme' => \kartik\select2\Select2::THEME_BOOTSTRAP, 'data' => \common\populac\models\Preferences::getByClassmark('tRight'), 'options' => ['prompt' => '', 'title' => '如需要选择右括号,请选择..'], 'pluginOptions' => ['allowClear' => true, 'minimumResultsForSearch' => 'Infinity']]);
    ?>
                            </div>
                            <div class="col-md-1 col-relation">
                                <?php 
    echo \kartik\widgets\Select2::widget(['name' => 'relation-' . $i, 'theme' => \kartik\select2\Select2::THEME_BOOTSTRAP, 'data' => \common\populac\models\Preferences::getByClassmark('tRelation'), 'value' => 'and', 'options' => ['multiple' => false], 'pluginOptions' => ['minimumResultsForSearch' => 'Infinity']]);
    ?>
                            </div>
                        </div>
                    <?php 
}
?>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关 闭</button>
                    <button type="button" class="btn btn-primary" id="btn-view-adv-search-relation">确 定</button>
                </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
Ejemplo n.º 17
0
                <div class="col-sm-12">
                    <?php 
echo Html::submitButton('保 存', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-info']);
?>
                </div>
            </div>
            <?php 
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 6, 'attributes' => ['personal_id' => ['type' => Form::INPUT_HIDDEN, 'label' => false, 'columnOptions' => ['colspan' => 0]], 's_date' => ['type' => Form::INPUT_TEXT, 'columnOptions' => ['colspan' => 2], 'options' => ['placeholder' => '请输入登记日期..', 'maxlength' => 8]], 'code1' => ['type' => Form::INPUT_TEXT, 'columnOptions' => ['colspan' => 2], 'options' => ['placeholder' => '请输入员工编码..', 'maxlength' => 36]], 'name1' => ['type' => Form::INPUT_TEXT, 'columnOptions' => ['colspan' => 2], 'options' => ['placeholder' => '请输入员工姓名..', 'maxlength' => 50]]]]);
?>
        </div>

        <div class="col-sm-12">
            <?php 
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 4, 'attributes' => ['fcode' => ['type' => Form::INPUT_TEXT, 'options' => ['id' => 'p-fcode', 'placeholder' => '身份证号', 'maxlength' => 18]], 'sex' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => Preferences::getByClassmark('psex'), 'options' => ['id' => 'p-sex', 'readOnly' => true]], 'birthdate' => ['type' => Form::INPUT_TEXT, 'options' => ['id' => 'p-birthdate', 'placeholder' => '请输入出生日期..', 'maxlength' => 8, 'readOnly' => true]], 'unit' => ['type' => Form::INPUT_TEXT, 'options' => ['id' => 'p-unit', 'readOnly' => true, 'maxlength' => 30]], 'flag' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => Preferences::getByClassmark('pflag'), 'options' => ['placeholder' => 'Enter Flag...', 'maxlength' => 2]], 'hkxz' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => Preferences::getByClassmark('chkxz'), 'options' => ['placeholder' => 'Enter Hkxz...', 'maxlength' => 2]], 'marry' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => Preferences::getByClassmark('pmarry'), 'options' => ['id' => 'p-marry', 'placeholder' => 'Enter Marry...', 'maxlength' => 2]], 'marrydate' => ['type' => Form::INPUT_TEXT, 'options' => ['id' => 'p-marrydate', 'placeholder' => 'Enter Marrydate...', 'maxlength' => 8]], 'memo1' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => Preferences::getByClassmark('pmemo1'), 'options' => ['placeholder' => 'Enter Memo1...', 'maxlength' => 2]], 'selfno' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter Selfno...']], 'lhdate' => ['type' => Form::INPUT_TEXT, 'options' => ['id' => 'p-lhdate', 'placeholder' => 'Enter Lhdate...', 'maxlength' => 8]], 'zhdate' => ['type' => Form::INPUT_TEXT, 'options' => ['id' => 'p-zhdate', 'maxlength' => 8]], 'work1' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => Preferences::getByClassmark('pwork1'), 'options' => ['placeholder' => 'Enter Work1...', 'maxlength' => 2]], 'childnum' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter Childnum...']], 'obect1' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => Select2::className(), 'options' => ['data' => Preferences::getByClassmark('pobect1'), 'options' => ['placeholder' => '--请选择--'], 'pluginOptions' => ['allowClear' => true]]], 'fhdate' => ['type' => Form::INPUT_TEXT, 'options' => ['id' => 'p-fhdate', 'maxlength' => 8]], 'mz' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => Preferences::getByClassmark('pmz'), 'options' => ['placeholder' => 'Enter Mz...', 'maxlength' => 2]], 'whcd' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => Select2::className(), 'options' => ['data' => Preferences::getByClassmarkReturnName1ToName1('pwhcd'), 'options' => ['placeholder' => '请输入..', 'id' => 'p-whcd', 'data-classmark' => 'pwhcd', 'data-classmarkcn' => '文化程度'], 'pluginOptions' => ['tags' => true, 'tokenSeparators' => [',', ' '], 'maximumInputLength' => 10]]], 'title' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => Select2::className(), 'options' => ['data' => Preferences::getByClassmarkReturnName1ToName1('ptitle'), 'options' => ['placeholder' => '请输入..', 'id' => 'p-title', 'data-classmark' => 'ptitle', 'data-classmarkcn' => '职称'], 'pluginOptions' => ['tags' => true, 'tokenSeparators' => [',', ' '], 'maximumInputLength' => 10]]], 'zw' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => Select2::className(), 'options' => ['data' => Preferences::getByClassmarkReturnName1ToName1('awork1'), 'options' => ['placeholder' => '请输入..', 'id' => 'p-zw', 'data-classmark' => 'awork1', 'data-classmarkcn' => '职务'], 'pluginOptions' => ['tags' => true, 'tokenSeparators' => [',', ' '], 'maximumInputLength' => 10]]], 'is_dy' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => Select2::className(), 'options' => ['data' => Preferences::getByClassmarkReturnName1ToName1('pis_dy'), 'options' => ['placeholder' => '请输入..', 'id' => 'p-is_dy', 'data-classmark' => 'pis_dy', 'data-classmarkcn' => '政治面貌'], 'pluginOptions' => ['tags' => true, 'tokenSeparators' => [',', ' '], 'maximumInputLength' => 10]]], 'onlysign' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => Preferences::getByClassmark('ponlysign'), 'options' => ['placeholder' => 'Enter Onlysign...', 'maxlength' => 2]], 'tel' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter Tel...', 'maxlength' => 50]], 'jobdate' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter Jobdate...', 'maxlength' => 8]], 'address1' => ['type' => Form::INPUT_TEXT, 'columnOptions' => ['colspan' => 2], 'options' => ['placeholder' => 'Enter Address1...', 'maxlength' => 80]], 'grous' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => Select2::className(), 'options' => ['data' => Preferences::getByClassmarkReturnName1ToName1('pgrous'), 'options' => ['placeholder' => '请输入..', 'id' => 'p-grous', 'data-classmark' => 'pgrous', 'data-classmarkcn' => '所属街道'], 'pluginOptions' => ['tags' => true, 'tokenSeparators' => [',', ' '], 'maximumInputLength' => 10]]], 'ingoingdate' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter Ingoingdate...', 'maxlength' => 8]]]]);
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 4, 'attributes' => ['hkaddr' => ['type' => Form::INPUT_TEXT, 'columnOptions' => ['colspan' => 2], 'options' => ['placeholder' => 'Enter Hkaddr...', 'maxlength' => 80]], 'logout' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => Preferences::getByClassmark('plogout'), 'options' => ['placeholder' => 'Enter Logout...']], 'e_date' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter E Date...', 'maxlength' => 8]]]]);
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 4, 'attributes' => ['memo' => ['type' => Form::INPUT_TEXT, 'columnOptions' => ['colspan' => 2], 'options' => ['placeholder' => 'Enter Memo...', 'maxlength' => 254]], 'checktime' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => Preferences::getByClassmark('pchecktime'), 'options' => ['id' => 'p-checktime', 'placeholder' => 'Enter Checktime...', 'maxlength' => 2]]]]);
ActiveForm::end();
?>
        </div>
    </div>

</div>

<?php 
\common\widgets\JsBlock::begin();
?>
    <script type="text/javascript">
        //身份证合法性
        function certificateNoParse(certificateNo){
            var pat = /^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9]|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}))$/;
            if(!pat.test(certificateNo))
Ejemplo n.º 18
0
?>

    <?php 
echo $form->field($model, 'cnname')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'memo')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'order_num')->textInput();
?>

    <?php 
echo $form->field($model, 'status')->dropDownList(\common\populac\models\Preferences::getByClassmark('sStatus'));
?>

  
	<?php 
if (!Yii::$app->request->isAjax) {
    ?>
	  	<div class="form-group">
	        <?php 
    echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
    ?>
	    </div>
	<?php 
}
?>