Example #1
0
 public function toHtml()
 {
     $this->htmlOptions['class'] .= ' ' . $this->options['level'];
     $this->htmlOptions['class'] .= ' event-action';
     $label = CHtml::encode($this->label);
     if ($this->options['level'] === 'save') {
         $this->htmlOptions['class'] .= ' button secondary small';
     }
     if ($this->options['level'] === 'delete') {
         $content = '<span class="icon-button-small-trash-can"></span>';
         $content .= '<span class="hide-offscreen">' . $label . '</span>';
         $label = $content;
         $this->htmlOptions['class'] .= ' button button-icon small';
     }
     if ($this->options['level'] === 'cancel') {
         $this->htmlOptions['class'] .= ' button small';
     }
     if ($this->options['disabled']) {
         $this->htmlOptions['class'] .= ' disabled';
         $this->htmlOptions['disabled'] = 'disabled';
     }
     if ($this->type == 'button') {
         return CHtml::htmlButton($label, $this->htmlOptions);
     } elseif ($this->type == 'link') {
         return CHtml::link($label, $this->href, $this->htmlOptions);
     }
 }
Example #2
0
 protected function renderButton($label, $metaData)
 {
     //Button can come from 2 system, by pluginSettings>settings>button ot by by pluginSettings>buttons
     if (is_string($metaData)) {
         $label = $metaData;
         $metaData = array('htmlOptions' => array());
     }
     $metaData['class'][] = 'btn';
     if (isset($metaData['type']) && $metaData['type'] == 'link') {
         $metaData['class'][] = 'btn-link';
         $metaData['class'][] = 'button';
     }
     $htmlOptions = $this->htmlOptions($metaData);
     if (isset($metaData['type']) && $metaData['type'] == 'link') {
         return CHtml::link($label, $metaData['href'], $htmlOptions);
         // This allow cancel without js
     } elseif (isset($metaData['type'])) {
         $htmlOptions['type'] = $metaData['type'];
         return CHtml::htmlButton($label, $htmlOptions);
     } elseif (isset($htmlOptions['type'])) {
         return CHtml::htmlButton($label, $htmlOptions);
     } else {
         return CHtml::submitButton($label, $htmlOptions);
     }
 }
 public function run()
 {
     parent::run();
     if (!empty($this->value)) {
         echo CHtml::htmlButton($this->controller->getActionLabel('cross', false), array('type' => 'submit', 'alt' => 'Remove filter', 'title' => 'Remove filter', 'onclick' => 'jQuery("#' . $this->id . '").val("")'));
     }
 }
Example #4
0
 /**
  * Renvoie le code HTML pour un bouton 'lire la suite' utilisé pour accéder à l'intégralité d'un texte tronqué
  * @internal L'accès au texte intégral passe par du javascript qui exploite ce bouton et certains de ces
  * attributs (classe CSS, id, etc...)
  * @param boolean $appendDiv
  * @return string
  */
 public static function getButtonMore($appendDiv = true)
 {
     $out = CHtml::htmlButton('Lire la suite', array('name' => 'more', 'class' => 'buttonMore'));
     if ($appendDiv) {
         $out .= CHtml::tag('div', array('class' => 'moreHere'));
     }
     return $out;
 }
Example #5
0
 /**
  * Creates the button element.
  * @return string the created button.
  */
 protected function createButton()
 {
     switch ($this->buttonType) {
         case self::BUTTON_BUTTON:
             return CHtml::htmlButton($this->label, $this->htmlOptions);
         case self::BUTTON_SUBMIT:
             $this->htmlOptions['type'] = 'submit';
             return CHtml::htmlButton($this->label, $this->htmlOptions);
         case self::BUTTON_RESET:
             $this->htmlOptions['type'] = 'reset';
             return CHtml::htmlButton($this->label, $this->htmlOptions);
         case self::BUTTON_SUBMITLINK:
             return CHtml::linkButton($this->label, $this->htmlOptions);
         case self::BUTTON_AJAXLINK:
             return CHtml::ajaxLink($this->label, $this->url, $this->ajaxOptions, $this->htmlOptions);
         case self::BUTTON_AJAXBUTTON:
             $this->ajaxOptions['url'] = $this->url;
             $this->htmlOptions['ajax'] = $this->ajaxOptions;
             return CHtml::htmlButton($this->label, $this->htmlOptions);
         case self::BUTTON_AJAXSUBMIT:
             $this->ajaxOptions['type'] = 'POST';
             $this->ajaxOptions['url'] = $this->url;
             $this->htmlOptions['type'] = 'submit';
             $this->htmlOptions['ajax'] = $this->ajaxOptions;
             return CHtml::htmlButton($this->label, $this->htmlOptions);
         default:
         case self::BUTTON_LINK:
             return CHtml::link($this->label, $this->url, $this->htmlOptions);
     }
 }
