</div> </div> <div class="mws-form-row"> <?php echo $form->labelEx($model, 'notelp_karyawan'); ?> <div class="mws-form-item "> <?php echo $form->textField($model, 'notelp_karyawan', array('style' => 'width:110px;', 'readonly' => true, 'onkeypress' => "return \$(this).focusNextInputField(event)")); ?> </div> </div> </td> <td style="width:200px;height:200px;"> <img src="<?php echo Params::urlIconModulThumbsDirectory() . 'kecil_' . $model->photo_karyawan; ?> " width="200" height=200" > </td> </tr> </table> </div> <?php $this->endWidget(); ?> <hr/> <div class="tab"> <!-- <ul> <li class="tab"><a title="Pendidikan Karyawan"href="<?php echo $this->createUrl('karyawan/pendidikanKaryawan/id/' . $model->karyawan_id); ?>
/** * Deletes a particular model. * If deletion is successful, the browser will be redirected to the 'admin' page. * @param integer $id the ID of the model to be deleted */ public function actionDelete($id) { if (Yii::app()->request->isPostRequest) { // we only allow deletion via POST request $model = $this->loadModel($id); $img = $model->photo_karyawan; if ($model->delete()) { if (file_exists(Params::urlIconModulDirectory() . $img) && file_exists(Params::urlIconModulThumbsDirectory() . 'kecil_' . $img) && $img != null) { unlink(Params::urlIconModulDirectory() . $img); unlink(Params::urlIconModulThumbsDirectory() . 'kecil_' . $img); } } // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser if (!isset($_GET['ajax'])) { $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); } } else { throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.'); } }