public function getInitData($req)
 {
     $data = array();
     $employees = new Employee();
     $data['numberOfEmployees'] = $employees->Count("1 = 1");
     $company = new CompanyStructure();
     $data['numberOfCompanyStuctures'] = $company->Count("1 = 1");
     $user = new User();
     $data['numberOfUsers'] = $user->Count("1 = 1");
     $project = new Project();
     $data['numberOfProjects'] = $project->Count("status = 'Active'");
     $attendance = new Attendance();
     $data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '" . date("Y-m-d H:i:s", strtotime("-1 week")) . "'");
     if (empty($data['numberOfAttendanceLastWeek'])) {
         $data['numberOfAttendanceLastWeek'] = 0;
     }
     $empLeave = new EmployeeLeave();
     $data['numberOfLeaves'] = $empLeave->Count("date_start > '" . date("Y-m-d") . "'");
     $timeEntry = new EmployeeTimeEntry();
     $data['numberOfAttendanceLastWeek'] = $timeEntry->Count("in_time > '" . date("Y-m-d H:i:s", strtotime("-1 week")) . "'");
     $candidate = new Candidate();
     $data['numberOfCandidates'] = $candidate->Count("1 = 1");
     $job = new Job();
     $data['numberOfJobs'] = $job->Count("status = 'Active'");
     $course = new Course();
     $data['numberOfCourses'] = $course->Count("1 = 1");
     return new IceResponse(IceResponse::SUCCESS, $data);
 }
 public function getDashboardItemData()
 {
     $data = array();
     $company = new CompanyStructure();
     $data['numberOfCompanyStuctures'] = $company->Count("1 = 1");
     return $data;
 }
예제 #3
0
 public function getChildCompanyStuctures($companyStructId)
 {
     $childIds = array();
     $childIds[] = $companyStructId;
     $nodeIdsAtLastLevel = $childIds;
     $count = 0;
     do {
         $count++;
         $companyStructTemp = new CompanyStructure();
         if (empty($nodeIdsAtLastLevel) || empty($childIds)) {
             break;
         }
         $idQuery = "parent in (" . implode(",", $nodeIdsAtLastLevel) . ") and id not in(" . implode(",", $childIds) . ")";
         LogManager::getInstance()->debug($idQuery);
         $list = $companyStructTemp->Find($idQuery, array());
         if (!$list) {
             LogManager::getInstance()->debug($companyStructTemp->ErrorMsg());
         }
         $nodeIdsAtLastLevel = array();
         foreach ($list as $item) {
             $childIds[] = $item->id;
             $nodeIdsAtLastLevel[] = $item->id;
         }
     } while (count($list) > 0 && $count < 10);
     return $childIds;
 }
 public function actionAdmin()
 {
     $model = new CompanyStructure('search');
     $model->unsetAttributes();
     if (isset($_GET['CompanyStructure'])) {
         $model->setAttributes($_GET['CompanyStructure']);
     }
     $this->render('admin', array('model' => $model));
 }
예제 #5
0
 public function getCurrentEmployeeTimeZone()
 {
     $cemp = $this->getCurrentProfileId();
     if (empty($cemp)) {
         return NULL;
     }
     $emp = new Employee();
     $emp->Load("id = ?", array($cemp));
     if (empty($emp->id) || empty($emp->department)) {
         return NULL;
     }
     $dept = new CompanyStructure();
     $dept->Load("id = ?", array($emp->department));
     return $dept->timezone;
 }
예제 #6
0
echo $form->dropDownList($model, 'type_id', GxHtml::listDataEx(CompanyStructureType::model()->findAllAttributes(null, true)));
?>
		<?php 
echo $form->error($model, 'type_id');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($model, 'location_id');
?>
		<?php 
echo $form->dropDownList($model, 'location_id', GxHtml::listDataEx(Location::model()->findAllAttributes(null, true)));
?>
		<?php 
echo $form->error($model, 'location_id');
?>
		</div><!-- row -->

		<label><?php 
echo GxHtml::encode($model->getRelationLabel('companyStructures'));
?>
</label>
		<?php 
echo $form->checkBoxList($model, 'companyStructures', GxHtml::encodeEx(GxHtml::listDataEx(CompanyStructure::model()->findAllAttributes(null, true)), false, true));
?>

<?php 
echo GxHtml::submitButton('Save');
$this->endWidget();
?>
</div><!-- form -->
예제 #7
0
<?php

