Formulaire d'ajout de POI qui fonctionne
This commit is contained in:
@@ -20,7 +20,7 @@ switch ($controller->splitted_url[1]) {
|
|||||||
$poi->author = $user->id;
|
$poi->author = $user->id;
|
||||||
$poi->source = "kab";
|
$poi->source = "kab";
|
||||||
$poi->is_commentable = isset($_POST['is_commentable'])?'t':'f';
|
$poi->is_commentable = isset($_POST['is_commentable'])?'t':'f';
|
||||||
$poi->parameters = '';
|
$poi->parameters = new \stdClass();
|
||||||
if(!$poi->checkPermalink($_POST['permalink'],1)) {
|
if(!$poi->checkPermalink($_POST['permalink'],1)) {
|
||||||
$poi->permalink = $_POST['permalink'];
|
$poi->permalink = $_POST['permalink'];
|
||||||
$poi->insert();
|
$poi->insert();
|
||||||
|
|||||||
@@ -111,12 +111,12 @@ class Poi
|
|||||||
|
|
||||||
pg_query($con, "BEGIN");
|
pg_query($con, "BEGIN");
|
||||||
|
|
||||||
$query = "INSERT INTO contents (is_commentable, is_public, permalink, creation_date, name, type, poi_type) VALUES
|
$query = "INSERT INTO contents (is_commentable, is_public, permalink, creation_date, type, poi_type) VALUES
|
||||||
($1, TRUE, $2, $3, $4, $5, $6) RETURNING id";
|
($1, TRUE, $2, $3, $4, $5) RETURNING id";
|
||||||
|
|
||||||
pg_prepare($con, "prepare1", $query)
|
pg_prepare($con, "prepare1", $query)
|
||||||
or die ("Cannot prepare statement\n");
|
or die ("Cannot prepare statement\n");
|
||||||
$result = pg_execute($con, "prepare1", array($this->is_commentable, $this->permalink, date('r'), $this->name, $this->type, $this->poi_type))
|
$result = pg_execute($con, "prepare1", array($this->is_commentable, $this->permalink, date('r'), $this->type, $this->poi_type))
|
||||||
or die ("Cannot execute statement\n");
|
or die ("Cannot execute statement\n");
|
||||||
|
|
||||||
$this->content_id = pg_fetch_assoc($result)['id'];
|
$this->content_id = pg_fetch_assoc($result)['id'];
|
||||||
|
|||||||
Reference in New Issue
Block a user