コード例 #1
0
function addComment($message, $idpincho)
{
    session_start();
    $p = new Pincho();
    $pinfo = $p->getbyCode($idpincho);
    $idestablishment = $pinfo[0]["Establishment_idEstablishment"];
    $pop = new Popular();
    $popinfo = $pop->select($_SESSION["name"]);
    $idpopular = $popinfo[0]["idPopular"];
    $c = new Comments();
    $boolean = $c->add($message, $idpincho, $idestablishment, $idpopular);
    if ($boolean == false) {
        echo "Database error";
    } else {
        viewComments($idpincho);
    }
}
コード例 #2
0
                $name = $_SESSION["name"];
                $p = new Professional();
                $aux = $p->getId($name);
                $idPro = $aux[0]["idProfessional"];
                $v = new ProfessionalValorations();
                $boolean = $v->getAssigned($idPro);
                if ($boolean == false) {
                    $msg = "You havent assigned pinchos yet.";
                    header("Location: ../views/professionalFinalist.php?msg={$msg}");
                } else {
                    $arrayPinchos = array();
                    $i = 0;
                    $pin = new Pincho();
                    foreach ($boolean as $pcode) {
                        $code = $pcode["Pincho_code"];
                        $pincho = $pin->getbyCode($code);
                        $arrayPinchos[$i] = $pincho;
                        $i++;
                    }
                    $pinchos = serialize($arrayPinchos);
                    header("Location: ../views/professionalFinalist.php?pinchos={$pinchos}");
                }
            } else {
                echo "No deberías estar aquí.";
            }
        }
    }
} else {
    if (isset($_POST["votation"]) && isset($_POST["idPincho"])) {
        $nota = $_POST["votation"];
        $idPincho = $_POST["idPincho"];