Ejemplo n.º 1
0
function checksession($sg = null)
{
    if ($sg != null && isset($_SESSION['operatorid'])) {
        $ap = new Approval();
        $ap->setValue('skillgroup', $sg);
        $ap->setValue('operatorid', $_SESSION['operatorid']);
        if ($ap->checkAuthority()) {
            return true;
        } else {
            return false;
        }
    }
    if (isset($_SESSION['user'])) {
        if (isset($_SESSION["LAST_ACTIVITY"])) {
            if (time() - $_SESSION["LAST_ACTIVITY"] > 300) {
                // last request was more than 30 minutes ago
                session_unset();
                // unset $_SESSION variable for the run-time
                session_destroy();
                // destroy session data in storage
                return false;
            } else {
                $_SESSION["LAST_ACTIVITY"] = time();
                // update last activity time stamp
                return true;
            }
        }
    }
    return false;
}
Ejemplo n.º 2
0
 public function getSidebar($catid = 0)
 {
     $sidebarAlias = "application.modules.article.views.sidebar";
     $approvals = Approval::model()->fetchAllApproval();
     $params = array("approvals" => $approvals, "categoryData" => $this->getCategoryOption(), "catid" => $catid);
     return $this->renderPartial($sidebarAlias, $params, true);
 }
Ejemplo n.º 3
0
 protected function getSidebar($catid = 0)
 {
     $sidebarAlias = "application.modules.officialdoc.views.sidebar";
     $approvals = Approval::model()->fetchAllApproval();
     $params = array("approvals" => $approvals, "categoryData" => $this->getCategoryOption(), "catid" => $catid);
     $noSignCount = Officialdoc::model()->countNoSignByUid(Ibos::app()->user->uid);
     $params["noSignCount"] = $noSignCount;
     return $this->renderPartial($sidebarAlias, $params, true);
 }
 public function status_options($id)
 {
     LeaveWPay::with('user')->where('leave_id', $id)->update(array('status' => Input::get('status')));
     $approve = LeaveWPay::with('user')->where('leave_id', $id)->first();
     $adminlog = new AdminLogWP();
     $adminlog->employee_id = Input::get('employee_id');
     $adminlog->leave_id = Input::get('leave_id');
     $adminlog->days_of_leave = $approve->days_of_leave;
     $adminlog->wdays_of_leave = $approve->wdays_of_leave;
     $adminlog->date_from = $approve->date_from;
     $adminlog->time_from = $approve->time_from;
     $adminlog->date_to = $approve->date_to;
     $adminlog->time_to = $approve->time_to;
     $adminlog->reason = $approve->reason;
     $adminlog->message = Input::get('message');
     $adminlog->status = Input::get('status');
     $adminlog->save();
     $userlog = new UserLeaveLog();
     $userlog->employee_id = Input::get('employee_id');
     $userlog->leave_id = Input::get('leave_id');
     $userlog->type_of_leave = 'Leave with pay';
     $userlog->days_of_leave = $approve->days_of_leave;
     $userlog->wdays_of_leave = $approve->wdays_of_leave;
     $userlog->date_from = $approve->date_from;
     $userlog->time_from = $approve->time_from;
     $userlog->date_to = $approve->date_to;
     $userlog->time_to = $approve->time_to;
     $userlog->company = '';
     $userlog->address = '';
     $userlog->reason = $approve->reason;
     $userlog->status = Input::get('status');
     $userlog->save();
     $approve = new Approval();
     $approve->employee_id = Auth::user()->employee_id;
     $approve->leave_id = Input::get('leave_id');
     $approve->type_of_leave = 'Leave with pay';
     $approve->message = Input::get('message');
     $approve->status = Input::get('status');
     $approve->save();
     return Redirect::route('leavepay');
 }
Ejemplo n.º 5
0
 public function actionDel()
 {
     if (Ibos::app()->request->isAjaxRequest) {
         $id = EnvUtil::getRequest("id");
         $delRet = Approval::model()->deleteApproval($id);
         if ($delRet) {
             $ret["isSuccess"] = true;
             $ret["msg"] = Ibos::lang("Del succeed", "message");
         } else {
             $ret["isSuccess"] = false;
             $ret["msg"] = Ibos::lang("Del failed", "message");
         }
         $this->ajaxReturn($ret);
     }
 }
			                                </div><!-- /.box-header -->
			                                <!-- form start -->
			                                <form role="form" id="marks_enter">
			                                    <div class="box-body">
			                                        <div class="form-group">
													<p>
													Note: Internal assessment, Class Tests, Mid-sem, End-sem is equally applicable to practicals, seminars etc. but do set grading scale accordingly.
													</p>
			                                            <label for="course">Select course with respective department</label>
			                                            <select class="form-control" id="course" name="course_id" onchange="changeload(this.value);">
			                                            	<option value="" >Select your Course</option>
																				<?php 
