本文整理汇总了PHP中Contest::__SET方法的典型用法代码示例。如果您正苦于以下问题:PHP Contest::__SET方法的具体用法?PHP Contest::__SET怎么用?PHP Contest::__SET使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contest
的用法示例。
在下文中一共展示了Contest::__SET方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Obtain
public function Obtain($id_event)
{
try {
$query = $this->pdo->prepare('SELECT * FROM Concursos WHERE id_event = ?');
$query->execute(array($id_event));
$r = $query->fetch(PDO::FETCH_OBJ);
$contest = new Contest();
$contest->__SET('id_event', $r->id_event);
$contest->__SET('id_type', $r->id_type);
$contest->__SET('name', $r->name);
$contest->__SET('question', $r->question);
$contest->__SET('initial_date', $r->initial_date);
$contest->__SET('final_date', $r->final_date);
$contest->__SET('winner', $r->winner);
$contest->__SET('active', $r->active);
return $contest;
} catch (Exception $e) {
die($e->getMessage());
}
}
示例2: TipoRespuesta
include_once '../PDO/ContestModel.php';
include_once '../includes/Answer.php';
include_once '../PDO/AnswerModel.php';
$tipo = new TipoRespuesta();
if (isset($_SESSION['name']) and $_SESSION['id'] == '10207674962976867') {
$id_event = $_GET['id_event'];
$id_type = $_GET['id_type'];
$contest = new Contest();
$contestModel = new ContestModel();
$answer = new Answer();
$answerModel = new AnswerModel();
$tipos = $tipo->fetch_all();
if (isset($_REQUEST['action'])) {
switch ($_REQUEST['action']) {
case 'update':
$contest->__SET('id_event', $_REQUEST['id_event']);
$contest->__SET('name', $_REQUEST['name']);
$contest->__SET('question', $_REQUEST['question']);
$contest->__SET('id_type', $_REQUEST['tiposelect']);
$contest->__SET('initial_date', $_REQUEST['initial_date']);
$contest->__SET('final_date', $_REQUEST['final_date']);
$contest->__SET('winner', $_REQUEST['winner']);
$contest->__SET('active', 1);
$contestModel->Update($contest);
//echo '<script language="javascript">alert("¡El registro se ha actualizado exitosamente!");</script>';
echo "<script type=\"text/javascript\">\n alert('¡El registro se ha actualizado exitosamente!');\n history.go(-2);\n </script>";
break;
case 'insert':
if ($_REQUEST['winner'] == '') {
$_REQUEST['winner'] = 'Sin determinar';
}