{"id":556,"date":"2024-04-15T08:20:22","date_gmt":"2024-04-14T23:20:22","guid":{"rendered":"http:\/\/inwelly.com\/?p=556"},"modified":"2024-04-23T05:28:50","modified_gmt":"2024-04-22T20:28:50","slug":"php-function-student_class-%ea%b5%ac%eb%b6%84%ec%9e%90%eb%a1%9c-%eb%b6%84%eb%a6%ac%ed%9b%84-%ec%9d%b4%ec%9a%a9","status":"publish","type":"post","link":"https:\/\/inwelly.com\/?p=556","title":{"rendered":"PHP FUNCTION &#8211; student_class() , \uad6c\ubd84\uc790\ub85c \ubd84\ub9ac\ud6c4 \uc774\uc6a9"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\/\/ GET CLASS INFO\nfunction student_class($classidx , $cuttxt , $element1 , $element2 , $functionyon)\n{\n $class_no = explode('||', $classidx);\n $class_count = count($class_no);\n\n for($k = 0; $k &lt;= $class_count; $k++)\n {\n  $L_CUT_CLASS   = substr( $class_no&#91;$k] , 1 ) ;\n\n  $R_CUT_CLASS = substr( $L_CUT_CLASS , 0 , -1 ) ;\n\n  $class_info  = mysql_fetch_array(mysql_query(\" select * from \ud14c\uc774\ube14\uba85 where \ud14c\uc774\ube14\uc758\uceec\ub7fc='$R_CUT_CLASS' \"));\n\n  $info_arry = $R_CUT_CLASS . \"|\" . $class_info&#91;studentgubun_tuition] ;\n\n  \/\/ \ud568\uc218 \uc0ac\uc6a9 \uc5ec\ubd80\n  if( $functionyon == Y )\n  {\n   $radiobuttonclick = \" onclick=radiobtclick(\".$k.\")\";\n  }\n  \n  \/\/ \ub2e8 : \ud55c\uac1c\ub9cc \uc0ac\uc6a9 \ud55c\ub2e4\uba74  RADIO ELEMENT \ub77c\uba74\n  if ( $class_count == 1 )\n  {\n   $radiobuttonclick = \"\";\n  }\n\n  if( $k == $class_count )\n  {\n   $element1  = \"\";\n   $element2  = \"\";\n   $info_arry  = \"\" ;\n   $radiobuttonclick  = \"\" ;\n  }\n\n  if( $element1 =='' &amp;&amp; $element2 == '' )\n  {\n   $info_arry    = \"\" ;\n   $radiobuttonclick  = \"\" ;\n  }\n\n  $class_str  .= $element1 . $info_arry . $radiobuttonclick . $element2 . $class_info&#91;studentgubun_name] . $cuttxt ;\n }\n\n $cut_class_str = substr( $class_str, 0 , -2 );\n\n return $cut_class_str ; \n}\n\n--------------------------------------------------------------------------------------------------------------------------------------------------------\nstudent_class($QUERYCLASS, \",\" , \"&lt;input type=radio name='class_code' value=\" , \" $checked_view>\" , \"Y\" )\n\n&lt;script>\nfunction radiobtclick(Z)\n{\n\nvar str   = F.class_code&#91;Z].value ;\n\/\/ str \uc5d0 \ub098\uc628 \uac12 \uc0ac\uc6a9 \uacb0\uacfc\uac12\uc744 \ub9cc\ub4e0\ub2e4.\n}\n&lt;\/script>\n\n\uacb0\uacfc :\n\uc120\ud0dd1,\uc120\ud0dd2,\uc120\ud0dd3\n\n--------------------------------------------------------------------------------------------------------------------------------------------------------\nstudent_class($class, \",\" , \"\" , \"\" , \"\" )\n\n\uacb0\uacfc :\n\uc120\ud0dd1,\uc120\ud0dd2,\uc120\ud0dd3\n\n--------------------------------------------------------------------------------------------------------------------------------------------------------\n\nstudent_class(\"\uc120\ud0dd\uac12\uc758code\",\"\uad6c\ubd84\uc790\",\"\ud45c\ud604\ud558\uace0\uc790\ud558\ub294element\uc2dc\uc791\",\"\ud45c\ud604\ud558\uace0\uc790\ud558\ub294element\ub05d\" , \"\ud568\uc218\uc0ac\uc6a9\uc5ec\ubd80\");\n\n \n\uc124\uba85 ( explain )  ----------\n\n- \uc120\ud0dd\uac12\uc758 code : *1*||*2*||*6*\n\n- \uad6c\ubd84\uc790 : , \/ | .... \uc6d0\ud558\ub294 \uad6c\ubd84\uc790\n\n- \ud45c\ud604\ud558\uace0\uc790\ud558\ub294 element \uc2dc\uc791  , \ud45c\ud604\ud558\uace0\uc790\ud558\ub294 element \ub05d \n   &lt;input type=radio name='class_code' value=\uacb0\uacfc\uac12 $checked_view>\n\n- $checked_view : \ud55c\uac1c\uc758 \uacb0\uacfc\uac00 \ub098\uc628\ub2e4\uba74 checked \uac00 \ud45c\ud604\ub418\ub3c4\ub85d \ud55c\ub2e4.\n\n- \ud568\uc218\uc0ac\uc6a9\uc5ec\ubd80\nradiobtclick(Z)  \ud568\uc218\uc758 \uc0ac\uc6a9 \ud560\uc9c0\uc5d0 \ub300\ud55c \uacb0\uc815 - Y \uc774\uba74 \uc0ac\uc6a9 \ud55c\ub2e4.<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1251,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-556","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=556"}],"version-history":[{"count":1,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/556\/revisions"}],"predecessor-version":[{"id":557,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/556\/revisions\/557"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/media\/1251"}],"wp:attachment":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}