Exemple #1
0
 /**
  * Create a new Color
  *
  * @param    string    $pARGB            ARGB value for the colour
  * @param    boolean    $isSupervisor    Flag indicating if this is a supervisor or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  * @param    boolean    $isConditional    Flag indicating if this is a conditional style or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  */
 public function __construct($pARGB = self::COLOR_BLACK, $isSupervisor = false, $isConditional = false)
 {
     //    Supervisor?
     parent::__construct($isSupervisor);
     //    Initialise values
     if (!$isConditional) {
         $this->argb = $pARGB;
     }
 }
 /**
  * Create a new Protection
  *
  * @param    boolean    $isSupervisor    Flag indicating if this is a supervisor or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  * @param    boolean    $isConditional    Flag indicating if this is a conditional style or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  */
 public function __construct($isSupervisor = false, $isConditional = false)
 {
     // Supervisor?
     parent::__construct($isSupervisor);
     // Initialise values
     if (!$isConditional) {
         $this->locked = self::PROTECTION_INHERIT;
         $this->hidden = self::PROTECTION_INHERIT;
     }
 }
Exemple #3
0
 /**
  * Create a new Border
  *
  * @param    boolean    $isSupervisor    Flag indicating if this is a supervisor or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  * @param    boolean    $isConditional    Flag indicating if this is a conditional style or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  */
 public function __construct($isSupervisor = false, $isConditional = false)
 {
     // Supervisor?
     parent::__construct($isSupervisor);
     // Initialise values
     $this->color = new Color(Color::COLOR_BLACK, $isSupervisor);
     // bind parent if we are a supervisor
     if ($isSupervisor) {
         $this->color->bindParent($this, 'color');
     }
 }
Exemple #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCodigoSupervisors()
 {
     return $this->hasMany(Supervisor::className(), ['codigoSupervisor' => 'codigoSupervisor'])->viaTable('Ingresa', ['codigoProducto' => 'codigoProducto']);
 }
function getSupervisorOfCenter()
{
    include "supervisor.php";
    $id = $_REQUEST['id'];
    $obj = new Supervisor();
    if (!$obj->getSupervisorOfCenter($id)) {
        echo '{"result":0,"message": "failed to display"}';
        return;
    }
    //at this point the search has been successful.
    //generate the JSON message to echo to the browser
    $row = $obj->fetch();
    echo '{"result":1,"supervisor":[';
    //start of json object
    while ($row) {
        echo json_encode($row);
        //convert the result array to json object
        $row = $obj->fetch();
        if ($row) {
            echo ",";
            //if there are more rows, add comma
        }
    }
    echo "]}";
}
Exemple #6
0
 /**
  * Create a new Font
  *
  * @param    boolean    $isSupervisor    Flag indicating if this is a supervisor or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  * @param    boolean    $isConditional    Flag indicating if this is a conditional style or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  */
 public function __construct($isSupervisor = false, $isConditional = false)
 {
     // Supervisor?
     parent::__construct($isSupervisor);
     // Initialise values
     if ($isConditional) {
         $this->name = null;
         $this->size = null;
         $this->bold = null;
         $this->italic = null;
         $this->superScript = null;
         $this->subScript = null;
         $this->underline = null;
         $this->strikethrough = null;
         $this->color = new Color(Color::COLOR_BLACK, $isSupervisor, $isConditional);
     } else {
         $this->color = new Color(Color::COLOR_BLACK, $isSupervisor);
     }
     // bind parent if we are a supervisor
     if ($isSupervisor) {
         $this->color->bindParent($this, 'color');
     }
 }
