Example #1
0
 public function getCalendarResources($connection, $group)
 {
     $personnel = new Personnel();
     $clients = new Clients();
     $personnel_list = $personnel->find(null, $connection);
     $client_list = $clients->find(null, $connection);
     $resources = [];
     switch ($group) {
         case 'Client':
             foreach ($client_list as $clientRecord) {
                 foreach ($personnel_list as $personnelRecord) {
                     $r = [];
                     $r["id"] = $personnelRecord["id"];
                     $r["clientName"] = $clientRecord["name"];
                     $r["title"] = $personnelRecord["name"];
                     $resources[] = $r;
                 }
             }
             break;
         default:
             foreach ($personnel_list as $personnelRecord) {
                 foreach ($client_list as $clientRecord) {
                     $r = [];
                     $r["id"] = $clientRecord["id"];
                     $r["personnelName"] = $personnelRecord["name"];
                     $r["title"] = $clientRecord["name"];
                     $resources[] = $r;
                 }
             }
             break;
     }
     $resources = json_encode($resources);
     return $resources;
 }
Example #2
0
 public function beforeSave()
 {
     if (!$this->isNewRecord) {
         $user = Personnel::model()->findByPk($this->personnel_id);
         if (!$this->isValidMd5($this->password)) {
             $this->password = md5($this->password);
         }
     } else {
         $this->password = md5($this->password);
     }
     return parent::beforeSave();
 }
 /**
  * Authenticates a user.
  * The example implementation makes sure if the username and password
  * are both 'demo'.
  * In practical applications, this should be changed to authenticate
  * against some persistent user identity storage (e.g. database).
  * @return boolean whether authentication succeeds.
  */
 public function authenticate()
 {
     $user = Personnel::model()->findByAttributes(array('username' => $this->username));
     if (!isset($user)) {
         $this->errorCode = self::ERROR_USERNAME_INVALID;
     } elseif ($user->password !== md5($this->password)) {
         $this->errorCode = self::ERROR_PASSWORD_INVALID;
     } else {
         $this->errorCode = self::ERROR_NONE;
         $this->_id = $user->personnel_id;
         $this->setState('backEnd', true);
     }
     return !$this->errorCode;
 }
Example #4
0
<li class="extra">
    <?php 
echo CHtml::image(Yii::app()->params['pathUpload'] . $data->pic, '', array('style' => 'width: 100px;'));
?>
    <p> 
        <strong><?php 
echo $data->name;
?>
</strong>
        <label><?php 
echo $data->tel;
?>
</label>
        <b><a href="#show_detail_<?php 
echo $data->personnel_id;
?>
" rel='facebox'>Read More</a></b>
    </p>
    <div id="show_detail_<?php 
echo $data->personnel_id;
?>
" style='display: none;'>
        <?php 
echo CHtml::image(Yii::app()->params['pathUpload'] . $data->pic, '', array('style' => 'width: 600px;'));
$model = Personnel::model()->findByPk($data->personnel_id);
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('name', 'position.name', 'tel', array('name' => 'create_at', 'value' => Tools::DateTimeToShow($model->create_at, "/", false)))));
?>
    </div>
</li>

 public function loadModel($id)
 {
     $model = Personnel::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
 public function getPersonnelJson()
 {
     $users = Personnel::select('id', 'name', 'email', 'mobile')->paginate(2);
     return $users->toJson();
 }
Example #7
0
if (!isset($_SESSION)) {
    session_start();
}
/* Inclusions */
include_once "../kernel/personnel.php";
include_once "../kernel/group.php";
include_once "../kernel/sms.php";
/* Inclusions */
/* 
ilog Web App Shell
Author: Ewere Diagboya
Company: Wicee Solutions
Date/Time: 2015-03-27 4:34PM
*/
/* Instances */
$personnel = new Personnel();
$group = new Group();
$sms = new SMS();
/* Instances */
// POST Req/Resp - Process all POST Reqeusts
if (isset($_POST['cmd'])) {
    /* @var $_POST type */
    switch ($_POST['cmd']) {
        // Create Personnel
        // POST: CreatePersonnel
        case "newpersonnel":
            echo $personnel->CreatePersonnel();
            break;
            // Create Group
            // POST: CreateGroup
        // Create Group
Example #8
0
 public static function personnel($criteria = array())
 {
     return CHtml::listData(Personnel::model()->findAll($criteria), 'personnel_id', 'positionANDname');
 }
Example #9
0
 public function getMemberBackend()
 {
     $_members = array();
     $member = Personnel::model()->findAll();
     foreach ($member as $value) {
         array_push($_members, $value->username);
     }
     return $_members;
 }
                            </a>
                            <!-- Thumb Image and Description -->
                            <img src="<?php 
    echo Yii::app()->params['pathUpload'] . $car->pic;
    ?>
" alt="ทะเบียน : <?php 
    echo $car->license_no;
    ?>
">
                        </li>
                        <?php 
}
?>

                    <?php 
$drivers = Personnel::model()->driver()->findAll();
foreach ($drivers as $driver) {
    ?>
                        <li class="item-thumbs span3 driver">
                            <!-- Fancybox - Gallery Enabled - Title - Full Image -->
                            <a class="hover-wrap fancybox" data-fancybox-group="gallery" title="พนักงานขับรถ" href="<?php 
    echo Yii::app()->params['pathUpload'] . $driver->pic;
    ?>
">
                                <span class="overlay-img"></span>
                                <span class="overlay-img-thumb font-icon-plus"></span>
                            </a>
                            <!-- Thumb Image and Description -->
                            <img src="<?php 
    echo Yii::app()->params['pathUpload'] . $driver->pic;
    ?>