public function actionAddFavourite() { if (isset($_POST['idUserList']) && (isset($_POST['idTruth']) || isset($_POST['idDare']))) { //Verify that the person that add to favourite is the owner of the list $model = UserList::model()->findByPk($_POST['idUserList']); if ($model->idUser == Yii::app()->user->getId()) { $model = new Userlistcontent(); $model->idUserList = $_POST['idUserList']; if (isset($_POST['idTruth'])) { $model->idTruth = $_POST['idTruth']; } if (isset($_POST['idDare'])) { $model->idDare = $_POST['idDare']; } if ($model->save()) { echo "SUCCESS"; $ttotot = "rr"; $ttotot = "rr"; } } } }
<?php if (isset($_POST['idUserList']) && (isset($_POST['idTruth']) || isset($_POST['idDare']))) { //VERIFIER QUE PERSONNE QUI AJOUTE EST BIEN PERSONNE QUI POSSEDE LA LISTE $test = 'toto'; $test = 'toto'; $test = 'toto'; $model = new Userlistcontent(); $model->idUserList = $_POST['idUserList']; if (isset($_POST['idTruth'])) { $model->idTruth = $_POST['idTruth']; } if (isset($_POST['idDare'])) { $model->idTruth = $_POST['idDare']; } if ($model->save()) { echo "SUCCESS"; } else { echo "FAIL"; } }