Ejemplo n.º 1
0
 public function actionBrancheslist($id)
 {
     $branches = Branches::find()->where(['companies_company_id' => $id])->all();
     echo "<option>Please Select Branch </option>";
     foreach ($branches as $branches) {
         echo "<option value=" . $branches->branch_id . ">{$branches->branch_name}</option>";
     }
 }
Ejemplo n.º 2
0
 public function actionLists($id)
 {
     $countBranches = Branches::find()->where(['companies_company_id' => $id])->count();
     $branches = Branches::find()->where(['companies_company_id' => $id])->all();
     if ($countBranches > 0) {
         foreach ($branches as $branch) {
             echo "<option value='" . $branch->branch_id . "'>" . $branch->branch_name . "</option>";
         }
     } else {
         echo "<option>-</option>";
     }
 }
Ejemplo n.º 3
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Branches::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->joinWith('companiesCompany');
     $query->andFilterWhere(['branch_id' => $this->branch_id, 'branch_created_date' => $this->branch_created_date]);
     $query->andFilterWhere(['like', 'branch_name', $this->branch_name])->andFilterWhere(['like', 'branch_address', $this->branch_address])->andFilterWhere(['like', 'branch_status', $this->branch_status])->andFilterWhere(['like', 'companies.company_name', $this->companies_company_id]);
     return $dataProvider;
 }
Ejemplo n.º 4
0
 public function actionLists($id)
 {
     $count = Branches::find()->where(['companies_company_id' => $id])->count();
     if ($count > 0) {
         $branches = Branches::find()->where(['companies_company_id' => $id])->all();
         $xhtml = "<option selected='selected'> - Select Branch - </option>";
         foreach ($branches as $branch) {
             $xhtml .= "<option value='" . $branch->branch_id . "'>" . $branch->branch_name . "</option>";
         }
         echo $xhtml;
     } else {
         echo "<option> - </option>";
     }
 }
Ejemplo n.º 5
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Branches::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['branch_id' => $this->branch_id, 'companies_company_id' => $this->companies_company_id, 'branch_created_date' => $this->branch_created_date]);
     $query->andFilterWhere(['like', 'branch_name', $this->branch_name])->andFilterWhere(['like', 'branch_address', $this->branch_address])->andFilterWhere(['like', 'branch_status', $this->branch_status]);
     return $dataProvider;
 }
Ejemplo n.º 6
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Branches::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'branch_title', $this->branch_title])->andFilterWhere(['like', 'lannet', $this->lannet])->andFilterWhere(['like', 'city_address', $this->city_address]);
     return $dataProvider;
 }
Ejemplo n.º 7
0
<div class="departaments-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'companies_company_id')->dropDownList(ArrayHelper::map(Companies::find()->all(), 'company_id', 'company_name'), ['prompt' => 'Select Company', 'onchange' => '
                $.post("index.php?r=branches/lists&id=' . '"+$(this).val(), function(data){
                    $("select#models-branch").html(data);
                });']);
?>

    <?php 
echo $form->field($model, 'branches_branch_id')->dropDownList(ArrayHelper::map(Branches::find()->all(), 'branch_id', 'branch_name'), ['prompt' => 'Select Branch', 'id' => 'models-branch']);
?>

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

    <?php 
echo $form->field($model, 'departament_status')->dropDownList(['active' => 'Active', 'inactive' => 'Inactive'], ['prompt' => '']);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
Ejemplo n.º 8
0
 public function getDropDownBranch()
 {
     return ArrayHelper::map(Branches::find()->all(), 'branch_id', 'branch_name');
 }
Ejemplo n.º 9
0
 public static function arrayBranches()
 {
     return Branches::find()->select('branch_title as value, branch_title as label, id as id')->asArray()->all();
 }
Ejemplo n.º 10
0
<div class="departments-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'companies_company_id')->dropDownList(ArrayHelper::map(\backend\models\Companies::find()->all(), 'company_id', 'company_name'), ['prompt' => 'Select Company', 'onchange' => '
                $.post("index.php?r=branches/list&id="+$(this).val(), function(data){
                    $("select#departments-branches_branch_id").html(data);
                })
            ']);
?>

    <?php 
echo $form->field($model, 'branches_branch_id')->dropDownList(ArrayHelper::map(\backend\models\Branches::find()->all(), 'branch_id', 'branch_name'), ['prompt' => 'Select Company']);
?>

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

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

    <?php 
echo $form->field($model, 'department_status')->dropDownList(['active' => 'Active', 'inactive' => 'Inactive'], ['prompt' => '']);
?>

    <div class="form-group">
Ejemplo n.º 11
0
?>
-->
    <?php 
echo $form->field($model, 'companies_company_id')->dropDownList(ArrayHelper::map(Companies::find()->all(), 'company_id', 'company_name'), ['prompt' => 'Please choose company', 'onchange' => '
                $.post("index.php?r=branches/lists&id=' . '"+$(this).val(),function(data){
                    $("select#departments-branches_branch_id").html(data);
                });']);
?>
    
    
    <!-- <?php 
echo $form->field($model, 'branches_branch_id')->textInput();
?>
-->
    <?php 
echo $form->field($model, 'branches_branch_id')->dropDownList(ArrayHelper::map(Branches::find()->all(), 'branch_id', 'branch_name'), ['prompt' => 'Please choose branch']);
?>
     
     

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



    <!--<?php 
echo $form->field($model, 'department_create_data')->textInput();
?>
-->
Ejemplo n.º 12
0
?>

<div class="departments-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'companies_company_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Companies::find()->all(), 'company_id', 'company_name'), 'options' => ['placeholder' => 'Select a state ...', 'onchange' => '$.post("index.php?r=departments/brancheslist&id=' . '"+$(this).val(),function(data){
                        $("#departments-branches_branch_id").html(data);                    
                    });'], 'pluginOptions' => ['allowClear' => true]]);