Example #6
0
	?>

	<div class="row buttons">
		<?php
		echo CHtml::htmlButton($actionModel->isNewRecord ? Yii::t('app','Submit Contact + Action'):Yii::t('app','Save'),
			array('type'=>'submit',
				'class'=>'x2-button',
				'id'=>'save-button1',
				'name'=>'submit',
				'value'=>'action',
				'tabindex'=>26
			)
		); ?>

		<?php
			echo CHtml::htmlButton(Yii::t('app','Submit Contact + Comment'),
				array(
					'type'=>'submit',
					'class'=>'x2-button',
					'id'=>'save-button2',
					'name'=>'submit',
					'value'=>'comment',
					'tabindex'=>27
				)
			); ?>
		<?php // echo CHtml::submitButton(Yii::t('app','Submit'),array('class'=>'x2-button','tabindex'=>25)); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
 /**
  * Main function
  *
  * @param mixed $surveyid
  * @param mixed $args
  */
 function run($surveyid, $args)
 {
     global $errormsg;
     extract($args);
     if (!$thissurvey) {
         $thissurvey = getSurveyInfo($surveyid);
     }
     $LEMsessid = 'survey_' . $surveyid;
     $this->setJavascriptVar($surveyid);
     global $oTemplate;
     $sTemplatePath = $oTemplate->path;
     $sTemplateViewPath = $oTemplate->viewPath;
     //$sTemplatePath=getTemplatePath(Yii::app()->getConfig("defaulttemplate")).DIRECTORY_SEPARATOR;
     // TODO : check if necessary :
     /*
     if (isset ($_SESSION['survey_'.$surveyid]['templatepath']))
     {
         $sTemplatePath=$_SESSION['survey_'.$surveyid]['templatepath'];
     }
     */
     // $LEMdebugLevel - customizable debugging for Lime Expression Manager
     $LEMdebugLevel = 0;
     // LEM_DEBUG_TIMING;    // (LEM_DEBUG_TIMING + LEM_DEBUG_VALIDATION_SUMMARY + LEM_DEBUG_VALIDATION_DETAIL);
     $LEMskipReprocessing = false;
     // true if used GetLastMoveResult to avoid generation of unneeded extra JavaScript
     switch ($thissurvey['format']) {
         case "A":
             //All in one
             $surveyMode = 'survey';
             break;
         default:
         case "S":
             //One at a time
             $surveyMode = 'question';
             break;
         case "G":
             //Group at a time
             $surveyMode = 'group';
             break;
     }
     $radix = getRadixPointData($thissurvey['surveyls_numberformat']);
     $radix = $radix['separator'];
     $surveyOptions = array('active' => $thissurvey['active'] == 'Y', 'allowsave' => $thissurvey['allowsave'] == 'Y', 'anonymized' => $thissurvey['anonymized'] != 'N', 'assessments' => $thissurvey['assessments'] == 'Y', 'datestamp' => $thissurvey['datestamp'] == 'Y', 'deletenonvalues' => Yii::app()->getConfig('deletenonvalues'), 'hyperlinkSyntaxHighlighting' => ($LEMdebugLevel & LEM_DEBUG_VALIDATION_SUMMARY) == LEM_DEBUG_VALIDATION_SUMMARY, 'ipaddr' => $thissurvey['ipaddr'] == 'Y', 'radix' => $radix, 'refurl' => $thissurvey['refurl'] == "Y" && isset($_SESSION[$LEMsessid]['refurl']) ? $_SESSION[$LEMsessid]['refurl'] : NULL, 'savetimings' => $thissurvey['savetimings'] == "Y", 'surveyls_dateformat' => isset($thissurvey['surveyls_dateformat']) ? $thissurvey['surveyls_dateformat'] : 1, 'startlanguage' => isset(App()->language) ? App()->language : $thissurvey['language'], 'target' => Yii::app()->getConfig('uploaddir') . DIRECTORY_SEPARATOR . 'surveys' . DIRECTORY_SEPARATOR . $thissurvey['sid'] . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR, 'tempdir' => Yii::app()->getConfig('tempdir') . DIRECTORY_SEPARATOR, 'timeadjust' => isset($timeadjust) ? $timeadjust : 0, 'token' => isset($clienttoken) ? $clienttoken : NULL);
     //Security Checked: POST, GET, SESSION, REQUEST, returnGlobal, DB
     $previewgrp = false;
     if ($surveyMode == 'group' && isset($param['action']) && $param['action'] == 'previewgroup') {
         $previewgrp = true;
     }
     $previewquestion = false;
     if ($surveyMode == 'question' && isset($param['action']) && $param['action'] == 'previewquestion') {
         $previewquestion = true;
     }
     //        if (isset($param['newtest']) && $param['newtest'] == "Y")
     //            setcookie("limesurvey_timers", "0");   //@todo fix - sometimes results in headers already sent error
     $show_empty_group = false;
     if ($previewgrp || $previewquestion) {
         $_SESSION[$LEMsessid]['prevstep'] = 2;
         $_SESSION[$LEMsessid]['maxstep'] = 0;
     } else {
         //RUN THIS IF THIS IS THE FIRST TIME , OR THE FIRST PAGE ########################################
         if (!isset($_SESSION[$LEMsessid]['step'])) {
             buildsurveysession($surveyid);
             //TODO : check if necessary
             //$sTemplatePath = $_SESSION[$LEMsessid]['templatepath'];
             if ($surveyid != LimeExpressionManager::getLEMsurveyId()) {
                 LimeExpressionManager::SetDirtyFlag();
             }
             LimeExpressionManager::StartSurvey($surveyid, $surveyMode, $surveyOptions, false, $LEMdebugLevel);
             $_SESSION[$LEMsessid]['step'] = 0;
             if ($surveyMode == 'survey') {
                 LimeExpressionManager::JumpTo(1, false, false, true);
             } elseif (isset($thissurvey['showwelcome']) && $thissurvey['showwelcome'] == 'N') {
                 $moveResult = LimeExpressionManager::NavigateForwards();
                 //$_SESSION[$LEMsessid]['step']=1;
             }
         } elseif ($surveyid != LimeExpressionManager::getLEMsurveyId()) {
             $_SESSION[$LEMsessid]['step'] = $_SESSION[$LEMsessid]['step'] < 0 ? 0 : $_SESSION[$LEMsessid]['step'];
             //$_SESSION[$LEMsessid]['step'] can not be less than 0, fix it always #09772
             LimeExpressionManager::StartSurvey($surveyid, $surveyMode, $surveyOptions, false, $LEMdebugLevel);
             LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false, false);
         }
         $totalquestions = $_SESSION['survey_' . $surveyid]['totalquestions'];
         if (!isset($_SESSION[$LEMsessid]['totalsteps'])) {
             $_SESSION[$LEMsessid]['totalsteps'] = 0;
         }
         if (!isset($_SESSION[$LEMsessid]['maxstep'])) {
             $_SESSION[$LEMsessid]['maxstep'] = 0;
         }
         if (isset($_SESSION[$LEMsessid]['LEMpostKey']) && isset($_POST['LEMpostKey']) && $_POST['LEMpostKey'] != $_SESSION[$LEMsessid]['LEMpostKey']) {
             // then trying to resubmit (e.g. Next, Previous, Submit) from a cached copy of the page
             // Does not try to save anything from the page to the database
             $moveResult = LimeExpressionManager::GetLastMoveResult(true);
             if (isset($_POST['thisstep']) && isset($moveResult['seq']) && $_POST['thisstep'] == $moveResult['seq']) {
                 // then pressing F5 or otherwise refreshing the current page, which is OK
                 $LEMskipReprocessing = true;
                 $move = "movenext";
                 // so will re-display the survey
             } else {
                 // trying to use browser back buttons, which may be disallowed if no 'previous' button is present
                 $LEMskipReprocessing = true;
                 $move = "movenext";
                 // so will re-display the survey
                 $invalidLastPage = true;
                 $backpopup = gT("Please use the LimeSurvey navigation buttons or index.  It appears you attempted to use the browser back button to re-submit a page.");
             }
         }
         if (isset($move) && $move == "clearcancel") {
             $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false, true, false, true);
             //$backpopup=gT("Clear all need confirmation.");
         }
         if (isset($move)) {
             if (!in_array($move, array("clearall", "changelang", "saveall", "reload"))) {
                 $_SESSION[$LEMsessid]['prevstep'] = $_SESSION[$LEMsessid]['step'];
             } else {
                 // Accepted $move without error
                 $_SESSION[$LEMsessid]['prevstep'] = $move;
             }
         } else {
             //$_SESSION[$LEMsessid]['prevstep'] = $_SESSION[$LEMsessid]['step']-1; // Is this needed ?
         }
         if (!isset($_SESSION[$LEMsessid]['prevstep'])) {
             $_SESSION[$LEMsessid]['prevstep'] = $_SESSION[$LEMsessid]['step'] - 1;
             // this only happens on re-load
         }
         if (isset($_SESSION[$LEMsessid]['LEMtokenResume'])) {
             LimeExpressionManager::StartSurvey($thissurvey['sid'], $surveyMode, $surveyOptions, false, $LEMdebugLevel);
             if (isset($_SESSION[$LEMsessid]['maxstep']) && $_SESSION[$LEMsessid]['maxstep'] > $_SESSION[$LEMsessid]['step']) {
                 LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['maxstep'], false, false);
             }
             $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false, false);
             // if late in the survey, will re-validate contents, which may be overkill
             unset($_SESSION[$LEMsessid]['LEMtokenResume']);
         } else {
             if (!$LEMskipReprocessing) {
                 //Move current step ###########################################################################
                 if (isset($move) && $move == 'moveprev' && ($thissurvey['allowprev'] == 'Y' || $thissurvey['questionindex'] > 0)) {
                     $moveResult = LimeExpressionManager::NavigateBackwards();
                     if ($moveResult['at_start']) {
                         $_SESSION[$LEMsessid]['step'] = 0;
                         unset($moveResult);
                         // so display welcome page again
                     }
                 }
                 if (isset($move) && $move == "movenext") {
                     $moveResult = LimeExpressionManager::NavigateForwards();
                 }
                 if (isset($move) && $move == 'movesubmit') {
                     if ($surveyMode == 'survey') {
                         $moveResult = LimeExpressionManager::NavigateForwards();
                     } else {
                         // may be submitting from the navigation bar, in which case need to process all intervening questions
                         // in order to update equations and ensure there are no intervening relevant mandatory or relevant invalid questions
                         if ($thissurvey['questionindex'] == 2) {
                             // Must : save actual page , review whole before set finished to true (see #09906), index==1 seems to don't need it : (don't force move)
                             LimeExpressionManager::StartSurvey($surveyid, $surveyMode, $surveyOptions);
                         }
                         $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['totalsteps'] + 1, false);
                     }
                 }
                 if (isset($move) && $move == 'changelang') {
                     // jump to current step using new language, processing POST values
                     $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false, true, true, true);
                     // do process the POST data
                 }
                 if (isset($move) && isNumericInt($move) && $thissurvey['questionindex'] == 1) {
                     $move = (int) $move;
                     if ($move > 0 && ($move <= $_SESSION[$LEMsessid]['step'] || isset($_SESSION[$LEMsessid]['maxstep']) && $move <= $_SESSION[$LEMsessid]['maxstep'])) {
                         $moveResult = LimeExpressionManager::JumpTo($move, false);
                     }
                 } elseif (isset($move) && isNumericInt($move) && $thissurvey['questionindex'] == 2) {
                     $move = (int) $move;
                     $moveResult = LimeExpressionManager::JumpTo($move, false, true, true);
                 }
                 if (!isset($moveResult) && !($surveyMode != 'survey' && $_SESSION[$LEMsessid]['step'] == 0)) {
                     // Just in case not set via any other means, but don't do this if it is the welcome page
                     $moveResult = LimeExpressionManager::GetLastMoveResult(true);
                     $LEMskipReprocessing = true;
                 }
             }
         }
         if (isset($moveResult) && isset($moveResult['seq'])) {
             // With complete index, we need to revalidate whole group bug #08806. It's actually the only mode where we JumpTo with force
             if ($moveResult['finished'] == true && $move != 'movesubmit' && $thissurvey['questionindex'] == 2) {
                 //LimeExpressionManager::JumpTo(-1, false, false, true);
                 LimeExpressionManager::StartSurvey($surveyid, $surveyMode, $surveyOptions);
                 $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['totalsteps'] + 1, false, false, false);
                 // no preview, no save data and NO force
                 if (!$moveResult['mandViolation'] && $moveResult['valid'] && empty($moveResult['invalidSQs'])) {
                     $moveResult['finished'] = true;
                 }
             }
             if ($moveResult['finished'] == true) {
                 $move = 'movesubmit';
             } else {
                 $_SESSION[$LEMsessid]['step'] = $moveResult['seq'] + 1;
                 // step is index base 1
                 $stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
             }
             if ($move == "movesubmit" && $moveResult['finished'] == false) {
                 // then there are errors, so don't finalize the survey
                 $move = "movenext";
                 // so will re-display the survey
                 $invalidLastPage = true;
             }
         }
         // We do not keep the participant session anymore when the same browser is used to answer a second time a survey (let's think of a library PC for instance).
         // Previously we used to keep the session and redirect the user to the
         // submit page.
         if ($surveyMode != 'survey' && $_SESSION[$LEMsessid]['step'] == 0) {
             $_SESSION[$LEMsessid]['test'] = time();
             display_first_page();
             Yii::app()->end();
             // So we can still see debug messages
         }
         // TODO FIXME
         if ($thissurvey['active'] == "Y") {
             Yii::import("application.libraries.Save");
             $cSave = new Save();
         }
         if ($thissurvey['active'] == "Y" && Yii::app()->request->getPost('saveall')) {
             $bTokenAnswerPersitance = $thissurvey['tokenanswerspersistence'] == 'Y' && isset($surveyid) && tableExists('tokens_' . $surveyid);
             // must do this here to process the POSTed values
             $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false);
             // by jumping to current step, saves data so far
             if (!isset($_SESSION[$LEMsessid]['scid']) && !$bTokenAnswerPersitance) {
                 $cSave->showsaveform();
                 // generates a form and exits, awaiting input
             } else {
                 // Intentional retest of all conditions to be true, to make sure we do have tokens and surveyid
                 // Now update lastpage to $_SESSION[$LEMsessid]['step'] in SurveyDynamic, otherwise we land on
                 // the previous page when we return.
                 $iResponseID = $_SESSION[$LEMsessid]['srid'];
                 $oResponse = SurveyDynamic::model($surveyid)->findByPk($iResponseID);
                 $oResponse->lastpage = $_SESSION[$LEMsessid]['step'];
                 $oResponse->save();
             }
         }
         if ($thissurvey['active'] == "Y" && Yii::app()->request->getParam('savesubmit')) {
             // The response from the save form
             // CREATE SAVED CONTROL RECORD USING SAVE FORM INFORMATION
             $popup = $cSave->savedcontrol();
             if (isset($errormsg) && $errormsg != "") {
                 $cSave->showsaveform();
                 // reshow the form if there is an error
             }
             $moveResult = LimeExpressionManager::GetLastMoveResult(true);
             $LEMskipReprocessing = true;
             // TODO - does this work automatically for token answer persistence? Used to be savedsilent()
         }
         //Now, we check mandatory questions if necessary
         //CHECK IF ALL CONDITIONAL MANDATORY QUESTIONS THAT APPLY HAVE BEEN ANSWERED
         global $notanswered;
         if (isset($moveResult) && !$moveResult['finished']) {
             $unansweredSQList = $moveResult['unansweredSQs'];
             if (strlen($unansweredSQList) > 0) {
                 $notanswered = explode('|', $unansweredSQList);
             } else {
                 $notanswered = array();
             }
             //CHECK INPUT
             $invalidSQList = $moveResult['invalidSQs'];
             if (strlen($invalidSQList) > 0) {
                 $notvalidated = explode('|', $invalidSQList);
             } else {
                 $notvalidated = array();
             }
         }
         // CHECK UPLOADED FILES
         // TMSW - Move this into LEM::NavigateForwards?
         $filenotvalidated = checkUploadedFileValidity($surveyid, $move);
         //SEE IF THIS GROUP SHOULD DISPLAY
         $show_empty_group = false;
         if ($_SESSION[$LEMsessid]['step'] == 0) {
             $show_empty_group = true;
         }
         $redata = compact(array_keys(get_defined_vars()));
         //SUBMIT ###############################################################################
         if (isset($move) && $move == "movesubmit") {
             //                setcookie("limesurvey_timers", "", time() - 3600); // remove the timers cookies   //@todo fix - sometimes results in headers already sent error
             if ($thissurvey['refurl'] == "Y") {
                 if (!in_array("refurl", $_SESSION[$LEMsessid]['insertarray'])) {
                     $_SESSION[$LEMsessid]['insertarray'][] = "refurl";
                 }
             }
             resetTimers();
             //Before doing the "templatereplace()" function, check the $thissurvey['url']
             //field for limereplace stuff, and do transformations!
             $thissurvey['surveyls_url'] = passthruReplace($thissurvey['surveyls_url'], $thissurvey);
             $thissurvey['surveyls_url'] = templatereplace($thissurvey['surveyls_url'], array(), $redata, 'URLReplace', false, NULL, array(), true);
             // to do INSERTANS substitutions
             //END PAGE - COMMIT CHANGES TO DATABASE
             if ($thissurvey['active'] != "Y") {
                 if ($thissurvey['assessments'] == "Y") {
                     $assessments = doAssessment($surveyid);
                 }
                 sendCacheHeaders();
                 doHeader();
                 echo templatereplace(file_get_contents($sTemplateViewPath . "startpage.pstpl"), array(), $redata, 'SubmitStartpageI', false, NULL, array(), true);
                 //Check for assessments
                 if ($thissurvey['assessments'] == "Y" && $assessments) {
                     echo templatereplace(file_get_contents($sTemplateViewPath . "assessment.pstpl"), array(), $redata, 'SubmitAssessmentI', false, NULL, array(), true);
                 }
                 // fetch all filenames from $_SESSIONS['files'] and delete them all
                 // from the /upload/tmp/ directory
                 /* echo "<pre>";print_r($_SESSION);echo "</pre>";
                    for($i = 1; isset($_SESSION[$LEMsessid]['files'][$i]); $i++)
                    {
                    unlink('upload/tmp/'.$_SESSION[$LEMsessid]['files'][$i]['filename']);
                    }
                    */
                 // can't kill session before end message, otherwise INSERTANS doesn't work.
                 $completed = templatereplace($thissurvey['surveyls_endtext'], array(), $redata, 'SubmitEndtextI', false, NULL, array(), true);
                 $completed .= "<br /><strong><font size='2' color='red'>" . gT("Did Not Save") . "</font></strong><br /><br />\n\n";
                 $completed .= gT("Your survey responses have not been recorded. This survey is not yet active.") . "<br /><br />\n";
                 if ($thissurvey['printanswers'] == 'Y') {
                     // 'Clear all' link is only relevant for survey with printanswers enabled
                     // in other cases the session is cleared at submit time
                     $completed .= "<a href='" . Yii::app()->getController()->createUrl("survey/index/sid/{$surveyid}/move/clearall") . "'>" . gT("Clear Responses") . "</a><br /><br />\n";
                 }
             } else {
                 if ($thissurvey['usecookie'] == "Y" && $tokensexist != 1) {
                     setcookie("LS_" . $surveyid . "_STATUS", "COMPLETE", time() + 31536000);
                     //Cookie will expire in 365 days
                 }
                 $content = '';
                 $content .= templatereplace(file_get_contents($sTemplateViewPath . "startpage.pstpl"), array(), $redata, 'SubmitStartpage', false, NULL, array(), true);
                 //Check for assessments
                 if ($thissurvey['assessments'] == "Y") {
                     $assessments = doAssessment($surveyid);
                     if ($assessments) {
                         $content .= templatereplace(file_get_contents($sTemplateViewPath . "assessment.pstpl"), array(), $redata, 'SubmitAssessment', false, NULL, array(), true);
                     }
                 }
                 //Update the token if needed and send a confirmation email
                 if (isset($_SESSION['survey_' . $surveyid]['token'])) {
                     submittokens();
                 }
                 //Send notifications
                 sendSubmitNotifications($surveyid);
                 $content = '';
                 $content .= templatereplace(file_get_contents($sTemplateViewPath . "startpage.pstpl"), array(), $redata, 'SubmitStartpage', false, NULL, array(), true);
                 //echo $thissurvey['url'];
                 //Check for assessments
                 if ($thissurvey['assessments'] == "Y") {
                     $assessments = doAssessment($surveyid);
                     if ($assessments) {
                         $content .= templatereplace(file_get_contents($sTemplateViewPath . "assessment.pstpl"), array(), $redata, 'SubmitAssessment', false, NULL, array(), true);
                     }
                 }
                 if (trim(str_replace(array('<p>', '</p>'), '', $thissurvey['surveyls_endtext'])) == '') {
                     $completed = "<br /><span class='success'>" . gT("Thank you!") . "</span><br /><br />\n\n" . gT("Your survey responses have been recorded.") . "<br /><br />\n";
                 } else {
                     $completed = templatereplace($thissurvey['surveyls_endtext'], array(), $redata, 'SubmitAssessment', false, NULL, array(), true);
                 }
                 // Link to Print Answer Preview  **********
                 if ($thissurvey['printanswers'] == 'Y') {
                     $url = Yii::app()->getController()->createUrl("/printanswers/view/surveyid/{$surveyid}");
                     $completed .= "<br /><br />" . "<a class='printlink' href='{$url}'  target='_blank'>" . gT("Print your answers.") . "</a><br />\n";
                 }
                 //*****************************************
                 if ($thissurvey['publicstatistics'] == 'Y' && $thissurvey['printanswers'] == 'Y') {
                     $completed .= '<br />' . gT("or");
                 }
                 // Link to Public statistics  **********
                 if ($thissurvey['publicstatistics'] == 'Y') {
                     $url = Yii::app()->getController()->createUrl("/statistics_user/action/surveyid/{$surveyid}/language/" . $_SESSION[$LEMsessid]['s_lang']);
                     $completed .= "<br /><br />" . "<a class='publicstatisticslink' href='{$url}' target='_blank'>" . gT("View the statistics for this survey.") . "</a><br />\n";
                 }
                 //*****************************************
                 $_SESSION[$LEMsessid]['finished'] = true;
                 $_SESSION[$LEMsessid]['sid'] = $surveyid;
                 sendCacheHeaders();
                 if (isset($thissurvey['autoredirect']) && $thissurvey['autoredirect'] == "Y" && $thissurvey['surveyls_url']) {
                     //Automatically redirect the page to the "url" setting for the survey
                     header("Location: {$thissurvey['surveyls_url']}");
                 }
                 doHeader();
                 echo $content;
             }
             $redata['completed'] = $completed;
             // @todo Remove direct session access.
             $event = new PluginEvent('afterSurveyComplete');
             if (isset($_SESSION[$LEMsessid]['srid'])) {
                 $event->set('responseId', $_SESSION[$LEMsessid]['srid']);
             }
             $event->set('surveyId', $surveyid);
             App()->getPluginManager()->dispatchEvent($event);
             $blocks = array();
             foreach ($event->getAllContent() as $blockData) {
                 /* @var $blockData PluginEventContent */
                 $blocks[] = CHtml::tag('div', array('id' => $blockData->getCssId(), 'class' => $blockData->getCssClass()), $blockData->getContent());
             }
             $redata['completed'] = implode("\n", $blocks) . "\n" . $redata['completed'];
             $redata['thissurvey']['surveyls_url'] = $thissurvey['surveyls_url'];
             echo templatereplace(file_get_contents($sTemplateViewPath . "completed.pstpl"), array('completed' => $completed), $redata, 'SubmitCompleted', false, NULL, array(), true);
             echo "\n";
             if (($LEMdebugLevel & LEM_DEBUG_TIMING) == LEM_DEBUG_TIMING) {
                 echo LimeExpressionManager::GetDebugTimingMessage();
             }
             if (($LEMdebugLevel & LEM_DEBUG_VALIDATION_SUMMARY) == LEM_DEBUG_VALIDATION_SUMMARY) {
                 echo "<table><tr><td align='left'><b>Group/Question Validation Results:</b>" . $moveResult['message'] . "</td></tr></table>\n";
             }
             echo templatereplace(file_get_contents($sTemplateViewPath . "endpage.pstpl"), array(), $redata, 'SubmitEndpage', false, NULL, array(), true);
             doFooter();
             // The session cannot be killed until the page is completely rendered
             if ($thissurvey['printanswers'] != 'Y') {
                 killSurveySession($surveyid);
             }
             exit;
         }
     }
     $redata = compact(array_keys(get_defined_vars()));
     // IF GOT THIS FAR, THEN DISPLAY THE ACTIVE GROUP OF QUESTIONSs
     //SEE IF $surveyid EXISTS ####################################################################
     if ($surveyExists < 1) {
         //SURVEY DOES NOT EXIST. POLITELY EXIT.
         echo templatereplace(file_get_contents($sTemplateViewPath . "startpage.pstpl"), array(), $redata);
         echo "\t<center><br />\n";
         echo "\t" . gT("Sorry. There is no matching survey.") . "<br /></center>&nbsp;\n";
         echo templatereplace(file_get_contents($sTemplateViewPath . "endpage.pstpl"), array(), $redata);
         doFooter();
         exit;
     }
     createFieldMap($surveyid, 'full', false, false, $_SESSION[$LEMsessid]['s_lang']);
     //GET GROUP DETAILS
     if ($surveyMode == 'group' && $previewgrp) {
         //            setcookie("limesurvey_timers", "0"); //@todo fix - sometimes results in headers already sent error
         $_gid = sanitize_int($param['gid']);
         LimeExpressionManager::StartSurvey($thissurvey['sid'], 'group', $surveyOptions, false, $LEMdebugLevel);
         $gseq = LimeExpressionManager::GetGroupSeq($_gid);
         if ($gseq == -1) {
             echo gT('Invalid group number for this survey: ') . $_gid;
             exit;
         }
         $moveResult = LimeExpressionManager::JumpTo($gseq + 1, true);
         if (is_null($moveResult)) {
             echo gT('This group contains no questions.  You must add questions to this group before you can preview it');
             exit;
         }
         if (isset($moveResult)) {
             $_SESSION[$LEMsessid]['step'] = $moveResult['seq'] + 1;
             // step is index base 1?
         }
         $stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
         $gid = $stepInfo['gid'];
         $groupname = $stepInfo['gname'];
         $groupdescription = $stepInfo['gtext'];
     } else {
         if ($show_empty_group || !isset($_SESSION[$LEMsessid]['grouplist'])) {
             $gid = -1;
             // Make sure the gid is unused. This will assure that the foreach (fieldarray as ia) has no effect.
             $groupname = gT("Submit your answers");
             $groupdescription = gT("There are no more questions. Please press the <Submit> button to finish this survey.");
         } else {
             if ($surveyMode != 'survey') {
                 if ($previewquestion) {
                     $_qid = sanitize_int($param['qid']);
                     LimeExpressionManager::StartSurvey($surveyid, 'question', $surveyOptions, false, $LEMdebugLevel);
                     $qSec = LimeExpressionManager::GetQuestionSeq($_qid);
                     $moveResult = LimeExpressionManager::JumpTo($qSec + 1, true, false, true);
                     $stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
                 } else {
                     $stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
                 }
                 $gid = $stepInfo['gid'];
                 $groupname = $stepInfo['gname'];
                 $groupdescription = $stepInfo['gtext'];
             }
         }
     }
     if ($previewquestion) {
         $_SESSION[$LEMsessid]['step'] = 0;
         //maybe unset it after the question has been displayed?
     }
     if ($_SESSION[$LEMsessid]['step'] > $_SESSION[$LEMsessid]['maxstep']) {
         $_SESSION[$LEMsessid]['maxstep'] = $_SESSION[$LEMsessid]['step'];
     }
     // If the survey uses answer persistence and a srid is registered in SESSION
     // then loadanswers from this srid
     /* Only survey mode used this - should all?
        if ($thissurvey['tokenanswerspersistence'] == 'Y' &&
        $thissurvey['anonymized'] == "N" &&
        isset($_SESSION[$LEMsessid]['srid']) &&
        $thissurvey['active'] == "Y")
        {
        loadanswers();
        }
        */
     //******************************************************************************************************
     //PRESENT SURVEY
     //******************************************************************************************************
     $okToShowErrors = !$previewgrp && (isset($invalidLastPage) || $_SESSION[$LEMsessid]['prevstep'] == $_SESSION[$LEMsessid]['step']);
     Yii::app()->getController()->loadHelper('qanda');
     setNoAnswerMode($thissurvey);
     //Iterate through the questions about to be displayed:
     $inputnames = array();
     foreach ($_SESSION[$LEMsessid]['grouplist'] as $gl) {
         $gid = $gl['gid'];
         $qnumber = 0;
         if ($surveyMode != 'survey') {
             $onlyThisGID = $stepInfo['gid'];
             if ($onlyThisGID != $gid) {
                 continue;
             }
         }
         // TMSW - could iterate through LEM::currentQset instead
         //// To diplay one question, all the questions are processed ?
         foreach ($_SESSION[$LEMsessid]['fieldarray'] as $key => $ia) {
             ++$qnumber;
             $ia[9] = $qnumber;
             // incremental question count;
             if (isset($ia[10]) && $ia[10] == $gid || !isset($ia[10]) && $ia[5] == $gid) {
                 if ($surveyMode == 'question' && $ia[0] != $stepInfo['qid']) {
                     continue;
                 }
                 $qidattributes = getQuestionAttributeValues($ia[0]);
                 if ($ia[4] != '*' && ($qidattributes === false || !isset($qidattributes['hidden']) || $qidattributes['hidden'] == 1)) {
                     continue;
                 }
                 //Get the answers/inputnames
                 // TMSW - can content of retrieveAnswers() be provided by LEM?  Review scope of what it provides.
                 // TODO - retrieveAnswers is slow - queries database separately for each question. May be fixed in _CI or _YII ports, so ignore for now
                 list($plus_qanda, $plus_inputnames) = retrieveAnswers($ia, $surveyid);
                 if ($plus_qanda) {
                     $plus_qanda[] = $ia[4];
                     $plus_qanda[] = $ia[6];
                     // adds madatory identifyer for adding mandatory class to question wrapping div
                     // Add a finalgroup in qa array , needed for random attribute : TODO: find a way to have it in new quanda_helper in 2.1
                     if (isset($ia[10])) {
                         $plus_qanda['finalgroup'] = $ia[10];
                     } else {
                         $plus_qanda['finalgroup'] = $ia[5];
                     }
                     $qanda[] = $plus_qanda;
                 }
                 if ($plus_inputnames) {
                     $inputnames = addtoarray_single($inputnames, $plus_inputnames);
                 }
                 //Display the "mandatory" popup if necessary
                 // TMSW - get question-level error messages - don't call **_popup() directly
                 if ($okToShowErrors && $stepInfo['mandViolation']) {
                     list($mandatorypopup, $popup) = mandatory_popup($ia, $notanswered);
                 }
                 //Display the "validation" popup if necessary
                 if ($okToShowErrors && !$stepInfo['valid']) {
                     list($validationpopup, $vpopup) = validation_popup($ia, $notvalidated);
                 }
                 // Display the "file validation" popup if necessary
                 if ($okToShowErrors && isset($filenotvalidated)) {
                     list($filevalidationpopup, $fpopup) = file_validation_popup($ia, $filenotvalidated);
                 }
             }
             if ($ia[4] == "|") {
                 $upload_file = TRUE;
             }
         }
         //end iteration
     }
     if ($surveyMode != 'survey' && isset($thissurvey['showprogress']) && $thissurvey['showprogress'] == 'Y') {
         if ($show_empty_group) {
             $percentcomplete = makegraph($_SESSION[$LEMsessid]['totalsteps'] + 1, $_SESSION[$LEMsessid]['totalsteps']);
         } else {
             $percentcomplete = makegraph($_SESSION[$LEMsessid]['step'], $_SESSION[$LEMsessid]['totalsteps']);
         }
     }
     if (!(isset($languagechanger) && strlen($languagechanger) > 0) && function_exists('makeLanguageChangerSurvey')) {
         $languagechanger = makeLanguageChangerSurvey($_SESSION[$LEMsessid]['s_lang']);
     }
     //READ TEMPLATES, INSERT DATA AND PRESENT PAGE
     sendCacheHeaders();
     doHeader();
     /**
      * Question Index
      */
     $aQuestionindexbuttons = null;
     $aQuestionindexbuttonsmenu = null;
     if (!$previewgrp && !$previewquestion) {
         if ($surveyMode != 'survey' && $thissurvey['questionindex'] == 1) {
             //$aQuestionindex = $this->createIncrementalQuestionIndex($LEMsessid, $surveyMode);
             $aQuestionindexmenu = $this->createIncrementalQuestionIndexMenu($LEMsessid, $surveyMode);
         } elseif ($surveyMode != 'survey' && $thissurvey['questionindex'] == 2) {
             //$aQuestionindex = $this->createFullQuestionIndex($LEMsessid, $surveyMode);
             $aQuestionindexmenu = $this->createFullQuestionIndexMenu($LEMsessid, $surveyMode);
         }
         //$questionindex = (isset($aQuestionindex['menulist']))?$aQuestionindex['menulist']:'';
         $questionindexmenu = isset($aQuestionindexmenu['menulist']) ? $aQuestionindexmenu['menulist'] : '';
         //$aQuestionindexbuttons = (isset($aQuestionindex['buttons']))?$aQuestionindex['buttons']:'';
         $aQuestionindexbuttonsmenu = isset($aQuestionindexmenu['buttons']) ? $aQuestionindexmenu['buttons'] : '';
     }
     /////////////////////////////////
     // First call to templatereplace
     echo "<!-- SurveyRunTimeHelper -->";
     $redata = compact(array_keys(get_defined_vars()));
     echo templatereplace(file_get_contents($sTemplateViewPath . "startpage.pstpl"), array(), $redata);
     $aPopup = array();
     // We can move this part where we want now
     if (isset($backpopup)) {
         $aPopup[] = $backpopup;
         // If user click reload: no need other popup
     } else {
         if (isset($popup)) {
             $aPopup[] = $popup;
         }
         if (isset($vpopup)) {
             $aPopup[] = $vpopup;
         }
         if (isset($fpopup)) {
             $aPopup[] = $fpopup;
         }
     }
     Yii::app()->clientScript->registerScript("showpopup", "showpopup=" . (int) Yii::app()->getConfig('showpopups') . ";", CClientScript::POS_HEAD);
     //if(count($aPopup))
     Yii::app()->clientScript->registerScript('startPopup', "startPopups=" . json_encode($aPopup) . ";", CClientScript::POS_HEAD);
     //ALTER PAGE CLASS TO PROVIDE WHOLE-PAGE ALTERNATION
     if ($surveyMode != 'survey' && $_SESSION[$LEMsessid]['step'] != $_SESSION[$LEMsessid]['prevstep'] || isset($_SESSION[$LEMsessid]['stepno']) && $_SESSION[$LEMsessid]['stepno'] % 2) {
         if (!isset($_SESSION[$LEMsessid]['stepno'])) {
             $_SESSION[$LEMsessid]['stepno'] = 0;
         }
         if ($_SESSION[$LEMsessid]['step'] != $_SESSION[$LEMsessid]['prevstep']) {
             ++$_SESSION[$LEMsessid]['stepno'];
         }
         if ($_SESSION[$LEMsessid]['stepno'] % 2) {
             echo "<script type=\"text/javascript\">\n" . "  \$(\"body\").addClass(\"page-odd\");\n" . "</script>\n";
         }
     }
     $hiddenfieldnames = implode("|", $inputnames);
     if (isset($upload_file) && $upload_file) {
         echo CHtml::form(array("/survey/index", "sid" => $surveyid), 'post', array('enctype' => 'multipart/form-data', 'id' => 'limesurvey', 'name' => 'limesurvey', 'autocomplete' => 'off', 'class' => 'survey-form-container surveyRunTimeUploadFile')) . "\n\n            <!-- INPUT NAMES -->\n            <input type='hidden' name='fieldnames' value='{$hiddenfieldnames}' id='fieldnames' />\n";
     } else {
         echo CHtml::form(array("/survey/index", "sid" => $surveyid), 'post', array('id' => 'limesurvey', 'name' => 'limesurvey', 'autocomplete' => 'off', 'class' => 'survey-form-container  surveyRunTime')) . "\n\n            <!-- INPUT NAMES -->\n            <input type='hidden' name='fieldnames' value='{$hiddenfieldnames}' id='fieldnames' />\n";
     }
     // <-- END FEATURE - SAVE
     // The default submit button
     echo CHtml::htmlButton("default", array('type' => 'submit', 'id' => "defaultbtn", 'value' => "default", 'name' => 'move', 'class' => "submit noview", 'style' => 'display:none'));
     if ($surveyMode == 'survey') {
         if (isset($thissurvey['showwelcome']) && $thissurvey['showwelcome'] == 'N') {
             //Hide the welcome screen if explicitly set
         } else {
             echo templatereplace(file_get_contents($sTemplateViewPath . "welcome.pstpl"), array(), $redata) . "\n";
         }
         if ($thissurvey['anonymized'] == "Y") {
             echo templatereplace(file_get_contents($sTemplateViewPath . "privacy.pstpl"), array(), $redata) . "\n";
         }
     }
     // <-- START THE SURVEY -->
     if ($surveyMode != 'survey') {
         echo templatereplace(file_get_contents($sTemplateViewPath . "survey.pstpl"), array(), $redata);
     }
     // runonce element has been changed from a hidden to a text/display:none one. In order to workaround an not-reproduced issue #4453 (lemeur)
     // We don't need runonce actually (140228): the script was updated and replaced by EM see #08783 (grep show no other runonce)
     // echo "<input type='text' id='runonce' value='0' style='display: none;'/>";
     $showpopups = Yii::app()->getConfig('showpopups');
     //Display the "mandatory" message on page if necessary
     if (!$showpopups && $stepInfo['mandViolation'] && $okToShowErrors) {
         echo "<p class='errormandatory alert alert-danger' role='alert'>" . gT("One or more mandatory questions have not been answered. You cannot proceed until these have been completed.") . "</p>";
     }
     //Display the "validation" message on page if necessary
     if (!$showpopups && !$stepInfo['valid'] && $okToShowErrors) {
         echo "<p class='errormandatory alert alert-danger' role='alert'>" . gT("One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid.") . "</p>";
     }
     //Display the "file validation" message on page if necessary
     if (!$showpopups && isset($filenotvalidated) && $filenotvalidated == true && $okToShowErrors) {
         echo "<p class='errormandatory alert alert-danger' role='alert'>" . gT("One or more uploaded files are not in proper format/size. You cannot proceed until these files are valid.") . "</p>";
     }
     $_gseq = -1;
     foreach ($_SESSION[$LEMsessid]['grouplist'] as $gl) {
         $gid = $gl['gid'];
         ++$_gseq;
         $groupname = $gl['group_name'];
         $groupdescription = $gl['description'];
         if ($surveyMode != 'survey' && $gid != $onlyThisGID) {
             continue;
         }
         $redata = compact(array_keys(get_defined_vars()));
         Yii::app()->setConfig('gid', $gid);
         // To be used in templaterplace in whole group. Attention : it's the actual GID (not the GID of the question)
         echo "\n\n<!-- START THE GROUP (in SurveyRunTime ) -->\n";
         echo "\n\n<div id='group-{$_gseq}'";
         $gnoshow = LimeExpressionManager::GroupIsIrrelevantOrHidden($_gseq);
         if ($gnoshow && !$previewgrp) {
             echo " style='display: none;'";
         }
         echo " class='row'>\n";
         echo templatereplace(file_get_contents($sTemplateViewPath . "startgroup.pstpl"), array(), $redata);
         echo "\n";
         if (!$previewquestion && trim($redata['groupdescription']) == "") {
             echo templatereplace(file_get_contents($sTemplateViewPath . "groupdescription.pstpl"), array(), $redata);
         }
         echo "\n";
         echo "\n\n<!-- PRESENT THE QUESTIONS (in SurveyRunTime )  -->\n";
         foreach ($qanda as $qa) {
             // Test if finalgroup is in this qid (for all in one survey, else we do only qanda for needed question (in one by one or group by goup)
             if ($gid != $qa['finalgroup']) {
                 continue;
             }
             $qid = $qa[4];
             $qinfo = LimeExpressionManager::GetQuestionStatus($qid);
             $lastgrouparray = explode("X", $qa[7]);
             $lastgroup = $lastgrouparray[0] . "X" . $lastgrouparray[1];
             // id of the last group, derived from question id
             $lastanswer = $qa[7];
             $n_q_display = '';
             if ($qinfo['hidden'] && $qinfo['info']['type'] != '*') {
                 continue;
                 // skip this one
             }
             $aReplacement = array();
             $question = $qa[0];
             //===================================================================
             // The following four variables offer the templating system the
             // capacity to fully control the HTML output for questions making the
             // above echo redundant if desired.
             $question['sgq'] = $qa[7];
             $question['aid'] = !empty($qinfo['info']['aid']) ? $qinfo['info']['aid'] : 0;
             $question['sqid'] = !empty($qinfo['info']['sqid']) ? $qinfo['info']['sqid'] : 0;
             //===================================================================
             $question_template = file_get_contents($sTemplateViewPath . 'question.pstpl');
             // Fix old template : can we remove it ? Old template are surely already broken by another issue
             if (preg_match('/\\{QUESTION_ESSENTIALS\\}/', $question_template) === false || preg_match('/\\{QUESTION_CLASS\\}/', $question_template) === false) {
                 // if {QUESTION_ESSENTIALS} is present in the template but not {QUESTION_CLASS} remove it because you don't want id="" and display="" duplicated.
                 $question_template = str_replace('{QUESTION_ESSENTIALS}', '', $question_template);
                 $question_template = str_replace('{QUESTION_CLASS}', '', $question_template);
                 $question_template = "<div {QUESTION_ESSENTIALS} class='{QUESTION_CLASS} {QUESTION_MAN_CLASS} {QUESTION_INPUT_ERROR_CLASS}'" . $question_template . "</div>";
             }
             $redata = compact(array_keys(get_defined_vars()));
             $aQuestionReplacement = $this->getQuestionReplacement($qa);
             echo templatereplace($question_template, $aQuestionReplacement, $redata, false, false, $qa[4]);
         }
         if ($surveyMode == 'group') {
             echo "<input type='hidden' name='lastgroup' value='{$lastgroup}' id='lastgroup' />\n";
             // for counting the time spent on each group
         }
         if ($surveyMode == 'question') {
             echo "<input type='hidden' name='lastanswer' value='{$lastanswer}' id='lastanswer' />\n";
         }
         echo "\n\n<!-- END THE GROUP -->\n";
         echo templatereplace(file_get_contents($sTemplateViewPath . "endgroup.pstpl"), array(), $redata);
         echo "\n\n</div>\n";
         Yii::app()->setConfig('gid', '');
     }
     LimeExpressionManager::FinishProcessingGroup($LEMskipReprocessing);
     echo LimeExpressionManager::GetRelevanceAndTailoringJavaScript();
     LimeExpressionManager::FinishProcessingPage();
     /**
      * Navigator
      */
     if (!$previewgrp && !$previewquestion) {
         $aNavigator = surveymover();
         $moveprevbutton = $aNavigator['sMovePrevButton'];
         $movenextbutton = $aNavigator['sMoveNextButton'];
         $navigator = $moveprevbutton . ' ' . $movenextbutton;
         $redata = compact(array_keys(get_defined_vars()));
         echo "\n\n<!-- PRESENT THE NAVIGATOR -->\n";
         echo templatereplace(file_get_contents($sTemplateViewPath . "navigator.pstpl"), array(), $redata);
         echo "\n";
         if ($thissurvey['active'] != "Y") {
             echo "<p style='text-align:center' class='error'>" . gT("This survey is currently not active. You will not be able to save your responses.") . "</p>\n";
         }
         if ($surveyMode != 'survey' && $thissurvey['questionindex'] == 1) {
             $this->createIncrementalQuestionIndex($LEMsessid, $surveyMode);
             $this->createIncrementalQuestionIndexMenu($LEMsessid, $surveyMode);
         } elseif ($surveyMode != 'survey' && $thissurvey['questionindex'] == 2) {
             $this->createFullQuestionIndex($LEMsessid, $surveyMode);
             $this->createFullQuestionIndexMenu($LEMsessid, $surveyMode);
         }
         echo "<input type='hidden' name='thisstep' value='{$_SESSION[$LEMsessid]['step']}' id='thisstep' />\n";
         echo "<input type='hidden' name='sid' value='{$surveyid}' id='sid' />\n";
         echo "<input type='hidden' name='start_time' value='" . time() . "' id='start_time' />\n";
         $_SESSION[$LEMsessid]['LEMpostKey'] = mt_rand();
         echo "<input type='hidden' name='LEMpostKey' value='{$_SESSION[$LEMsessid]['LEMpostKey']}' id='LEMpostKey' />\n";
         if (isset($token) && !empty($token)) {
             echo "\n<input type='hidden' name='token' value='{$token}' id='token' />\n";
         }
     }
     if (($LEMdebugLevel & LEM_DEBUG_TIMING) == LEM_DEBUG_TIMING) {
         echo LimeExpressionManager::GetDebugTimingMessage();
     }
     if (($LEMdebugLevel & LEM_DEBUG_VALIDATION_SUMMARY) == LEM_DEBUG_VALIDATION_SUMMARY) {
         echo "<table><tr><td align='left'><b>Group/Question Validation Results:</b>" . $moveResult['message'] . "</td></tr></table>\n";
     }
     echo "</form>\n";
     echo templatereplace(file_get_contents($sTemplateViewPath . "endpage.pstpl"), array(), $redata);
     echo "\n";
     doFooter();
 }
