/** * Renderize the view. * * @return null */ public function render(Professional $professional) { ?> <p> <?php echo REQUIRED_FIELDS_TEXT; ?> </p> <form action="<?php echo $this->generateURL('professional', 'edit', $professional->getIdProfessional()); ?> " method="post"> <fieldset> <div class="row"> <div class="col-md-6"> <div> <label for="name"> Título <small>(*)</small> </label> <input name="name" type="text" required value="<?php echo $professional->getName(); ?> " /> </div> </div> <div class="col-md-6"> <div> <label for="bio"> Biografía <small>(*)</small> </label> <textarea name="bio" required><?php echo $professional->getBio(); ?> </textarea> </div> <div> <input type="submit" value="Modificar" /> </div> </div> </div> </fieldset> </form> <?php }
public function __construct($ID, $db) { parent::__construct($ID, $db); $itemid = $this->getId(); $this->details = $this->makeList($itemid, $db, 'listly', 'itype=2'); $this->position = $this->thing; }
public function executeUpdate() { $pid = $this->getRequestParameter('id'); if ($pid) { $professional = ProfessionalPeer::retrieveByPK($pid); } else { $professional = new Professional(); $professional->setUserId($this->getRequestParameter('user_id')); } $professional->setEmployer($this->getRequestParameter('employer')); $professional->setEmployerflag($this->getRequestParameter('employerflag')); $professional->setPosition($this->getRequestParameter('position')); $professional->setPositionflag($this->getRequestParameter('positionflag')); if ($this->getRequestParameter('fromdate')) { $professional->setFromdate($this->getRequestParameter('fromdate')); } else { $professional->setFromdate(NULL); } if ($this->getRequestParameter('todate')) { $professional->setTodate($this->getRequestParameter('todate')); } else { $professional->setTodate(NULL); } $professional->save(); $this->redirect('professional/show'); }
/** * Modify a professional saved in the database. * * @param Professional $professional * @return integer */ public function editProfessional(Professional $professional) { $sql = "UPDATE professional \n\t\t\tSET id_professional = '" . $professional->getIdProfessional() . "', name = '" . replaceCharacters($professional->getName()) . "', bio = '" . $this->formatBody(replaceCharacters($professional->getBio())) . "' WHERE id_professional = '" . $professional->getIdProfessional() . "'"; return DB::query($sql); }
$bool = $p->setFinalist($idPincho); if ($bool == false) { $msg = "Database update error"; header("Location: ../views/professionalFinalist.php?msg={$msg}"); } else { header("Location: professionalController.php?action=finalist"); } } else { if (isset($_POST["name"]) && isset($_POST["pass"]) && isset($_POST["email"]) && isset($_POST["phone"])) { //Editar perfil profesional $professional = array(); $professional["name"] = $_POST["name"]; $professional["pass"] = $_POST["pass"]; $professional["email"] = $_POST["email"]; $professional["phone"] = $_POST["phone"]; $p = new Professional(); $boolean = $p->isValid($professional); if ($boolean == false) { $msg = "User already exists"; header("Location: ../views/editProfileProfessional.php?msg={$msg}"); } else { $id = $_SESSION["name"]; $bool = $p->update($professional, $id); if ($bool == true) { $_SESSION["name"] = $professional["name"]; $msg = "Your profile was updated"; header("Location: ../views/editProfileProfessional.php?msg={$msg}"); } else { $msg = "Server error. Try again"; header("Location: ../views/editProfileProfessional.php?msg={$msg}"); }
public function __construct($ID, $db) { parent::__construct($ID, $db); $this->degree = $this->thing; }
function pinAssignPro($proname, $piname) { //Recoger id del professional $p = new Professional(); $boolean = $p->getId($proname); if ($boolean == false) { $msg = "Error: Professinal not found in system"; header("Location: ../views/pinAssigPro.php?msg={$msg}"); } else { $idProfessional = $boolean[0]["idProfessional"]; $pi = new Pincho(); $bool = $pi->getData($piname); if ($bool == false) { $msg = "Error: Pincho not found in system"; header("Location: ../views/pinAssigPro.php?msg={$msg}"); } else { $idPincho = $bool[0]["code"]; $idEstablishment = $bool[0]["Establishment_idEstablishment"]; $v = new ProfessionalValorations(); $bool2 = $v->isValid($idPincho); if ($bool2 == false) { $msg = "Error: Selected Pincho is actually assigned to Professional"; header("Location: ../views/pinAssigPro.php?msg={$msg}"); } else { $insert = $v->insert($idPincho, $idProfessional, $idEstablishment); if ($insert == false) { $msg = "Internal database Error.Please, try again"; header("Location: ../views/pinAssigPro.php?msg={$msg}"); } else { $msg = "Pincho assigned to Professional. Operation Done."; header("Location: ../views/pinAssigPro.php?msg={$msg}"); } } } } }
public function addProfessional(Professional $l) { $this->collProfessionals[] = $l; $l->setUser($this); }