Exemplo n.º 1
0
 public static function getShowData($data)
 {
     $data["subject"] = stripslashes($data["subject"]);
     if (!empty($data["author"])) {
         $data["authorDeptName"] = Department::model()->fetchDeptNameByUid($data["author"]);
     }
     if ($data["approver"] != 0) {
         $data["approver"] = User::model()->fetchRealNameByUid($data["approver"]);
     } else {
         $data["approver"] = Ibos::lang("None");
     }
     $data["addtime"] = ConvertUtil::formatDate($data["addtime"], "u");
     $data["uptime"] = empty($data["uptime"]) ? "" : ConvertUtil::formatDate($data["uptime"], "u");
     $data["categoryName"] = ArticleCategory::model()->fetchCateNameByCatid($data["catid"]);
     if (empty($data["deptid"]) && empty($data["positionid"]) && empty($data["uid"])) {
         $data["departmentNames"] = Ibos::lang("All");
         $data["positionNames"] = $data["uidNames"] = "";
     } elseif ($data["deptid"] == "alldept") {
         $data["departmentNames"] = Ibos::lang("All");
         $data["positionNames"] = $data["uidNames"] = "";
     } else {
         $department = DepartmentUtil::loadDepartment();
         $data["departmentNames"] = ArticleUtil::joinStringByArray($data["deptid"], $department, "deptname", "、");
         $position = PositionUtil::loadPosition();
         $data["positionNames"] = ArticleUtil::joinStringByArray($data["positionid"], $position, "posname", "、");
         if (!empty($data["uid"])) {
             $users = User::model()->fetchAllByUids(explode(",", $data["uid"]));
             $data["uidNames"] = ArticleUtil::joinStringByArray($data["uid"], $users, "realname", "、");
         } else {
             $data["uidNames"] = "";
         }
     }
     return $data;
 }
Exemplo n.º 2
0
 public static function checkReadScope($uid, $data)
 {
     if ($data["deptid"] == "alldept") {
         return true;
     }
     if ($uid == $data["author"]) {
         return true;
     }
     if (empty($data["deptid"]) && empty($data["positionid"]) && empty($data["uid"])) {
         return true;
     }
     $user = User::model()->fetch(array("select" => array("deptid", "positionid"), "condition" => "uid=:uid", "params" => array(":uid" => $uid)));
     $childDeptid = Department::model()->fetchChildIdByDeptids($data["deptid"]);
     if (StringUtil::findIn($user["deptid"], $childDeptid . "," . $data["deptid"])) {
         return true;
     }
     $childCcDeptid = Department::model()->fetchChildIdByDeptids($data["ccdeptid"]);
     if (StringUtil::findIn($user["deptid"], $childCcDeptid . "," . $data["ccdeptid"])) {
         return true;
     }
     if (StringUtil::findIn($data["positionid"], $user["positionid"])) {
         return true;
     }
     if (StringUtil::findIn($data["uid"], $uid)) {
         return true;
     }
     if (StringUtil::findIn($data["ccpositionid"], $user["positionid"])) {
         return true;
     }
     if (StringUtil::findIn($data["ccuid"], $uid)) {
         return true;
     }
     return false;
 }
 public function loadModel($id)
 {
     if (($model = Department::model()->findByPk($id)) === null) {
         throw new CHttpException(404, 'Страница не найдена');
     }
     return $model;
 }
Exemplo n.º 4
0
 public function actionForm($id = null)
 {
     if (Yii::app()->session["username"] != null) {
         $this->layout = "main";
     } else {
         $this->layout = "front";
     }
     $model = new Department();
     if (!empty($_POST["Department"])) {
         // 1.step new Department
         $model = new Department();
         // 2.step edit Department
         if (!empty($id)) {
             $model = Department::model()->findByPk($id);
         }
         // 3. step merge data
         $model->_attributes = $_POST["Department"];
         // 6. step save/update
         if ($model->save()) {
             $this->redirect("index.php?r=department");
         }
     }
     if (!empty($id)) {
         $model = Department::model()->findByPk($id);
     }
     $this->render("//department/form", array("model" => $model));
 }
 /**
  * Страница "Наша команда"
  */
 public function actionIndex()
 {
     // Загрузка страницы "Наша команда"
     Yii::import("application.modules.page.models.Page");
     $page = Page::model()->with(array('slides' => array('scopes' => 'published', 'order' => 'slides.sort ASC')))->findByPath("team");
     // Загрузка списка отделов с сотрудниками и руководителями
     $deparmtents = Department::model()->published()->with(array('chief' => array('scopes' => 'published'), 'employees' => array('scopes' => 'published', 'order' => 'employees.sort ASC')))->findAll(array('order' => 't.sort'));
     // Рендер шаблона
     $this->render('index', array('deparmtents' => $deparmtents, 'page' => $page));
 }