$i = 0;
$c = new Course();
$courses = $c->getAppointed(Session::get('teacher_id'));
$a = new Approval();
while (!empty($courses) && ($course = $courses->fetch_object())) {
    $matched = 0;
    $b = $a->underApproval();
    while ($key = $b->fetch_object()) {
        if ($key->course_code == $course->course_code && $key->course_dep == $course->course_dep) {
            $matched = 1;
            break;
        }
    }
    if (!$matched) {
        ?>
																							<option  value="<?php 
        echo $course->course_code . ',' . $course->course_dep;
        ?>
">	<?php 
Ejemplo n.º 7
0
    if (isset($_GET['ui'])) {
        $nc->showNCUI();
    }
    if (isset($_GET['newtmrow'])) {
        $id = $_GET['id'];
        $ope = new Operator();
        $ope->createOperatorList();
        $any = new Anylist();
        $any->createList('Department');
        echo '<tr><td>';
        $sel = new selectlist("teammember[" . $id . "]", $ope->getOperatorList(), 'Select Member Name', 'Operator_ID', 'Operator_Name', 'class="required"', '', '');
        echo '</td><td>';
        $sel = new selectlist("department[" . $id . "]", $any->anylist, 'Select Department', 'Department', 'Department', 'class="required"', '', '');
        echo '</td><td><input id="work[' . $id . ']" name="work[' . $id . ']" class="required"></td>';
        echo '<td><input id="tdate[' . $id . ']" name="tdate[' . $id . ']" class="required"></td><td><input id="memberremarks[' . $id . ']" name="memberremarks[' . $id . ']"></td>';
        echo '<input type="hidden" id="tdatedb[' . $id . ']" name="tdatedb[' . $id . ']"></tr>';
    }
    if (isset($_GET['nclid'])) {
        $nc->setValue('nonconformanceid', $_GET['nclid']);
        $nc->showNCUI();
    }
    if (isset($_GET['sgid'])) {
        $au = new Approval();
        $au->setValue('skillgroup', $_GET['sgid']);
        $au->setValue('tname', 'NonConformance');
        $au->setValue('linkcol', 'NonConformance_ID');
        $au->setValue('linkid', $_GET['lid']);
        $au->setValue('remarks', $_GET['appremarks']);
        $au->saveApproval();
    }
}
<?php

require_once '../core/init.php';
if (loggedIn() && privilege() != NULL) {
    if (Input::exists('get')) {
        $tid = Input::get('tid');
        $cid = Input::get('cid');
        $did = Input::get('did');
        $a = new Approval();
        $b = $a->approve($tid, $cid, $did);
        if ($b === 1) {
            echo '<div class="alert alert-success alert-dismissible" role="alert">';
            echo 'Result approved!';
            echo '</div>';
        } else {
            if ($b === 2) {
                echo '<div class="alert alert-warning alert-dismissible" role="alert">';
                echo 'Already approved by you!';
                echo '</div>';
            } else {
                if ($b === 0) {
                    echo '<div class="alert alert-success alert-dismissible" role="alert">';
                    echo 'Temporary Error!';
                    echo '</div>';
                } else {
                    echo '<div class="alert alert-danger alert-dismissible" role="alert">';
                    echo $b;
                    echo '</div>';
                }
            }
        }
Ejemplo n.º 9
0
 public function checkIsApproval($catid, $uid)
 {
     $aid = $this->fetchAidByCatid($catid);
     $approvalUids = Approval::model()->fetchApprovalUidsByIds($aid);
     $res = in_array($uid, $approvalUids);
     return $res;
 }
Ejemplo n.º 10
0
 public static function getApprovalStatus($id)
 {
     $apv = Approval::find($id);
     return isset($apv->approvalStatus) ? $apv->approvalStatus : '';
 }
Ejemplo n.º 11
0
 public function postApproval()
 {
     $in = Input::get();
     $ticket_id = $in['ticket_id'];
     $approval_status = $in['approval_status'];
     $approval = Approval::find($ticket_id);
     if ($approval) {
         $approval->approvalStatus = $approval_status;
         $approval->save();
         $p = json_encode($approval);
         $actor = isset(Auth::user()->email) ? Auth::user()->fullname . ' - ' . Auth::user()->email : 'guest';
         Event::fire('log.a', array('approval', 'change', $actor, $p));
         return Response::json(array('result' => 'OK'));
     } else {
         $p = 'asset not found';
         $actor = isset(Auth::user()->email) ? Auth::user()->email : 'guest';
         Event::fire('log.a', array('approval', 'change', $actor, $p));
         return Response::json(array('result' => 'ERR::NOTFOUND'));
     }
 }
Ejemplo n.º 12
0
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<div class="box box-default">
				<div class="box-header">
					<h3 class="box-title">Approval Status</h3>
					<div class="box-tools pull-right">
	                	<button class="btn btn-default btn-sm" data-widget="collapse"><i class="fa fa-minus"></i></button>
	                </div>
				</div> <!-- /.box header -->
				<div class="box-body">
					<h3><strong>
					<?php 
$a = new Approval();
$b = $a->statusApproval($cid, $dep);
if ($b->num_rows) {
    $status = $b->fetch_object()->status_level;
} else {
    $status = -1;
}
switch ($status) {
    case -1:
        echo "Not yet approved by you for result.";
        break;
    case 0:
        echo "Approved by course teacher for result.";
        break;
    case 1:
        echo "Approved by 1 DUPC/DPPC member for result.";
Ejemplo n.º 13
0
 private function verify()
 {
     if (Ibos::app()->request->isAjaxRequest) {
         $uid = Ibos::app()->user->uid;
         $artIds = trim(EnvUtil::getRequest("articleids"), ",");
         $ids = explode(",", $artIds);
         if (empty($ids)) {
             $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("Parameters error", "error")));
         }
         $sender = User::model()->fetchRealnameByUid($uid);
         foreach ($ids as $artId) {
             $artApproval = ArticleApproval::model()->fetchLastStep($artId);
             if (empty($artApproval)) {
                 $this->verifyComplete($artId, $uid);
             } else {
                 $art = Article::model()->fetchByPk($artId);
                 $category = ArticleCategory::model()->fetchByPk($art["catid"]);
                 $approval = Approval::model()->fetch("id={$category["aid"]}");
                 $curApproval = Approval::model()->fetchNextApprovalUids($approval["id"], $artApproval["step"]);
                 $nextApproval = Approval::model()->fetchNextApprovalUids($approval["id"], $artApproval["step"] + 1);
                 if (!in_array($uid, $curApproval["uids"])) {
                     $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("You do not have permission to verify the article")));
                 }
                 if (!empty($nextApproval)) {
                     if ($nextApproval["step"] == "publish") {
                         $this->verifyComplete($artId, $uid);
                     } else {
                         ArticleApproval::model()->recordStep($artId, $uid);
                         $config = array("{sender}" => $sender, "{subject}" => $art["subject"], "{category}" => $category["name"], "{content}" => $this->renderPartial("remindcontent", array("article" => $art, "author" => $sender), true), "{url}" => $this->createUrl("default/index", array("type" => "notallow")));
                         foreach ($nextApproval["uids"] as $k => $approvalUid) {
                             if (!ArticleUtil::checkReadScope($approvalUid, $art)) {
                                 unset($nextApproval["uids"][$k]);
                             }
                         }
                         Notify::model()->sendNotify($nextApproval["uids"], "article_verify_message", $config, $uid);
                         Article::model()->updateAllStatusAndApproverByPks($artId, $uid, 2);
                     }
                 }
             }
         }
         $this->ajaxReturn(array("isSuccess" => true, "msg" => Ibos::lang("Verify succeed", "message")));
     }
 }
