/** * This method returns the category based on the category id. * Returns 1 if successfully found. * Returns 0 if not successfull. * * @param string $categoryId * @return 1 || 0 */ public static function getJukeboxCategoryById($categoryId) { return JukeboxCategory::model()->findByPk($categoryId); }
echo $form->labelEx($model, 'description'); ?> <?php echo $form->textArea($model, 'description', array('rows' => 6, 'cols' => 50)); ?> <?php echo $form->error($model, 'description'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'category_id'); ?> <?php echo $form->dropDownList($model, 'category_id', CHtml::listData(JukeboxCategory::model()->findAll(), 'id', 'category'), array('empty' => 'Select')); ?> <?php echo $form->error($model, 'category_id'); ?> </div> <div class="row buttons"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?> </div> <?php $this->endWidget(); ?>
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = JukeboxCategory::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
?> <input type="hidden" name="mode" value="property" /> <ul class="acc" id="acc"> <li> <h3>Basic Details</h3> <div class="acc-section"> <table width="92%" border="0" cellpadding="0" cellspacing="0" align="center"> <tr> <td>Keyword(s)<input type="text" name="keyword" class="txt-box1" value="<?php echo isset($_POST['keyword']) ? $_POST['keyword'] : ''; ?> " /></td> </tr> <tr> <td><label>Category</label> <?php echo $form->dropDownList($modelJukeboxQuestions, 'category_id', CHtml::listData(JukeboxCategory::model()->findAll(), 'id', 'category'), array('class' => 'select_box', 'empty' => 'All')); ?> </td> </tr> <tr> <td>Time <select name="time" class="select_box"> <option value="">All</option> <option value="7">1 Week Ago</option> <option value="14">2 Week Ago</option> <option value="30">1 Month Ago</option> <option value="60">2 Month Ago</option> <option value="90">3 Month Ago</option> <option value="180">6 Month Ago</option> </select> <script type="text/javascript">