Exemplo n.º 6
0
 /**
  * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
  * using two-column layout. See 'protected/views/layouts/column2.php'.
  */
 public function loadDepartment($departid)
 {
     if ($this->_department === null) {
         $this->_department = Department::model()->findbyPk($departid);
         if ($this->_department === null) {
             throw new CHttpException(404, 'The requested Department does not exist.');
         }
     }
     return $this->_department;
 }
Exemplo n.º 7
0
 public static function getMyFlowIDs($uid)
 {
     $flowIDs = $orgIDs = array();
     $user = User::model()->fetchByUid($uid);
     $allDeptStr = Department::model()->queryDept($user["alldeptid"], true);
     $deptArr = DepartmentUtil::loadDepartment();
     foreach ($deptArr as $id => $dept) {
         if ($dept["pid"] == 0) {
             $orgIDs[] = $id;
         }
     }
     $orgIDs = implode(",", $orgIDs);
     foreach (FlowPermission::model()->fetchAllByPer() as $val) {
         switch ($val["scope"]) {
             case "selfdeptall":
             case "selfdept":
                 $deptid = FlowType::model()->fetchDeptIDByFlowID($val["flowid"]);
                 if ($deptid !== 0 && $user["isadministrator"] != 1) {
                     if ($val["scope"] == "selfdept") {
                         $deptAccess = StringUtil::findIn($user["alldeptid"], $val["deptid"]);
                         $userAccess = WfNewUtil::compareIds($user["uid"], $val["uid"], "u");
                         $posAccess = WfNewUtil::compareIds($user["allposid"], $val["positionid"], "p");
                         if ($deptAccess || $userAccess || $posAccess) {
                             $flowIDs[] = $val["flowid"];
                         }
                     } elseif (self::hasAccess($user, $val)) {
                         $flowIDs[] = $val["flowid"];
                     }
                 } else {
                     $flowIDs[] = $val["flowid"];
                 }
                 break;
             case "selforg":
                 if (StringUtil::findIn($allDeptStr, $orgIDs)) {
                     if (self::hasAccess($user, $val)) {
                         $flowIDs[] = $val["flowid"];
                     }
                 }
                 break;
             case "alldept":
                 if (self::hasAccess($user, $val)) {
                     $flowIDs[] = $val["flowid"];
                 }
                 break;
             default:
                 if (StringUtil::findIn($allDeptStr, $val["scope"])) {
                     if (self::hasAccess($user, $val)) {
                         $flowIDs[] = $val["flowid"];
                     }
                 }
                 break;
         }
     }
     return $flowIDs;
 }
Exemplo n.º 8
0
 public function getProcessInfo()
 {
     $data = array("name" => $this->name);
     $preProcessName = FlowProcess::model()->fetchAllPreProcessName($this->flowid, $this->processid);
     foreach ($preProcessName as $key => $value) {
         $data["pre"][$key] = $value["name"];
     }
     if (!empty($this->processto)) {
         foreach (explode(",", $this->processto) as $key => $toId) {
             $toId = intval($toId);
             if ($toId == 0) {
                 $data["next"][$key] = Ibos::lang("End");
             } else {
                 $next = FlowProcess::model()->fetchProcess($this->flowid, $toId);
                 $data["next"][$key] = $next["name"];
             }
             if (isset($next) && !empty($next["processin"])) {
                 $data["prcsout"][$key]["name"] = $next["name"];
                 $data["prcsout"][$key]["con"] = $next["processin"];
             }
         }
     }
     if (!empty($this->processitem)) {
         $itemPart = explode(",", $this->processitem);
         $data["processitem"] = $this->processitem;
         $data["itemcount"] = count($itemPart);
     } else {
         $data["processitem"] = "";
         $data["itemcount"] = 0;
     }
     if (!empty($this->hiddenitem)) {
         $itemPart = explode(",", $this->hiddenitem);
         $data["hiddenitem"] = $this->hiddenitem;
         $data["hiddencount"] = count($itemPart);
     } else {
         $data["hiddenitem"] = "";
         $data["hiddencount"] = 0;
     }
     if (!empty($this->uid)) {
         $data["user"] = User::model()->fetchRealnamesByUids($this->uid);
     } else {
         $data["user"] = "";
     }
     if (!empty($this->deptid)) {
         $data["dept"] = Department::model()->fetchDeptNameByDeptId($this->deptid);
     } else {
         $data["dept"] = "";
     }
     if (!empty($this->positionid)) {
         $data["position"] = Position::model()->fetchPosNameByPosId($this->positionid);
     } else {
         $data["position"] = "";
     }
     return $data;
 }
