Example #1
0
                 $formation_id = 4;
                 break;
     
                 case 5: // PEI
                 $formation_id = 5;
                 break;
     
                 default: // Master
                 $formation_id = 3; 
             }*/
 } else {
     $login = $datas['login'] . '.' . $datas['promo'];
     $formation_id = 2;
 }
 $u->login($login);
 $u->addStudy($formation_id, $datas['promo'], (int) $datas['promo'] + 4, $datas['promo'], $login);
 // Linking with the nationality
 if (!empty($datas['nationalite'])) {
     $nf = new GroupFilter(new GFC_Name('nation_' . conv_name($datas['nationalite'])));
     $n = $nf->get(true);
     if ($n) {
         $n->select(GroupSelect::castes());
         $n->caste(Rights::member())->addUser($u);
     }
 }
 // Linking with the sport
 /*    if (!empty($datas['sport'])) {
         $nf = new GroupFilter(new GFC_Name('sport_' . conv_name($datas['sport'])));
         $n = $nf->get(true);
         $n->select(GroupSelect::castes());
         $n->caste(Rights::member())->addUser($u);
Example #2
0
         break;
     case "PEI":
         // PEI
         $formation_id = 5;
         break;
     case "Supop":
         // Supop
         $formation_id = 6;
         break;
     default:
         // Master
         $formation_id = 3;
 }
 $u->login($login);
 $u->hruid($login);
 $u->addStudy($formation_id, $year_in === null ? (int) $datas[$promo] : (int) $datas[$year_in], $year_out === null ? (int) $datas[$promo] + 4 : (int) $datas[$year_out], $datas[$promo], $login);
 // Linking with the nationality
 if ($nationality != null) {
     if (!empty($datas[$nationality])) {
         echo conv_name($datas[$nationality]);
         $nf = new GroupFilter(new GFC_Name('nation_' . conv_name($datas[$nationality])));
         $n = $nf->get(true);
         if ($n) {
             $n->select(GroupSelect::castes());
             $n->caste(Rights::member())->addUser($u);
         }
     }
 }
 // Linking with the sport
 if ($sport != null) {
     $nf = new GroupFilter(new GFC_Name('sport_' . conv_name($datas[$sport])));