Example #8
0
        <div class="mws-panel-toolbar top clearfix">
            <ul>
                <li><a class="mws-ic-16 ic-add" href="index.php?r=kepegawaian/kabupatenkotaM/create">Tambah Kabupaten / Kota</a></li>
            </ul>
        </div>
        <div class="mws-table">
<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'kabupatenkota-m-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('header' => 'ID Kab / Kota', 'name' => 'kabupatenkota_id', 'value' => '$data->kabupatenkota_id'), array('header' => 'Propinsi', 'name' => 'propinsi_id', 'filter' => CHtml::listData(PropinsiM::model()->findAll(), 'propinsi_id', 'propinsi_nama'), 'value' => 'isset($data->propinsi->propinsi_nama) ? $data->propinsi->propinsi_nama : ""'), array('header' => 'Nama Kab / Kota', 'name' => 'kabupatenkota_nama', 'value' => '$data->kabupatenkota_nama'), array('header' => 'Aktif', 'class' => 'CCheckBoxColumn', 'selectableRows' => 0, 'id' => 'rows', 'checked' => '$data->kabupatenkota_aktif'), array('header' => 'Lihat', 'class' => 'CButtonColumn', 'template' => '{view}'), array('header' => 'Ubah', 'class' => 'CButtonColumn', 'template' => '{update}'), array('header' => 'Delete', 'class' => 'CButtonColumn', 'template' => '{delete}'))));
?>
              </div>
        
                <div class="mws-button-row" align="right">
                    <?php 
