Source for file pgsql.inc.php
Documentation is available at pgsql.inc.php
* @package linea21.modules
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
* 'Content' module is used by 'Publication' and 'Workshop' modules
//////////// Check Inclusion de pages ////////////
include_once("../lib/lib_common.php");
$req_max_publi_content_id = "SELECT MAX(publicon_id) AS maxid FROM " . T_PUBLI_CONT . ";";
$q = "SELECT PC.publicon_id, PC.publicon_title, to_char(PC.publicon_date_crea, '". toStringSqlDate(). "') AS publicon_date_crea_display, to_char(PC.publicon_last_modify, '". toStringSqlDate('long'). "') AS publicon_last_modify_display FROM " . J_PARTS . " AS JP ".
"LEFT OUTER JOIN ". T_PUBLI_CONT. " AS PC ON JP.j_parts_id=PC.publicon_id ".
"WHERE JP.j_root_id='". $publi_id. "' ".
"AND JP.j_type='P' AND PC.publicon_validity='". $statut. "' ";
if($orderby== 'CREA') $q.= "ORDER BY PC.publicon_range ASC, PC.publicon_date_crea DESC";
if($orderby== 'MODIFY') $q.= "ORDER BY PC.publicon_last_modify DESC";
if($limit!=- 1) $q.= " OFFSET 0 LIMIT ". $limit;
$q = "SELECT W.workrepcon_id , W.workrepcon_title, to_char(W.workrepcon_date_crea, '". toStringSqlDate(). "') AS workrepcon_date_crea_display, to_char(W.workrepcon_last_modify, '". toStringSqlDate('long'). "') AS workrepcon_last_modify_display FROM " . J_PARTS . " AS JW ".
"LEFT OUTER JOIN ". T_WORK_REP_CONT. " AS W ON JW.j_parts_id=W.workrepcon_id ".
"WHERE JW.j_root_id='". $workrep_id. "' ".
"AND JW.j_type='W' AND W.workrepcon_validity='". $statut. "' ";
if($orderby== 'CREA') $q.= "ORDER BY W.workrepcon_range ASC, W.workrepcon_date_crea DESC";
if($orderby== 'MODIFY') $q.= "ORDER BY W.workrepcon_last_modify DESC";
if($limit!=- 1) $q.= " OFFSET 0 LIMIT ". $limit;
$q = "SELECT publi_title, publi_id, publi_posted_by, publi_statut FROM " . T_PUBLI . " WHERE publi_id='". $publi_id. "' LIMIT 1;";
$q = "SELECT workrep_title, workrep_id, workshop_denomination, workshop_id, workrep_workshop_id FROM " . T_WORK_REP . " ".
"LEFT OUTER JOIN ". T_WORK. " on workshop_id=workrep_workshop_id ".
"WHERE workrep_id='". $workrep_id. "' LIMIT 1;";
$q = "SELECT PC.publicon_title, PC.publicon_body, to_char(PC.publicon_date_crea, '". toStringSqlDate(). "') AS publicon_date_crea_display, to_char(PC.publicon_last_modify, '". toStringSqlDate('long'). "') AS publicon_last_modify_display FROM " . T_PUBLI_CONT. " AS PC ".
"WHERE PC.publicon_id='". $publi_id. "' LIMIT 1;";
$q = "SELECT WC.workrepcon_title, WC.workrepcon_body, to_char( WC.workrepcon_date_crea, '". toStringSqlDate(). "') AS workrepcon_date_crea_display, to_char(WC.workrepcon_last_modify, '". toStringSqlDate('long'). "') AS workrepcon_last_modify_display FROM " . T_WORK_REP_CONT. " AS WC ".
"WHERE WC.workrepcon_id='". $workrep_id. "' LIMIT 1;";
$q = "SELECT workrepcon_id AS part_id, workrepcon_title AS part_title FROM " . J_PARTS . " ".
"LEFT OUTER JOIN ". T_WORK_REP_CONT. " ON workrepcon_id=j_parts_id ".
"WHERE workrepcon_id <> '". $id. "' AND workrepcon_date_crea < '". $date. "' AND j_root_id='". $parentid. "' AND j_type='W' AND workrepcon_validity = 'Y' ORDER BY workrepcon_date_crea DESC LIMIT 1;";
$q = "SELECT workrepcon_id AS part_id, workrepcon_title AS part_title FROM " . J_PARTS . " ".
"LEFT OUTER JOIN ". T_WORK_REP_CONT. " ON workrepcon_id=j_parts_id ".
"WHERE workrepcon_id <> '". $id. "' AND workrepcon_date_crea > '". $date. "' AND j_root_id='". $parentid. "' AND j_type='W' AND workrepcon_validity = 'Y' ORDER BY workrepcon_date_crea ASC LIMIT 1;";
$q = "SELECT workrepcon_id AS part_id, workrepcon_title AS part_title FROM " . J_PARTS . " ".
"LEFT OUTER JOIN ". T_WORK_REP_CONT. " ON workrepcon_id=j_parts_id ".
"WHERE workrepcon_id <> '". $id. "' AND workrepcon_range >= '". $range. "' AND j_root_id='". $parentid. "' AND j_type='W' AND workrepcon_validity = 'Y' ORDER BY workrepcon_range ASC, workrepcon_date_crea ASC LIMIT 1;";
$q = "SELECT workrepcon_id AS part_id, workrepcon_title AS part_title FROM " . J_PARTS . " ".
"LEFT OUTER JOIN ". T_WORK_REP_CONT. " ON workrepcon_id=j_parts_id ".
"WHERE workrepcon_id <> '". $id. "' AND workrepcon_range <= '". $range. "' AND j_root_id='". $parentid. "' AND j_type='W' AND workrepcon_validity = 'Y' ORDER BY workrepcon_range DESC, workrepcon_date_crea ASC LIMIT 1;";
$q = "SELECT publicon_id AS part_id, publicon_title AS part_title FROM " . J_PARTS . " ".
"LEFT OUTER JOIN ". T_PUBLI_CONT. " ON publicon_id=j_parts_id ".
"WHERE publicon_id <>'". $id. "' AND publicon_date_crea < '". $date. "' AND j_root_id='". $parentid. "' AND j_type='P' AND publicon_validity = 'Y' ORDER BY publicon_date_crea DESC LIMIT 1;";
$q = "SELECT publicon_id AS part_id, publicon_title AS part_title FROM " . J_PARTS . " ".
"LEFT OUTER JOIN ". T_PUBLI_CONT. " ON publicon_id=j_parts_id ".
"WHERE publicon_id <>'". $id. "' AND publicon_date_crea > '". $date. "' AND j_root_id='". $parentid. "' AND j_type='P' AND publicon_validity = 'Y' ORDER BY publicon_date_crea ASC LIMIT 1;";
$q = "SELECT publicon_id AS part_id, publicon_title AS part_title FROM " . J_PARTS . " ".
"LEFT OUTER JOIN ". T_PUBLI_CONT. " ON publicon_id=j_parts_id ".
"WHERE publicon_id <>'". $id. "' AND publicon_range <= '". $range. "' AND j_root_id='". $parentid. "' AND j_type='P' AND publicon_validity = 'Y' ORDER BY publicon_range DESC, publicon_date_crea ASC LIMIT 1;";
$q = "SELECT publicon_id AS part_id, publicon_title AS part_title FROM " . J_PARTS . " ".
"LEFT OUTER JOIN ". T_PUBLI_CONT. " ON publicon_id=j_parts_id ".
"WHERE publicon_id <>'". $id. "' AND publicon_range >= '". $range. "' AND j_root_id='". $parentid. "' AND j_type='P' AND publicon_validity = 'Y' ORDER BY publicon_range ASC, publicon_date_crea ASC LIMIT 1;";
$q = "SELECT workrepcon_range as item_range, workrepcon_date_crea as item_date_crea FROM " . T_WORK_REP_CONT . " WHERE workrepcon_id = ". $id. ";";
$q = "SELECT publicon_range as item_range, publicon_date_crea as item_date_crea FROM " . T_PUBLI_CONT . " WHERE publicon_id = ". $id. ";";
|