Exemplo n.º 9
0
 static function departmentOptions()
 {
     $criteria = new CDbCriteria();
     $criteria->select = 'department_id, department_name';
     $model = Department::model()->findAll();
     $departments = array('' => '请选择相应院系');
     foreach ($model as $row) {
         $departments[$row->department_id] = $row->department_name;
     }
     return $departments;
 }
Exemplo n.º 10
0
 public function duplicatedName($attribute, $params)
 {
     if ($this->isNewRecord) {
         if (count(Department::model()->findALl('name=:name', array("name" => $this->name))) > 0) {
             $this->addError($attribute, str_replace("{attribute}", $attribute, Yii::app()->params["templateDuplicatedValueErrorMessage"]));
         }
     } else {
         if (count(Department::model()->findALl('id<> :id and name=:name', array("name" => $this->name, "id" => $this->id))) > 0) {
             $this->addError($attribute, str_replace("{attribute}", $attribute, Yii::app()->params["templateDuplicatedValueErrorMessage"]));
         }
     }
 }
Exemplo n.º 11
0
 public function handleDepartment($event)
 {
     $departments = array();
     $records = Department::model()->findAll(array("order" => "sort ASC"));
     if (!empty($records)) {
         foreach ($records as $record) {
             $dept = $record->attributes;
             $departments[$dept["deptid"]] = $dept;
         }
     }
     Syscache::model()->modify("department", $departments);
 }
Exemplo n.º 12
0
 public function run()
 {
     $currentMenuId = Yii::app()->controller->menuId;
     $arr[0] = $currentMenuId;
     $criteria = new CDbCriteria();
     $criteria->order = 'department_id ASC';
     $departments = Department::model()->localized()->findAll($criteria);
     foreach ($departments as $i => $department) {
         $items[$i] = array('label' => $department->title, 'url' => Yii::app()->createUrl('job/index', array('id' => $department->primaryKey)), 'active' => $department->primaryKey == $currentMenuId);
     }
     //print_r($items);exit;
     $this->render('jobSidebar', array('items' => $items));
 }
Exemplo n.º 13
0
 protected function getProfile()
 {
     $uid = intval(EnvUtil::getRequest("uid"));
     $user = User::model()->fetchByUid($uid);
     $user["fax"] = "";
     if (!empty($user["deptid"])) {
         $dept = Department::model()->fetchByPk($user["deptid"]);
         $user["fax"] = $dept["fax"];
     }
     $user["birthday"] = !empty($user["birthday"]) ? date("Y-m-d", $user["birthday"]) : "";
     $cuids = Contact::model()->fetchAllConstantByUid(Ibos::app()->user->uid);
     $this->ajaxReturn(array("isSuccess" => true, "user" => $user, "uid" => Ibos::app()->user->uid, "cuids" => $cuids));
 }