echo CHtml::htmlButton(Yii::t('mds', '{icon} PDF', array('{icon}' => '<i class="icon-book icon-white"></i>')), array('class' => 'mws-button blue', 'type' => 'button', 'onclick' => 'print(\'PDF\')')) . "&nbsp&nbsp";
echo CHtml::htmlButton(Yii::t('mds', '{icon} Excel', array('{icon}' => '<i class="icon-pdf icon-white"></i>')), array('class' => 'mws-button green', 'type' => 'button', 'onclick' => 'print(\'EXCEL\')')) . "&nbsp&nbsp";
echo CHtml::htmlButton(Yii::t('mds', '{icon} Print', array('{icon}' => '<i class="icon-print icon-white"></i>')), array('class' => 'mws-button orange', 'type' => 'button', 'onclick' => 'print(\'PRINT\')')) . "&nbsp&nbsp";
///echo CHtml::htmlButton(Yii::t('mds','{icon} Petunjuk',array('{icon}'=>'<i class="icon-print icon-white"></i>')),array('class'=>'mws-button yellow', 'type'=>'button','id'=>'clickme'))."&nbsp&nbsp";
?>
                </div><br>
                 <div id ="ptjk" class="mws-form-message info" style="display: none;">
                    <p>
                    You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
                    or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
                    </p>
                </div>
         </div>
    </div>
