Example #1
0
 echo '<div style="positon:relative;float:left;width:80%;margin:0px;"><a style="color:#C52EAD;" href="javascript:void(0)" onclick="showSharedDetail(\'' . $_SESSION['do_coworker']->idcoworker . '\');" >' . $_SESSION['do_coworker']->firstname . ' ' . $_SESSION['do_coworker']->lastname . '</a><br />' . $job_description . '</div>&nbsp;';
 $num_project_shared = $do_project->getNumProjectsShared($_SESSION["do_User"]->iduser, $_SESSION['do_coworker']->idcoworker);
 $no_proj_shared_by_co_worker = $do_project->getNumProjectsShared($_SESSION['do_coworker']->idcoworker, $_SESSION["do_User"]->iduser);
 echo '<div style="clear:both;padding:10px;"></div>';
 echo '<div class="feed_user_pic" style="overflow:hidden;">&nbsp;</div>
 <div id="' . $_SESSION['do_coworker']->idcoworker . '" style="display:none;width:80%;margin:0px;">';
 if ($no_cont_shared > 0) {
     //echo $e_shared_contacts_filter->getLink('<span>' . sprintf(_('You shared %d contacts') , $no_cont_shared) . '</span>&nbsp;' . sprintf(_('and %d projects') , $num_project_shared) . '&nbsp;&nbsp;');
     echo '<span>' . sprintf(_('You shared %d contacts'), $no_cont_shared) . '</span>&nbsp;' . sprintf(_('and %d projects'), $num_project_shared) . '&nbsp;&nbsp;';
 } else {
     echo '<span>' . sprintf(_('You shared %d contacts'), $no_cont_shared) . '</span>&nbsp;' . sprintf(_('and %d projects'), $num_project_shared) . '&nbsp;&nbsp;';
 }
 $do_user = new User();
 $do_contact = new Contact();
 $do_user->query("select idcontact from user where iduser = " . $_SESSION['do_coworker']->idcoworker);
 $do_user->getValues();
 if ($do_user->getNumRows() > 0) {
     $contact_id = $do_user->idcontact;
     if ($contact_id != '' || $contact_id != 0) {
         if ($do_contact->getId($contact_id)) {
             $user_picture = $do_contact->picture;
         }
     }
 }
 /*$do_contact->getUserContacts($_SESSION['do_coworker']->idcoworker);
       if($do_contact->getNumRows()){
 
       // while($do_contact->next()){
 
       $co_workers[] = $do_contact->idcoworker;
       $user_picture = $do_contact->picture;
$user->address->city = 'City';
$user->address->state = 'State';
$user->address->country = 'Country';
$user->address->insert();
YDDebugUtil::dump($user->address->getValues());
echo "<p>Done. Now I'll check again if I have any addresses.</p>";
// I reset all info so I'll just check with my ID
// The resetRelation method executes a reset at each related object
$user->resetRelation();
$user->id = 1;
$user->findRelation();
echo "<p>I have " . $user->count() . " address defined. I don't have to fetch it because<br>";
echo "single results are automatically fetched.</p>";
YDDebugUtil::dump($user->address->getValues());
echo "<p>And my info...</p>";
YDDebugUtil::dump($user->getValues());
echo "<p>Let's filter the results a little. We'll select only the id, name and the country.</p>";
$user->resetRelation();
$user->id = 1;
$user->addSelect('id', 'name');
$user->address->addSelect('country');
$user->findRelation();
echo "<p>Still have " . $user->count() . " address defined.</p>";
YDDebugUtil::dump($user->getValues());
YDDebugUtil::dump($user->address->getValues());
echo "<p>But we can get a single array with getRelationValues. By default this method<br>";
echo "returns the relation values with a prefix (the variable name).</p>";
YDDebugUtil::dump($user->getRelationValues());
echo "<p>You can take out this prefix setting false the prefix parameter, but is risky<br>";
echo "if you have same field names in different tables.</p>";
YDDebugUtil::dump($user->getRelationValues(false));