prepare($sql);
$stmh->bindValue(1, $e_num, PDO::PARAM_STR);
$stmh->execute();
$row = $stmh->fetch(PDO::FETCH_ASSOC) ;
include $_SERVER['DOCUMENT_ROOT'] . "/eworks/_row.php";
$arr = explode("!", $e_line_id);
$approval_time = explode("!", $e_confirm_id);
$last_approved_id = end($approval_time); // 마지막으로 결재한 사용자 ID
//나의 결재 차례인지 확인하는 로직
if ($status !== 'reject' && $status !== 'end') {
if (empty($e_confirm_id)) {
// e_confirm_id가 비어 있으면 첫 번째 결재자가 현재 차례인지 확인
$myTurn = ($arr[0] == $user_id);
} else {
$approval_time = explode("!", $e_confirm_id);
$last_approved_id = end($approval_time); // 마지막으로 결재한 사용자 ID
$index = array_search($last_approved_id, $arr);
if ($index !== false && isset($arr[$index + 1]) && $arr[$index + 1] == $user_id) {
$myTurn = true; // 현재 결재 차례임
}
}
}
}catch (PDOException $Exception) {
print "오류: ".$Exception->getMessage();
}
if( $myTurn && $done!=='done' ) // 승인자이름에 포함되면?
{
print ' ';
print ' ';
print ' ';
print ' ';
}
else if( $done==='done' )
{
print ' ';
}
else if( $status === 'draft' || $status === '' || $status === null )
{
print ' ';
print ' ';
print ' ';
print ' ';
}
else if( $status === 'reject' )
{
print ' ';
print ' ';
print ' ';
print ' ';
}
else if( $status === 'wait' )
{
print ' ';
print ' ';
print ' ';
}
else if( $status === 'ing' && $user_id == $author_id )
{
}
else if( $status === 'send' )
{
if($user_id !== $author_id)
{
print ' ';
print ' ';
}
else
{
print '';
print ' ';
}
}
?>