Exemple #7
0
    /**
     * Self Referencing
     */
    function self_referencing()
    {
        echo '<h1>Self Referencing Relationships</h1>';
        echo '<p>DataMapper allows you to have a model setup with a relationship to its self (hence, self referencing).</p>';
        echo '<p>Take a look at the Employee, Manager, Supervisor, and Underling models included in the DataMapper download.  You\'ll notice they all have references back to the employees table (with their inheritance of the Employee model). The relationships they\'re setup with are:</p>';
        echo '<ul><li>A Manager manages Many Supervisors.</li><li>A Supervisor has One Manager.</li><li>A Supervisor supervises Many Underlings.</li><li>An Underling has One Supervisor.</li></ul>';
        echo '<hr />';
        echo '<p>Here we create a number of different types of employees.</p>';
        echo '<code>
		// Create Manager<br />
		$m = new Manager();<br />
		$m->first_name = \'Jake\';<br />
		$m->last_name = \'Ronalds\';<br />
		$m->position = \'Manager\';<br />
		$m->save();<br />
		<br />
		<br />
		// Create Supervisors<br />
		$s = new Supervisor();<br />
		$s->first_name = \'Bob\';<br />
		$s->last_name = \'Thomas\';<br />
		$s->position = \'Supervisor\';<br />
		$s->save();<br />
		<br />
		$s = new Supervisor();<br />
		$s->first_name = \'Sarah\';<br />
		$s->last_name = \'Parker\';<br />
		$s->position = \'Supervisor\';<br />
		$s->save();<br />
		<br />
		<br />
		// Create Underlings<br />
		$u = new Underling();<br />
		$u->first_name = \'Fred\';<br />
		$u->last_name = \'Smith\';<br />
		$u->position = \'Underling\';<br />
		$u->save();<br />
		<br />
		$u = new Underling();<br />
		$u->first_name = \'Jayne\';<br />
		$u->last_name = \'Doe\';<br />
		$u->position = \'Underling\';<br />
		$u->save();<br />
		<br />
		$u = new Underling();<br />
		$u->first_name = \'Joe\';<br />
		$u->last_name = \'Public\';<br />
		$u->position = \'Underling\';<br />
		$u->save();<br />
		<br />
		$u = new Underling();<br />
		$u->first_name = \'Sam\';<br />
		$u->last_name = \'Rogers\';<br />
		$u->position = \'Underling\';<br />
		$u->save();</code>';
        // Create Manager
        $m = new Manager();
        $m->first_name = 'Jake';
        $m->last_name = 'Ronalds';
        $m->position = 'Manager';
        $m->save();
        // Create Supervisors
        $s = new Supervisor();
        $s->first_name = 'Bob';
        $s->last_name = 'Thomas';
        $s->position = 'Supervisor';
        $s->save();
        $s = new Supervisor();
        $s->first_name = 'Sarah';
        $s->last_name = 'Parker';
        $s->position = 'Supervisor';
        $s->save();
        // Create Underlings
        $u = new Underling();
        $u->first_name = 'Fred';
        $u->last_name = 'Smith';
        $u->position = 'Underling';
        $u->save();
        $u = new Underling();
        $u->first_name = 'Jayne';
        $u->last_name = 'Doe';
        $u->position = 'Underling';
        $u->save();
        $u = new Underling();
        $u->first_name = 'Joe';
        $u->last_name = 'Public';
        $u->position = 'Underling';
        $u->save();
        $u = new Underling();
        $u->first_name = 'Sam';
        $u->last_name = 'Rogers';
        $u->position = 'Underling';
        $u->save();
        echo '<hr />';
        echo '<p>Now we\'ll set up some relationships.</p>';
        echo '<code>// Get the first Supervisor<br />
		$s = new Supervisor();<br />
		$s->get(1);<br />
		<br />
		// Get first 2 Underlings<br />
		$u = new Underling();<br />
		$u->get(2);<br />
		<br />
		// Setup Supervisor to supervise those Underlings<br />
		$s->save($u->all);<br />
		<br />
		<br />
		// Get the second Supervisor<br />
		$s = new Supervisor();<br />
		$s->get(1, 1);<br />
		<br />
		// Get the other 2 Underlings<br />
		$u = new Underling();<br />
		$u->get(2, 2);<br />
		<br />
		// Setup Supervisor to supervise those Underlings<br />
		$s->save($u->all);<br />
		<br />
		<br />
		// Get the Manager<br />
		$m = new Manager();<br />
		$m->get();<br />
		<br />
		// Get the Supervisors<br />
		$s = new Supervisor();<br />
		$s->get();<br />
		<br />
		// Setup Manager to manage those Supervisors<br />
		$m->save($s->all);</code>';
        // Get the first Supervisor
        $s = new Supervisor();
        $s->get(1);
        // Get first 2 Underlings
        $u = new Underling();
        $u->get(2);
        // Setup Supervisor to supervise those Underlings
        $s->save($u->all);
        // Get the second Supervisor
        $s = new Supervisor();
        $s->get(1, 1);
        // Get the other 2 Underlings
        $u = new Underling();
        $u->get(2, 2);
        // Setup Supervisor to supervise those Underlings
        $s->save($u->all);
        // Get the Manager
        $m = new Manager();
        $m->get();
        // Get the Supervisors
        $s = new Supervisor();
        $s->get();
        // Setup Manager to manage those Supervisors
        $m->save($s->all);
        echo '<hr />';
        echo '<p>Now that we\'ve got our relationships setup, let\'s show how they\'re related to each other:</p>';
        echo '<code>$m = new Manager();<br />
		$m->get();<br />
		<br />
		echo $m->full_name() . \' is a \' . $m->position . \' who manages these Supervisors:&lt;br /&gt;\';<br />
		<br />
		$m->supervisor->get();<br />
		<br />
		foreach ($m->supervisor->all as $s)<br />
		{
		&nbsp;&nbsp;&nbsp;&nbsp;echo \'&nbsp;&nbsp;&nbsp;&nbsp;\' . $s->full_name() . \' is a \' . $s->position . \' who supervises these Underlings:&lt;br /&gt;\';<br />
			<br />
		&nbsp;&nbsp;&nbsp;&nbsp;$s->underling->get();<br />
			<br />
		&nbsp;&nbsp;&nbsp;&nbsp;foreach ($s->underling->all as $u)<br />
		&nbsp;&nbsp;&nbsp;&nbsp;{<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo \'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\' . $u->full_name() . \' is an \' . $u->position . \'&lt;br /&gt;\';<br />
		&nbsp;&nbsp;&nbsp;&nbsp;}<br />
		}</code>';
        echo '<hr />';
        echo '<p>This produces:</p>';
        $m = new Manager();
        $m->get();
        echo $m->full_name() . ' is a ' . $m->position . ' who manages these Supervisors:<br />';
        $m->supervisor->get();
        foreach ($m->supervisor->all as $s) {
            echo '&nbsp;&nbsp;&nbsp;&nbsp;' . $s->full_name() . ' is a ' . $s->position . ' who supervises these Underlings:<br />';
            $s->underling->get();
            foreach ($s->underling->all as $u) {
                echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $u->full_name() . ' is an ' . $u->position . '<br />';
            }
        }
        echo '<hr />';
        echo '<p>If we wanted to look at Sam Rogers\' supervisor and their supervisors manager, we could do:</p>';
        echo '<code>$u = new Underling();<br />
		$u->where(\'first_name\', \'Sam\')->where(\'last_name\', \'Rogers\')->get();<br />
		<br />
		$u->supervisor->get();<br />
		$u->supervisor->manager->get();<br />
		<br />
		echo $u->full_name . \' is supervised by \' . $u->supervisor->full_name() . \' who is in turn managed by \' . $u->supervisor->manager->full_name() . \'&lt;br /&gt;\';</code>';
        echo '<hr />';
        echo '<p>This produces:</p>';
        $u = new Underling();
        $u->where('first_name', 'Sam')->where('last_name', 'Rogers')->get();
        $u->supervisor->get();
        $u->supervisor->manager->get();
        echo $u->full_name() . ' is supervised by ' . $u->supervisor->full_name() . ' who is in turn managed by ' . $u->supervisor->manager->full_name() . '<br />';
        echo '<hr />';
        echo '<p>Ok, so let\'s do something different and show the total number of Managers:</p>';
        echo '<code>echo $m . \' count: \' . $m->count() . \'&nbsp;br /&nbsp;\';</code>';
        echo '<hr />';
        echo '<p>This produces:</p>';
        echo $m . ' count: ' . $m->count() . '<br />';
        echo '<hr />';
        echo '<p>Now let\'s show how many supervisors are related to ' . $m . ' ' . $m->full_name() . ':</p>';
        echo '<code>echo $m . \' \' . $m->full_name() . \' supervises \' .  $m->supervisor->count() . \' \' . plural($m->supervisor) . \'&lt;br /&gt;\' ;</code>';
        echo '<hr />';
        echo '<p>This produces:</p>';
        echo $m . ' ' . $m->full_name() . ' manages ' . $m->supervisor->count() . ' ' . plural($m->supervisor) . '.<br />';
        echo '<hr />';
        echo '<p>The total counts:</p>';
        echo ucfirst(plural($m)) . ': ' . $m->count() . '<br />';
        echo ucfirst(plural($s)) . ': ' . $s->count() . '<br />';
        echo ucfirst(plural($u)) . ': ' . $u->count() . '<br />';
        echo '<p><a href="' . site_url('examples') . '">Back to Examples</a></p>';
    }
 /**
  * Create a new Alignment
  *
  * @param    boolean    $isSupervisor    Flag indicating if this is a supervisor or not
  *                                       Leave this value at default unless you understand exactly what
  *                                          its ramifications are
  * @param    boolean    $isConditional   Flag indicating if this is a conditional style or not
  *                                       Leave this value at default unless you understand exactly what
  *                                          its ramifications are
  */
 public function __construct($isSupervisor = false, $isConditional = false)
 {
     // Supervisor?
     parent::__construct($isSupervisor);
     if ($isConditional) {
         $this->horizontal = null;
         $this->vertical = null;
         $this->textRotation = null;
     }
 }
 public function compose()
 {
     $kelas = new Kelas();
     $arrKelas = $kelas->getWhere("kelas_aktiv = 1 ORDER BY kelas_id ASC", "kelas_id,kelas_name");
     $guru = new Guru();
     $arrGuru = $guru->getWhere("guru_aktiv = 1 ORDER BY nama_depan ASC", "guru_id,account_id,nama_depan");
     $supervisor = new Supervisor();
     $arrSupervisor = $supervisor->getWhere("supervisor_aktiv = 1 ORDER BY nama_depan ASC", "supervisor_id,account_id,nama_depan");
     $tatausaha = new Tatausaha();
     $arrTU = $tatausaha->getWhere("tu_aktiv = 1 ORDER BY nama_depan ASC", "tu_aktiv,account_id,nama_depan");
     $admin = new Admin();
     $arrAdmin = $admin->getWhere("sys_aktiv = 1 ORDER BY nama_depan ASC", "sys_id,account_id,nama_depan");
     $t = time();
     $return['arrTU'] = $arrTU;
     $return['arrSupervisor'] = $arrSupervisor;
     $return['arrAdmin'] = $arrAdmin;
     $return['arrGuru'] = $arrGuru;
     $return['arrKelas'] = $arrKelas;
     $return['method'] = __FUNCTION__;
     $return['webClass'] = __CLASS__;
     $return['byID'] = 0;
     Mold::both("inbox/compose", $return);
 }
 public function browseStaff()
 {
     $guru = new Guru();
     $arrGuru = $guru->getWhere("guru_aktiv = 1 ORDER BY nama_depan ASC", "guru_id,account_id,nama_depan,foto");
     $supervisor = new Supervisor();
     $arrSupervisor = $supervisor->getWhere("supervisor_aktiv = 1 ORDER BY nama_depan ASC", "supervisor_id,account_id,nama_depan,foto");
     $tatausaha = new Tatausaha();
     $arrTU = $tatausaha->getWhere("tu_aktiv = 1 ORDER BY nama_depan ASC", "tu_aktiv,account_id,nama_depan,foto");
     $admin = new Admin();
     $arrAdmin = $admin->getWhere("sys_aktiv = 1 ORDER BY nama_depan ASC", "sys_id,account_id,nama_depan,foto");
     $t = time();
     $return['arrTU'] = $arrTU;
     $return['arrSupervisor'] = $arrSupervisor;
     $return['arrAdmin'] = $arrAdmin;
     $return['arrGuru'] = $arrGuru;
     $return['method'] = __FUNCTION__;
     $return['webClass'] = __CLASS__;
     Mold::both("leap/browseStaff", $return);
 }
Exemple #11
0
 /**
  * Create a new Borders
  *
  * @param    boolean    $isSupervisor    Flag indicating if this is a supervisor or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  * @param    boolean    $isConditional    Flag indicating if this is a conditional style or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  */
 public function __construct($isSupervisor = false, $isConditional = false)
 {
     // Supervisor?
     parent::__construct($isSupervisor);
     // Initialise values
     $this->left = new Border($isSupervisor, $isConditional);
     $this->right = new Border($isSupervisor, $isConditional);
     $this->top = new Border($isSupervisor, $isConditional);
     $this->bottom = new Border($isSupervisor, $isConditional);
     $this->diagonal = new Border($isSupervisor, $isConditional);
     $this->diagonalDirection = self::DIAGONAL_NONE;
     // Specially for supervisor
     if ($isSupervisor) {
         // Initialize pseudo-borders
         $this->allBorders = new Border(true);
         $this->outline = new Border(true);
         $this->inside = new Border(true);
         $this->vertical = new Border(true);
         $this->horizontal = new Border(true);
         // bind parent if we are a supervisor
         $this->left->bindParent($this, 'left');
         $this->right->bindParent($this, 'right');
         $this->top->bindParent($this, 'top');
         $this->bottom->bindParent($this, 'bottom');
         $this->diagonal->bindParent($this, 'diagonal');
         $this->allBorders->bindParent($this, 'allBorders');
         $this->outline->bindParent($this, 'outline');
         $this->inside->bindParent($this, 'inside');
         $this->vertical->bindParent($this, 'vertical');
         $this->horizontal->bindParent($this, 'horizontal');
     }
 }
 /**
  * Create a new NumberFormat
  *
  * @param    boolean    $isSupervisor    Flag indicating if this is a supervisor or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  * @param    boolean    $isConditional    Flag indicating if this is a conditional style or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  */
 public function __construct($isSupervisor = false, $isConditional = false)
 {
     // Supervisor?
     parent::__construct($isSupervisor);
     if ($isConditional) {
         $this->formatCode = null;
         $this->builtInFormatCode = false;
     }
 }
Exemple #13
0
 /**
  * Create a new Fill
  *
  * @param    boolean    $isSupervisor    Flag indicating if this is a supervisor or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  * @param    boolean    $isConditional    Flag indicating if this is a conditional style or not
  *                                    Leave this value at default unless you understand exactly what
  *                                        its ramifications are
  */
 public function __construct($isSupervisor = false, $isConditional = false)
 {
     // Supervisor?
     parent::__construct($isSupervisor);
     // Initialise values
     if ($isConditional) {
         $this->fillType = null;
     }
     $this->startColor = new Color(Color::COLOR_WHITE, $isSupervisor, $isConditional);
     $this->endColor = new Color(Color::COLOR_BLACK, $isSupervisor, $isConditional);
     // bind parent if we are a supervisor
     if ($isSupervisor) {
         $this->startColor->bindParent($this, 'startColor');
         $this->endColor->bindParent($this, 'endColor');
     }
 }
Exemple #14
0
 function getSupervisorMain()
 {
     $supervisor = new Supervisor($this->user);
     return $supervisor->getPage();
 }
Exemple #15
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCodigoSupervisors()
 {
     return $this->hasMany(Supervisor::className(), ['codigoSupervisor' => 'codigoSupervisor'])->viaTable('Asigna', ['codigoBono' => 'codigoBono']);
 }
Exemple #16
0
 public function postSavenewsupervisor()
 {
     $supervisor = new Supervisor();
     $supervisor_stations = "";
     if (Input::get('supervisor_stations') != null) {
         $supervisor_stations = implode(",", Input::get('supervisor_stations'));
     }
     $supervisor->name = Input::get('supervisor_name');
     $supervisor->posting = Input::get('posting');
     $supervisor->role = Input::get('role');
     $supervisor->designation = Input::get('desig_id');
     $supervisor->jurisdiction = $supervisor_stations;
     $supervisor->save();
     return Response::json($supervisor);
 }