Example #1
0
    /**
     * Index action
     * @param string $tab
     */
    public function actionIndex($tab = 'cl_adm_change')
    {
        //get users to approve
        $usersToApprove = UsersToApprove::model()->with('user')->findAllByAttributes(array(
            'Approved_By_Admin' => UsersToApprove::NOT_APPR_BY_ADMIN,
        ));

        if ($_SESSION['admin_active_tab']) {
            $tab = $_SESSION['admin_active_tab'];
        }
        //get clients list
        $clientsList = Clients::model()->getClientsList();

        //get service level settings
        $serviceLevelSettings = ServiceLevelSettings::model()->findAll();

        //get service requests for support
        $support_requests = SupportRequests::model()->findAllByAttributes(array(
           'Problem_Status'=>'W'
        ));


        $auto_loaded_tabs = $this->generateTabsForAutoLoad(); //array of views and additional variables



        $this->render('index' , array(
            'tab' => $tab,
            'usersToApprove' => $usersToApprove,
            'support_requests'=>$support_requests,
            'clientsList' => $clientsList,
            'serviceLevelSettings' => $serviceLevelSettings,
            'auto_loaded_tabs'=>$auto_loaded_tabs
        ));
    }
	/**
	 * 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 $id the ID of the model to be loaded
	 * @return SupportRequests the loaded model
	 * @throws CHttpException
	 */
	public function loadModel($id)
	{
		$model=SupportRequests::model()->findByPk($id);
		if($model===null)
			throw new CHttpException(404,'The requested page does not exist.');
		return $model;
	}
        'action'=>Yii::app()->createUrl('/supportrequests/add'),
        'enableClientValidation'=>true,
        'clientOptions'=>array(
            'validateOnSubmit'=>true,
        ),
    )); ?>

        <?php
            $model = new SupportRequests();

        ?>


        <div class="row">
            Select category :
            <?echo CHtml::dropDownList('request_category','',SupportRequests::getProblemCategories());?>
        </div>
    <br/><br/>
    <div class="row">
        <?php echo $form->labelEx($model,'User_Login'); ?>
        <?php echo $form->textField($model,'User_Login',array('size'=>30,'maxlength'=>30)); ?>
        <?php echo $form->error($model,'User_Login'); ?>
    </div>
    <br/>
    <div class="row">
        <?php echo $form->labelEx($model,'User_Email'); ?>
        <?php echo $form->textField($model,'User_Email',array('size'=>30,'maxlength'=>80)); ?>
        <?php echo $form->error($model,'User_Email'); ?>
    </div>
    <br/>
    <div class="row">