Exemplo n.º 14
0
 public function actionStruct()
 {
     $id = $_POST['type_id'];
     $mType = $_POST['mType'];
     $products = new Products();
     $stuff = new Halfstaff();
     $dish = new Dishes();
     $prodList = $products->getUseProdList();
     $stuffList = $stuff->getUseStuffList();
     $dishList = $dish->getUseDishList();
     $dishModel = Menu::model()->with('dish')->findAll('t.type_id = :typeId AND mType = :mType', array(':typeId' => $id, ':mType' => $mType));
     $prodModel = Menu::model()->with('products')->findAll('t.type_id = :typeId AND mType = :mType', array(':typeId' => $id, ':mType' => $mType));
     $stuffModel = Menu::model()->with('halfstuff')->findAll('t.type_id = :typeId AND mType = :mType', array(':typeId' => $id, ':mType' => $mType));
     $listDep = CHtml::listData(Department::model()->findAll(), 'department_id', 'name');
     $this->renderPartial('struct', array('id' => $id, 'mType' => $mType, 'listDep' => $listDep, 'dishModel' => $dishModel, 'prodModel' => $prodModel, 'stuffModel' => $stuffModel, 'prodList' => $prodList, 'stuffList' => $stuffList, 'dishList' => $dishList));
 }
Exemplo n.º 15
0
	public function actionUpdate(){
		$id = Yii::app()->request->getParam('id');
		$model = Department::model()->findByPk($id);
		
		if(Yii::app()->request->isPostRequest) {
			$model->attributes = Yii::app()->request->getPost('Department');
			if($model->save()){
				Yii::app()->user->setFlash('success' , '修改成功');
				$this->redirect(array('department/index' , 'companyId' => $this->companyId));
			}
		}
		$printers = $this->getPrinterList();
		$this->render('update' , array(
				'model'=>$model,
				'printers'=>$printers
		));
	}
Exemplo n.º 16
0
 public function fetchShareInfoByUid($uid)
 {
     $record = $this->fetch("uid=:uid", array(":uid" => $uid));
     if (!empty($record)) {
         $shareIdArrTemp = explode(",", $record["deftoid"]);
         $shareIdArr = array_filter($shareIdArrTemp, create_function("\$v", "return !empty(\$v);"));
         $result = array();
         foreach ($shareIdArr as $key => $shareId) {
             $result[$key]["department"] = Department::model()->fetchDeptNameByUid($shareId);
             $result[$key]["user"] = User::model()->fetchRealnameByUid($shareId);
             $result[$key]["userid"] = $shareId;
         }
         return array("shareInfo" => $result, "deftoid" => $record["deftoid"]);
     } else {
         return array("shareInfo" => array(), "deftoid" => "");
     }
 }
Exemplo n.º 17
0
 public function actionUpdate()
 {
     $id = Yii::app()->request->getParam('id');
     $model = Department::model()->findByPk($id);
     if (Yii::app()->request->isPostRequest) {
         Until::isUpdateValid(array($id), $this->companyId, $this);
         //0,表示企业任何时候都在云端更新。
         $model->attributes = Yii::app()->request->getPost('Department');
         $model->update_at = date('Y-m-d H:i:s', time());
         if ($model->save()) {
             Yii::app()->user->setFlash('success', yii::t('app', '修改成功'));
             $this->redirect(array('department/index', 'companyId' => $this->companyId));
         }
     }
     $printers = $this->getPrinterList();
     $this->render('update', array('model' => $model, 'printers' => $printers));
 }
Exemplo n.º 18
0
 public static function processDefaultShowData($diary)
 {
     $dashboardConfig = Yii::app()->setting->get("setting/diaryconfig");
     $lockday = $dashboardConfig["lockday"] ? intval($dashboardConfig["lockday"]) : 0;
     $todayTime = (int) strtotime(date("Y-m-d", time()));
     $diaryTime = (int) $diary["diarytime"];
     $diffDay = ($todayTime - $diaryTime) / (24 * 60 * 60);
     if (0 < $lockday && $lockday < $diffDay) {
         $diary["editIsLock"] = 1;
     } else {
         $diary["editIsLock"] = 0;
     }
     $diary["addtime"] = date("Y-m-d H:i:s", $diary["addtime"]);
     $diary["originalDiarytime"] = $diary["diarytime"];
     $diary["diarytime"] = DiaryUtil::getDateAndWeekDay(date("Y-m-d", $diary["diarytime"]));
     $diary["nextDiarytime"] = DiaryUtil::getDateAndWeekDay(date("Y-m-d", $diary["nextdiarytime"]));
     $diary["realname"] = User::model()->fetchRealnameByUid($diary["uid"]);
     $diary["departmentName"] = Department::model()->fetchDeptNameByUid($diary["uid"]);
     $diary["shareuid"] = StringUtil::wrapId($diary["shareuid"]);
     return $diary;
 }