Ejemplo n.º 14
0
        $i = $_GET['rowno'] - 1;
        $data = array('id' => $i, 'tl' => $_GET['tl'], 'tu' => $_GET['tu']);
        $dimn->addDimensionRow($data);
    }
    if (isset($_GET['rev'])) {
        $dimn->setValue('operationid', $_GET['opid']);
        if (isset($_GET['oldrev'])) {
            $dimn->setValue('oldrev', 1);
        }
        if (isset($_GET['id'])) {
            $dimn->getStageRevno($_GET['id']);
        } else {
            $dimn->getStageRevno();
        }
    }
    if (isset($_GET['sgid'])) {
        $au = new Approval();
        $au->setValue('skillgroup', $_GET['sgid']);
        $au->setValue('tname', 'Ope_Drawing');
        $au->setValue('linkcol', 'Ope_Drawing_ID');
        $au->setValue('linkid', $_GET['opdrgid']);
        $au->setValue('remarks', $_GET['appremarks']);
        $au->saveApproval();
    }
    if (isset($_GET['copy'])) {
        ///show dimwnsions list for copying to another operation
        $dimn->setValue('operationid', $_GET['opid']);
        $dimn->setValue('opedrawingid', $_GET['revid']);
        $dimn->showDimensionCopyUI();
    }
}
Ejemplo n.º 15
0
 public function post_delete($id)
 {
     $d_login = UserLogin::where('employee_id', $id)->first();
     $d_login->delete();
     $userlog = UserLeaveLog::where('employee_id', $id)->delete();
     LeaveWPay::where('employee_id', $id)->delete();
     LeaveWOPay::where('employee_id', $id)->delete();
     LeaveCounter::where('employee_id', $id)->delete();
     LeaveAWT::where('employee_id', $id)->delete();
     LeaveOB::where('employee_id', $id)->delete();
     AdminLogWP::where('employee_id', $id)->delete();
     AdminLogWOP::where('employee_id', $id)->delete();
     AdminLogOB::where('employee_id', $id)->delete();
     AdminLogAWT::where('employee_id', $id)->delete();
     AnnouncementComments::where('employee_id', $id)->delete();
     Approval::where('employee_id', $id)->delete();
     $d_user = UserDetails::where('employee_id', $id)->first();
     $d_user->delete();
     return Redirect::route('view_users');
 }
