<?php
/**
 * The control file of egress module of ZDOO.
 *
 * @copyright   Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Gang Liu <liugang@cnezsoft.com>
 * @package     egress
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
include_once dirname(dirname(__FILE__)) . '/trip/control.php';
class egress extends trip
{
    /**
     * The __construct function.
     *
     * @param  string $moduleName
     * @param  string $methodName
     * @param  string $appName
     * @access public
     * @return void
     */
    public function __construct($moduleName = '', $methodName = '', $appName = '')
    {
        parent::__construct($moduleName, $methodName, $appName);
        $this->loadModel('trip');
        $this->type = 'egress';
    }

    /**
     * The index function.
     *
     * @access public
     * @return void
     */
    public function index()
    {
        $this->locate(inlink('personal'));
    }

    /**
     * Browse personal's egresses.
     *
     * @param  string $date
     * @param  string $orderBy
     * @param  int    $recTotal
     * @param  int    $recPerPage
     * @param  int    $pageID
     * @access public
     * @return void
     */
    public function personal($date = 'latest', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
    {
        echo $this->fetch('egress', 'browse', "mode=personal&date=$date&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID", 'oa');
    }

    /**
     * Browse department's egresses.
     *
     * @param  string $date
     * @param  string $orderBy
     * @param  int    $recTotal
     * @param  int    $recPerPage
     * @param  int    $pageID
     * @access public
     * @return void
     */
    public function department($date = 'latest', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
    {
        echo $this->fetch('egress', 'browse', "mode=department&date=$date&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID", 'oa');
    }

    /**
     * Browse egresses to review.
     *
     * @param  string  $date
     * @param  string $orderBy
     * @param  int    $recTotal
     * @param  int    $recPerPage
     * @param  int    $pageID
     * @access public
     * @return void
     */
    public function browseReview($date = 'latest', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
    {
        echo $this->fetch('egress', 'browse', "mode=browseReview&date=$date&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID", 'oa');
    }

    /**
     * Browse company's egresses.
     *
     * @param  string $date
     * @param  string $orderBy
     * @param  int    $recTotal
     * @param  int    $recPerPage
     * @param  int    $pageID
     * @access public
     * @return void
     */
    public function company($date = 'latest', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
    {
        echo $this->fetch('egress', 'browse', "mode=company&date=$date&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID", 'oa');
    }

    /**
     * create trip.
     *
     * @param  string $customers
     * @access public
     * @return void
     */
    public function create($customers = '')
    {
        parent::create($customers);
    }

    /**
     * Edit trip.
     *
     * @param  int    $id
     * @param  string $customers
     * @access public
     * @return void
     */
    public function edit($id, $customers = '')
    {
        parent::edit($id, $customers);
    }

    /**
     * Delete trip.
     *
     * @param  int    $id
     * @access public
     * @return void
     */
    public function delete($id)
    {
        parent::delete($id);
    }

    /**
     * Detail view of a trip.
     *
     * @param  int    $id
     * @param  string $type
     * @access public
     * @return void
     */
    public function view($id, $type = '')
    {
        parent::view($id, $type);
    }

    /**
     * Set reviewer.
     *
     * @param  string $module 
     * @access public
     * @return void
     */
    public function setReviewer($module = '')
    {
        parent::setReviewer($module);
    }
}
