update upload ảnh nhân viên

This commit is contained in:
2020-10-26 11:07:13 +07:00
parent 7204a46da7
commit e97496a628
6 changed files with 2126 additions and 2053 deletions

View File

@@ -111,6 +111,7 @@ class StaffController extends Controller {
$model->phone = $data["Phone"];
$model->date_in = date_format(date_create_from_format('d/m/Y', $data["DateIn"]), 'U');
$model->address = $data["Address"];
$model->image = $data["Image"];
$model->modified_at = time();
if ($model->save()) {
common::insertSystemLogs(["action" => "update", "description" => "Chỉnh sửa nhân viên: " . $data["Name"], "type" => Yii::$app->controller->id]);
@@ -294,4 +295,11 @@ class StaffController extends Controller {
}
}
public function actionImage() {
if (Yii::$app->request->post()) {
$model = new common();
return $model->UploadFile("AnhNhanVien", ["PNG", "JPG", "JPEG", "GIF"], "staff");
}
}
}