Exemplo n.º 19
0
 public function fetchAllListByFlowId($flowId)
 {
     $list = $this->fetchAllByFlowId($flowId);
     foreach ($list as &$per) {
         $per["userName"] = !empty($per["uid"]) ? User::model()->fetchRealnamesByUids($per["uid"]) : "";
         if (!empty($per["deptid"])) {
             if ($per["deptid"] == "alldept") {
                 $per["deptName"] = "全体部门";
             } else {
                 $per["deptName"] = Department::model()->fetchDeptNameByDeptId($per["deptid"]);
             }
         } else {
             $per["deptName"] = "";
         }
         $per["posName"] = !empty($per["positionid"]) ? Position::model()->fetchPosNameByPosId($per["positionid"]) : "";
         $per["typeName"] = Ibos::lang($this->_typeLangMap[$per["type"]], "workflow.default");
         if (array_key_exists($per["scope"], $this->_scopeLangMap)) {
             $per["scopeName"] = Ibos::lang($this->_scopeLangMap[$per["scope"]], "workflow.default");
         } else {
             $per["scopeName"] = Department::model()->fetchDeptNameByDeptId($per["scope"]);
         }
     }
     return $list;
 }
Exemplo n.º 20
0
<tr>
	
	<td><?php 
echo CHtml::link(CHtml::encode($data->username), array('view', 'id' => $data->id));
?>
</td>

        <td><?php 
echo CHtml::encode(Department::model()->find('id = :id ', array(':id' => $data->department))->attributes['name']);
?>
</td>
                
	<td><?php 
echo CHtml::encode($data->email);
?>
</td>
	<td><?php 
echo CHtml::encode($data->mobile);
?>
</td>
        <td><?php 
echo CHtml::encode(date("Y-m-d H:i:s", $data->regtime));
?>
</td>
	<td><?php 
echo !$data->disable ? "<i class='fa fa-circle-o'>" : "<i class='fa fa-check-circle-o '></i>";
?>
</td>
        
        <td id="admin-user-list-<?php 
echo $data->id;
Exemplo n.º 21
0
<?php

$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'dep-realize-form', 'enableAjaxValidation' => false));
?>


	<?php 
echo $form->errorSummary($model);
?>

    <?php 
echo CHtml::dropDownList('department', '', CHtml::listData(Department::model()->findAll(), 'department_id', 'name'), array('id' => 'department', 'empty' => '--Выберите отдел--'));
?>
<br />
<br />
<div id="data">
    
