public function trackState($task, $state, $userId = 1)
 {
     $this->set_log_date(date("Y-m-d"));
     $this->set_log_state($state);
     $this->set_log_task($task);
     if ($userId == 1) {
         $user = new main_users();
         $user->getUserByKey();
         $this->set_log_user($user->get_use_id());
     } else {
         $this->set_log_user($userId);
     }
     $this->insertOne();
 }
 public function autoAssign($task)
 {
   $user = new main_users();
   $user->getUserByKey($_SESSION["key"]);
   $this->sql = "UPDATE main_tasks SET task_user = "******", task_state = 1 WHERE task_id = ".$task;
   if($user->get_use_pushover() != "")
   {
       $push = new pushover();
       $push->key = $user->get_use_pushover();
       $push->message = "New task assigned.";
       $push->push();
   }
   $this->query();
   // Log
   $log = new main_logs();
   $log->trackState($task, 1);
   
 }
<?
// ######################################################################
// list for main_users table
// Built with ListBuilder by Mauricio Giraldo Mutis
// http://www.bymurdock.com
// This class was built on: 12/03/2012 11:12:18
// ClassBuilder classes requires ConDB v.2.0 or later
// Class builder is Open Source, but for copyright issues, please keep
// this copy on any class that uses it.
// (R) 2005-2012
// ######################################################################
require "framework.php";
$db_main_users = new main_users;
$db_main_users->getAllUsers();
?>

<ul class="breadcrumb">
          <li><a href="#" class="active">Users</a></li>
        </ul>

<table width="100%"  border="0" cellspacing="1" cellpadding="1" class="table table-striped table-bordered">
  <tr id="listInsert">
    <td colspan="7"><a href="index.php?load=user.do&do=insert" class="btn btn-success btn-large">Add User</a></td>
  </tr>

  <tr id="listHeader">
    <td>Name</td>
    <td>Email</td>
    <td>Team</td>
    <td>WIP Tasks</td>
    <td>Load Units</td>
<script language="javascript" src="js/main.js"></script>
<form action="index.php?load=team.do" method="post" name="do_main_teams" id="do_main_teams" onSubmit="return validate_types(this);">
  <table width="100%"  border="0" cellspacing="1" cellpadding="1" class="table table-striped table-bordered">
    <tr>
      <td>Name</td>
      <td><input name="team_name" type="text" id="team_name" value="<?php 
echo $db_main_teams->get_team_name();
?>
" maxlength="100"></td>
    </tr>
    
    <tr>
      <td>Scrum-master/Team leader</td>
      <td>
          <?
        $users = new main_users();
        $users->getAll();
        print $users->dropdown("team_leader", "use_id", "use_name", $db_main_teams->get_team_leader());
        ?>
      </td>
    </tr>
    
    <tr>
      <td>Notify about changes?</td>
      <td>
          <?
          $dd = new utils();
          $dd->renderActivation("team_notify", $db_main_teams->get_team_notify());
          ?>
      </td>
    </tr>
        $dd->renderActivation("pro_status", $db_main_projects->get_pro_status());
        ?>
        </td>
    </tr>
    <tr>
      <td>GitHub Repository</td>
      <td><input name="pro_github_repo" type="text" id="pro_github_repo" value="<?php 
echo $db_main_projects->get_pro_github_repo();
?>
" maxlength="100"> (Optional)</td>
    </tr>
    <tr>
      <td>GitHub Repo User</td>
      <td>
          <?
        $users = new main_users();
        $users->getAllGitHubUsers();
        print $users->dropdown("pro_github_user", "use_id", "use_name", $db_main_projects->get_pro_github_user());
        ?> (Optional)
      </td>
    </tr>
    <tr>
      <td> </td>
      <td>
<?
        $form_name = "do_main_projects";
        include("bottom.edition.php")
        ?>
      <input name="do" type="hidden" id="do" value="<?php 
echo $_GET["do"];
?>