<?php 
$controller = Yii::app()->controller->id;
//mengambil Controller yang sedang dipakai
$module = Yii::app()->controller->module->id;
        ?>

								<?php 
        echo Yii::t('checkout', 'or');
        ?>
								<?php 
        echo CHtml::ajaxLink(Yii::t('checkout', 'Remove'), Yii::app()->createUrl('myaccount/removeaddress'), array('type' => 'POST', 'data' => array('CustomerAddressId' => $objAddress->id, 'YII_CSRF_TOKEN' => Yii::app()->request->csrfToken), 'success' => 'function(data) {
										var addressBlock = $(this).parents(".address-block")[0];
										$(addressBlock).remove();
										}.bind(this)'), array('class' => 'delete'));
        ?>
							</span>
						</p>
						<div class="buttons">
							<?php 
        echo CHtml::htmlButton(Yii::t('checkout', $objAddress->id == $model->intShippingAddress ? 'Use shipping address' : 'Use this address'), array('type' => 'submit', 'class' => $objAddress->id == $model->intBillingAddress ? 'small default' : 'small', 'name' => 'BillingAddress', 'id' => 'BillingAddress', 'onclick' => '$("form").removeClass("error").end().find(".required").remove().end().find(".form-error").remove().end()', 'value' => $objAddress->id));
        ?>
						</div>
					</li>
				<?php 
    }
    ?>
			<?php 
}
?>
			<li class="add">
				<?php 
echo CHtml::link(Yii::t('checkout', 'Add New Address'), Yii::app()->createUrl('/checkout/newaddress', array('type' => 'billing')), array('class' => 'small button'));
?>
			</li>
		</ol>
Example #10
0
?>

<div class="control-group">
	<?php 
echo $form->labelEx($model, 'type', array('class' => 'control-label'));
?>
	<div class="controls">
		<?php 
$this->widget('zii.widgets.jui.CJuiAutoComplete', array('model' => $model, 'attribute' => 'type', 'value' => $this->createUrl('SParameter/TParameter'), 'source' => $this->createUrl('SParameter/TParameter'), 'options' => array('minLength' => '2'), 'htmlOptions' => array()));
?>
	</div>
</div>


<?php 
echo $form->textFieldRow($model, 'code');
?>

<?php 
echo $form->textFieldRow($model, 'name', array('class' => 'span3'));
?>

<div class="form-actions">
	<?php 
echo CHtml::htmlButton($model->isNewRecord ? '<i class="icon-ok"></i> Create' : '<i class="icon-ok"></i> Save', array('class' => 'btn', 'type' => 'submit'));
?>
</div>


<?php 
$this->endWidget();
Example #11
0
 /**
  * (non-PHPdoc)
  * @see framework/CWidget::run()
  */
 public function run()
 {
     $cs = Yii::app()->getClientScript();
     list($name, $id) = $this->resolveNameID();
     if (isset($this->htmlOptions['id'])) {
         $id = $this->htmlOptions['id'];
     } else {
         $this->htmlOptions['id'] = $id;
     }
     if (isset($this->htmlOptions['name'])) {
         $name = $this->htmlOptions['name'];
     } else {
         $this->htmlOptions['name'] = $name;
     }
     if ($this->buttonType == 'buttonset') {
         echo CHtml::closeTag($this->htmlTag);
         $cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').buttonset();");
     } else {
         switch ($this->buttonType) {
             case 'submit':
                 echo CHtml::submitButton($this->caption, $this->htmlOptions) . "\n";
                 break;
             case 'button':
                 echo CHtml::htmlButton($this->caption, $this->htmlOptions) . "\n";
                 break;
             case 'link':
                 echo CHtml::link($this->caption, $this->url, $this->htmlOptions) . "\n";
                 break;
             case 'radio':
                 if ($this->hasModel()) {
                     echo CHtml::activeRadioButton($this->model, $this->attribute, $this->htmlOptions);
                     echo CHtml::label($this->caption, CHtml::activeId($this->model, $this->attribute)) . "\n";
                 } else {
                     echo CHtml::radioButton($name, $this->value, $this->htmlOptions);
                     echo CHtml::label($this->caption, $id) . "\n";
                 }
                 break;
             case 'checkbox':
                 if ($this->hasModel()) {
                     echo CHtml::activeCheckbox($this->model, $this->attribute, $this->htmlOptions);
                     echo CHtml::label($this->caption, CHtml::activeId($this->model, $this->attribute)) . "\n";
                 } else {
                     echo CHtml::checkbox($name, $this->value, $this->htmlOptions);
                     echo CHtml::label($this->caption, $id) . "\n";
                 }
                 break;
             default:
                 throw new CException(Yii::t('zii', 'The button type "{type}" is not supported.', array('{type}' => $this->buttonType)));
         }
         $options = empty($this->options) ? '' : CJavaScript::encode($this->options);
         if (isset($this->onclick)) {
             if (strpos($this->onclick, 'js:') !== 0) {
                 $this->onclick = 'js:' . $this->onclick;
             }
             $click = CJavaScript::encode($this->onclick);
             $cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').button({$options}).click({$click});");
         } else {
             $cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').button({$options});");
         }
     }
 }