Ejemplo n.º 16
0
                }
            }
            $dimnob->showDimensionObservationUI();
        }
        if (isset($_GET['jno'])) {
            $dimnob->setValue('operationid', $_GET['opid']);
            $dimnob->setValue('batchid', $_GET['bid']);
            $dimnob->setValue('opedrawingid', $_GET['revid']);
            $dimnob->getJobnos();
        }
        if (isset($_GET['date'])) {
            $dimnob->setValue('dimnobservationid', $_GET['doid']);
            $dimnob->getDate();
        }
        if (isset($_GET['check'])) {
            $dimnob->checkvalue($_GET['edimn'], $_GET['tlow'], $_GET['tup'], $_GET['bdim']);
        }
        if (isset($_GET['tomm'])) {
            $dimnob->converttomm($_GET['edimn']);
        }
        if (isset($_GET['sgid'])) {
            $au = new Approval();
            $au->setValue('skillgroup', $_GET['sgid']);
            $au->setValue('tname', 'Dimn_Observation');
            $au->setValue('linkcol', 'Dimn_Observation_ID');
            $au->setValue('linkid', $_GET['doid']);
            $au->setValue('remarks', $_GET['appremarks']);
            $au->saveApproval();
        }
    }
}
Ejemplo n.º 17
0
 protected function getCurApproval()
 {
     $catid = EnvUtil::getRequest("catid");
     $category = OfficialdocCategory::model()->fetchByPk($catid);
     $approval = Approval::model()->fetchByPk($category["aid"]);
     $this->ajaxReturn(array("approval" => $approval));
 }
Ejemplo n.º 18
0
                $insqry = "insert into {$skills_table} set skill_name='{$v[$skname]}',DATE_OF_ADDITION=now(),added_by='{$emp_id}',over_used='{$v[$ovused]}',career_killer='{$v[$crklr]}',compensator='{$v[$cmptr]}',";
                if ($v[$sktp] == "t") {
                    $subqry = "skill_description='{$v[$skdes]}',unskilled_desc=NULL,skill_type='{$v[$sktp]}'";
                } else {
                    $subqry = "skill_description=NULL,unskilled_desc='{$v[$skdes]}',skill_type='{$v[$sktp]}'";
                }
                $insqry = $insqry . $subqry;
                //	echo $insqry;
                $db_object->insert($insqry);
                $insqry = "";
                $subqry = "";
            }
        }
        if (count($skillids) > 0) {
            $skills_id = @implode(",", $skillids);
            $skill_ids = "(" . $skills_id . ")";
            //$delqry="delete from $unapskill where emp_id='$emp_id'";
            $delqry = "delete from {$unapskill} where skill_id in {$skill_ids}";
            $db_object->insert($delqry);
        }
        echo $alert_msg["cApproved"];
        //print_r($skill_set);
    }
}
$aprobj = new Approval();
if ($fApproval) {
    $aprobj->approve($common, $db_object, $_POST, $emp_id, $gbl_skill_type, $alert_msg);
} else {
    $aprobj->display($common, $db_object, $emp_id);
}
include "footer.php";
Ejemplo n.º 19
0
<?php

