diff --git a/application/controllers/admin/authentication.php b/application/controllers/admin/authentication.php index c540194d936..bb7739db0ee 100644 --- a/application/controllers/admin/authentication.php +++ b/application/controllers/admin/authentication.php @@ -50,7 +50,7 @@ public function run() */ public function index() { - redirect('/admin', 'refresh'); + $this->_doRedirect(); } /** diff --git a/application/controllers/admin/quotas.php b/application/controllers/admin/quotas.php index a01691e40a3..a57def0d82a 100644 --- a/application/controllers/admin/quotas.php +++ b/application/controllers/admin/quotas.php @@ -21,582 +21,576 @@ * @package LimeSurvey * @subpackage Backend */ -class quotas extends Survey_Common_Action { - - /** - * Base function - * - * @access publlic - * @param int $surveyid - * @param string $subaction - * @return void - */ - public function run($surveyid, $subaction = null) - { - $surveyid = sanitize_int($surveyid); - - $this->getController()->_js_admin_includes(Yii::app()->getConfig("generalscripts").'/jquery/jquery.tablesorter.min.js'); - $this->getController()->_js_admin_includes(Yii::app()->getConfig("adminscripts").'/quotas.js'); - - if(!bHasSurveyPermission($surveyid, 'quotas','read')) - { - show_error("no permissions"); - } - - $clang = $this->getController()->lang; - $conn = Yii::app()->db; - - Yii::app()->loadHelper('surveytranslator'); - - $data = array('clang' => $clang, 'surveyid' => $surveyid); - - if (isset($_POST['quotamax'])) $_POST['quotamax']=sanitize_int($_POST['quotamax']); - if (!isset($action)) $action=returnglobal('action'); - if (!isset($action)) $action="quotas"; - if (!isset($subaction)) $subaction=returnglobal('subaction'); - //if (!isset($quotasoutput)) $quotasoutput = ""; - if (!isset($_POST['autoload_url']) || empty($_POST['autoload_url'])) {$_POST['autoload_url']=0;} - - //Get the languages used in this survey - $langs = GetAdditionalLanguagesFromSurveyID($surveyid); - $baselang = GetBaseLanguageFromSurveyID($surveyid); - $data['baselang'] = $baselang; - array_push($langs, $baselang); - - $css_admin_includes[] = Yii::app()->getConfig('styleurl')."admin/default/superfish.css"; - Yii::app()->setConfig("css_admin_includes", $css_admin_includes); - $this->getController()->_getAdminHeader(); +class quotas extends Survey_Common_Action +{ + + /** + * Base function + * + * @access public + * @return void + */ + public function run($subaction = 'index', $surveyid = 0) + { + if (!bHasSurveyPermission($surveyid, 'quotas', 'read')) + { + die(); + } + + // Load helpers + Yii::app()->loadHelper('surveytranslator'); + // Sanitize/get globals/variables + $_POST['quotamax'] = sanitize_int(CHttpRequest::getPost('quotamax')); + if (empty($_POST['autoload_url'])) + { + $_POST['autoload_url'] = 0; + } + if (empty($_POST['quota_limit']) || !is_numeric(CHttpRequest::getPost('quota_limit')) || CHttpRequest::getPost('quota_limit') < 0) + { + $_POST['quota_limit'] = 0; + } + + switch ($subaction) + { + case 'index' : + $this->route('index', array('surveyid', 'quickreport')); + break; + case 'insertquota' : + case 'modifyquota' : + case 'insertquotaanswer' : + case 'quota_delans' : + case 'quota_delquota' : + case 'quota_editquota' : + case 'new_quota' : + $this->route($subaction, array('surveyid')); + break; + case 'new_answer' : + case 'new_answer_two' : + $this->route('new_answer', array('surveyid', 'subaction')); + break; + } + } + + private function _getData($iSurveyId) + { + // Set the variables in an array + $aData['iSurveyId'] = $iSurveyId; + $aData['clang'] = $this->getController()->lang; + $aData['aLangs'] = GetAdditionalLanguagesFromSurveyID($iSurveyId); + $aData['sBaseLang'] = GetBaseLanguageFromSurveyID($iSurveyId); + array_push($aData['aLangs'], $aData['sBaseLang']); + + $aData['action'] = $action = CHttpRequest::getParam('action'); + if (!isset($action)) + $aData['action'] = 'quotas'; + + return $aData; + } + + private function _checkPermissions($iSurveyId, $sPermission) + { + if (!empty($sPermission) && !bHasSurveyPermission($iSurveyId, 'quotas', $sPermission)) { + die(); + } + } + + /** + * Pre Quota + * + * @access publlic + * @param int $iSurveyId + * @return void + */ + public function _displayHeader($iSurveyId) + { + // Insert scripts and styles + $this->getController()->_js_admin_includes(Yii::app()->getConfig('generalscripts') . '/jquery/jquery.tablesorter.min.js'); + $this->getController()->_js_admin_includes(Yii::app()->getConfig('adminscripts') . '/quotas.js'); + $this->getController()->_css_admin_includes(Yii::app()->getConfig('styleurl') . 'admin/default/superfish.css'); + + // Show the common head of the page + $this->getController()->_getAdminHeader(); $this->getController()->_showadminmenu(); - $this->_surveybar($surveyid); - - if($subaction == "insertquota" && bHasSurveyPermission($surveyid, 'quotas','create')) - { - if(!isset($_POST['quota_limit']) || $_POST['quota_limit'] < 0 || empty($_POST['quota_limit']) || !is_numeric($_POST['quota_limit'])) - { - $_POST['quota_limit'] = 0; - - } - - $comm = $conn->createCommand("INSERT INTO {{quota}} (sid,name,qlimit,action,autoload_url) - VALUES (:surveyid, :quota_name, :quota_limit, :quota_action, :autoload_url)"); - $comm->execute(array( - ':surveyid' => $surveyid, - ':quota_name' => $_POST['quota_name'], - ':quota_limit' => $_POST['quota_limit'], - ':quota_action' => $_POST['quota_action'], - ':autoload_url' => $_POST['autoload_url'], - )); - - $quotaid = $conn->lastInsertID;//$connect->Insert_Id($this->db->dbprefix_nq('quota'),"id"); - - //Get the languages used in this survey - $langs = GetAdditionalLanguagesFromSurveyID($surveyid); - $baselang = GetBaseLanguageFromSurveyID($surveyid); - array_push($langs, $baselang); - //Iterate through each language, and make sure there is a quota message for it - $errorstring = ''; - foreach ($langs as $lang) - { - if (!$_POST['quotals_message_'.$lang]) { $errorstring.= GetLanguageNameFromCode($lang,false)."\\n";} - } - if ($errorstring!='') - { - $data['showerror'] = "\n"; - } - else - //All the required quota messages exist, now we can insert this info into the database - { - - foreach ($langs as $lang) //Iterate through each language - { - //Clean XSS - Automatically provided by CI input class - $_POST['quotals_message_'.$lang] = html_entity_decode($_POST['quotals_message_'.$lang], ENT_QUOTES, "UTF-8"); - - // Fix bug with FCKEditor saving strange BR types - $_POST['quotals_message_'.$lang]=fix_FCKeditor_text($_POST['quotals_message_'.$lang]); - - $comm = $conn->createCommand(" - INSERT INTO {{quota_languagesettings}} (quotals_quota_id, quotals_language, quotals_name, quotals_message, quotals_url, quotals_urldescrip) - VALUES (:quotaid, :lang, :quota_name, :quotal_message, :quotal_url, :quotal_urldesc)"); - $comm->execute(array( - ':quotaid' => $quotaid, - ':lang' => $lang, - ':quota_name' => $_POST['quota_name'], - ':quotal_message' => $_POST['quotals_message_' . $lang], - ':quotal_url' => $_POST['quotals_url_' . $lang], - ':quotal_urldesc' => $_POST['quotals_urldescrip_' . $lang], - )); - } - } //End insert language based components - $viewquota = "1"; - - } //End foreach $lang - - if($subaction == "modifyquota" && bHasSurveyPermission($surveyid, 'quotas','update')) - { - $query = " - UPDATE {{quota}} - SET name=:name, - qlimit=:limit, - action=:action, - autoload_url=:autoload_url - WHERE id=:id"; - $conn->createCommand($query)->execute(array( - ':name' => $_POST['quota_name'], - ':limit' => $_POST['quota_limit'], - ':action' => $_POST['quota_action'], - ':autoload_url' => $_POST['autoload_url'], - ':id' => $_POST['quota_id'], - )); - - //Get the languages used in this survey - $langs = GetAdditionalLanguagesFromSurveyID($surveyid); - $baselang = GetBaseLanguageFromSurveyID($surveyid); - array_push($langs, $baselang); - //Iterate through each language, and make sure there is a quota message for it - $errorstring = ''; - foreach ($langs as $lang) - { - if (!$_POST['quotals_message_'.$lang]) { $errorstring.= GetLanguageNameFromCode($lang,false)."\\n";} - } - if ($errorstring!='') - { - $data['showerror'] = "\n"; - } - else - //All the required quota messages exist, now we can insert this info into the database - { - - foreach ($langs as $lang) //Iterate through each language - { - //Clean XSS - Automatically provided by CI - $_POST['quotals_message_'.$lang] = html_entity_decode($_POST['quotals_message_'.$lang], ENT_QUOTES, "UTF-8"); - - // Fix bug with FCKEditor saving strange BR types - $_POST['quotals_message_'.$lang]=fix_FCKeditor_text($_POST['quotals_message_'.$lang]); - - $query = " - UPDATE {{quota_languagesettings}} - SET quotals_name=:name, - quotals_message=:message, - quotals_url=:url, - quotals_urldescrip=:desc - WHERE - quotals_quota_id=:id - AND quotals_language=:lang"; - $conn->createCommand($query)->execute(array( - ':name' => $_POST['quota_name'], - ':message' => $_POST['quotals_message_' . $lang], - ':url' => $_POST['quotals_url_' . $lang], - ':desc' => $_POST['quotals_urldescrip_' . $lang], - ':id' => $_POST['quota_id'], - ':lang' => $lang, - )); - } - } //End insert language based components - - - $viewquota = "1"; - } - - if($subaction == "insertquotaanswer" && bHasSurveyPermission($surveyid, 'quotas','create')) - { - $query = "INSERT INTO {{quota_members}} (sid, qid, quota_id, code) - VALUES (:survey_id, :quota_qid, :quota_id, :quota_anscode)"; - $conn->createCommand($query)->execute(array( - ':survey_id' => $surveyid, - ':quota_qid' => $_POST['quota_qid'], - ':quota_id' => $_POST['quota_id'], - ':quota_anscode' => $_POST['quota_anscode'], - )); - - if(isset($_POST['createanother']) && $_POST['createanother'] == "on") { - $_POST['action']="quotas"; - $_POST['subaction']="new_answer"; - $subaction="new_answer"; - } else { - $viewquota = "1"; - } - } - - if($subaction == "quota_delans" && bHasSurveyPermission($surveyid, 'quotas','delete')) - { - $query = "DELETE FROM {{quota_members}} WHERE id = :quota_member_id AND qid = :quota_qid AND code = :quota_anscode"; - $conn->createCommand($query)->execute(array( - ':quota_member_id' => $_POST['quota_member_id'], - ':quota_qid' => $_POST['quota_qid'], - ':quota_anscode' => $_POST['quota_anscode'], - )); - $viewquota = "1"; - - } - - if($subaction == "quota_delquota" && bHasSurveyPermission($surveyid, 'quotas','delete')) - { - $query = "DELETE FROM {{quota}} WHERE id=:quota_id"; - $conn->createCommand($query)->execute(array(':quota_id' => $_POST['quota_id'])); - - $query = "DELETE FROM {{quota_languagesettings}} WHERE quotals_quota_id=:quota_id"; - $conn->createCommand($query)->execute(array(':quota_id' => $_POST['quota_id'])); - - $query = "DELETE FROM {{quota_members}} WHERE quota_id=:quota_id"; - $conn->createCommand($query)->execute(array(':quota_id' => $_POST['quota_id'])); - - $viewquota = "1"; - } - - if ($subaction == "quota_editquota" && bHasSurveyPermission($surveyid, 'quotas','update')) - { - $query = "SELECT * FROM {{quota}} - WHERE id=:quota_id"; - $comm = $conn->createCommand($query); - $reader = $comm->query(array(':quota_id' => $_POST['quota_id'])); - $quotainfo = $reader->read(); - - $langs = GetAdditionalLanguagesFromSurveyID($surveyid); - $baselang = GetBaseLanguageFromSurveyID($surveyid); - array_push($langs,$baselang); - - $data['quotainfo'] = $quotainfo; - $this->getController()->render("/admin/quotas/editquota_view",$data); - - foreach ($langs as $lang) - { - $langquery = "SELECT * FROM {{quota_languagesettings}} WHERE quotals_quota_id=:quota_id AND quotals_language=:lang"; - $comm = $conn->createCommand($langquery); - $reader = $comm->query(array(':lang' => $lang, ':quota_id' => $_POST['quota_id'])); - $langquotainfo = $reader->read(); - - $data['langquotainfo'] = $langquotainfo; - $data['lang'] = $lang; - $this->getController()->render("/admin/quotas/editquotalang_view",$data); - - }; - $this->getController()->render("/admin/quotas/editquotafooter_view",$data); - } - - $totalquotas=0; - $totalcompleted=0; - $csvoutput=array(); - if (($action == "quotas" && !isset($subaction)) || isset($viewquota)) - { - $query = "SELECT * FROM {{quota}} AS q - LEFT JOIN {{quota_languagesettings}} as qls ON (q.id = qls.quotals_quota_id) - WHERE sid=:survey - AND quotals_language=:lang - ORDER BY name"; - $result = $conn->createCommand($query)->query(array(':survey' => $surveyid, ':lang' => $baselang)); - - $this->getController()->render("/admin/quotas/viewquotas_view",$data); - - //if there are quotas let's proceed - if ($result->getRowCount() > 0) - { - //loop through all quotas - foreach ($result->readAll() as $quotalisting) - { - $totalquotas+=$quotalisting['qlimit']; - $completed=get_quotaCompletedCount($surveyid, $quotalisting['id']); - $highlight=($completed >= $quotalisting['qlimit']) ? "" : "style='color: red'"; //Incomplete quotas displayed in red - $totalcompleted=$totalcompleted+$completed; - $csvoutput[]=$quotalisting['name'].",".$quotalisting['qlimit'].",".$completed.",".($quotalisting['qlimit']-$completed)."\r\n"; - - $data['quotalisting'] = $quotalisting; - $data['highlight'] = $highlight; - $data['completed'] = $completed; - $data['totalquotas'] = $totalquotas; - $data['totalcompleted'] = $totalcompleted; - $this->getController()->render("/admin/quotas/viewquotasrow_view",$data); - - //check how many sub-elements exist for a certain quota - $query = "SELECT id,code,qid FROM {{quota_members}} where quota_id=:id"; - $result2 = $conn->createCommand($query)->query(array('id' => $quotalisting['id'])); - - if ($result2->getRowCount() > 0) - { - //loop through all sub-parts - foreach ($result2->readAll() as $quota_questions ) - { - $question_answers = self::getQuotaAnswers($quota_questions['qid'],$surveyid,$quotalisting['id']); - $data['question_answers'] = $question_answers; - $data['quota_questions'] = $quota_questions; - $this->getController()->render("/admin/quotas/viewquotasrowsub_view",$data); - } - } - - } - - } - else - { - // No quotas have been set for this survey - $this->getController()->render("/admin/quotas/viewquotasempty_view",$data); - } - - $data['totalquotas'] = $totalquotas; - $data['totalcompleted'] = $totalcompleted; - - $this->getController()->render("/admin/quotas/viewquotasfooter_view",$data); - } - if(isset($_GET['quickreport']) && $_GET['quickreport']) - { - header("Content-Disposition: attachment; filename=results-survey".$surveyid.".csv"); - header("Content-type: text/comma-separated-values; charset=UTF-8"); - header("Pragma: public"); - echo $clang->gT("Quota name").",".$clang->gT("Limit").",".$clang->gT("Completed").",".$clang->gT("Remaining")."\r\n"; - foreach($csvoutput as $line) - { - echo $line; - } - die; - } - if(($subaction == "new_answer" || ($subaction == "new_answer_two" && !isset($_POST['quota_qid']))) && bHasSurveyPermission($surveyid,'quotas','create')) - { - if ($subaction == "new_answer_two") $_POST['quota_id'] = $_POST['quota_id']; - - $allowed_types = "(type ='G' or type ='M' or type ='Y' or type ='A' or type ='B' or type ='I' or type = 'L' or type='O' or type='!')"; - - $query = "SELECT name FROM {{quota}} WHERE id=:quota_id"; - $result = $conn->createCommand($query)->query(array(':quota_id' => $_POST['quota_id'])); - foreach ($result->readAll() as $quotadetails) - { - $quota_name=$quotadetails['name']; - } - - $query = "SELECT qid, title, question FROM {{questions}} WHERE $allowed_types AND sid=:surveyid AND language=:lang"; - $result = $conn->createCommand($query)->query(array(':surveyid' => $surveyid, ':lang' => $baselang)); - if ($result->getRowCount() == 0) - { - $this->getController()->render("/admin/quotas/newanswererror_view", $data); - } else - { - $data['newanswer_result'] = $result->readAll(); - $data['quota_name'] = $quota_name; - $this->getController()->render("/admin/quotas/newanswer_view", $data); - } - } - - if($subaction == "new_answer_two" && isset($_POST['quota_qid']) && bHasSurveyPermission($surveyid, 'quotas','create')) - { - $query = "SELECT name FROM {{quota}} WHERE id=:id"; - $result = $conn->createCommand($query)->query(array(':id' => $_POST['quota_qid'])); - foreach ($result->readAll() as $quotadetails) - { - $quota_name=$quotadetails['name']; - } - - $question_answers = self::getQuotaAnswers($_POST['quota_qid'],$surveyid,$_POST['quota_id']); - $x=0; - - foreach ($question_answers as $qacheck) - { - if (isset($qacheck['rowexists'])) $x++; - } - - reset($question_answers); - $data['question_answers'] = $question_answers; - $data['x'] = $x; - $data['quota_name'] = $quota_name; - $this->getController()->render("/admin/quotas/newanswertwo_view", $data); - - } - - if ($subaction == "new_quota" && bHasSurveyPermission($surveyid, 'quotas','create')) - { - $langs = GetAdditionalLanguagesFromSurveyID($surveyid); - $baselang = GetBaseLanguageFromSurveyID($surveyid); - array_push($langs,$baselang); - $thissurvey=getSurveyInfo($surveyid); - $data['thissurvey'] = $thissurvey; - $data['langs'] = $langs; - $this->getController()->render("/admin/quotas/newquota_view", $data); - - } - $this->getController()->_getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual")); - } - - function getQuotaAnswers($qid,$surveyid,$quota_id) - { - $clang = $this->getController()->lang; - $conn = Yii::app()->db; - $baselang = GetBaseLanguageFromSurveyID($surveyid); - $query = "SELECT type, title FROM {{questions}} WHERE qid=:id AND language=:lang"; - $result = $conn->createCommand($query)->query(array(':id' => $qid, ':lang' => $baselang)); - $qtype = $result->read(); - - if ($qtype['type'] == 'G') - { - $query = "SELECT * FROM {{quota_members}} WHERE sid=:sid and qid=:qid and quota_id=:quota_id"; - $result = $conn->createCommand($query)->query(array(':sid' => $surveyid, ':qid' => $qid, ':quota_id' => $quota_id)); - - $answerlist = array('M' => array('Title' => $qtype['title'], 'Display' => $clang->gT("Male"), 'code' => 'M'), - 'F' => array('Title' => $qtype['title'],'Display' => $clang->gT("Female"), 'code' => 'F')); - - if ($result->getRowCount() > 0) - { - foreach ($result->readAll() as $quotalist) - { - $answerlist[$quotalist['code']]['rowexists'] = '1'; - } - - } - } - - if ($qtype['type'] == 'M') - { - $query = "SELECT title,question FROM {{questions}} WHERE parent_qid=:qid"; - $result = $conn->createCommand($query)->query(array(':qid' => $qid)); - - $answerlist = array(); - - while ($dbanslist = $result->read()) - { - $tmparrayans = array('Title' => $qtype['title'], 'Display' => substr($dbanslist['question'],0,40), 'code' => $dbanslist['title']); - $answerlist[$dbanslist['title']] = $tmparrayans; - } - - $query = "SELECT * FROM {{quota_members}} WHERE sid=:sid and qid=:qid and quota_id=:quota_id"; - $result = $conn->createCommand($query)->query(array(':sid' => $surveyid, ':qid' => $qid, ':quota_id' => $quota_id)); - - if ($result->getRowCount() > 0) - { - while ($quotalist = $result->read()) - { - $answerlist[$quotalist['code']]['rowexists'] = '1'; - } - - } - } - - if ($qtype['type'] == 'L' || $qtype['type'] == 'O' || $qtype['type'] == '!') - { - $query = "SELECT * FROM {{quota_members}} WHERE sid=:sid and qid=:qid and quota_id=:quota_id"; - $result = $conn->createCommand($query)->query(array(':sid' => $surveyid, ':qid' => $qid, ':quota_id' => $quota_id)); - - $query = "SELECT code,answer FROM {{answers}} WHERE qid=:qid"; - $ansresult = $conn->createCommand($query)->query(array(':qid' => $qid)); - - $answerlist = array(); - - foreach ($ansresult->readAll() as $dbanslist) - { - $answerlist[$dbanslist['code']] = array('Title'=>$qtype['title'], - 'Display'=>substr($dbanslist['answer'],0,40), - 'code'=>$dbanslist['code']); - } - - } - - if ($qtype['type'] == 'A') - { - $query = "SELECT * FROM {{quota_members}} WHERE sid=:sid and qid=:qid and quota_id=:quota_id"; - $result = $conn->createCommand($query)->query(array(':sid' => $surveyid, ':qid' => $qid, ':quota_id' => $quota_id)); - - $query = "SELECT title,question FROM {{questions}} WHERE parent_qid=:qid"; - $ansresult = $conn->createCommand($query)->query(array(':qid' => $qid)); - - $answerlist = array(); - - foreach ($ansresult->readAll() as $dbanslist) - { - for ($x=1; $x<6; $x++) - { - $tmparrayans = array('Title' => $qtype['title'], 'Display' => substr($dbanslist['question'],0,40).' ['.$x.']', 'code' => $dbanslist['title']); - $answerlist[$dbanslist['title']."-".$x] = $tmparrayans; - } - } - - if ($result->getRowCount() > 0) - { - foreach ($result->readAll() as $quotalist) - { - $answerlist[$quotalist['code']]['rowexists'] = '1'; - } - - } - } - - if ($qtype['type'] == 'B') - { - $query = "SELECT * FROM {{quota_members}} WHERE sid=:sid and qid=:qid and quota_id=:quota_id"; - $result = $conn->createCommand($query)->query(array(':sid' => $surveyid, ':qid' => $qid, ':quota_id' => $quota_id)); - - $query = "SELECT code,answer FROM {{answers}} WHERE qid=:qid"; - $ansresult = $conn->createCommand($query)->query(array('qid' => $qid)); - - $answerlist = array(); - - foreach ($ansresult->readAll() as $dbanslist) - { - for ($x=1; $x<11; $x++) - { - $tmparrayans = array('Title' => $qtype['title'], 'Display' => substr($dbanslist['answer'],0,40).' ['.$x.']', 'code' => $dbanslist['code']); - $answerlist[$dbanslist['code']."-".$x] = $tmparrayans; - } - } - - if ($result->getRowCount() > 0) - { - foreach ($result->readAll() as $quotalist) - { - $answerlist[$quotalist['code']]['rowexists'] = '1'; - } - - } - } - - if ($qtype['type'] == 'Y') - { - $query = "SELECT * FROM {{quota_members}} WHERE sid=:sid and qid=:qid and quota_id=:quota_id"; - $result = $conn->createCommand($query)->query(array(':sid' => $surveyid, ':qid' => $qid, ':quota_id' => $quota_id)); - - $answerlist = array('Y' => array('Title' => $qtype['title'], 'Display' => $clang->gT("Yes"), 'code' => 'Y'), - 'N' => array('Title' => $qtype['title'],'Display' => $clang->gT("No"), 'code' => 'N')); - - if ($result->getRowCount() > 0) - { - foreach ($ansresult->readAll() as $quotalist) - { - $answerlist[$quotalist['code']]['rowexists'] = '1'; - } - - } - } - - if ($qtype['type'] == 'I') - { - - $slangs = GetAdditionalLanguagesFromSurveyID($surveyid); - array_unshift($slangs,$baselang); - - $query = "SELECT * FROM {{quota_members}} WHERE sid=:sid and qid=:qid and quota_id=:quota_id"; - $result = $conn->createCommand($query)->query(array(':sid' => $surveyid, ':qid' => $qid, ':quota_id' => $quota_id)); - - while(list($key,$value) = each($slangs)) - { - $tmparrayans = array('Title' => $qtype['title'], 'Display' => getLanguageNameFromCode($value,false), $value); - $answerlist[$value] = $tmparrayans; - } - - if ($result->getRowCount() > 0) - { - foreach ($result->readAll() as $quotalist) - { - $answerlist[$quotalist['code']]['rowexists'] = '1'; - } - - } - } - - if (!isset($answerlist)) - { - return array(); - } - else - { - return $answerlist; - } - } - - -} + $this->_surveybar($iSurveyId); + } + + function _redirectToIndex($iSurveyId) + { + $this->getController()->redirect($this->getController()->createUrl("/admin/quotas/surveyid/$iSurveyId")); + } + + function index($iSurveyId, $bQuickReport = false) + { + $iSurveyId = sanitize_int($iSurveyId); + $aData = $this->_getData($iSurveyId); + + if ($bQuickReport == false) + { + $this->_displayHeader($iSurveyId); + $this->getController()->render("/admin/quotas/viewquotas_view", $aData); + } + + $clang = $aData['clang']; + $totalquotas = 0; + $totalcompleted = 0; + $csvoutput = array(); + + $criteria = new CDbCriteria; + $criteria->select = '*'; + $criteria->join = 'LEFT JOIN {{quota_languagesettings}} as qls ON (t.id = qls.quotals_quota_id)'; + $criteria->condition = 'sid=:survey AND quotals_language=:lang'; + $criteria->params = array(':survey' => $iSurveyId, ':lang' => $aData['sBaseLang']); + $criteria->order = 'name'; + $aResult = Quota::model()->findAll($criteria); + + //if there are quotas let's proceed + if (count($aResult) > 0) + { + //loop through all quotas + foreach ($aResult as $aQuotaListing) + { + $totalquotas += $aQuotaListing['qlimit']; + $completed = get_quotaCompletedCount($iSurveyId, $aQuotaListing['id']); + $highlight = ($completed >= $aQuotaListing['qlimit']) ? "" : "style='color: red'"; //Incomplete quotas displayed in red + $totalcompleted = $totalcompleted + $completed; + $csvoutput[] = $aQuotaListing['name'] . "," . $aQuotaListing['qlimit'] . "," . $completed . "," . ($aQuotaListing['qlimit'] - $completed) . "\r\n"; + + if ($bQuickReport != false) + { + continue; + } + + $aData['quotalisting'] = $aQuotaListing; + $aData['highlight'] = $highlight; + $aData['completed'] = $completed; + $aData['totalquotas'] = $totalquotas; + $aData['totalcompleted'] = $totalcompleted; + $this->getController()->render("/admin/quotas/viewquotasrow_view", $aData); + + //check how many sub-elements exist for a certain quota + $aResults2 = Quota_members::model()->findAllByAttributes(array('quota_id' => $aQuotaListing['id'])); + + //loop through all sub-parts + foreach ($aResults2 as $aQuotaQuestions) + { + $aQuestionAnswers = self::getQuotaAnswers($aQuotaQuestions['qid'], $iSurveyId, $aQuotaListing['id']); + $aData['question_answers'] = $aQuestionAnswers; + $aData['quota_questions'] = $aQuotaQuestions; + $this->getController()->render('/admin/quotas/viewquotasrowsub_view', $aData); + } + } + } + else + { + // No quotas have been set for this survey + $this->getController()->render('/admin/quotas/viewquotasempty_view', $aData); + } + + $aData['totalquotas'] = $totalquotas; + $aData['totalcompleted'] = $totalcompleted; + + if ($bQuickReport == false) + { + $this->getController()->render('/admin/quotas/viewquotasfooter_view', $aData); + $this->getController()->_getAdminFooter('http://docs.limesurvey.org', $clang->gT('LimeSurvey online manual')); + } + else + { + header("Content-Disposition: attachment; filename=results-survey" . $iSurveyId . ".csv"); + header("Content-type: text/comma-separated-values; charset=UTF-8"); + header("Pragma: public"); + echo $clang->gT("Quota name") . "," . $clang->gT("Limit") . "," . $clang->gT("Completed") . "," . $clang->gT("Remaining") . "\r\n"; + foreach ($csvoutput as $line) + { + echo $line; + } + die; + } + } + + function insertquota($iSurveyId) + { + $iSurveyId = sanitize_int($iSurveyId); + $this->_checkPermissions($iSurveyId, 'create'); + $aData = $this->_getData($iSurveyId); + $aLangs = $aData['aLangs']; + + $oQuota = new Quota; + $oQuota->sid = $iSurveyId; + $oQuota->name = CHttpRequest::getPost('quota_name'); + $oQuota->qlimit = CHttpRequest::getPost('quota_limit'); + $oQuota->action = CHttpRequest::getPost('quota_action'); + $oQuota->autoload_url = CHttpRequest::getPost('autoload_url'); + $oQuota->save(); + $iQuotaId = Yii::app()->db->lastInsertID; + + //Iterate through each language, and make sure there is a quota message for it + $sError = ''; + foreach ($aLangs as $sLang) + { + if (!$_POST['quotals_message_' . $sLang]) + { + $sError .= GetLanguageNameFromCode($sLang, false) . "\\n"; + } + } + if ($sError != '') + { + $aData['sShowError'] = $sError; + } + else + //All the required quota messages exist, now we can insert this info into the database + { + + foreach ($aLangs as $sLang) //Iterate through each language + { + //Clean XSS - Automatically provided by CI input class + $_POST['quotals_message_' . $sLang] = html_entity_decode($_POST['quotals_message_' . $sLang], ENT_QUOTES, "UTF-8"); + + // Fix bug with FCKEditor saving strange BR types + $_POST['quotals_message_' . $sLang] = fix_FCKeditor_text($_POST['quotals_message_' . $sLang]); + + $oQuotaLanguageSettings = new Quota_languagesettings; + $oQuotaLanguageSettings->quotals_quota_id = $iQuotaId; + $oQuotaLanguageSettings->quotals_language = $sLang; + $oQuotaLanguageSettings->quotals_name = CHttpRequest::getPost('quota_name'); + $oQuotaLanguageSettings->quotals_message = $_POST['quotals_message_' . $sLang]; + $oQuotaLanguageSettings->quotals_url = $_POST['quotals_url_' . $sLang]; + $oQuotaLanguageSettings->quotals_urldescrip = $_POST['quotals_urldescrip_' . $sLang]; + $oQuotaLanguageSettings->save(); + } + } + + self::_redirectToIndex($iSurveyId); + } + + function modifyquota($iSurveyId) + { + $iSurveyId = sanitize_int($iSurveyId); + $this->_checkPermissions($iSurveyId, 'update'); + $aData = $this->_getData($iSurveyId); + $aLangs = $aData['aLangs']; + + $oQuota = Quota::model()->findByPk(CHttpRequest::getPost('quota_id')); + $oQuota->name = CHttpRequest::getPost('quota_name'); + $oQuota->qlimit = CHttpRequest::getPost('quota_limit'); + $oQuota->action = CHttpRequest::getPost('quota_action'); + $oQuota->autoload_url = CHttpRequest::getPost('autoload_url'); + $oQuota->save(); + + //Iterate through each language, and make sure there is a quota message for it + $sError = ''; + foreach ($aLangs as $sLang) + { + if (!$_POST['quotals_message_' . $sLang]) + { + $sError.= GetLanguageNameFromCode($sLang, false) . "\\n"; + } + } + if ($sError != '') + { + $aData['sShowError'] = $sError; + } + else + //All the required quota messages exist, now we can insert this info into the database + { + + foreach ($aLangs as $sLang) //Iterate through each language + { + //Clean XSS - Automatically provided by CI + $_POST['quotals_message_' . $sLang] = html_entity_decode($_POST['quotals_message_' . $sLang], ENT_QUOTES, "UTF-8"); + + // Fix bug with FCKEditor saving strange BR types + $_POST['quotals_message_' . $sLang] = fix_FCKeditor_text($_POST['quotals_message_' . $sLang]); + + $oQuotaLanguageSettings = Quota_languagesettings::model()->findByAttributes(array('quotals_quota_id' => CHttpRequest::getPost('quota_id'), 'quotals_language' => $sLang)); + $oQuotaLanguageSettings->quotals_name = CHttpRequest::getPost('quota_name'); + $oQuotaLanguageSettings->quotals_message = $_POST['quotals_message_' . $sLang]; + $oQuotaLanguageSettings->quotals_url = $_POST['quotals_url_' . $sLang]; + $oQuotaLanguageSettings->quotals_urldescrip = $_POST['quotals_urldescrip_' . $sLang]; + $oQuotaLanguageSettings->save(); + } + } //End insert language based components + + self::_redirectToIndex($iSurveyId); + } + + function insertquotaanswer($iSurveyId) + { + $iSurveyId = sanitize_int($iSurveyId); + $this->_checkPermissions($iSurveyId, 'create'); + + $oQuotaMembers = new Quota_members; + $oQuotaMembers->sid = $iSurveyId; + $oQuotaMembers->qid = CHttpRequest::getPost('quota_qid'); + $oQuotaMembers->quota_id = CHttpRequest::getPost('quota_id'); + $oQuotaMembers->code = CHttpRequest::getPost('quota_anscode'); + $oQuotaMembers->save(); + + if (!empty($_POST['createanother'])) + { + $_POST['action'] = "quotas"; + $_POST['subaction'] = "new_answer"; + $sSubAction = "new_answer"; + self::new_answer($iSurveyId, $sSubAction); + } + else + { + self::_redirectToIndex($iSurveyId); + } + } + + function quota_delans($iSurveyId) + { + $iSurveyId = sanitize_int($iSurveyId); + $this->_checkPermissions($iSurveyId, 'delete'); + + Quota_members::model()->deleteAllByAttributes(array( + 'id' => CHttpRequest::getPost('quota_member_id'), + 'qid' => CHttpRequest::getPost('quota_qid'), + 'code' => CHttpRequest::getPost('quota_anscode'), + )); + + self::_redirectToIndex($iSurveyId); + } + + function quota_delquota($iSurveyId) + { + $iSurveyId = sanitize_int($iSurveyId); + $this->_checkPermissions($iSurveyId, 'delete'); + + Quota::model()->deleteByPk(CHttpRequest::getPost('quota_id')); + Quota_languagesettings::model()->deleteAllByAttributes(array('quotals_quota_id' => CHttpRequest::getPost('quota_id'))); + Quota_members::model()->deleteAllByAttributes(array('quota_id' => CHttpRequest::getPost('quota_id'))); + + self::_redirectToIndex($iSurveyId); + } + + function quota_editquota($iSurveyId) + { + $iSurveyId = sanitize_int($iSurveyId); + $this->_checkPermissions($iSurveyId, 'update'); + $aData = $this->_getData($iSurveyId); + $aLangs = $aData['aLangs']; + $clang = $aData['clang']; + + $aQuotaInfo = Quota::model()->findByPk(CHttpRequest::getPost('quota_id')); + $aData['quotainfo'] = $aQuotaInfo; + + $this->getController()->render('/admin/quotas/editquota_view', $aData); + + foreach ($aLangs as $sLang) + { + $aData['langquotainfo'] = Quota_languagesettings::model()->findByAttributes(array('quotals_quota_id' => CHttpRequest::getPost('quota_id'), 'quotals_language' => $sLang)); + $aData['lang'] = $sLang; + $this->getController()->render('/admin/quotas/editquotalang_view', $aData); + } + + $this->getController()->render('/admin/quotas/editquotafooter_view', $aData); + $this->getController()->_getAdminFooter('http://docs.limesurvey.org', $clang->gT('LimeSurvey online manual')); + } + + function new_answer($iSurveyId, $sSubAction) + { + $iSurveyId = sanitize_int($iSurveyId); + $this->_checkPermissions($iSurveyId, 'create'); + $aData = $this->_getData($iSurveyId); + $sBaseLang = $aData['sBaseLang']; + $clang = $aData['clang']; + + if (($sSubAction == "new_answer" || ($sSubAction == "new_answer_two" && !isset($_POST['quota_qid']))) && bHasSurveyPermission($iSurveyId, 'quotas', 'create')) + { + $result = Quota::model()->findAllByPk(CHttpRequest::getPost('quota_id')); + foreach ($result as $aQuotaDetails) + { + $quota_name = $aQuotaDetails['name']; + } + + $result = Questions::model()->findAllByAttributes(array('type' => array('G', 'M', 'Y', 'A', 'B', 'I', 'L', 'O', '!'), 'sid' => $iSurveyId, 'language' => $sBaseLang)); + if (empty($result)) + { + $this->getController()->render("/admin/quotas/newanswererror_view", $aData); + } + else + { + $aData['newanswer_result'] = $result; + $aData['quota_name'] = $quota_name; + $this->getController()->render("/admin/quotas/newanswer_view", $aData); + } + } + + if ($sSubAction == "new_answer_two" && isset($_POST['quota_qid']) && bHasSurveyPermission($iSurveyId, 'quotas', 'create')) + { + $aResults = Quota::model()->findByPk(CHttpRequest::getPost('quota_qid')); + $sQuotaName = $aResults['name']; + + $aQuestionAnswers = self::getQuotaAnswers(CHttpRequest::getPost('quota_qid'), $iSurveyId, CHttpRequest::getPost('quota_id')); + $x = 0; + + foreach ($aQuestionAnswers as $aQACheck) + { + if (isset($aQACheck['rowexists'])) + $x++; + } + + reset($aQuestionAnswers); + $aData['question_answers'] = $aQuestionAnswers; + $aData['x'] = $x; + $aData['quota_name'] = $sQuotaName; + $this->getController()->render('/admin/quotas/newanswertwo_view', $aData); + } + + $this->getController()->_getAdminFooter('http://docs.limesurvey.org', $clang->gT('LimeSurvey online manual')); + } + + function new_quota($iSurveyId) + { + $iSurveyId = sanitize_int($iSurveyId); + $this->_checkPermissions($iSurveyId, 'create'); + $aData = $this->_getData($iSurveyId); + $clang = $aData['clang']; + + $aData['thissurvey'] = getSurveyInfo($iSurveyId); + $aData['langs'] = $aData['sLangs']; + + $this->getController()->render('/admin/quotas/newquota_view', $aData); + $this->getController()->_getAdminFooter('http://docs.limesurvey.org', $clang->gT('LimeSurvey online manual')); + } + + function getQuotaAnswers($iQuestionId, $iSurveyId, $iQuotaId) + { + $iSurveyId = sanitize_int($iSurveyId); + $aData = $this->_getData($iSurveyId); + $sBaseLang = $aData['sBaseLang']; + $clang = $aData['clang']; + + $aQuestionType = Questions::model()->findByPk(array('qid' => $iQuestionId, 'language' => $sBaseLang)); + $aQuestionType = $aQuestionType['type']; + + if ($aQuestionType == 'M') + { + $aResults = Questions::model()->findAllByAttributes(array('parent_qid' => $iQuestionId)); + $aAnswerList = array(); + + foreach($aResults as $aDbAnsList) + { + $tmparrayans = array('Title' => $aQuestionType['title'], 'Display' => substr($aDbAnsList['question'], 0, 40), 'code' => $aDbAnsList['title']); + $aAnswerList[$aDbAnsList['title']] = $tmparrayans; + } + + $aResults = Quota_members::model()->findAllByAttributes(array('sid' => $iSurveyId, 'qid' => $iQuestionId, 'quota_id' => $iQuotaId)); + foreach($aResults as $aQuotaList) + { + $aAnswerList[$aQuotaList['code']]['rowexists'] = '1'; + } + } + else + { + $aResults = Quota_members::model()->findAllByAttributes(array('sid' => $iSurveyId, 'qid' => $iQuestionId, 'quota_id' => $iQuotaId)); + } + + if ($aQuestionType == 'G') + { + $aAnswerList = array('M' => array('Title' => $aQuestionType['title'], 'Display' => $clang->gT("Male"), 'code' => 'M'), + 'F' => array('Title' => $aQuestionType['title'], 'Display' => $clang->gT("Female"), 'code' => 'F')); + + foreach ($aResults as $aQuotaList) + { + $aAnswerList[$aQuotaList['code']]['rowexists'] = '1'; + } + } + + if ($aQuestionType == 'L' || $aQuestionType == 'O' || $aQuestionType == '!') + { + $aAnsResults = Answers::model()->findAllByAttributes(array('qid' => $iQuestionId)); + + $aAnswerList = array(); + + foreach ($aAnsResults as $aDbAnsList) + { + $aAnswerList[$aDbAnsList['code']] = array('Title' => $aQuestionType['title'], + 'Display' => substr($aDbAnsList['answer'], 0, 40), + 'code' => $aDbAnsList['code']); + } + } + + if ($aQuestionType == 'A') + { + $aAnsResults = Questions::model()->findAllByAttributes(array('parent_qid' => $iQuestionId)); + + $aAnswerList = array(); + + foreach ($aAnsResults as $aDbAnsList) + { + for ($x = 1; $x < 6; $x++) + { + $tmparrayans = array('Title' => $aQuestionType['title'], 'Display' => substr($aDbAnsList['question'], 0, 40) . ' [' . $x . ']', 'code' => $aDbAnsList['title']); + $aAnswerList[$aDbAnsList['title'] . "-" . $x] = $tmparrayans; + } + } + + foreach ($aResults as $aQuotaList) + { + $aAnswerList[$aQuotaList['code']]['rowexists'] = '1'; + } + } + + if ($aQuestionType == 'B') + { + $aAnsResults = Answers::model()->findAllByAttributes(array('qid' => $iQuestionId)); + + $aAnswerList = array(); + + foreach ($aAnsResults as $aDbAnsList) + { + for ($x = 1; $x < 11; $x++) + { + $tmparrayans = array('Title' => $aQuestionType['title'], 'Display' => substr($aDbAnsList['answer'], 0, 40) . ' [' . $x . ']', 'code' => $aDbAnsList['code']); + $aAnswerList[$aDbAnsList['code'] . "-" . $x] = $tmparrayans; + } + } + + foreach ($aResults as $aQuotaList) + { + $aAnswerList[$aQuotaList['code']]['rowexists'] = '1'; + } + } + + if ($aQuestionType == 'Y') + { + $aAnswerList = array('Y' => array('Title' => $aQuestionType['title'], 'Display' => $clang->gT("Yes"), 'code' => 'Y'), + 'N' => array('Title' => $aQuestionType['title'], 'Display' => $clang->gT("No"), 'code' => 'N')); + + foreach ($aResults as $aQuotaList) + { + $aAnswerList[$aQuotaList['code']]['rowexists'] = '1'; + } + } + + if ($aQuestionType == 'I') + { + $slangs = GetAdditionalLanguagesFromSurveyID($iSurveyId); + array_unshift($slangs, $sBaseLang); + + while (list($key, $value) = each($slangs)) + { + $tmparrayans = array('Title' => $aQuestionType['title'], 'Display' => getLanguageNameFromCode($value, false), $value); + $aAnswerList[$value] = $tmparrayans; + } + + foreach ($aResults as $aQuotaList) + { + $aAnswerList[$aQuotaList['code']]['rowexists'] = '1'; + } + } + + if (empty($aAnswerList)) + { + return array(); + } + else + { + return $aAnswerList; + } + } + +} \ No newline at end of file diff --git a/application/helpers/common_helper.php b/application/helpers/common_helper.php index 2bd3816312c..3d93df1e034 100644 --- a/application/helpers/common_helper.php +++ b/application/helpers/common_helper.php @@ -6010,14 +6010,14 @@ function SSL_mode() /** * Returns the number of answers matching the quota * - * @param int $surveyid - Survey identification number + * @param int $iSurveyId - Survey identification number * @param int $quotaid - quota id for which you want to compute the completed field * @return mixed - Integer of matching entries in the result DB or 'N/A' */ -function get_quotaCompletedCount($surveyid, $quotaid) +function get_quotaCompletedCount($iSurveyId, $quotaid) { $result = "N/A"; - $quota_info = getQuotaInformation($surveyid, GetBaseLanguageFromSurveyID($surveyid), $quotaid); + $quota_info = getQuotaInformation($iSurveyId, GetBaseLanguageFromSurveyID($iSurveyId), $quotaid); $quota = $quota_info[0]; if (Yii::app()->db->schema->getTable('{{survey_' . $surveyid . '}}') && diff --git a/application/views/admin/quotas/editquota_view.php b/application/views/admin/quotas/editquota_view.php index c0d5ee199ff..145b8ddb174 100644 --- a/application/views/admin/quotas/editquota_view.php +++ b/application/views/admin/quotas/editquota_view.php @@ -1,42 +1,44 @@ -
" method="post"> - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
gT("Edit quota");?>
-

gT("Quota name");?>:

-
-

gT("Quota limit");?>:

-
-

gT("Quota action");?>:

-
-

gT("Autoload URL");?>:

-
/>
-
+" method="post"> +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
gT("Edit quota");?>
+

gT("Quota name");?>:

+
+

gT("Quota limit");?>:

+
+

gT("Quota action");?>:

+
+

gT("Autoload URL");?>:

+
/>
+
+
\ No newline at end of file diff --git a/application/views/admin/quotas/newanswer_view.php b/application/views/admin/quotas/newanswer_view.php index 988597fab38..c02d2cfd95a 100644 --- a/application/views/admin/quotas/newanswer_view.php +++ b/application/views/admin/quotas/newanswer_view.php @@ -1,6 +1,6 @@
gT("Survey Quota");?>: gT("Add Answer");?>

- " method="post"> + " method="post"> @@ -30,13 +30,13 @@
  " /> - + - +

-
\ No newline at end of file +
diff --git a/application/views/admin/quotas/newanswererror_view.php b/application/views/admin/quotas/newanswererror_view.php index 6024dd9ee2a..dfe959ad63d 100644 --- a/application/views/admin/quotas/newanswererror_view.php +++ b/application/views/admin/quotas/newanswererror_view.php @@ -1,5 +1,5 @@
gT("Add Answer");?>: gT("Question Selection");?>

gT("Sorry there are no supported question types in this survey.");?> -

', '_top')" value="gT("Continue");?>"/> +

', '_top')" value="gT("Continue");?>"/>
\ No newline at end of file diff --git a/application/views/admin/quotas/newanswertwo_view.php b/application/views/admin/quotas/newanswertwo_view.php index 8c2bc377308..2e4594ccc62 100644 --- a/application/views/admin/quotas/newanswertwo_view.php +++ b/application/views/admin/quotas/newanswertwo_view.php @@ -2,12 +2,12 @@
gT("Add Answer");?>: gT("Question Selection");?>

gT("All answers are already selected in this quota.");?> -

', '_top')" value="gT("Continue");?>"/> +

', '_top')" value="gT("Continue");?>"/>
gT("Survey Quota");?>: gT("Add Answer");?>

-
#quota_" method="post"> + #quota_" method="post"> @@ -43,15 +43,15 @@
  " /> - + - - + +

- \ No newline at end of file + diff --git a/application/views/admin/quotas/viewquotas_view.php b/application/views/admin/quotas/viewquotas_view.php index be8cf10523c..dd1e95a6673 100644 --- a/application/views/admin/quotas/viewquotas_view.php +++ b/application/views/admin/quotas/viewquotas_view.php @@ -1,4 +1,10 @@ - + + +
gT("Survey quotas");?>

diff --git a/application/views/admin/quotas/viewquotasfooter_view.php b/application/views/admin/quotas/viewquotasfooter_view.php index 60a1c25546d..9beeae2ca5c 100644 --- a/application/views/admin/quotas/viewquotasfooter_view.php +++ b/application/views/admin/quotas/viewquotasfooter_view.php @@ -5,10 +5,10 @@ - -
" method="post"> + + " method="post"> " /> - +
@@ -17,4 +17,4 @@ - \ No newline at end of file + diff --git a/application/views/admin/quotas/viewquotasrow_view.php b/application/views/admin/quotas/viewquotasrow_view.php index 6a1d773d301..bf935019e4a 100644 --- a/application/views/admin/quotas/viewquotasrow_view.php +++ b/application/views/admin/quotas/viewquotasrow_view.php @@ -23,18 +23,18 @@ > - -
" method="post"> + + " method="post"> " /> - +
- -
" method="post"> + + " method="post"> " /> - + @@ -49,14 +49,14 @@     - - " method="post"> + + " method="post"> " /> - +
- \ No newline at end of file + diff --git a/application/views/admin/quotas/viewquotasrowsub_view.php b/application/views/admin/quotas/viewquotasrowsub_view.php index 87a449a7c90..adfe248c09a 100644 --- a/application/views/admin/quotas/viewquotasrowsub_view.php +++ b/application/views/admin/quotas/viewquotasrowsub_view.php @@ -5,9 +5,9 @@     -
" method="post"> + " method="post"> " /> - + @@ -15,4 +15,4 @@
- \ No newline at end of file +