本文整理汇总了PHP中Params::pathIconModulDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP Params::pathIconModulDirectory方法的具体用法?PHP Params::pathIconModulDirectory怎么用?PHP Params::pathIconModulDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Params
的用法示例。
在下文中一共展示了Params::pathIconModulDirectory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionUpdateCalonKaryawan
public function actionUpdateCalonKaryawan($id)
{
$modelp = $this->loadModel($id);
$model = new KKaryawanM();
$model->lokasi_id = Params::DEFAULT_LOKASI;
$format = new CustomFormat();
/*inisialisasi model karyawan yang diisi dari model pelamar*/
$model->attributes = $modelp->getAttributes();
$model->nama_karyawan = $modelp->nama_pelamar;
$model->tempatlahir_karyawan = $modelp->tempatlahir_pelamar;
$model->tgllahir_karyawan = $modelp->tgl_lahirpelamar;
$model->tglditerima = $modelp->tglditerima;
$model->alamat_karyawan = $modelp->alamat_pelamar;
$model->nomobile_karyawan = $modelp->nomobile_pelamar;
$model->warganegara_karyawan = $modelp->warganegara_pelamar;
$model->photo_karyawan = $modelp->photopelamar;
$model->agama = $modelp->agama;
$model->pelamar_id = $modelp->pelamar_id;
if (isset($_POST['KKaryawanM'])) {
$model->unsetAttributes();
$model->attributes = $_POST['KKaryawanM'];
$model->tglditerima = $_POST['tglditerima'];
//$format->formatDateForDb($_POST['tglditerima']);
$model->karyawan_aktif = 1;
$model->tgllahir_karyawan = $_POST['tgllahir_karyawan'];
$model->create_user_id = Yii::app()->session['loginpemakai_id'];
$model->create_time = date('Y-m-d H:i:s');
$modelp->tglditerima = $model->tglditerima;
$modelp->tglmulaibekerja = isset($_POST['tglmulaibekerja']) ? $_POST['tglmulaibekerja'] : null;
// $modelp->tgllowongan = $format->formatDbtoDate($modelp->tgllowongan);
// $modelp->Create_Time = $format->formatDbToDateTime($modelp->Create_Time);
// print_r($modelp->tgl_lahirpelamar);exit();
// $modelp->tgl_lahirpelamar = $format->formatDbtoDate($modelp->tgl_lahirpelamar);
// print_r($modelp->tgl_lahirpelamar);exit();
$transaksi = Yii::app()->db->beginTransaction();
// try{
if (!empty($model->photo_karyawan)) {
$model->photo_karyawan = $random . $model->photo_karyawan;
Yii::import("ext.EPhpThumb.EPhpThumb");
$thumb = new EPhpThumb();
$thumb->init();
// this is needed
$fullImgName = $model->photo_karyawan;
$fullImgSource = Params::pathIconModulDirectory() . $fullImgName;
$fullThumbSource = Params::pathIconModulThumbsDirectory() . 'kecil_' . $fullImgName;
if ($model->validate()) {
if ($model->save()) {
$gambar->saveAs($fullImgSource);
$thumb->create($fullImgSource)->resize(200, 200)->save($fullThumbSource);
$modelp->karyawan_id = $model->karyawan_id;
$modelp->save();
$transaksi->commit();
$this->redirect(array('admin'));
}
}
} else {
$model->photo_karyawan = $modelp->photopelamar;
if ($model->validate()) {
// print_r($model->attributes);exit();
if ($model->save()) {
$modelp->karyawan_id = $model->karyawan_id;
$modelp->save();
$transaksi->commit();
$this->redirect(array('admin'));
}
}
}
//}catch(Exception $e){
// $transaksi->rollback();
// }
}
$this->render('updatekaryawan', array('model' => $model, 'modelp' => $modelp));
}