/**
* checkCompletedQuota() returns matched quotas information for the current response
* @param integer $surveyid - Survey identification number
* @param bool $return - set to true to return information, false do the quota
* @return array - nested array, Quotas->Members->Fields, includes quota information matched in session.
*/
function checkCompletedQuota($surveyid, $return = false)
{
    if (!isset($_SESSION['survey_' . $surveyid]['srid'])) {
        return;
    }
    static $aMatchedQuotas;
    // EM call 2 times quotas with 3 lines of php code, then use static.
    if (!$aMatchedQuotas) {
        $aMatchedQuotas = array();
        $quota_info = $aQuotasInfo = getQuotaInformation($surveyid, $_SESSION['survey_' . $surveyid]['s_lang']);
        // $aQuotasInfo have an 'active' key, we don't use it ?
        if (!$aQuotasInfo || empty($aQuotasInfo)) {
            return $aMatchedQuotas;
        }
        // Test only completed quota, other is not needed
        $aQuotasCompleted = array();
        foreach ($aQuotasInfo as $aQuotaInfo) {
            $iCompleted = getQuotaCompletedCount($surveyid, $aQuotaInfo['id']);
            // Return a string
            if (ctype_digit($iCompleted) && (int) $iCompleted >= (int) $aQuotaInfo['qlimit']) {
                // This remove invalid quota and not completed
                $aQuotasCompleted[] = $aQuotaInfo;
            }
        }
        if (empty($aQuotasCompleted)) {
            return $aMatchedQuotas;
        }
        // OK, we have some quota, then find if this $_SESSION have some set
        $aPostedFields = explode("|", Yii::app()->request->getPost('fieldnames', ''));
        // Needed for quota allowing update
        foreach ($aQuotasCompleted as $aQuotaCompleted) {
            $iMatchedAnswers = 0;
            $bPostedField = false;
            // Array of field with quota array value
            $aQuotaFields = array();
            // Array of fieldnames with relevance value : EM fill $_SESSION with default value even is unrelevant (em_manager_helper line 6548)
            $aQuotaRelevantFieldnames = array();
            foreach ($aQuotaCompleted['members'] as $aQuotaMember) {
                $aQuotaFields[$aQuotaMember['fieldname']][] = $aQuotaMember['value'];
                $aQuotaRelevantFieldnames[$aQuotaMember['fieldname']] = isset($_SESSION['survey_' . $surveyid]['relevanceStatus'][$aQuotaMember['qid']]) && $_SESSION['survey_' . $surveyid]['relevanceStatus'][$aQuotaMember['qid']];
            }
            // For each field : test if actual responses is in quota (and is relevant)
            foreach ($aQuotaFields as $sFieldName => $aValues) {
                $bInQuota = isset($_SESSION['survey_' . $surveyid][$sFieldName]) && in_array($_SESSION['survey_' . $surveyid][$sFieldName], $aValues);
                if ($bInQuota && $aQuotaRelevantFieldnames[$sFieldName]) {
                    $iMatchedAnswers++;
                }
                if (in_array($sFieldName, $aPostedFields)) {
                    $bPostedField = true;
                }
            }
            if ($iMatchedAnswers == count($aQuotaFields)) {
                switch ($aQuotaCompleted['action']) {
                    case '1':
                    default:
                        $aMatchedQuotas[] = $aQuotaCompleted;
                        break;
                    case '2':
                        if ($bPostedField) {
                            // Action 2 allow to correct last answers, then need to be posted
                            $aMatchedQuotas[] = $aQuotaCompleted;
                        }
                        break;
                }
            }
        }
    }
    if ($return) {
        return $aMatchedQuotas;
    }
    if (empty($aMatchedQuotas)) {
        return;
    }
    // Now we have all the information we need about the quotas and their status.
    // We need to construct the page and do all needed action
    $aSurveyInfo = getSurveyInfo($surveyid, $_SESSION['survey_' . $surveyid]['s_lang']);
    $sTemplatePath = getTemplatePath($aSurveyInfo['templatedir']);
    $sClientToken = isset($_SESSION['survey_' . $surveyid]['token']) ? $_SESSION['survey_' . $surveyid]['token'] : "";
    // {TOKEN} is take by $redata ...
    // $redata for templatereplace
    $aDataReplacement = array('thissurvey' => $aSurveyInfo, 'clienttoken' => $sClientToken, 'token' => $sClientToken);
    // We take only the first matched quota, no need for each
    $aMatchedQuota = $aMatchedQuotas[0];
    // If a token is used then mark the token as completed, do it before event : this allow plugin to update token information
    $event = new PluginEvent('afterSurveyQuota');
    $event->set('surveyId', $surveyid);
    $event->set('responseId', $_SESSION['survey_' . $surveyid]['srid']);
    // We allways have a responseId
    $event->set('aMatchedQuotas', $aMatchedQuotas);
    // Give all the matched quota : the first is the active
    App()->getPluginManager()->dispatchEvent($event);
    $blocks = array();
    foreach ($event->getAllContent() as $blockData) {
        /* @var $blockData PluginEventContent */
        $blocks[] = CHtml::tag('div', array('id' => $blockData->getCssId(), 'class' => $blockData->getCssClass()), $blockData->getContent());
    }
    // Allow plugin to update message, url, url description and action
    $sMessage = $event->get('message', $aMatchedQuota['quotals_message']);
    $sUrl = $event->get('url', $aMatchedQuota['quotals_url']);
    $sUrlDescription = $event->get('urldescrip', $aMatchedQuota['quotals_urldescrip']);
    $sAction = $event->get('action', $aMatchedQuota['action']);
    $sAutoloadUrl = $event->get('autoloadurl', $aMatchedQuota['autoload_url']);
    // Construct the default message
    $sMessage = templatereplace($sMessage, array(), $aDataReplacement, 'QuotaMessage', $aSurveyInfo['anonymized'] != 'N', NULL, array(), true);
    $sUrl = passthruReplace($sUrl, $aSurveyInfo);
    $sUrl = templatereplace($sUrl, array(), $aDataReplacement, 'QuotaUrl', $aSurveyInfo['anonymized'] != 'N', NULL, array(), true);
    $sUrlDescription = templatereplace($sUrlDescription, array(), $aDataReplacement, 'QuotaUrldescription', $aSurveyInfo['anonymized'] != 'N', NULL, array(), true);
    // Doing the action and show the page
    if ($sAction == "1" && $sClientToken) {
        submittokens(true);
    }
    // Construction of default message inside quotamessage class
    $quotaMessage = "<div class='quotamessage limesurveycore'>\n";
    $quotaMessage .= "\t" . $sMessage . "\n";
    if ($sUrl) {
        $quotaMessage .= "<br /><br />\t<a href='" . $sUrl . "'>" . $sUrlDescription . "</a><br />\n";
    }
    // Add the navigator with Previous button if quota allow modification.
    if ($sAction == "2") {
        $sQuotaStep = isset($_SESSION['survey_' . $surveyid]['step']) ? $_SESSION['survey_' . $surveyid]['step'] : 0;
        // Surely not needed
        $sNavigator = CHtml::htmlButton(gT("Previous"), array('type' => 'submit', 'id' => "moveprevbtn", 'value' => $sQuotaStep, 'name' => 'move', 'accesskey' => 'p', 'class' => "submit button"));
        $quotaMessage .= CHtml::form(array("/survey/index"), 'post', array('id' => 'limesurvey', 'name' => 'limesurvey'));
        $quotaMessage .= templatereplace(file_get_contents($sTemplatePath . "/navigator.pstpl"), array('NAVIGATOR' => $sNavigator, 'SAVE' => ''), $aDataReplacement);
        $quotaMessage .= CHtml::hiddenField('sid', $surveyid);
        $quotaMessage .= CHtml::hiddenField('token', $sClientToken);
        // Did we really need it ?
        $quotaMessage .= CHtml::endForm();
    }
    $quotaMessage .= "</div>\n";
    // Add the plugin message before default message
    $quotaMessage = implode("\n", $blocks) . "\n" . $quotaMessage;
    // Send page to user and end.
    sendCacheHeaders();
    if ($sAutoloadUrl == 1 && $sUrl != "") {
        if ($sAction == "1") {
            killSurveySession($surveyid);
        }
        header("Location: " . $sUrl);
    }
    doHeader();
    echo templatereplace(file_get_contents($sTemplatePath . "/startpage.pstpl"), array(), $aDataReplacement);
    echo $quotaMessage;
    echo templatereplace(file_get_contents($sTemplatePath . "/endpage.pstpl"), array(), $aDataReplacement);
    doFooter();
    if ($sAction == "1") {
        killSurveySession($surveyid);
    }
    Yii::app()->end();
}
/**
* checkCompletedQuota() returns matched quotas information for the current response
* @param integer $surveyid - Survey identification number
* @param bool $return - set to true to return information, false do the quota
* @return array|void - nested array, Quotas->Members->Fields, includes quota information matched in session.
*/
function checkCompletedQuota($surveyid, $return = false)
{
    /* Check if session is set */
    if (!isset(App()->session['survey_' . $surveyid]['srid'])) {
        return;
    }
    /* Check is Response is already submitted : only when "do" the quota: allow to send information about quota */
    $oResponse = Response::model($surveyid)->findByPk(App()->session['survey_' . $surveyid]['srid']);
    if (!$return && $oResponse && !is_null($oResponse->submitdate)) {
        return;
    }
    static $aMatchedQuotas;
    // EM call 2 times quotas with 3 lines of php code, then use static.
    if (!$aMatchedQuotas) {
        $aMatchedQuotas = array();
        $quota_info = $aQuotasInfo = getQuotaInformation($surveyid, $_SESSION['survey_' . $surveyid]['s_lang']);
        // $aQuotasInfo have an 'active' key, we don't use it ?
        if (!$aQuotasInfo || empty($aQuotasInfo)) {
            return $aMatchedQuotas;
        }
        // OK, we have some quota, then find if this $_SESSION have some set
        $aPostedFields = explode("|", Yii::app()->request->getPost('fieldnames', ''));
        // Needed for quota allowing update
        foreach ($aQuotasInfo as $aQuotaInfo) {
            if (count($aQuotaInfo['members']) === 0) {
                continue;
            }
            $iMatchedAnswers = 0;
            $bPostedField = false;
            // Array of field with quota array value
            $aQuotaFields = array();
            // Array of fieldnames with relevance value : EM fill $_SESSION with default value even is unrelevant (em_manager_helper line 6548)
            $aQuotaRelevantFieldnames = array();
            // To count number of hidden questions
            $aQuotaQid = array();
            foreach ($aQuotaInfo['members'] as $aQuotaMember) {
                $aQuotaFields[$aQuotaMember['fieldname']][] = $aQuotaMember['value'];
                $aQuotaRelevantFieldnames[$aQuotaMember['fieldname']] = isset($_SESSION['survey_' . $surveyid]['relevanceStatus'][$aQuotaMember['qid']]) && $_SESSION['survey_' . $surveyid]['relevanceStatus'][$aQuotaMember['qid']];
                $aQuotaQid[] = $aQuotaMember['qid'];
            }
            $aQuotaQid = array_unique($aQuotaQid);
            // For each field : test if actual responses is in quota (and is relevant)
            foreach ($aQuotaFields as $sFieldName => $aValues) {
                $bInQuota = isset($_SESSION['survey_' . $surveyid][$sFieldName]) && in_array($_SESSION['survey_' . $surveyid][$sFieldName], $aValues);
                if ($bInQuota && $aQuotaRelevantFieldnames[$sFieldName]) {
                    $iMatchedAnswers++;
                }
                if (in_array($sFieldName, $aPostedFields)) {
                    // Need only one posted value
                    $bPostedField = true;
                }
            }
            // Condition to count quota : Answers are the same in quota + an answer is submitted at this time (bPostedField) OR all questions is hidden (bAllHidden)
            $bAllHidden = QuestionAttribute::model()->countByAttributes(array('qid' => $aQuotaQid), 'attribute=:attribute', array(':attribute' => 'hidden')) == count($aQuotaQid);
            if ($iMatchedAnswers == count($aQuotaFields) && ($bPostedField || $bAllHidden)) {
                if ($aQuotaInfo['qlimit'] == 0) {
                    // Always add the quota if qlimit==0
                    $aMatchedQuotas[] = $aQuotaInfo;
                } else {
                    $iCompleted = getQuotaCompletedCount($surveyid, $aQuotaInfo['id']);
                    if (!is_null($iCompleted) && (int) $iCompleted >= (int) $aQuotaInfo['qlimit']) {
                        // This remove invalid quota and not completed
                        $aMatchedQuotas[] = $aQuotaInfo;
                    }
                }
            }
        }
    }
    if ($return) {
        return $aMatchedQuotas;
    }
    if (empty($aMatchedQuotas)) {
        return;
    }
    // Now we have all the information we need about the quotas and their status.
    // We need to construct the page and do all needed action
    $aSurveyInfo = getSurveyInfo($surveyid, $_SESSION['survey_' . $surveyid]['s_lang']);
    $oTemplate = Template::model()->getInstance('', $surveyid);
    $sTemplatePath = $oTemplate->path;
    $sTemplateViewPath = $oTemplate->viewPath;
    $sClientToken = isset($_SESSION['survey_' . $surveyid]['token']) ? $_SESSION['survey_' . $surveyid]['token'] : "";
    // $redata for templatereplace
    $aDataReplacement = array('thissurvey' => $aSurveyInfo, 'clienttoken' => $sClientToken, 'token' => $sClientToken);
    // We take only the first matched quota, no need for each
    $aMatchedQuota = $aMatchedQuotas[0];
    // If a token is used then mark the token as completed, do it before event : this allow plugin to update token information
    $event = new PluginEvent('afterSurveyQuota');
    $event->set('surveyId', $surveyid);
    $event->set('responseId', $_SESSION['survey_' . $surveyid]['srid']);
    // We allways have a responseId
    $event->set('aMatchedQuotas', $aMatchedQuotas);
    // Give all the matched quota : the first is the active
    App()->getPluginManager()->dispatchEvent($event);
    $blocks = array();
    foreach ($event->getAllContent() as $blockData) {
        /* @var $blockData PluginEventContent */
        $blocks[] = CHtml::tag('div', array('id' => $blockData->getCssId(), 'class' => $blockData->getCssClass()), $blockData->getContent());
    }
    // Allow plugin to update message, url, url description and action
    $sMessage = $event->get('message', $aMatchedQuota['quotals_message']);
    $sUrl = $event->get('url', $aMatchedQuota['quotals_url']);
    $sUrlDescription = $event->get('urldescrip', $aMatchedQuota['quotals_urldescrip']);
    $sAction = $event->get('action', $aMatchedQuota['action']);
    $sAutoloadUrl = $event->get('autoloadurl', $aMatchedQuota['autoload_url']);
    // Doing the action and show the page
    if ($sAction == "1" && $sClientToken) {
        submittokens(true);
    }
    // Construct the default message
    $sMessage = templatereplace($sMessage, array(), $aDataReplacement, 'QuotaMessage', $aSurveyInfo['anonymized'] != 'N', NULL, array(), true);
    $sUrl = passthruReplace($sUrl, $aSurveyInfo);
    $sUrl = templatereplace($sUrl, array(), $aDataReplacement, 'QuotaUrl', $aSurveyInfo['anonymized'] != 'N', NULL, array(), true);
    $sUrlDescription = templatereplace($sUrlDescription, array(), $aDataReplacement, 'QuotaUrldescription', $aSurveyInfo['anonymized'] != 'N', NULL, array(), true);
    // Construction of default message inside quotamessage class
    $sHtmlQuotaMessage = "<div class='quotamessage limesurveycore'>\n";
    $sHtmlQuotaMessage .= "\t" . $sMessage . "\n";
    $sHtmlQuotaUrl = $sUrl ? "<a href='" . $sUrl . "'>" . $sUrlDescription . "</a>" : "";
    // Add the navigator with Previous button if quota allow modification.
    if ($sAction == "2") {
        $sQuotaStep = isset($_SESSION['survey_' . $surveyid]['step']) ? $_SESSION['survey_' . $surveyid]['step'] : 0;
        // Surely not needed
        $sNavigator = CHtml::htmlButton(gT("Previous"), array('type' => 'submit', 'id' => "moveprevbtn", 'value' => $sQuotaStep, 'name' => 'move', 'accesskey' => 'p', 'class' => "submit button btn btn-default"));
        //$sNavigator .= " ".CHtml::htmlButton(gT("Submit"),array('type'=>'submit','id'=>"movesubmit",'value'=>"movesubmit",'name'=>"movesubmit",'accesskey'=>'l','class'=>"submit button"));
        $sHtmlQuotaMessage .= CHtml::form(array("/survey/index", "sid" => $surveyid), 'post', array('id' => 'limesurvey', 'name' => 'limesurvey', 'class' => 'survey-form-container QuotaMessage'));
        $sHtmlQuotaMessage .= templatereplace(file_get_contents($sTemplateViewPath . "/navigator.pstpl"), array('NAVIGATOR' => $sNavigator, 'SAVE' => ''), $aDataReplacement);
        $sHtmlQuotaMessage .= CHtml::hiddenField('sid', $surveyid);
        $sHtmlQuotaMessage .= CHtml::hiddenField('token', $sClientToken);
        // Did we really need it ?
        $sHtmlQuotaMessage .= CHtml::endForm();
    }
    $sHtmlQuotaMessage .= "</div>\n";
    // Add the plugin message before default message
    $sHtmlQuotaMessage = implode("\n", $blocks) . "\n" . $sHtmlQuotaMessage;
    // Send page to user and end.
    sendCacheHeaders();
    if ($sAutoloadUrl == 1 && $sUrl != "") {
        if ($sAction == "1") {
            killSurveySession($surveyid);
        }
        header("Location: " . $sUrl);
    }
    doHeader();
    echo templatereplace(file_get_contents($sTemplateViewPath . "/startpage.pstpl"), array(), $aDataReplacement);
    echo templatereplace(file_get_contents($sTemplateViewPath . "/completed.pstpl"), array("COMPLETED" => $sHtmlQuotaMessage, "URL" => $sHtmlQuotaUrl), $aDataReplacement);
    echo templatereplace(file_get_contents($sTemplateViewPath . "/endpage.pstpl"), array(), $aDataReplacement);
    doFooter();
    if ($sAction == "1") {
        killSurveySession($surveyid);
    }
    Yii::app()->end();
}
Example #14
0
		<div class="controls <?php 
echo $model->isAttributeRequired('repetir_contrasena') ? 'required' : '';
?>
">
			<?php 
echo $form->passwordField($model, 'repetir_contrasena', array('placeholder' => '••••••••', 'disabled' => true));
?>
			<?php 
echo $form->error($model, 'repetir_contrasena');
?>
		</div>
	</div>
	<div class="row buttons" style="display:none;">
		<?php 