</div>
<script>
    $(document).ready(function(){
        var depId;
        $('#department').change(function(){
            depId = $(this).val();
            $.ajax({
               type: "POST",
               url: "<?php 
echo Yii::app()->createUrl('depRealize/todayStorage');
?>
",
               data: "depId="+depId,
               success: function(data){
Exemplo n.º 22
0
echo Yii::t('TeamModule.team', 'Fields with');
?>
    <span class="required">*</span>
    <?php 
echo Yii::t('TeamModule.team', 'are required.');
?>
</div>

<?php 
echo $form->errorSummary($model);
?>

<div class="row">
    <div class="col-sm-3">
        <?php 
echo $form->dropDownListGroup($model, 'department_id', ['widgetOptions' => ['data' => Department::model()->departmentList, 'htmlOptions' => ['class' => 'popover-help', 'empty' => Yii::t('TeamModule.team', '--choose--'), 'data-original-title' => $model->getAttributeLabel('department_id'), 'data-content' => $model->getAttributeDescription('department_id')]]]);
?>
    </div>
    <div class="col-sm-2">
        <?php 
echo $form->dropDownListGroup($model, 'status', ['widgetOptions' => ['data' => $model->statusList, 'htmlOptions' => ['class' => 'popover-help', 'empty' => Yii::t('TeamModule.team', '--choose--'), 'data-original-title' => $model->getAttributeLabel('status'), 'data-content' => $model->getAttributeDescription('status')]]]);
?>
    </div>
    <div class="col-sm-2">
        <label></label>
        <?php 
echo $form->checkBoxGroup($model, 'in_contact_widget', ['widgetOptions' => ['htmlOptions' => ['class' => 'popover-help', 'data-original-title' => $model->getAttributeLabel('in_contact_widget'), 'data-content' => $model->getAttributeDescription('in_contact_widget')]]]);
?>
    </div>
</div>
 public function actionAdminlibdataExportToExcel()
 {
     $dep_name = "Admin Department";
     $department = Department::model()->findByAttributes(array('department_name' => $dep_name, 'department_organization_id' => Yii::app()->user->getState('org_id')));
     $dep_id = $department['department_id'];
     if ($dep_id) {
         $emp_data = EmployeeTransaction::model()->findAll('employee_transaction_organization_id = ' . Yii::app()->user->getState('org_id') . ' AND employee_transaction_department_id = ' . $dep_id);
         if ($emp_data) {
             $this->toExcel($emp_data, array('Rel_Emp_Info.title::Title', 'Rel_Emp_Info.employee_first_name::First Name', 'Rel_Emp_Info.employee_middle_name::Middle Name', 'Rel_Emp_Info.employee_last_name::Surname', 'Rel_Emp_Info.employee_mother_name::Mother Name', 'Rel_Emp_Info.employee_middle_name::Father Name', 'Rel_Employee_Address.employee_address_c_line1::Address Line 1', 'Rel_Employee_Address.employee_address_c_line2::Address Line 2', 'Rel_Employee_Address.Rel_c_city.city_name::City/Village', 'Rel_Employee_Address.Rel_c_state.state_name::State', 'Rel_Employee_Address.employee_address_c_pincode::Postal Code', 'res_phone::Res Phone', 'Rel_Emp_Info.employee_private_mobile::Mobile Phone #', 'Rel_Emp_Info.employee_dob::Date of Birth', 'Rel_Emp_Info.employee_gender::Gender', 'phd::PhD', 'master_degree::Master Degree', 'bachelor_degree::Bachelor Degree', 'diploma::Diploma', 'other::Other', 'Rel_Designation.employee_designation_name::Exact Designation', 'appointment_type::Appointment Type', 'Rel_Emp_Info.employee_joining_date::Date of Joining', 'pf_number::PF Number', 'salary_type::Salary Type', 'salary_mode::Salary Mode', 'gross_per_month::Gross Pay Per Month', 'bank_name::Bank Name', 'Rel_Emp_Info.employee_account_no::Bank Account Number', 'ifsc_code::IFSC Code', 'Rel_Emp_Info.employee_private_email::Email', 'Rel_Emp_Info.employee_pancard_no::PAN'), 'AdminLibStaffExcel', array('creator' => 'Rudrasoftech'), 'Excel2007');
         } else {
             echo "No data Found" . "</br>";
             echo CHtml::link('GO BACK', Yii::app()->createUrl('/site/newdashboard'));
             break;
         }
     } else {
         echo "No data Found" . "</br>";
         echo CHtml::link('GO BACK', Yii::app()->createUrl('/site/newdashboard'));
         break;
     }
 }
Exemplo n.º 24
0
 public function actionCalculate()
 {
     $dep = CHtml::listData(Department::model()->findAll(), 'department_id', 'name');
     $this->render('calculate', array('dep' => $dep));
 }
?>
<button style='margin-left:50px;' class='submit' onclick="javascript:window.print()" id="printid1" class="submit">Print</button>
<?php
if($emp_info)
{
	$trans = EmployeeTransaction::model()->findByPk($emp_info->employee_info_transaction_id); 
	$titl = "<b>".$emp_info->title."</b>"; 	
	$name = "<b>".$emp_info->employee_first_name." ".$emp_info->employee_middle_name." ".$emp_info->employee_last_name."</b>"; 
	
	$attendence_no = "<b>".$attendence_no."</b>";
	$gender = "<b>".$emp_info->employee_gender."</b>";
	$emobile = "<b>".$emp_info->employee_private_mobile."</b>";

	if($trans->employee_transaction_department_id !=0)
		$department = "<b>".Department::model()->findByPk($trans->employee_transaction_department_id)->department_name."</b>";
	else 
		$department = "<b>not set</b>";
	
	if($trans->employee_transaction_designation_id !=0)
		$designation = "<b>".EmployeeDesignation::model()->findByPk($trans->employee_transaction_designation_id)->employee_designation_name."</b>";
	else 
		$designation = "<b>not set</b>";
	
	$lin1 = "<b>not set</b>";
	$lin2 = "<b>not set</b>";
	$ct = "<b>not set</b>";
	$stat = "<b>not set</b>";
	$pc = "<b>not set</b>";

	if($trans->employee_transaction_emp_address_id !=0)
Exemplo n.º 26
0
 public function actionGetMajors()
 {
     if (!isset($_POST['department_id'])) {
         return;
     }
     $dep_id = $_POST['department_id'];
     $majors = Department::model()->findByPk($dep_id)->majors;
     $majors = CHtml::listData($majors, 'major_id', 'major_name');
     $htmlData = CHtml::tag('option', array('selected' => 'selected', 'value' => ''), '请选择专业');
     foreach ($majors as $value => $key) {
         $htmlData .= Chtml::tag('option', array('value' => $value), Chtml::encode($key));
     }
     echo json_encode(array('htmlData' => $htmlData));
 }
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'employee-leave-info-form',
	'enableAjaxValidation'=>true,
)); ?>
	<div class="row">        
	<?php echo CHtml::label(Yii::t('demo','Year'),'year'); ?>
	<?php echo CHtml::dropdownlist('year','',$yearValue,array('prompt'=>'Select Year','options'=>array($yr=>array('selected'=>true))));
	?>		 	
	</div>
	<div class="row">
	<?php echo CHtml::label(Yii::t('demo', 'Month'), 'month'); ?>
	<?php echo CHtml::dropDownList('months', '' , $months, array('prompt'=>'Select 			Month','options' =>array($month=>array('selected'=>true)))); ?>	
	</div>
	<div class="row">
	<?php echo CHtml::label(Yii::t('demo', 'Department'), 'department'); ?>
	<?php echo CHtml::dropDownList('department', '',CHtml::listData(Department::model()->findAll(), 'department_id','department_name'),array('empty'=>'Select Department','options' =>array($dept=>array('selected'=>true)),));?>
	
	</div>
	
	<div class="row buttons">
		<?php echo CHtml::submitButton('Submit', array('class'=>'submit')); ?>
	</div>	

<?php $this->endWidget(); ?>
</div>	<!-- div form end--> 
</div>
<?php 
if(isset($yr)&& isset($month))
{
$month_value = $month;
$num = cal_days_in_month(CAL_GREGORIAN, $month_value, date('Y')); 
Exemplo n.º 28
0
	<?php 
echo $form->errorSummary($model);
?>

<?php 
echo $form->textFieldRow($model, 'name', array('class' => 'span3', 'maxlength' => 100));
echo $form->textFieldRow($model, 'login', array('class' => 'span3', 'maxlength' => 100));
?>
<label for="Employee_password">Пароль</label>
<?php 
echo CHtml::passwordField('Employee[password]', '', array('class' => 'span3', 'maxlength' => 100));
echo $form->dropDownListRow($model, 'role', array(0 => 'Повар', 1 => 'Официант', 2 => 'Администратор'), array('class' => 'span3', 'empty' => 'Выберите роль'));
?>
<span id="department">
<?php 
echo $form->dropDownListRow($model, 'depId', CHtml::listData(Department::model()->findAll(), 'department_id', 'name'), array('class' => 'span3', 'empty' => 'Выберите отдел'));
?>
</span>
<?php 
echo $form->checkBoxRow($model, 'check_percent');
?>


<div class="form-actions">
	<?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $model->isNewRecord ? 'Сохранить' : 'Сохранить'));
?>
</div>
<script>
    $(document).ready(function(){
        $('#Employee_role').change(function(){
Exemplo n.º 29
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Department the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Department::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemplo n.º 30
0
 /**
  * Index Page, for now just render all static content.
  */
 public function actionIndex()
 {
     $departs = Department::model()->with('staff')->findAllByAttributes(array('d_isShown' => 1));
     $this->render('index', array('departs' => $departs));
 }