Sindbad~EG File Manager
<?php
class ProgramMark extends Eloquent {
protected $primaryKey = 'p_marks_id';
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'program_marks';
/**
* Sridhar On 17 Apr 2017 2:11 PM
* Get User is evaliation
*/
public Static function getUserIsEvaluator($user_id)
{
try
{
$result = ProgramMark::where('user_id',$user_id)
->count();
return $result>0?true:false;
} catch (Exception $e)
{
Log::error('Models: Mark -> '.$e->getMessage());
return false;
}
}
/**
* Sridhar On 20 Apr 2017 11:41 AM
* Get evulators and evulators Abstracts
*/
public Static function usp_program_evaluation_index($user_id)
{
try
{
// $evaluators = array();
$partcipants = array();
$engagedAbstracts = array();
$pdo = DB::connection()->getPdo();
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$stmt = $pdo->prepare("CALL usp_program_evaluation_index(:user_id);");
//$stmt = $pdo->prepare("CALL usp_search_products($storeId,$currencyId,null,null,null,null,null,null,$page,$pageSize );");
$stmt->execute(array(':user_id' => $user_id ));
//var_dump($stmt);
$i = 1;
do
{
if($i == 1)
{
while ($row = $stmt->fetch())
{
array_push($partcipants, (object)$row);
// var_dump($partcipants);
// exit();
}
}
$i++;
} while ($stmt->nextRowset());
return $partcipants;
}catch (Exception $e)
{
Log::error('Models: ProgramMark -> usp_program_evaluation_index '.$e->getMessage());
//echo $e->getMessage();
return array('partcipants' => []);
}
}
public Static function usp_prev_next_evaluation_program($evaluator_id,$program_id,$participant_id)
{
try
{
$evaluator_id = !is_null($evaluator_id) ? "'" . $evaluator_id ."'": "null";
$program_id = !is_null($program_id) ? "'" . $program_id ."'": "null";
$participant_id = !is_null($participant_id) ? "'" . $participant_id ."'": "null";
$result = DB::select("call usp_prev_next_evaluation_program($evaluator_id,$program_id,$participant_id)");
return $result;
} catch (Exception $e)
{
Log::error('Models: ProgramMark -> usp_evaluation_status '.$e->getMessage());
return [];
}
}
public Static function talent_search_program_marks_report($program_id)
{
try
{
// $evaluators = array();
$report = array();
$pdo = DB::connection()->getPdo();
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$stmt = $pdo->prepare("CALL talent_search_program_marks_report(:program_id);");
$stmt->execute(array(':program_id' => $program_id ));
$i = 1;
do
{
if($i == 1)
{
while ($row = $stmt->fetch())
{
array_push($report, (object)$row);
// var_dump($report);
// exit();
}
}
$i++;
} while ($stmt->nextRowset());
return $report;
}catch (Exception $e)
{
Log::error('Models: ProgramMark -> talent_search_program_marks_report '.$e->getMessage());
//echo $e->getMessage();
return array('$report' => []);
}
}
}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists