当前位置: 首页>>代码示例>>PHP>>正文


PHP Answer::__SET方法代码示例

本文整理汇总了PHP中Answer::__SET方法的典型用法代码示例。如果您正苦于以下问题:PHP Answer::__SET方法的具体用法?PHP Answer::__SET怎么用?PHP Answer::__SET使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Answer的用法示例。


在下文中一共展示了Answer::__SET方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Obtain

 public function Obtain($id_answer)
 {
     try {
         $query = $this->pdo->prepare('SELECT * FROM Respuestas WHERE id_answer = ?');
         $query->execute(array($id_answer));
         $r = $query->fetch(PDO::FETCH_OBJ);
         $answer = new Answer();
         $answer->__SET('id_answer', $r->id_answer);
         $answer->__SET('id_event', $r->id_event);
         $answer->__SET('respuesta', $r->respuesta);
         $answer->__SET('correct', $r->correct);
         return $answer;
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }
开发者ID:Gonxis,项目名称:TOMO2_Project,代码行数:16,代码来源:AnswerModel.php

示例2: date

         $image['name'] = date('ymhis') . $_FILES['image']['name'];
         $image['directory'] = '../img_bbdd/';
         move_uploaded_file($_FILES['image']['tmp_name'], $image['directory'] . $image['name']);
         $directory = 'img_bbdd/' . $image['name'];
     } else {
         $image = 'img_bbdd/helados.jpg';
         $directory = "img_bbdd/helados.jpg";
     }
 }
 switch ($_REQUEST['action']) {
     case 'update':
         /*echo "<script type=\"text/javascript\">
           alert('¡El registro se ha actualizado exitosamente! El directorio de la imagen es: $directory');
           //history.go(-2);
           </script>";*/
         $answer->__SET('id_answer', $_REQUEST['id_answer']);
         $answer->__SET('id_event', $_REQUEST['id_event']);
         $answer->__SET('respuesta', $_REQUEST['respuesta']);
         $answer->__SET('correct', $_REQUEST['correct']);
         $answerModel->Update($answer);
         echo "<script type=\"text/javascript\">\n                alert('¡El registro se ha actualizado exitosamente! El directorio de la imagen es: {$directory}');\n                history.go(-2);\n                </script>";
         break;
     case 'insert':
         //$answer->__SET('id_answer'      , $_REQUEST['id_answer']);
         $answer->__SET('id_event', $_REQUEST['id_event']);
         $answer->__SET('respuesta', $_REQUEST['respuesta']);
         $answer->__SET('correct', $_REQUEST['correct']);
         $answerModel->Insert($answer);
         echo "<script type=\"text/javascript\">\n                alert('Se ha añadido correctamente a la base de datos una respuesta');\n                history.go(-2);\n                </script>";
         break;
     case 'edit':
开发者ID:Gonxis,项目名称:TOMO2_Project,代码行数:31,代码来源:modifyAnswers.php

示例3: alert

 if ($_REQUEST['winner'] == '') {
     $_REQUEST['winner'] = 'Sin determinar';
 }
 if ($_REQUEST['tiposelect'] == 2) {
     $contest->__SET('id_event', $_REQUEST['id_event']);
     $contest->__SET('id_type', $_REQUEST['tiposelect']);
     $contest->__SET('name', $_REQUEST['name']);
     $contest->__SET('question', $_REQUEST['question']);
     $contest->__SET('initial_date', $_REQUEST['initial_date']);
     $contest->__SET('final_date', $_REQUEST['final_date']);
     $contest->__SET('winner', $_REQUEST['winner']);
     $contest->__SET('active', 1);
     $contestModel->Insert($contest);
     $lastID = $answerModel->lastID();
     //$answer->__SET('id_answer'      , $_REQUEST['id_answer']);
     $answer->__SET('id_event', $lastID);
     $answer->__SET('respuesta', $_REQUEST['first_answer']);
     $answer->__SET('correct', $_REQUEST['last_correct']);
     $answerModel->InsertA($answer);
     echo "<script type=\"text/javascript\">\n                alert('Se ha añadido correctamente a la base de datos un nuevo Concurso con sus posibles respuestas');\n                history.go(-2);\n                </script>";
     break;
 } else {
     $contest->__SET('id_event', $_REQUEST['id_event']);
     $contest->__SET('id_type', $_REQUEST['tiposelect']);
     $contest->__SET('name', $_REQUEST['name']);
     $contest->__SET('question', $_REQUEST['question']);
     $contest->__SET('initial_date', $_REQUEST['initial_date']);
     $contest->__SET('final_date', $_REQUEST['final_date']);
     $contest->__SET('winner', $_REQUEST['winner']);
     $contest->__SET('active', 1);
     $contestModel->Insert($contest);
开发者ID:Gonxis,项目名称:TOMO2_Project,代码行数:31,代码来源:modifyContest.php


注:本文中的Answer::__SET方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。