Hi, i am new to phalcon and is now developing a simple project using phalcon, so my question is " is there any way to access the session identity variable of a logged in user in the config.php file if so, can you please explain me how? Pls help me.
The real thing i want is that i have included dhtmlx scheduler in my project and i want to display the events based on the current user company-id and the connector file for the scheduler is located in public folder and in that connector file only the query has been written to fetch events from the events table.
THis is my scheculer.php connector file and i want the $comid to be the current logged in user company-id. Any ways?? pls help me.
<?php
require_once("../codebase/connector/scheduler_connector.php");
use Phalcon\Config;
require __DIR__ . "/../../app/config/config.php";
$config = new Config($settings);
$username = $config->database->username;
$host = $config->database->host;
$password = $config->database->password;
$dbname = $config->database->dbname;
$dbadapter = $config->database->adapter;
$comid = $config->companyId;
$res=mysql_connect($host,$username,$password);
mysql_select_db($dbname);
$dbtype = $dbadapter;
$scheduler = new schedulerConnector($res, $dbtype);
$scheduler->render_sql("SELECT * FROM engagement WHERE eng_companyid = $comid","id","fromdate,todate,title,description,place,location,status");
?>