echo CHtml::ajaxSubmitButton("Guardar nueva contraseña", array('/usuario/perfil/cambiarclave'), array('success' => 'cambio_clave'), array('id' => 'btn-guardar-contrasena'));
echo CHtml::htmlButton('Cancelar', array('id' => 'btn-cancelar-contrasena'));
?>
	</div>
</fieldset>
<fieldset>
	<legend>Datos personales</legend>
	<div class="control-group">
		<?php 
echo CHtml::label('Nombre completo', 'nombres', array('class' => 'control-label'));
?>
		<div class="controls <?php 
echo $model->isAttributeRequired('nombres') ? 'required' : '';
?>
">
			<?php 
echo $form->textField($model, 'nombres', array('placeholder' => 'Nombres'));
Example #15
0
	<div class="row">
		<?php 
echo $form->labelEx($formRelationModel, 'name');
?>
		<?php 
echo $form->dropDownList($formRelationModel, 'attributeId', $attributesArray, array('id' => 'attributeId', 'selected' => isset($attributesArray['name']) ? $attributesArray['name'] : ""));
?>
		<?php 
echo $form->error($formRelationModel, 'subFormId');
?>
	</div>
	<div class="row">
		<?php 
echo $form->labelEx($formRelationModel, 'inputName');
?>
		<?php 
echo $form->dropDownList($formRelationModel, 'subFormId', $surformDetailsArray, array('id' => 'subFormId', 'selected' => isset($surformDetailsArray['inputName']) ? $surformDetailsArray['inputName'] : ""));
?>
		<?php 
echo $form->error($formRelationModel, 'subFormId');
?>
	</div>
	<div class="row buttons">
		<?php 
echo CHtml::htmlButton($buttonText, array('id' => 'save', 'type' => 'submit'));
?>
	</div>
<?php 
$this->endWidget();
?>
</div>
Example #16
0
        $w = $who3;
        echo "<td>-</td>";
    } else {
        $w = $who;
    }
    // echo "<td>" . $form->radioButtonList($model, $role, $w, array("template" => "{input}", "separator" => "</td><td>", "uncheckValue" => null)) . "</td>\n";
    foreach ($w as $val => $t) {
        echo "<td><input type='radio' name='Book[{$role}]' value='{$val}' " . ($book->{$role} == $val ? "checked" : "") . ($book->opts_get(Book::OPTS_BAN_COPYRIGHT) && $val == "a" ? " disabled" : "") . "/></td>";
    }
    //			echo "<td class='hint'>{$title[1]}</td>";
    echo "</tr>\n";
}
?>
</table>
<p class="help-block">
	<sup>*</sup> эти права можно также указать индивидуально для каждой главы.
</p>

<div class="form-actions">
<?php 
if ($book->isNewRecord) {
    echo "<a class='btn btn-primary' href='" . $book->getUrl("edit/info") . "'><i class='icon-arrow-left icon-white'></i> Назад</a> ";
    echo CHtml::htmlButton("Сохранить", array("type" => "submit", "class" => "btn btn-primary pull-right")) . " ";
} else {
    echo CHtml::htmlButton("<i class='icon-ok icon-white'></i> Сохранить", array("type" => "submit", "class" => "btn btn-primary")) . " ";
    echo CHtml::htmlButton("<i class='icon-remove icon-white'></i> Отмена", array("onclick" => "location.href='" . ($book->isNewRecord ? Yii::app()->user->url : $book->url) . "'", "class" => "btn btn-success"));
}
?>
</div>
<?php 
$this->endWidget();
Example #17
0
 /**
  * Creates a button the of given type.
  * @param string $type the button type.
  * @param string $label the button label.
  * @param array $htmlOptions additional HTML attributes.
  * @return string the button.
  * @throws CException if the button type is valid.
  */
 protected static function createButton($type, $label, $htmlOptions)
 {
     $url = TbArray::popValue('url', $htmlOptions, '#');
     $ajaxOptions = TbArray::popValue('ajaxOptions', $htmlOptions, array());
     switch ($type) {
         case self::BUTTON_TYPE_HTML:
             return parent::htmlButton($label, $htmlOptions);
         case self::BUTTON_TYPE_SUBMIT:
             $htmlOptions['type'] = 'submit';
             return parent::htmlButton($label, $htmlOptions);
         case self::BUTTON_TYPE_RESET:
             $htmlOptions['type'] = 'reset';
             return parent::htmlButton($label, $htmlOptions);
         case self::BUTTON_TYPE_IMAGE:
             return parent::imageButton($label, $htmlOptions);
         case self::BUTTON_TYPE_LINKBUTTON:
             return parent::linkButton($label, $htmlOptions);
         case self::BUTTON_TYPE_AJAXLINK:
             return parent::ajaxLink($label, $url, $ajaxOptions, $htmlOptions);
         case self::BUTTON_TYPE_AJAXBUTTON:
             $htmlOptions['ajax'] = $ajaxOptions;
             return parent::htmlButton($label, $htmlOptions);
         case self::BUTTON_TYPE_INPUTBUTTON:
             return parent::button($label, $htmlOptions);
         case self::BUTTON_TYPE_INPUTSUBMIT:
             $htmlOptions['type'] = 'submit';
             return parent::button($label, $htmlOptions);
         case self::BUTTON_TYPE_LINK:
             return self::link($label, $url, $htmlOptions);
         default:
             throw new CException('Invalid button type "' . $type . '".');
     }
 }
Example #18
0
 /**
  * @dataProvider providerHtmlButton
  *
  * @param string $label
  * @param array $htmlOptions
  * @param string $assertion
  */
 public function testHtmlButton($label, $htmlOptions, $assertion)
 {
     $this->assertEquals($assertion, CHtml::htmlButton($label, $htmlOptions));
 }
echo CHtml::label('Прикрепить файл', 'fileupload');
?>
							<?php 
echo CHtml::fileField('ProjectChanges[fileupload]', $fileupload, array('class' => 'col-xs-12 btn btn-user'));
?>
						</div>

						<div class="col-xs-12">
							<?php 
echo CHtml::label('Комментарий', 'comment');
?>
							<?php 
echo CHtml::textArea('ProjectChanges[comment]', $comment, array('class' => 'col-xs-12'));
?>
						</div>
						<?php 
echo CHtml::endForm();
?>
						<?php 
$url = Yii::app()->createUrl("/project/changes/add", array('project' => $project->id));
echo CHtml::htmlButton(ProjectModule::t('Add changes'), array('class' => 'col-xs-12 btn btn-primary addPart', 'onclick' => "javascript: send('{$url}')"));
?>
					</div>
				</div>
				
            </div>
        </div>
    </div>
</div>

<br>
<div class="span8">

<div class="well form-inline">

    <?php 
echo CHtml::beginForm();
?>
    <div style="alignment-baseline:5px; ">  
        <label>Committee : </label>
        <?php 
$this->widget('bootstrap.widgets.TbSelect2', array('name' => 'comm_name', 'data' => CHtml::listData(Committee::model()->findAll(), 'comm_id', 'comm_name'), 'asDropDownList' => true, 'htmlOptions' => array('style' => 'width:60%;')));
?>
       
        <?php 
echo CHtml::htmlButton('<i class="icon-search icon-white"></i> Search', array('class' => 'btn btn-success', 'type' => 'submit', 'name' => 'searchButton'));
?>
         <?php 
$this->widget('bootstrap.widgets.TbButton', array('type' => 'primary', 'url' => Yii::app()->controller->createUrl("reportsOthers/printCommReportMonthly", array("model" => $comm_name . ',' . $year . "," . $month)), 'label' => 'Print Result', 'visible' => isset($_POST['searchButton']) ? true : false, 'htmlOptions' => array('id' => 'printButton')));
?>
        <br/>
        <br/>
        <label>Month :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
        <?php 
$this->widget('bootstrap.widgets.TbSelect2', array('name' => 'month', 'data' => $months, 'asDropDownList' => true, 'htmlOptions' => array('style' => 'width:20%;')));
?>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <label>Year : </label>
        <?php 
$this->widget('bootstrap.widgets.TbSelect2', array('name' => 'year', 'data' => array('2000' => '2000', '2001' => '2001', '2002' => '2002', '2003' => '2003', '2004' => '2004', '2005' => '2005', '2006' => '2006', '2007' => '2007', '2008' => '2008', '2009' => '2009', '2010' => '2010', '2011' => '2011', '2012' => '2012', '2013' => '2013', '2014' => '2014', '2015' => '2015', '2016' => '2016', '2017' => '2017', '2018' => '2018', '2019' => '2019', '2020' => '2020'), 'value' => date('Y'), 'asDropDownList' => true, 'htmlOptions' => array('style' => 'width:20%;')));
?>
    </div>
Example #21
0
<?php 
if ($reply) {
    echo "W.is_reply=true;\n";
}
?>
$(W.init);
</script>

<?php 
echo "<h1>" . ($reply ? "Ответить" : "Написать письмо") . "</h1>";
/** @var TbActiveForm $form */
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array("id" => "form-write", "type" => "horizontal"));
echo $form->errorSummary($message);
echo $form->textFieldRow($message, "sendTo", array("class" => "span6"));
echo $form->textFieldRow($message, "subj", array("class" => "span6"));
if ($reply) {
    $quote = htmlspecialchars_decode($reply->body);
    $quote = "> " . str_replace("\n", "\n> ", $quote);
    $message->body = $quote;
}
echo $form->textAreaRow($message, "body", array("class" => "span6", "hint" => "Здесь можно использовать некоторые HTML-теги"));
?>
<div class="form-actions">
<?php 
echo CHtml::htmlButton("<i class='icon-ok icon-white'></i> Отправить", array("type" => "submit", "class" => "btn btn-primary")) . " ";
$back = $reply ? $reply->url : "/my/mail";
echo CHtml::htmlButton("<i class='icon-remove icon-white'></i> Отмена", array("onclick" => "location.href='{$back}'", "class" => "btn btn-success"));
?>
</div>
<?php 
$this->endWidget();
Example #22
0
                    <label class="col-sm-2 control-label" for='filterduplicatefields'><?php 
eT("Duplicates are determined by:");
?>
</label>
                    <div class="col-sm-10">
                        <?php 
echo CHtml::listBox('filterduplicatefields', array('firstname', 'lastname', 'email'), $aTokenTableFields, array('multiple' => 'multiple', 'size' => '7'));
?>
                    </div>
                </div>

                <!-- Buttons -->
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <?php 
echo CHtml::htmlButton(gT("Upload"), array('type' => 'submit', 'name' => 'upload', 'value' => 'import', 'class' => 'btn btn-default'));
?>
                    </div>
                </div>
            </form>

            <!-- Infos -->
            <div class="alert alert-info" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <strong><?php 
eT("CSV input format");
?>
</strong><br/>
                <p><?php 
eT("File should be a standard CSV (comma delimited) file with optional double quotes around values (default for OpenOffice and Excel). The first line must contain the field names. The fields can be in any order.");
?>
Example #23
0
 /**
  * Delete token attributes
  */
 function deletetokenattributes($iSurveyId)
 {
     $clang = $this->getController()->lang;
     $iSurveyId = sanitize_int($iSurveyId);
     // CHECK TO SEE IF A TOKEN TABLE EXISTS FOR THIS SURVEY
     $bTokenExists = tableExists('{{tokens_' . $iSurveyId . '}}');
     if (!$bTokenExists) {
         Yii::app()->session['flashmessage'] = $clang->gT("No token table.");
         $this->getController()->redirect($this->getController()->createUrl("/admin/survey/sa/view/surveyid/{$iSurveyId}"));
     }
     if (!Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'update') && !Permission::model()->hasSurveyPermission($iSurveyID, 'surveysettings', 'update')) {
         Yii::app()->session['flashmessage'] = $clang->gT("You do not have sufficient rights to access this page.");
         $this->getController()->redirect($this->getController()->createUrl("/admin/survey/sa/view/surveyid/{$iSurveyId}"));
     }
     $aData['thissurvey'] = getSurveyInfo($iSurveyId);
     $aData['surveyid'] = $iSurveyId;
     $confirm = Yii::app()->request->getPost('confirm', '');
     $cancel = Yii::app()->request->getPost('cancel', '');
     $tokenfields = getAttributeFieldNames($iSurveyId);
     $sAttributeToDelete = Yii::app()->request->getPost('deleteattribute', '');
     tracevar($sAttributeToDelete);
     if (!in_array($sAttributeToDelete, $tokenfields)) {
         $sAttributeToDelete = false;
     }
     tracevar($sAttributeToDelete);
     if ($cancel == 'cancel') {
         Yii::app()->getController()->redirect(Yii::app()->getController()->createUrl("/admin/tokens/sa/managetokenattributes/surveyid/{$iSurveyId}"));
     } elseif ($confirm != 'confirm' && $sAttributeToDelete) {
         $this->_renderWrappedTemplate('token', array('tokenbar', 'message' => array('title' => sprintf($clang->gT("Delete token attribute %s"), $sAttributeToDelete), 'message' => "<p>" . $clang->gT("If you remove this attribute, you will lose all information.") . "</p>\n" . CHtml::form(array("admin/tokens/sa/deletetokenattributes/surveyid/{$iSurveyId}"), 'post', array('id' => 'attributenumber')) . CHtml::hiddenField('deleteattribute', $sAttributeToDelete) . CHtml::hiddenField('sid', $iSurveyId) . CHtml::htmlButton($clang->gT('Delete attribute'), array('type' => 'submit', 'value' => 'confirm', 'name' => 'confirm')) . CHtml::htmlButton($clang->gT('Cancel'), array('type' => 'submit', 'value' => 'cancel', 'name' => 'cancel')) . CHtml::endForm())), $aData);
     } elseif ($sAttributeToDelete) {
         $sTableName = "{{tokens_" . intval($iSurveyId) . "}}";
         Yii::app()->db->createCommand(Yii::app()->db->getSchema()->dropColumn($sTableName, $sAttributeToDelete))->execute();
         Yii::app()->db->schema->getTable($sTableName, true);
         // Refresh schema cache just in case the table existed in the past
         LimeExpressionManager::SetDirtyFlag();
         Yii::app()->session['flashmessage'] = sprintf($clang->gT("Attribute %s was deleted."), $sAttributeToDelete);
         Yii::app()->getController()->redirect(Yii::app()->getController()->createUrl("/admin/tokens/sa/managetokenattributes/surveyid/{$iSurveyId}"));
     } else {
         Yii::app()->session['flashmessage'] = $clang->gT("The selected attribute was invalid.");
         Yii::app()->getController()->redirect(Yii::app()->getController()->createUrl("/admin/tokens/sa/managetokenattributes/surveyid/{$iSurveyId}"));
     }
 }