require_once 'autoload.php';
include 'checksession.php';
if (!checksession()) {
    header('Location: login.php');
}
$au = new Approval();
$commallowed = array('2', '17');
if (isset($_SESSION['operatorid'])) {
    $au->setValue('operatorid', $_SESSION['operatorid']);
    $me = new Message();
    $me->setTo($_SESSION['operatorid']);
    $nm = $me->getMessagecount();
} else {
    checksession('index.php');
}
echo <<<_END



<!DOCTYPE HTML>
    <head>
        <meta charset="utf-8" />
        <title>Divya Engineering ERP</title>
<link href="js/css/sm-core-css.css" rel="stylesheet" type="text/css" />
<link href="js/css/sm-blue/sm-blue.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-2.1.4.min.js" ></script>
<script src="js/jquery.smartmenus.js" ></script>

<script>
Ejemplo n.º 20
0
 /**
  * Store a newly created resource in storage.
  * POST /atw
  *
  * @return Response
  */
 public function store($id)
 {
     //
     LeaveAWT::with('user')->where('leave_id', $id)->update(array('status' => Input::get('status')));
     $approve = LeaveAWT::with('user')->where('leave_id', $id)->first();
     $adminlog = new AdminLogAWT();
     $adminlog->employee_id = Input::get('employee_id');
     $adminlog->leave_id = Input::get('leave_id');
     $adminlog->days_of_leave = $approve->days_of_leave;
     $adminlog->wdays_of_leave = $approve->wdays_of_leave;
     $adminlog->date_from = $approve->date_from;
     $adminlog->time_from = $approve->time_from;
     $adminlog->date_to = $approve->date_to;
     $adminlog->time_to = $approve->time_to;
     $adminlog->reason = $approve->reason;
     $adminlog->message = Input::get('message');
     $adminlog->status = Input::get('status');
     $adminlog->save();
     $userlog = new UserLeaveLog();
     $userlog->employee_id = Input::get('employee_id');
     $userlog->leave_id = Input::get('leave_id');
     $userlog->type_of_leave = 'Application for Authority to Work (ATW)';
     $userlog->days_of_leave = $approve->days_of_leave;
     $userlog->wdays_of_leave = $approve->wdays_of_leave;
     $userlog->date_from = $approve->date_from;
     $userlog->time_from = $approve->time_from;
     $userlog->company = '';
     $userlog->address = '';
     $userlog->date_to = $approve->date_to;
     $userlog->time_to = $approve->time_to;
     $userlog->reason = $approve->reason;
     $userlog->status = Input::get('status');
     $userlog->save();
     $approve = new Approval();
     $approve->employee_id = Auth::user()->employee_id;
     $approve->leave_id = Input::get('leave_id');
     $approve->type_of_leave = 'Application for Authority to Work (ATW)';
     $approve->message = Input::get('message');
     $approve->status = Input::get('status');
     $approve->save();
     return Redirect::route('leaveatw_admin');
 }