$this->breadcrumbs = array($model->label(2) => array('index'), 'Manage');
$this->menu = array(array('label' => 'List' . ' ' . $model->label(2), 'url' => array('index')), array('label' => 'Create' . ' ' . $model->label(), 'url' => array('create')));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('company-structure-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1><?php 
echo 'Manage' . ' ' . GxHtml::encode($model->label(2));
?>
</h1>

<p>
You may optionally enter a comparison operator (&lt;, &lt;=, &gt;, &gt;=, &lt;&gt; or =) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<?php 
echo GxHtml::link('Advanced Search', '#', array('class' => 'search-button'));
?>
<div class="search-form">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'company-structure-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', 'name', array('name' => 'parent_id', 'value' => 'GxHtml::valueEx($data->parent)', 'filter' => GxHtml::listDataEx(CompanyStructure::model()->findAllAttributes(null, true))), array('name' => 'type_id', 'value' => 'GxHtml::valueEx($data->type)', 'filter' => GxHtml::listDataEx(CompanyStructureType::model()->findAllAttributes(null, true))), array('name' => 'location_id', 'value' => 'GxHtml::valueEx($data->location)', 'filter' => GxHtml::listDataEx(Location::model()->findAllAttributes(null, true))), 'create_at', array('class' => 'CButtonColumn'))));
예제 #8
0
<?php

$this->breadcrumbs = array(CompanyStructure::label(2), 'Index');
//$this->mainT = 'AD';
//$this->subT = 'CS';
?>


<?php 
$this->beginWidget('yiiwheels.widgets.box.WhBox', array('title' => GxHtml::encode(CompanyStructure::label(2)), 'headerButtons' => array(TbHtml::buttonGroup(array(array('label' => 'Create', 'icon' => TbHtml::ICON_PLUS), array('label' => 'List', 'icon' => TbHtml::ICON_LIST, 'class' => 'active'), array('label' => 'Manage', 'icon' => TbHtml::ICON_WRENCH)), array('toggle' => TbHtml::BUTTON_TOGGLE_RADIO, 'color' => TbHtml::BUTTON_COLOR_PRIMARY)), '&nbsp;', TbHtml::buttonDropdown('More', array(array('label' => 'Update', 'url' => '#', 'icon' => TbHtml::ICON_EDIT), array('label' => 'Delete', 'url' => '#', 'icon' => TbHtml::ICON_TRASH), array('label' => 'Export', 'url' => '#', 'icon' => TbHtml::ICON_DOWNLOAD_ALT))))));
?>

<?php 
$this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view'));
$this->endWidget();
//include_once ("/usr/share/php/Mail.php");
include APP_BASE_PATH . 'lib/Mail.php';
include APP_BASE_PATH . 'adodb512/adodb.inc.php';
include APP_BASE_PATH . 'adodb512/adodb-active-record.inc.php';
$ADODB_ASSOC_CASE = 2;
$user = getSessionObject('user');
include APP_BASE_PATH . "classes/BaseService.php";
include APP_BASE_PATH . "classes/FileService.php";
include APP_BASE_PATH . "classes/SubActionManager.php";
include APP_BASE_PATH . "classes/AbstractInitialize.php";
include APP_BASE_PATH . "classes/SettingsManager.php";
include APP_BASE_PATH . "classes/EmailSender.php";
include APP_BASE_PATH . "mysql_error_list.php";
include APP_BASE_PATH . "model/models.inc.php";
$dbLocal = NewADOConnection(APP_CON_STR);
CompanyStructure::SetDatabaseAdapter($dbLocal);
Country::SetDatabaseAdapter($dbLocal);
Province::SetDatabaseAdapter($dbLocal);
CurrencyType::SetDatabaseAdapter($dbLocal);
JobTitle::SetDatabaseAdapter($dbLocal);
ChucVu::SetDatabaseAdapter($dbLocal);
PayGrade::SetDatabaseAdapter($dbLocal);
EmploymentStatus::SetDatabaseAdapter($dbLocal);
Skill::SetDatabaseAdapter($dbLocal);
Education::SetDatabaseAdapter($dbLocal);
Certification::SetDatabaseAdapter($dbLocal);
Language::SetDatabaseAdapter($dbLocal);
Nationality::SetDatabaseAdapter($dbLocal);
Employee::SetDatabaseAdapter($dbLocal);
User::SetDatabaseAdapter($dbLocal);
EmployeeSkill::SetDatabaseAdapter($dbLocal);
예제 #10
0
	<div class="row">
		<?php 
echo $form->label($model, 'name');
?>
		<?php 
echo $form->textField($model, 'name', array('maxlength' => 128));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'parent_id');
?>
		<?php 
echo $form->dropDownList($model, 'parent_id', GxHtml::listDataEx(CompanyStructure::model()->findAllAttributes(null, true)), array('prompt' => 'All'));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'type_id');
?>
		<?php 
echo $form->dropDownList($model, 'type_id', GxHtml::listDataEx(CompanyStructureType::model()->findAllAttributes(null, true)), array('prompt' => 'All'));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'location_id');