Example #24
0
<div class="row">

    <div class="col-sm-2 col-xs-6">
		<?php 
echo CHtml::ajaxButton(Yii::t('cart', 'Clear Cart'), array('cart/clearcart'), array('data' => array(), 'type' => 'POST', 'dataType' => 'json', 'success' => 'js:function(data){
	                    if (data.action=="alert") {
	                      alert(data.errormsg);
						} else if (data.action=="success") {
							 location.reload();
						}}'), array('confirm' => Yii::t('cart', "Are you sure you want to erase your cart items?")));
?>
    </div>

    <div class="col-sm-2 col-xs-6" >
		<?php 
echo CHtml::htmlButton(Yii::t('cart', 'Share Cart'), array('onClick' => 'js:jQuery($("#CartShare")).dialog("open");return false;'));
?>
    </div>



 	<div class="col-sm-2 col-xs-6" >
	<?php 
echo CHtml::tag('div', array('id' => 'shoppingcartcontinue', 'class' => 'col-sm-4 checkoutlink', 'onclick' => 'window.location.href=\'' . $this->CreateUrl("cart/checkout") . '\''), Yii::t('cart', 'Checkout'));
?>
	</div>


    <div class="col-sm-2 col-xs-6" >
		<?php 
echo CHtml::ajaxButton(Yii::t('cart', 'Update Cart'), array('cart/updatecart'), array('data' => 'js:$("#ShoppingCart").serialize()', 'type' => 'POST', 'dataType' => 'json', 'success' => 'js:function(data){
/**
* doHtmlSaveAll return HTML part of saveall button in survey
* @param string $move :
* @return string
**/
function doHtmlSaveAll($move = "")
{
    static $aSaveAllButtons = array();
    if (isset($aSaveAllButtons[$move])) {
        return $aSaveAllButtons[$move];
    }
    $surveyid = Yii::app()->getConfig('surveyID');
    $thissurvey = getsurveyinfo($surveyid);
    $aHtmlOptionsLoadall = array('type' => 'submit', 'id' => 'loadallbtn', 'value' => 'loadall', 'name' => 'loadall', 'class' => "saveall btn btn-default col-xs-12 col-sm-4 submit button hidden");
    $aHtmlOptionsSaveall = array('type' => 'submit', 'id' => 'saveallbtn', 'value' => 'saveall', 'name' => 'saveall', 'class' => "saveall btn btn-default col-xs-12 col-sm-4 submit button hidden");
    if ($thissurvey['allowsave'] == "Y") {
        $sLoadButton = CHtml::htmlButton(gT("Load unfinished survey"), $aHtmlOptionsLoadall);
        $sSaveButton = CHtml::htmlButton(gT("Resume later"), $aHtmlOptionsSaveall);
    } else {
        $sLoadButton = '';
        $sSaveButton = '';
    }
    // Fill some test here, more clear ....
    $bTokenanswerspersistence = $thissurvey['tokenanswerspersistence'] == 'Y' && tableExists('tokens_' . $surveyid);
    $bAlreadySaved = isset($_SESSION['survey_' . $surveyid]['scid']);
    $iSessionStep = isset($_SESSION['survey_' . $surveyid]['step']) ? $_SESSION['survey_' . $surveyid]['step'] : false;
    $iSessionMaxStep = isset($_SESSION['survey_' . $surveyid]['maxstep']) ? $_SESSION['survey_' . $surveyid]['maxstep'] : false;
    $sSaveAllButtons = "";
    // Find out if the user has any saved data
    if ($thissurvey['format'] == 'A') {
        if (!$bTokenanswerspersistence && !$bAlreadySaved) {
            $sSaveAllButtons .= $sLoadButton;
        }
        $sSaveAllButtons .= CHtml::htmlButton(gT("Resume later"), $aHtmlOptionsSaveall);
    } elseif (!$iSessionStep) {
        if (!$bTokenanswerspersistence && !$bAlreadySaved) {
            $sSaveAllButtons .= $sLoadButton;
        }
        if ($thissurvey['showwelcome'] == "N") {
            $sSaveAllButtons .= $sSaveButton;
        }
    } elseif ($iSessionMaxStep == 1 && $thissurvey['showwelcome'] == "N") {
        if (!$bTokenanswerspersistence && !$bAlreadySaved) {
            $sSaveAllButtons .= $sLoadButton;
        }
        $sSaveAllButtons .= $sSaveButton;
    } elseif ($move != "movelast") {
        $sSaveAllButtons .= $sSaveButton;
    }
    $aSaveAllButtons[$move] = $sSaveAllButtons;
    return $aSaveAllButtons[$move];
}
<?php

$form = $this->beginWidget('bootstrap.widgets.BootActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'get'));
echo $form->label($model, 'complete_name');
echo $form->textFieldRow($model, 'complete_name', array('class' => 'span3'));
echo $form->label($model, 'company_name');
echo $form->textFieldRow($model, 'company_name', array('class' => 'span3'));
echo $form->label($model, 'title');
echo $form->textFieldRow($model, 'title', array('class' => 'span3'));
echo $form->label($model, 'handphone');
echo $form->textFieldRow($model, 'handphone', array('class' => 'span3'));
echo $form->label($model, 'email');
echo $form->textFieldRow($model, 'email', array('class' => 'span3'));
?>

<div class="form-actions">
	<?php 
echo CHtml::htmlButton('<i class="icon-search"></i> Search', array('class' => 'btn', 'type' => 'submit'));
?>
</div>
<?php 
$this->endWidget();
echo $form->labelEx($model, 'input_date', array('class' => 'control-label'));
?>
	<div class="controls">
		<?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'id' => 'g2', 'value' => CTimestamp::formatDate('yyyy-MM-dd', $model->input_date), 'attribute' => 'input_date', 'options' => array('showAnim' => 'fold', 'dateFormat' => 'dd-mm-yy', 'minDate' => '-20', 'maxDate' => '+1M +10D'), 'htmlOptions' => array()));
?>
	</div>
</div>

<?php 
//echo $form->dropDownListRow($model,'yearmonth_periode',array(Yii::app()->settings->get("System", "cCurrentPeriod")=>Yii::app()->settings->get("System", "cCurrentPeriod")));
?>

<?php 
echo $form->dropDownListRow($model, 'var_account', tAccount::cashBankAccount());
echo $form->textFieldRow($model, 'cb_receiver', array('class' => 'span3'));
echo $form->textAreaRow($model, 'remark', array('class' => 'span5', 'rows' => 3));
?>

<?php 
$this->widget('ext.appendo.JAppendo', array('id' => 'repeateEnum1', 'model' => $model, 'viewName' => '_detailJournal', 'labelDel' => 'Remove Row'));
?>

<div class="form-actions">
	<?php 
echo CHtml::htmlButton('<i class="icon-ok"></i> Save Expense', array('class' => 'btn', 'type' => 'submit'));
?>
</div>

<?php 
$this->endWidget();
Example #28
0
</div>


<?php 
$form = $this->beginWidget('BootActiveForm', array('id' => 'login-form', 'type' => 'horizontal', 'enableAjaxValidation' => true));
?>

<?php 
echo $form->textFieldRow($model, 'username', array('class' => 'span3'));
echo $form->passwordFieldRow($model, 'password', array('class' => 'span3'));
echo $form->checkBoxRow($model, 'rememberMe');
?>

<div class="form-actions">
	<?php 
echo CHtml::htmlButton('<i class="icon-ok"></i> Submit', array('class' => 'btn-large', 'type' => 'submit'));
?>
</div>

<?php 
$this->endWidget();
?>

<div class="alert alert-info">
	<h4 class="alert-heading">Note!!</h4>
	This Application IS NOT designed to open with Internet Explorer
	Browser. Please, use Chrome, Firefox or Opera
</div>


<?php 
eT("Corner lines");
?>
</option>
                        <option value='boxes'
                            <?php 
if ($queXMLEdgeDetectionFormat == "boxes") {
    ?>
                                selected='selected'
                                <?php 
}
?>
                            ><?php 
eT("Corner boxes");
?>
</option>
                   </select>
                </li>

            <input type='hidden' name='ok' value='Y' />
            <input type='submit' value="<?php 
eT("queXML PDF export");
?>
" />
        </form>
             <?php 
echo CHtml::form(array("admin/export/sa/quexmlclear/surveyid/{$surveyid}/"), 'post', array('class' => 'form44'));
echo CHtml::htmlButton(gT('Reset to default settings'), array('type' => 'submit'));
?>
        </form>
    </div><br />&nbsp;
Example #30
0
            <ul>
                <li><a class="mws-ic-16 ic-add" href="index.php?r=kepegawaian/MastergajiM/create ">Tambah Master Gaji</a></li>
            </ul>
        </div>
        <div class="mws-table">
<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'mastergaji-m-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('header' => 'ID', 'name' => 'mastergaji_id', 'value' => '$data->mastergaji_id'), array('header' => 'Lama Bulan', 'name' => 'lama_bln', 'value' => '$data->lama_bln'), array('header' => 'Gaji Pokok', 'name' => 'gajipokok', 'value' => '$data->gajipokok'), array('header' => 'Komisi Galon', 'name' => 'kgalon', 'value' => '$data->kgalon'), array('header' => 'Komisi Gelas', 'name' => 'kgelas', 'value' => '$data->kgelas'), array('header' => 'Komisi Karton', 'name' => 'kkarton', 'value' => '$data->kkarton'), array('header' => 'Lihat', 'class' => 'CButtonColumn', 'template' => '{view}'), array('header' => 'Ubah', 'class' => 'CButtonColumn', 'template' => '{update}'), array('header' => 'Delete', 'class' => 'CButtonColumn', 'template' => '{delete}'))));
?>
              </div>
        
                <div class="mws-button-row" align="right">
                    <?php 
echo CHtml::htmlButton(Yii::t('mds', '{icon} PDF', array('{icon}' => '<i class="icon-book icon-white"></i>')), array('class' => 'mws-button blue', 'type' => 'button', 'onclick' => 'print(\'PDF\')')) . "&nbsp&nbsp";
echo CHtml::htmlButton(Yii::t('mds', '{icon} Excel', array('{icon}' => '<i class="icon-pdf icon-white"></i>')), array('class' => 'mws-button green', 'type' => 'button', 'onclick' => 'print(\'EXCEL\')')) . "&nbsp&nbsp";
echo CHtml::htmlButton(Yii::t('mds', '{icon} Print', array('{icon}' => '<i class="icon-print icon-white"></i>')), array('class' => 'mws-button orange', 'type' => 'button', 'onclick' => 'print(\'PRINT\')')) . "&nbsp&nbsp";
echo CHtml::htmlButton(Yii::t('mds', '{icon} Petunjuk', array('{icon}' => '<i class="icon-print icon-white"></i>')), array('class' => 'mws-button yellow', 'type' => 'button', 'id' => 'clickme')) . "&nbsp&nbsp";
?>
                </div><br>
                 <div id ="ptjk" class="mws-form-message info" style="display: none;">
                    <p>
                    You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
                    or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
                    </p>
                </div>
         </div>
    </div>
<?php 
$controller = Yii::app()->controller->id;
//mengambil Controller yang sedang dipakai
$module = Yii::app()->controller->module->id;
//mengambil Module yang sedang dipakai