コード例 #1
0
ファイル: Getdataform.php プロジェクト: geniuspom/4oj-back
 public static function geteducation($id)
 {
     $education = education::orderBy('id')->get();
     echo "<select name='education' id='education' class='form-control'>";
     foreach ($education as $recode) {
         echo "<option value='" . $recode->id . "'";
         if ($id == $recode->id) {
             echo " selected='selected'";
         }
         echo ">" . $recode->name . "</option>";
     }
     echo "</select>";
 }
コード例 #2
0
ファイル: GetUser.php プロジェクト: geniuspom/4oj
 public static function getprofile($id, $value)
 {
     $profiles = Member::where('id', '=', $id)->get();
     foreach ($profiles as $record) {
         $vdata = $record->{$value};
     }
     if ($value == 'education') {
         $education = education::orderBy('id')->get();
         foreach ($education as $recode) {
             if ($vdata == $recode->id) {
                 echo $recode->name;
             }
         }
     } else {
         if ($value == 'bank') {
             $bank = bank::orderBy('id')->get();
             foreach ($bank as $recode) {
                 if ($vdata == $recode->id) {
                     echo $recode->name;
                 }
             }
         } else {
             if ($value == 'province') {
                 $province = province::orderBy('id')->get();
                 foreach ($province as $recode) {
                     if ($vdata == $recode->id) {
                         echo $recode->name;
                     }
                 }
             } else {
                 if ($value == 'district') {
                     $district = district::orderBy('name')->get();
                     foreach ($district as $recode) {
                         if ($vdata == $recode->id) {
                             echo $recode->name;
                         }
                     }
                 } else {
                     if ($value == 'birthday' && !empty($vdata)) {
                         $split_birthday = explode("-", $vdata);
                         $vdata = $split_birthday[2] . "/" . $split_birthday[1] . "/" . $split_birthday[0];
                         echo $vdata;
                     } else {
                         echo $vdata;
                     }
                 }
             }
         }
     }
 }