示例#1
0
 function generateCoWorkersListNotAddedInTeam($lastInsertedId)
 {
     $str_idco_workers = "";
     $cw_list = "";
     $coworkers = $this->getTeamCoWorkersId($lastInsertedId);
     if (count($coworkers)) {
         $str_idco_workers = implode(',', $coworkers);
     }
     $do_cw = new UserRelations();
     $do_cw->getAllCoWorkersNotInTeam($str_idco_workers);
     if ($do_cw->getNumRows()) {
         $cw_list .= "<div>You can add Co-Worker/s to this Team.</div>";
         while ($do_cw->next()) {
             $cw_list .= '<div><input type="checkbox" name="coworker" value="' . $do_cw->idcoworker . '" />' . $do_cw->firstname . ' ' . $do_cw->lastname . '</div>';
         }
     }
     if ($cw_list) {
         $cw_list .= '<div>';
         $cw_list .= '<input type="button" name="btnAddCoWorkers" id="btnAddCoWorkers" value="Add" onclick="addCoWorkerToTeam();" />';
         $cw_list .= '<input type="button" name="btnSkipCoWorkers" id="btnSkipCoWorkers"value="Skip" onclick="skipAddCoWorker();" />';
         $cw_list .= '<input type="hidden" name="idteam_users" id="idteam_users" value="' . $lastInsertedId . '"';
         $cw_list .= '</div>';
     } else {
         $cw_list = 'You do not have a Co-Worker.';
     }
     return $cw_list;
 }
示例#2
0
/> <br />
		 <input type="button" id="btnEditTeam" name="btnEditTeam" value="Edit" />
		 </div>
		 <!-- Edit Co-Worker/s-->
		 <div id="DivEditCW" style="display:none;margin-top:20px;">
<?php 
$e_cw = new Event("Teams->eventUpdateTeamCWs");
$e_cw->addParam("idteam", $idteam);
$e_cw->addParam("goto", "teams.php");
echo $e_cw->getFormHeader();
echo $e_cw->getFormEvent();
$arr_cw = $do_team->getTeamCoWorkersId($idteam);
$do_ur = new UserRelations();
$do_ur->getAllCoWorker();
if ($do_ur->getNumRows()) {
    while ($do_ur->next()) {
        ?>
<div><input type="checkbox" name="coworker[]" value="<?php 
        echo $do_ur->idcoworker;
        ?>
" <?php 
        if (in_array($do_ur->idcoworker, $arr_cw)) {
            echo "checked";
        }
        ?>
 /><?php 
        echo $do_ur->firstname . " " . $do_ur->lastname;
        ?>
</div>
<?php 
    }