Sindbad~EG File Manager
<?php
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
class User extends Eloquent implements UserInterface, RemindableInterface {
use UserTrait, RemindableTrait;
protected $primaryKey = 'user_id';
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = array('password', 'remember_token');
/*
* The attributes are fillable
*/
protected $fillable = array('email', 'password');
public Static function IsProfileUpdated()
{
try
{
$user_id = CustomClass::getUserId();
$user = User::join('users_memberships','users.user_id', '=','users_memberships.user_id')
->where('users.user_id',$user_id)->first();
if($user->user_status == 1)
{
return true;
}
else
{
return false;
}
} catch (Exception $e)
{
Log::error('Models: User -> IsProfileUpdate '.$e->getMessage());
return false;
}
}
public Static function usp_get_data_for_agenda_mailer($user_id,$order_by)
{
try
{
// $user_id = !is_null($user_id) ? "'" . $user_id ."'": "null";
$users = array();
$abstracts = array();
$abs_users = array();
$pdo = DB::connection()->getPdo();
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$stmt = $pdo->prepare("CALL usp_get_data_for_agenda_mailer(:user_id,:order_by);");
$stmt->execute(array(':user_id' => $user_id,':order_by' => $order_by));
$i = 1;
do
{
if($i == 1)
{
while ($row = $stmt->fetch())
{
array_push($users, (object)$row);
}
}
elseif($i == 2)
{
while ($row = $stmt->fetch())
{
array_push($abstracts,(object)$row);
}
}
elseif($i == 3)
{
while ($row = $stmt->fetch())
{
array_push($abs_users,(object)$row);
}
}
$i++;
} while ($stmt->nextRowset());
return array('users' => $users,'abstracts' => $abstracts,'abs_users'=>$abs_users);
// return array('users' => $users,'abstracts' => $abstracts);
// return $result;
}
catch (Exception $e)
{
Log::error('Models: User -> usp_get_data_for_agenda_mailer '.$e->getMessage());
return [];
}
}
public Static function usp_get_participate_evaluators($user_ids,$is_consent)
{
try
{
$users = array();
$pdo = DB::connection()->getPdo();
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$stmt = $pdo->prepare("CALL usp_get_participate_evaluators(:input_user_ids,:input_is_consent);");
$stmt->execute(array(':input_user_ids' => $user_ids,':input_is_consent' => $is_consent));
$i = 1;
do
{
if($i == 1)
{
while ($row = $stmt->fetch())
{
array_push($users, (object)$row);
}
}
$i++;
} while ($stmt->nextRowset());
return $users;
}
catch (Exception $e)
{
Log::error('Models: User -> usp_get_participate_evaluators '.$e->getMessage());
return [];
}
}
//Sridhar On 11 May 2022 12:35 PM
//search commitment users
public Static function usp_search_commitment_users($search)
{
try
{
$users = array();
$pdo = DB::connection()->getPdo();
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$stmt = $pdo->prepare("CALL usp_search_commitment_users(:in_search);");
$stmt->execute(array(':in_search' => $search));
$i = 1;
do
{
if($i == 1)
{
while ($row = $stmt->fetch())
{
array_push($users, (object)$row);
}
}
$i++;
} while ($stmt->nextRowset());
return $users;
}
catch (Exception $e)
{
Log::error('Models: User -> usp_search_commitment_users '.$e->getMessage());
return [];
}
}
//Sridhar On 13 May 2022 03:48 PM
//commitment list for whatsapp
public Static function usp_get_agenda_reports_for_whatsapp($user_id,$from_dt,$to_dt,$is_upcoming,$break_code,$order_by)
{
try
{
$users = array();
$users = DB::select('CALL usp_get_agenda_reports_for_whatsapp(?,?,?,?,?,?)',array($user_id,$from_dt,$to_dt,$is_upcoming,$break_code,$order_by));
return $users;
// $users = array();
// $pdo = DB::connection()->getPdo();
// $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
// $stmt = $pdo->prepare("CALL usp_get_agenda_reports_for_whatsapp(:user_id,:break_code,:order_by);");
// $stmt->execute(array(':user_id' => $user_id,':break_code' => $break_code,':order_by' => $order_by));
// $i = 1;
// do
// {
// if($i == 1)
// {
// while ($row = $stmt->fetch())
// {
// array_push($users, (object)$row);
// }
// }
// $i++;
// } while ($stmt->nextRowset());
// return $users;
}
catch (Exception $e)
{
Log::error('Models: User -> usp_get_agenda_reports_for_whatsapp '.$e->getMessage());
return [];
}
}
}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists