Example #1
0
<?php

require_once "../model/business/CustomApplicationService.php";
require_once "../model/business/EventActions.php";
$app = new CustomApplicationService();
$user = new Sky_stakeholderVO();
$user->sky_login = $_GET["user"];
$user->sky_password = $_GET["password"];
$user = $app->getMatchStakeHolder($user);
if (!is_null($user)) {
    $user->sky_password = '';
    $target = "#content";
    $page = "view/default.php";
    $notRedirect = true;
    require_once "main.control.php";
    $_SESSION["user"] = serialize($user);
    $app->registerEvent(EventActions::$LOGIN, $user->sky_name);
    echo "{logged: true, teste: '" . $_SESSION["user"] . "'}";
    exit;
}
echo "{logged: false}";
Example #2
0
$name = $_POST["fldName"];
$client = $_POST["fldClient"] > 0 ? $_POST["fldClient"] : NULL;
$start = urldecode($_POST["fldStart"]);
$end = urldecode($_POST["fldEnd"]);
$objectives = $_POST["fldObjectives"];
$description = $_POST["fldDescription"];
//recebe dados de período e monta para o banco de dados
$dateStart = explode("/", $start);
$dateStart = $dateStart[2] . "-" . $dateStart[1] . "-" . $dateStart[0];
$dateEnd = explode("/", $end);
$dateEnd = $dateEnd[2] . "-" . $dateEnd[1] . "-" . $dateEnd[0];
//recupera informações do usuário logado na sessão
session_start();
$user = unserialize($_SESSION["user"]);
//cria objeto de acesso ao banco de dados
$app = new CustomApplicationService();
//cria objeto de projeto
$project = new Sky_projectVO();
$project->sky_creator_id = $user->sky_id;
$project->sky_name = urldecode($name);
$project->sky_start = substr($dateStart, 2);
$project->sky_end = substr($dateEnd, 2);
$project->sky_status = 1;
//Status Criado //deve ser substituído por um constante futuramente
$project->sky_applicant_id = isset($client) && !empty($client) && !is_null($client) ? $client : "null";
$project->sky_objectives = urldecode($objectives);
$project->sky_description = urldecode($description);
$project->sky_project_id = "null";
//Grava projeto no banco de dados
$newProject = $app->createSky_project($project);
//Monta resposta
Example #3
0
	}
	#dataProject {
		line-height: 25px;
	}
</style>

<h2>Detalhes do projeto</h2>

<?php 
$incCustomApplicationService = "../model/business/CustomApplicationService.php";
if (!file_exists($incCustomApplicationService)) {
    $incCustomApplicationService = "model/business/CustomApplicationService.php";
}
require_once $incCustomApplicationService;
$projectId = $_GET["projectId"];
$app = new CustomApplicationService();
$project = $app->getOneSky_project($projectId);
$client = $project->sky_applicant_id > 0 ? $app->getOneSky_stakeholder($project->sky_applicant_id) : null;
?>
<br />
<div id="dataProject">
	<label>Nome: </label>
	<span id="nameField"><?php 
echo utf8_encode($project->sky_name);
?>
<br /></span>
	<label>Cliente: </label>
	<span id="clientField">
	<?php 
echo utf8_encode(!is_null($client) ? $client->sky_name : "Nenhum");
?>
Example #4
0
<?php

require_once "../model/business/CustomApplicationService.php";
require_once "../model/business/EventActions.php";
session_start();
session_destroy();
$user = unserialize($_SESSION["user"]);
$app = new CustomApplicationService();
$app->registerEvent(EventActions::$LOGOUT, $user->sky_name);
header("Location: ../index.php");
Example #5
0
<?php

$incCustomApplicationService = "../model/business/CustomApplicationService.php";
if (!file_exists($incCustomApplicationService)) {
    $incCustomApplicationService = "model/business/CustomApplicationService.php";
}
require_once $incCustomApplicationService;
$app = new CustomApplicationService();
$listProjects = $app->getAllSky_project();
foreach ($listProjects as $project) {
    echo "> <a href=\"";
    echo "javascript: app.openPage('view/project.detail.php?projectId={$project->sky_id}', '#internal')\">";
    echo utf8_encode($project->sky_name);
    echo "</a>";
    ?>
<br /><br />
<?php 
}