Ejemplo n.º 21
0
     $op->adminUI();
 }
 if (isset($_GET['holui'])) {
     $op->holidayUI();
 }
 if (isset($_GET['leaveappui'])) {
     $op->setValue('leaveid', $_GET['lid']);
     $op->leaveapproveUI();
 }
 if (isset($_GET['attendence'])) {
     $op->setValue('uitype', 'att');
     $op->setValue('attstatusid', 1);
     $op->saveAttendence();
 }
 if (isset($_GET['sgid'])) {
     $au = new Approval();
     $au->setValue('skillgroup', $_GET['sgid']);
     $au->setValue('tname', 'Leaves');
     $au->setValue('linkcol', 'Leave_ID');
     $au->setValue('linkid', $_GET['lid']);
     $au->setValue('remarks', $_GET['appremarks']);
     $au->saveApproval();
 }
 if (isset($_GET['plan'])) {
     if (isset($_GET['mid'])) {
         $op->setValue('operatorid', $_GET['mid']);
     }
     $op->showAttencence();
 }
 if (isset($_GET['mpdetail'])) {
     $op->setValue('attendenceid', $_GET['id']);
<?php

require_once '../core/init.php';
if (privilege() == NULL) {
    die;
}
if (loggedIn()) {
    if (Input::exists('post')) {
        $validate = new Validate();
        $validation = $validate->check($_POST, array('reject_msg' => array('required' => true)));
        if ($validate->passed()) {
            $tid = Input::get('tid');
            $cid = Input::get('cid');
            $did = Input::get('did');
            $reject_msg = Input::get('reject_msg');
            $a = new Approval();
            $b = $a->reject($tid, $cid, $did, $reject_msg);
            if ($b === 1) {
                echo '<div class="alert alert-success alert-dismissible" role="alert">';
                echo 'Result rejected!';
                echo '</div>';
            } else {
                if ($b === 2) {
                    echo '<div class="alert alert-warning alert-dismissible" role="alert">';
                    echo 'You cannot reject because you have already approved this result.';
                    echo '</div>';
                } else {
                    if ($b === 0) {
                        echo '<div class="alert alert-danger alert-dismissible" role="alert">';
                        echo 'Temporary Problem!!';
                        echo '</div>';
Ejemplo n.º 23
0
     if (isset($_GET['class'])) {
         $class = 'class="required"';
     } else {
         $class = '';
     }
     $sel = new selectlist('Skill_Group_ID', $sg->getSkillGroupList(), 'Select Skill Group', 'Skill_Group_ID', 'Group_Desc', $class, '', '1');
     break;
 case 'auth':
     //machine list
     $au = new Authority();
     $au->createAuthorityList();
     $sel = new selectlist('Authority_ID', $au->getAuthorityList(), 'Select Authority Group', 'Authority_ID', 'Authority', '', '', '1');
     break;
 case 'approval':
     //machine list
     $app = new Approval();
     $app->setValue('skillgroup', $_GET['sgid']);
     $app->createApprovarList();
     $sel = new selectlist('Approver_ID', $app->getApprovarList(), 'Select Approver', 'Operator_ID', 'Operator_Name', '', '', '1');
     break;
 case 'idle':
     //machine list
     $act = new Activitylog();
     $act->createReasonList();
     $sel = new selectlist('Idle_ID', $act->getReasonList(), 'Select Idle Reason', 'Idle_ID', 'Idle_Reason', 'class="required"', '', '1');
     break;
 case 'nclog':
     //machine list
     $ncl = new NCLog();
     if (isset($_GET['class'])) {
         $class = 'class="required"';
Ejemplo n.º 24
0
 public static function handleApproval($datas)
 {
     $allApprovals = Approval::model()->fetchAllSortByPk("id");
     $allCategorys = ArticleCategory::model()->fetchAllSortByPk("catid");
     $artApprovals = ArticleApproval::model()->fetchAllGroupByArtId();
     $backArtIds = ArticleBack::model()->fetchAllBackArtId();
     foreach ($datas as &$art) {
         $art["back"] = in_array($art["articleid"], $backArtIds) ? 1 : 0;
         $art["approval"] = $art["approvalStep"] = array();
         $catid = $art["catid"];
         if (!empty($allCategorys[$catid]["aid"])) {
             $aid = $allCategorys[$catid]["aid"];
             if (!empty($allApprovals[$aid])) {
                 $art["approval"] = $allApprovals[$aid];
             }
         }
         if (!empty($art["approval"])) {
             $art["approvalName"] = !empty($art["approval"]) ? $art["approval"]["name"] : "";
             $art["artApproval"] = isset($artApprovals[$art["articleid"]]) ? $artApprovals[$art["articleid"]] : array();
             $art["stepNum"] = count($art["artApproval"]);
             $step = array();
             foreach ($art["artApproval"] as $artApproval) {
                 $step[$artApproval["step"]] = User::model()->fetchRealnameByUid($artApproval["uid"]);
             }
             for ($i = 1; $i <= $art["approval"]["level"]; $i++) {
                 if ($i <= $art["stepNum"]) {
                     $art["approval"][$i]["approvaler"] = isset($step[$i]) ? $step[$i] : "未知";
                 } else {
                     $levelName = Approval::model()->getLevelNameByStep($i);
                     $approvalUids = $art["approval"][$levelName];
                     $art["approval"][$i]["approvaler"] = User::model()->fetchRealnamesByUids($approvalUids, "、");
                 }
             }
         }
     }
     return $datas;
 }