PHP User::gender Examples

PHP User::gender - 7 examples found. These are the top rated real world PHP examples of User::gender extracted from open source projects. You can rate examples to help us improve the quality of examples.
 public function postLogVisit()
 {
     $input = Input::all();
     $user_id = Helper::userId();
     //get user environment information
     $data = ['ip_address' => Helper::getIP(), 'referrer_url' => $input['referrer_url'], 'page_url' => $input['page_url'], 'latitude' => $input['latitude'], 'longitude' => $input['longitude'], 'browser' => $input['browser'], 'operating_system' => $input['operating_system'], 'screen_size' => $input['screen_size']];
     //get user data
     if ($user_id) {
         $birthdate = User::birthdate($user_id);
         $data['gender'] = User::gender($user_id);
         $data['nationality'] = User::nationality($user_id);
         $data['civil_status'] = User::civil_status($user_id);
         $data['birth_day'] = $birthdate ? date('d', $birthdate) : null;
         $data['birth_month'] = $birthdate ? date('m', $birthdate) : null;
         $data['birth_year'] = $birthdate ? date('Y', $birthdate) : null;
         $data['age'] = User::age($user_id);
     }
     //get page information
     $url_data = explode('/', $input['page_url']);
     if ($url_data[3] == 'broadcast' && $url_data[4] == 'business') {
         $business_id = $url_data[5];
         $data['business_id'] = $business_id;
         try {
             $data['industry'] = Business::industry($business_id);
             $data['local_address'] = Business::localAddress($business_id);
         } catch (Exception $e) {
         }
     }
     $log_data = ['user_id' => Helper::userId(), 'action_type' => 'page_view', 'value' => serialize($data)];
     $id = Watchdog::createRecord($log_data);
     return json_encode(['success' => 1, 'log_id' => $id]);
 }
Example #2
0
  /**
   * Ajout des utilisateurs à la base de données
   * @param $user User instance de la classe User
   **/
  public function add(User $user)
  {
      $q = $this->_db->prepare('INSERT INTO User 
	SET name = :name, 
		email = :email, 
		password = :password,
		gender = :gender,
		description = :description');
      $q->bindValue(':name', $user->name());
      $q->bindValue(':email', $user->email());
      $q->bindValue(':password', $user->password());
      $q->bindValue(':gender', $user->gender());
      $q->bindValue(':description', $user->description());
      $q->execute();
      $user->hydrate(['id' => $this->_db->lastInsertId()]);
      echo "Création du profil, avec succès";
  }
Example #3
0
  /**
   * Ajout des utilisateurs à la base de données
   * @param $user User instance de la classe User
   **/
  public function add(User $user)
  {
      $q = $this->_db->prepare('INSERT INTO User 
	SET name = :name, 
		email = :email, 
		password = :password,
		gender = :gender,
		description = :description,
		nationalityId = :country,
		cityId = :city');
      $q->bindValue(':name', $user->name());
      $q->bindValue(':email', $user->email());
      $q->bindValue(':password', $user->password());
      $q->bindValue(':gender', $user->gender());
      $q->bindValue(':description', $user->description());
      $q->bindValue(':country', $user->nationalityId());
      $q->bindValue(':city', $user->cityId());
      $q->execute();
      $user->setId($this->_db->lastInsertId());
      echo _('Your account has been created');
  }
Example #4
0
                               promo, email,
                               SUBSTR(email, 1, LENGTH(email) - 18) AS hruid
                         FROM  dev.temp_tol_2k10');
$users = $iter->total();
$k = 0;
while ($datas = $iter->next()) {
    $t = microtime(true);
    // Creating the User
    $u = new User();
    $u->insert();
    //    $u->password($datas['passwd'], false);
    $u->firstname(ucwords(strtolower(conv($datas['prenom']))));
    $u->lastname(ucwords(strtolower(conv($datas['nom']))));
    //    $u->nickname(conv($datas['surnom']));
    //    $u->birthdate(new FrankizDateTime($datas['date_nais']));
    $u->gender($datas['sexe'] == 'F' ? User::GENDER_FEMALE : User::GENDER_MALE);
    if (!empty($datas['email'])) {
        $u->email($datas['email']);
    }
    $u->skin('default');
    //setting default minimodules
    XDB::execute('INSERT INTO users_minimodules (uid,name,col,row) VALUES
                              ({?}, "birthday",     "COL_LEFT",   0 )', $u->id());
    XDB::execute('INSERT INTO users_minimodules (uid,name,col,row) VALUES
                              ({?}, "days",         "COL_LEFT",   1 )', $u->id());
    XDB::execute('INSERT INTO users_minimodules (uid,name,col,row) VALUES
                              ({?}, "ik",           "COL_LEFT",   2 )', $u->id());
    XDB::execute('INSERT INTO users_minimodules (uid,name,col,row) VALUES
                              ({?}, "qdj",          "COL_MIDDLE", 0 )', $u->id());
    XDB::execute('INSERT INTO users_minimodules (uid,name,col,row) VALUES
                              ({?}, "jtx",          "COL_MIDDLE", 1 )', $u->id());
Example #5
0
?>
                <?php 
echo CHtml::activeFileField($model, 'foto');
?>
                <?php 
echo $form->error($model, 'foto');
?>
         </div>


	<div class="row">
		<?php 
echo $form->labelEx($model, 'gender');
?>
		<?php 
echo $form->dropDownList($model, 'gender', User::gender(), array('prompt' => '- Choose -', 'style' => 'width: 200px; '));
?>
		<?php 
echo $form->error($model, 'gender');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'alamat');
?>
		<?php 
echo $form->textField($model, 'alamat', array('size' => 50, 'maxlength' => 50));
?>
		<?php 
echo $form->error($model, 'alamat');
Example #6
0
$group = $gf->get(true)->select(GroupSelect::castes());
$tol_caste = $group->caste(Rights::everybody());
$fic = fopen($file, 'rb');
$k = 0;
for ($datas = fgetcsv($fic, 1024, ','); !feof($fic); $datas = fgetcsv($fic, 1024, ',')) {
    $t = microtime(true);
    // Creating the User
    $u = new User();
    $u->insert();
    //    $u->password($datas['passwd'], false);
    $u->firstname(ucwords(strtolower(conv($datas[$firstname]))));
    $u->lastname(ucwords(strtolower(conv($datas[$lastname]))));
    //    $u->nickname(conv($datas['surnom']));
    $u->birthdate(new FrankizDateTime($datas[$birthdate]));
    if ($gender != null) {
        $u->gender($datas[$gender] == 'F' ? User::GENDER_FEMALE : User::GENDER_MALE);
    }
    if (!empty($datas[$email])) {
        $u->email($datas[$email]);
    }
    $u->skin('default');
    //setting default minimodules
    $u->select(UserSelect::minimodules());
    $u->copyMinimodulesFromUser(11794);
    /*    try {
            $u->cellphone(new Phone($datas['portable']));
        } catch(Exception $e) {
            echo 'Error for phone ' . $datas['portable'] . "\n";
        }*/
    //    $u->poly($datas['login']);
    // Linking with the room
Example #7
0
 public static function getGenderIcon(User $user)
 {
     if ($user->gender() == 'male') {
         return 'male';
     } else {
         return 'female';
     }
 }