?>

    <?php 
echo $form->field($model, 'branches_branch_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Branches::find()->all(), 'branch_id', 'branch_name'), 'options' => ['placeholder' => 'Select a Branch ...'], 'pluginOptions' => ['allowClear' => true]]);
?>

    
    <?php 
//    echo $form->field($model, 'companies_company_id')->dropDownList(
//
//         ArrayHelper::map(Companies::find()->all(),'company_id','company_name'),
//        [
//        'prompt' => 'Select Company',
//        'onchange'=>'$.post("index.php?r=departments/brancheslist&id='.'"+$(this).val(),function(data){
//                        $("#departments-branches_branch_id").html(data);
//                    });',
//
//
//        ]);
Ejemplo n.º 13
0
 public function actionList($company_id)
 {
     $countBranches = Branches::find()->where(['companies_company_id' => $company_id])->count();
     $branches = Branches::find()->where(['companies_company_id' => $company_id])->all();
     if ($countBranches > 0) {
         foreach ($branches as $branch) {
             echo '<option value="' . $branch->branch_id . '">' . $branch->branch_name . '</option>';
         }
     } else {
         echo '<option>Select Branch</option>';
     }
 }
Ejemplo n.º 14
0
?>

<div class="departments-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'companies_company_id')->dropDownList(ArrayHelper::map(Companies::find()->all(), 'company_id', 'company_name'), ['prompt' => 'Выберите компанию', 'onchange' => '$.post("index.php?r=branches/lists&id=" + $(this).val(), function( data ){
                $("select#departments-branches_branch_id").html( data );
            });']);
?>

    <?php 
echo $form->field($model, 'branches_branch_id')->dropDownList(ArrayHelper::map(Branches::find()->all(), 'branch_id', 'branch_name'), ['prompt' => 'Выберите бранч']);
?>

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

    <?php 
echo $form->field($model, 'department_status')->dropDownList(['active' => 'Active', 'inactive' => 'Inactive'], ['prompt' => '']);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
Ejemplo n.º 15
0
    </div>
    <div class = "col-xs-12 col-md-7 col-md-pull-5">
        <p>
            <b>Корпоративные сим-карты</b>
        <ul style="margin-left: 2px; padding-left: 2px;">
            <li>Ежедневно проверяйте состояние счета командой: <b>*105*98#</b></li>
            <li>В случае утери сим-карты, сообщите в отдел информатизации.</li>
            <li>Не допускайте попадания корпоративной сим-карты в распоряжение третьих лиц!</li>
            <li>Не пополняйте счет самостоятельно!</li>
            <li>Не используйте передачу данных, если у вас не подключены опции безлимитного интернет.</li>
            <li>Не используйте передачу данных за пределами домашнего региона, если у вас не подключена
                опция Интернет по России.
            </li>
        </ul>
        </p>
    </div>
</div>

<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pager' => ['prevPageLabel' => 'Назад', 'nextPageLabel' => 'Далее', 'maxButtonCount' => 20], 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'branch_title', 'value' => 'branch_title', 'filter' => ArrayHelper::map(Branches::find()->orderBy('id')->all(), 'branch_title', 'branch_title')], ['attribute' => 'snp', 'value' => function ($model) {
    //var_dump($model);
    return Html::a($model->snp, ['employees/view', 'id' => $model->emp_id, 'mode' => 'start']);
}, 'format' => 'raw'], 'cell_number', 'voip_number', 'email_address', 'room_title', ['attribute' => 'workplaces_title', 'value' => function ($arr) {
    return Html::a($arr['wp_id'], ['workplaces/view', 'id' => $arr['wp_id']]);
}, 'format' => 'raw'], 'job_title']]);
?>




Ejemplo n.º 16
0
    <?php 
echo $form->field($model, 'patronymic')->textInput(['maxlength' => true]);
?>

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

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

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

    <?php 
echo $form->field($model, 'branch_id')->dropDownList(ArrayHelper::map(Branches::find()->all(), 'id', 'branch_title'), ['prompt' => 'Выберите подразделение...']);
?>
    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Создать' : 'Редактировать', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
Ejemplo n.º 17
0
use yii\jui\AutoComplete;
/* @var $this yii\web\View */
/* @var $model backend\models\Devices */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="devices-form">

    <?php 
$form = ActiveForm::begin();
?>
    <?php 
if ($mode !== 'update' && $id_wp == 0) {
    ?>
    <?php 
    echo $form->field($model, 'branch_id')->dropDownList(ArrayHelper::map(Branches::find()->all(), 'id', 'branch_title'), ['prompt' => 'Выберите подраздление...', 'onchange' => '$.post("/admin/rooms/list?id=' . '"+$(this).val(), function(data) {
            var devRoom = $("select#devices-room_id");
            devRoom.html(data);
            var devWork = $("select#devices-workplace_id");
            devWork.html(\'<option value="0"> - </option>\');
        });']);
    ?>
    <?php 
    echo $form->field($model, 'room_id')->dropDownList(ArrayHelper::map(Rooms::find()->orderBy('room_title')->all(), 'id', 'room_title'), ['prompt' => 'Выберите отдел/кабинет...', 'onchange' => '$.post("/admin/workplaces/list?id=' . '"+$(this).val(), function(data) {
            $("select#devices-workplace_id").html(data);
        });']);
    ?>
    <?php 
}
if ($id_wp > 0) {
    $model->workplace_id = $id_wp;