public function actionImport() { $model = new ImportForm(); if (isset($_POST['ImportForm'])) { $model->attributes = $_POST['ImportForm']; MyHelper::ImportFile($model, AttendancePresences::model()->tableSchema->name, '`year`, `city_id`, `department_id`, `section_id`, `position_id`, `years_of_service_start`, `years_of_service_end`, `level_id`, `grade_id`, `basic_salary_from`, `basic_salary_to`, `basic_salary_inc_amount`, `basic_salary_inc_percentage`', array("attendance/schedulle")); } $this->render("importcsv", array('model' => $model)); }
public function actionImport() { $model = new ImportForm(); if (isset($_POST['ImportForm'])) { $model->attributes = $_POST['ImportForm']; $table = AttendancePresences::model(); $table_name = $table->tableSchema->name; $table_name_temp = $table_name . '_temp'; $table->clearTemporary($table_name_temp); MyHelper::ImportFile($model, $table_name_temp, '`employee_id`, `date`, `shift_id`, `type`, `presence_date`'); $table->moveDataImport($table_name, $table_name_temp); } $this->render("import", array('model' => $model)); }