혹시 만들어져있는 코드를 간추려서 만들수있나요 ?
본문
include_once "./_common.php";
include_once "{$g4[lms_path]}/head.sub.php";
$sql = "select a.*, d.wr_1 as d_wr_1,d.wr_15 as d_wr_15, e.wr_1 as e_wr_1, e.wr_2 as e_wr_2
from {$g4['lms_prefix']}D07 a
left join
{$g4['lms_prefix']}D04 d
on
a.wr_2 = d.wr_id
left join
{$g4['lms_prefix']}D01 e
on
d.wr_3 = e.wr_id
where
a.wr_2='{$d_id}'
and a.wr_19='{$wr_19}'
and a.wr_20='{$wr_20}'"; //성적표양식변경 및 학생이 확인시 변경된 성적표대로 나오도록 수정
$is = sql_query($sql);
?>
<!-- <link rel="stylesheet" href="<?=$g4['lms_path']?>/css/grade.css" type="text/css" media="screen" title="no title" charset="utf-8"/>
<link rel="stylesheet" href="<?=$g4['lms_path']?>/css/common.css" type="text/css" media="screen" title="no title" charset="utf-8"/> -->
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<style>
.main_left {
float: left;
width:35%;
margin: 11px;
margin-top:48px;
}
.left{
float: left;
margin-top: 13px;
}
.right{
float: right;
}
.score_l{
width: 49%;
border-left: 3px solid #000000;
border-right: 3px solid #000000;
float: left;
}
/* .score_r{
width: 10%;
float: left;
} */
.main_left .section{
margin:7px;
padding-bottom: 45px;
}
.right_section1{
height: 138px;
padding: 10px;
}
.right_section2{
height: 138px;
border-top: 3px solid #000000;
padding: 10px;
}
.right_section3{
}
.grade_wrap {
width:950px;
margin:30px auto;
}
.grade_wrap .grade_head{
width:100%;
height:40px;
margin-bottom : 30px;
position: relative;
}
.logo_l {
position: absolute;
margin-left: 85px;
margin-top: 120px;
}
.logo_r {
margin-left: 797px;
margin-top: 113px;
position: absolute;
}
.head_title img{
padding-top: 71px;
position: absolute;
width: 975px;
margin-right: 10px;
}
.info_wrap{
width:950px;
height:304px;
border-radius: 1px;
margin-bottom:16px;
margin-top: 120px;
border-style: solid;
border-color: #FCBD30;
FONT-WEIGHT: 800;
padding-top: 11.5px;
}
.name_wrap{
float:left;
width: 400px;
}
.name_E{
width:195px;
margin-bottom:15px;
margin-top:35px;
}
.E_title{
/* color:#666666; */
font-family: NotoSansCJKkr-Regular;
font-size:12px;
padding-bottom: 3.5px;
}
.E_title2 {
/* color:#666666; */
font-family: NotoSansCJKkr-Regular;
margin-top: 30px;
font-size:18.83px;
text-align:center;
/* padding-bottom: 5px; */
background-color: #FCBD30;
margin-right: 10px;
}
/* .R_title {
border-top:1.9px solid #000000;
border-bottom:1.9px solid #000000;
/* color:#666666; */
font-family: NotoSansCJKkr-Regular;
font-size:12px;
/* padding-bottom: 5px; */
.N_title{
font-family: NotoSansCJKkr-Regular;
font-size:12px;
/* border-top:1.9px solid #000000;
border-bottom:1.9px solid #000000; */
border-width:30%;
}
.G_title{
font-family: NotoSansCJKkr-Regular;
font-size:12px;
/* border-top:1.9px solid #000000;
border-bottom:1.9px solid #000000; */
border-width:30%;
}
.B_title{
font-family: NotoSansCJKkr-Regular;
font-size:12px;
/* border-top:1.9px solid #000000;
border-bottom:1.9px solid #000000; */
}
.T_title{
font-family: NotoSansCJKkr-Regular;
font-size:12px;
/* border-top:1.9px solid #000000;
border-bottom:1.9px solid #000000; */
}
.V_title {
font-family: NotoSansCJKkr-Regular;
font-size:12px;
/* border-top:1.9px solid #000000;
border-bottom:1.9px solid #000000; */
}
/* .HGD{
margin-bottom:20px;
font-size:33.33px;
} */
.name_K{
color:#000000;
font-size:19.08px;
position: relative;
padding-left: 20px;
}
/* .sub_E{
width:195px;
float:left;
} */
.date{
font-family: NotoSansCJKkr-Medium;
}
.date2{
font-family: NotoSansCJKkr-Medium;
font-size:16px;
margin-left: 10px;
}
.info2_L{
font-size:14.58px;
}
.li_re{
/* width:100%; */
margin-right: 265px;
margin-bottom:22px;
margin-left :23px;
background-color: #FCBD30;
font-size :21px;
FONT-WEIGHT: 800;
}
.font_g{
/* color:#42d3a9; */
font-family: NotoSansCJKkr-Bold;
font-size:21px;
border-bottom:1px solid #dddddf;
}
.y_score{
margin-bottom:20px;
margin-left: 185px;
}
/* .score_bar{
} */
.bold{
font-family: NotoSansCJKkr-Bold;
}
/* .score_r_wrap{
} */
.tatal_s{
width:372px;
}
.content2_wrap {
margin-bottom:30px;
}
.content2_l {
display:inline-block;
width:474px;
vertical-align:top;
float:left;
}
.content2_l>div {
display:inline-block;
}
.content2_l .listening_wrap {
margin-bottom:30px;
}
.content2_l .score_bar {
width:100%;
height:12px;
}
.score_bar .score_wrap {
width:75%;
height:12px;
background-color:#e6e7e8;
margin-left:50px;
}
.score_bar .score_wrap .score_in {
height:12px;
}
.content2_r {
margin-top: 40px;
margin-right: 7px;
width:110px;
float:right;
display:inline-block;
position: center;
}
.content2_r .score_img {
padding-top: 36px;
width: 110px;
height: 131px;
background:url('../../img/grade_score12.png') no-repeat;
position:relative;
margin:29px auto 0;
}
.content2_r .score_img span {
font-size: 23px;
/* top: 50%;
left: 50%; */
margin-left: 30px;
margin-top: 20px;
transform: translateX(-50%) translateY(-50%);
}
.content2_r .score_img span .noto_m {
margin-top: 30px;
}
.score_bar .score_wrap .listening_score{
background-color:#787772;
}
.score_bar .score_wrap .reading_score{
background-color:#787772;
}
.content3_wrap {
width:100%;
margin-bottom:10px;
display: flex;
}
.content3_wrap>div {
width:474px;
display:inline-block;
}
.content3_wrap .c_titles {
font-size:20.83px;
border-bottom:1px solid #dddddf;
padding-bottom:10px;
margin-bottom:15px;
}
.content3_wrap .c_bottom {
width:100%;
padding:20px 20px 68px 20px;
}
.content3_wrap .listening_top {
color:#3366cc;
flex-basis: 50%;
}
.content3_wrap .reading_top {
color:#00cc99;
flex-basis: 50%;
}
.content3_wrap .listening_bottom {
background:#f8faff;
}
.content3_wrap .reading_bottom {
background:#f8fffd;
}
.content3_wrap .content3_r{
float:right;
}
.content4_wrap {
width:100%;
}
.content4_wrap .content4_t {
width:100%;
padding-bottom:6px;
margin-bottom:10px;
color:#3366cc;
border-bottom:1px solid #dddddf;
}
.content4_b .part_text {
font-size:20.83px;
display:inline-block;
margin-bottom:15px;
margin-right: 20px;
}
.content4_b .progress_bar {
float: right;
margin-top: 8px;
width:875px;
background:#e6e7e8;
height:12px;
display:inline-block;
}
.content4_b .progress_bar .Proceeding {
background:#3366cc;
height:12px;
}
.abilities{
border-collapse: collapse;
}
.abilities th{
background-color: #FCBD30;
}
.abilities td{
text-align: center;
}
.abilities th, td{
border:1px black solid;
padding : 10px;
}
@font-face {
font-family: NotoSansCJKkr-Medium;
src: url('../font/NotoSans/notokr-medium.woff');
}
@font-face {
font-family: NotoSansCJKkr-Bold;
src: url('../font/NotoSans/notokr-bold.woff');
}
@font-face {
font-family: NotoSansCJKkr-Regular;
src: url('../font/NotoSans/notokr-regular.woff');
}
@font-face {
font-family: NotoSansCJKkr-Light;
src: url('../font/NotoSans/notokr-light.woff');
}
@font-face {
font-family: NotoSansCJKkr-Thin;
src: url('../font/NotoSans/notokr-thin.woff');
}
@page {
margin:0;
}
@page { size: A4 portrait; margin:0; } //A4 세로 출력
html, body {
width: 100%;
padding: 0;
margin: 0;
overflow-x: hidden;
font-family: NotoSansCJKkr-Regular;
}
ul, ol {
list-style: none;
margin: 0;
padding: 0;
}
/* img {
border: 0;
} */
a {
text-decoration: none;
color: black;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.footer {
font-size:13.5px;
}
.name .E_title {
font-size:11.5px;
}
.date .noto_m {
font-size:11.5px;
}
.percent{
position: absolute;
}
.testdateV {
margin-top:-25px;
position: absolute;
font-size: 16px;
margin-left: 10px;
color: #000000;
}
.Gender {
position: absolute;
}
.backback img{
width: 330px;
margin-top: 175px;
padding-left: 0px;
margin-left: 15px;
} */
.wrap{
width: 1100px;
}
.main_left .section .mid_section_r{
margin-top: 30px;
margin-right: 60px;
padding-left: 170px;
}
.noto_b {
font-family: NotoSansCJKkr-Bold;
}
.noto_r {
font-family: NotoSansCJKkr-Regular;
}
.noto_l {
font-family: NotoSansCJKkr-Light;
}
.noto_m {
font-family: NotoSansCJKkr-Medium;
}
.noto_t {
font-family: NotoSansCJKkr-Thin;
}
</style>
<?
$index = 0;
while($row = sql_fetch_array($is)){
$index++;
$lis_score = "";
$rea_score = "";
$lis_comment = "";
$rea_comment = "";
$one_p = "";
$part1_p = "";
$part2_p = "";
$part3_p = "";
$part4_p = "";
$part5_p = "";
$part6_p = "";
$part7_p = "";
$lis_p = "";
$rea_p = "";
$lis_score = $row['wr_25']; //$row['wr_11']+$row['wr_12']+$row['wr_13']+$row['wr_14'];
$rea_score = $row['wr_26']; //$row['wr_15']+$row['wr_16']+$row['wr_17'];
$today = date("Y-m-d");
$sub_sql = "
SELECT
a.*, b.wr_15 as b_wr_15
FROM
lms_D07 a
left join lms_D04 b
on a.wr_2 = b.wr_id
WHERE
a.wr_19 = '".$row['wr_19']."' AND
a.wr_2 != '{$d_id}' and
b.wr_12 < '{$today}' and
b.wr_14 < '{$today}'
ORDER BY
a.wr_datetime DESC
LIMIT 0 , 2
";
$sub_is = sql_query($sub_sql);
$sub_as = sql_fetch($sub_sql);
$sub_index = 0;
$one_lis_score = 0;
$one_rea_score = 0;
$one_total_score = 0;
$one_date = null;
$two_lis_score = 0;
$two_rea_score = 0;
$two_total_score = 0;
$two_date = null;
if(!$sub_as) {
$one_lis_score = $one_rea_score = $one_total_score = "-";
$one_date = "이전 시험내역이<br> 없습니다";
$two_lis_score = $two_rea_score = $two_total_score = "-";
$two_date = "이전 시험내역이<br> 없습니다";
}
while($sub_row = sql_fetch_array($sub_is)){
$sub_index++;
if($sub_index == 1){
$one_lis_score = $sub_row['wr_25']; //$sub_row['wr_11']+$sub_row['wr_12']+$sub_row['wr_13']+$sub_row['wr_14'];
$one_rea_score = $sub_row['wr_26']; //$sub_row['wr_15']+$sub_row['wr_16']+$sub_row['wr_17'];
$one_total_score = $sub_row["wr_18"];
if($sub_row['wr_3'] == '2') $one_date = date("Y/m/d", strtotime($sub_row['b_wr_15']));
else $one_date = date("Y/m/d", strtotime($sub_row['wr_datetime']));
}else if($sub_index == 2){
$two_lis_score = $sub_row['wr_25'];//$sub_row['wr_11']+$sub_row['wr_12']+$sub_row['wr_13']+$sub_row['wr_14'];
$two_rea_score = $sub_row['wr_26'];//$sub_row['wr_15']+$sub_row['wr_16']+$sub_row['wr_17'];
$two_total_score = $sub_row["wr_18"];
if($sub_row['wr_3'] == '2') $two_date = date("Y/m/d", strtotime($sub_row['b_wr_15']));
else $two_date = date("Y/m/d", strtotime($sub_row['wr_datetime']));
}
}
if($row['e_wr_1'] == "1"){
$one_p = "5";
$part1_p = ($row['wr_11']/(6*$one_p))*100;
$part2_p = ($row['wr_12']/(25*$one_p))*100;
$part3_p = ($row['wr_13']/(39*$one_p))*100;
$part4_p = ($row['wr_14']/(30*$one_p))*100;
$part5_p = ($row['wr_15']/(30*$one_p))*100;
$part6_p = ($row['wr_16']/(16*$one_p))*100;
$part7_p = ($row['wr_17']/(54*$one_p))*100;
$lis_p = ($lis_score/495)*100;
$rea_p = ($rea_score/495)*100;
}else if($row['e_wr_1'] == "2"){
$one_p = "10";
$part1_p = ($row['wr_11']/(3*$one_p))*100;
$part2_p = ($row['wr_12']/(14*$one_p))*100;
$part3_p = ($row['wr_13']/(18*$one_p))*100;
$part4_p = ($row['wr_14']/(15*$one_p))*100;
$part5_p = ($row['wr_15']/(15*$one_p))*100;
$part6_p = ($row['wr_16']/(8*$one_p))*100;
$part7_p = ($row['wr_17']/(27*$one_p))*100;
$lis_p = ($lis_score/495)*100;
$rea_p = ($rea_score/495)*100;
}
if((0<$lis_score && $lis_score<=150) || !$lis_score){
$lis_cha = "wr_19";
$lis_weak = "wr_20";
$lis_comment = "wr_21";
}else if(150<$lis_score && $lis_score<=270){
$lis_cha = "wr_16";
$lis_weak = "wr_17";
$lis_comment = "wr_18";
}else if(270<$lis_score && $lis_score<=322){
$lis_cha = "wr_13";
$lis_weak = "wr_14";
$lis_comment = "wr_15";
}else if(322<$lis_score && $lis_score<=370){
$lis_cha = "wr_10";
$lis_weak = "wr_11";
$lis_comment = "wr_12";
}else if(370<$lis_score && $lis_score<=415){
$lis_cha = "wr_7";
$lis_weak = "wr_8";
$lis_comment = "wr_9";
}else if(415<$lis_score && $lis_score<=455){
$lis_cha = "wr_4";
$lis_weak = "wr_5";
$lis_comment = "wr_6";
}else if(455<$lis_score && $lis_score<=500){
$lis_cha = "wr_1";
$lis_weak = "wr_2";
$lis_comment = "wr_3";
}
if((0<$rea_score && $rea_score<=150) || !$rea_score){
$rea_cha = "wr_40";
$rea_weak = "wr_41";
$rea_comment = "wr_42";
}else if(150<$rea_score && $rea_score<=270){
$rea_cha = "wr_37";
$rea_weak = "wr_38";
$rea_comment = "wr_39";
}else if(270<$rea_score && $rea_score<=322){
$rea_cha = "wr_34";
$rea_weak = "wr_35";
$rea_comment = "wr_36";
}else if(322<$rea_score && $rea_score<=370){
$rea_cha = "wr_31";
$rea_weak = "wr_32";
$rea_comment = "wr_33";
}else if(370<$rea_score && $rea_score<=415){
$rea_cha = "wr_28";
$rea_weak = "wr_29";
$rea_comment = "wr_30";
}else if(415<$rea_score && $rea_score<=455){
$rea_cha = "wr_25";
$rea_weak = "wr_26";
$rea_comment = "wr_27";
}else if(455<$rea_score && $rea_score<=500){
$rea_cha = "wr_22";
$rea_weak = "wr_23";
$rea_comment = "wr_24";
}
$sql = "select * from {$g4['lms_prefix']}D06";
$comment = sql_fetch($sql);
$crm_info = get_crm2($member[mb_id]);
$imagPath='20230411_110638431.jpg';
$image = imagecreatefromjpeg($imagePath);
$text = '하이헬로우';
imagettftext($image, 20, 0, 50, 50, $textColor, 'arial.ttf', $text);
header('Content-Type: image/jpeg');
imagejpeg($image);
?>
<div class="wrap">
<div class="grade_wrap">
<div class="grade_head">
<div class="logo_l"><img src="<?=$g4['lms_path']?>/img/grade_logoLL.png" alt="" /></div>
<div class="logo_r"><img src="<?=$g4['lms_path']?>/img/grade_logoRR.png" alt="" /></div>
<div class="head_title"><img src="<?=$g4['lms_path']?>/img/토익성적표헤더.png" alt="" /></div>
<div class="backback"><img src="<?=$g4['lms_path']?>/img/선.png" alt="" /></div>
</div>
<div class="info_wrap">
<div class="info_wrap_l">
<div class="main_left">
<div class="name_K">
<?=$is['b_wr_6'] ? $is['b_wr_6'] : $wr_20?>
</div>
<div class="left_1 section">
<!-- <div class="date noto_m"><?=$crm_info['wr_6']?></div> -->
<div class="name N_title">Name</div>
</div>
<div class="left_2 section">
<div class="mid_section3" style="margin-top: 0px; position: absolute;">
<div class="Student" style="margin-top: -25px;"><div class="date2 noto_m">
<?
if($row['b_wr_10']){
?>
<?=$row['b_wr_10']?>
<?
}else{
?>
<?=$row['wr_28']?>
<?
}
?>
</div>
</div>
<div class="Student" style="margin-top: 13px;">Student Number</div>
</div>
</div>
<div class="left_3 section" style="padding-bottom: 0px; margin-top: 40px;">
<div class="mid_section3 left">
<div class="testdateV">
<? if($row['d_wr_1'] == '2') {
if($row['wr_32']){
echo date("Y/m/d", strtotime($row['wr_32']));
} else {
echo date("Y/m/d", strtotime($row['d_wr_15']));
}
} else if($row['d_wr_1'] == '1') { ?>
<?=date("Y/m/d", strtotime($row['wr_datetime']))?>
<? } ?>
</div>
<div class="testdate T_title">Test date</div>
<div class="date noto_m">(yyyy/mm/dd)</div>
</div>
</div>
</div>
<div class="main_right">
<div class="score_l">
<div class="right_section1">
<div class="listening_wrap">
<div class="E_title li_re">
LISTENING
</div>
<div class="y_score">
Your Score: <span class="bold"><?=$lis_score?></span>
</div>
<div class="percent">5<br>0 %</div>
<div class="percent1 right">495<br>99 %</div>
<div class="score_bar">
<div class="score_wrap">
<div class="score_in listening_score" style="width: <?=$lis_p ? $lis_p : "0"?>%;"></div>
</div>
</div>
</div>
</div>
<div class="right_section2" style="border-top:3px solid #000000;">
<div class="reading_wrap">
<div class="li_re font_g">
READING
</div>
<div class="y_score">
Your Score: <span class="bold"><?=$rea_score?></span>
</div>
<div class="percent">5<br>0 %</div>
<div class="percent1 right">495<br>99 %</div>
<div class="score_bar">
<div class="score_wrap">
<div class="score_in reading_score" style="width: <?=$rea_p ? $rea_p : "0"?>%;"></div>
</div>
</div>
</div>
</div>
</div>
<div class="score_r">
<div class="content2_r">
<div class="E_title2 total_s">
TOTAL<br>SCORE
</div>
<div class="score_img">
<span class="noto_m"><?=$row['wr_18'] ? $row['wr_18'] : "0"?></span>
</div>
</div>
</div>
<div class="content3_wrap" style="padding-top: 20px;">
<div class="content3_l">
<div class="listening_top c_titles noto_m">
LISTENING
</div>
<div class="listening_bottom c_bottom noto_l">
특징 : <?=$comment[$lis_cha]?><br><br>
취약점 : <?=$comment[$lis_weak]?><br><br>
Comment : <?=$comment[$lis_comment]?>
</div>
</div>
<div class="content3_r">
<div class="reading_top c_titles noto_m">
READING
</div>
<div class="reading_bottom c_bottom noto_l">
특징 : <?=$comment[$rea_cha]?><br><br>
취약점 : <?=$comment[$rea_weak]?><br><br>
Comment : <?=$comment[$rea_comment]?>
</div>
</div>
</div>
<div class="content4_wrap">
<div class="content4_t">
ABILITIES MEASURED
</div>
<div class="content4_b">
<table style="width:100%" class="abilities" >
<colgroup>
<col width="12.5%" />
<col width="12.5%" />
<col width="12.5%" />
<col width="12.5%" />
<col width="12.5%" />
<col width="12.5%" />
<col width="12.5%" />
<col width="12.5%" />
</colgroup>
<tr>
<th>PART</th>
<th>PART1</th>
<th>PART2</th>
<th>PART3</th>
<th>PART4</th>
<th>PART5</th>
<th>PART6</th>
<th>PART7</th>
</tr>
<?if($row['e_wr_1'] == "1"){?> <!--2018.10.31 오지우 200,100문제마다 정답률 계산방법 변경 -->
<tr>
<td>CORRECT</td>
<td><span class="noto_m"><?=round(($row['wr_11']/6)*100,1)?>%</span></td>
<td><span class="noto_m"><?=round(($row['wr_12']/25)*100,1)?>%</span></td>
<td><span class="noto_m"><?=round(($row['wr_13']/39)*100,1)?>%</span></td>
<td><span class="noto_m"><?=round(($row['wr_14']/30)*100,1)?>%</span></td>
<td><span class="noto_m"><?=round(($row['wr_15']/30)*100,1)?>%</span></td>
<td><span class="noto_m"><?=round(($row['wr_16']/16)*100,1)?>%</span></td>
<td><span class="noto_m"><?=round(($row['wr_17']/54)*100,1)?>%</span></td>
</tr>
<?}
else if($row['e_wr_1'] == "2"){?>
<tr>
<td>CORRECT</td>
<td><span class="noto_m"><?=round(($row['wr_11']/3)*100,1)?>%</span></td>
<td><span class="noto_m"><?=round(($row['wr_12']/14)*100,1)?>%</span></td>
<td><span class="noto_m"><?=round(($row['wr_13']/18)*100,1)?>%</span></td>
<td><span class="noto_m"><?=round(($row['wr_14']/15)*100,1)?>%</span></td>
<td><span class="noto_m"><?=round(($row['wr_15']/15)*100,1)?>%</span></td>
<td><span class="noto_m"><?=round(($row['wr_16']/8)*100,1)?>%</span></td>
<td><span class="noto_m"><?=round(($row['wr_17']/27)*100,1)?>%</span></td>
</tr>
<?}?>
</table>
</div>
</div>
</div>
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawVisualization);
google.charts.setOnLoadCallback(subdrawVisualization);
function drawVisualization() {
var data = google.visualization.arrayToDataTable([
['test clate', 'LC', 'RC', 'TOTAL'],
['<?=$one_date?>', <?=$one_lis_score?>, <?=$one_rea_score?>, <?=$one_total_score?>],
['<?=$two_date?>', <?=$two_lis_score?>, <?=$two_rea_score?>, <?=$two_total_score?>]
]);
var options = {
title : '',
vAxis: {title: '', viewWindow:{max:1000,min:0}},
hAxis: {title: ''},
seriesType: 'bars',
legend: { position: 'bottom', maxLines: 10 },
series: {5: {type: 'line'}}
};
var chart = new google.visualization.ComboChart(document.getElementById('chart_div<?=$index?>'));
chart.draw(data, options);
}
function subdrawVisualization() {
var e_wr_2 = "<?=$row['e_wr_2']?>";
var e_part1 = 0;
var e_part2 = 0;
var e_part3 = 0;
var e_part4 = 0;
var e_part5 = 0;
var e_part6 = 0;
var e_part7 = 0;
if(e_wr_2 == 200) {
var e_part1 = 6;
var e_part2 = 25;
var e_part3 = 39;
var e_part4 = 30;
var e_part5 = 30;
var e_part6 = 16;
var e_part7 = 54;
}else if(e_wr_2 == 100) {
var e_part1 = 3;
var e_part2 = 14;
var e_part3 = 18;
var e_part4 = 15;
var e_part5 = 15;
var e_part6 = 8;
var e_part7 = 27;
}
var data = google.visualization.arrayToDataTable([
['PART', '정답수', '문항수'],
['Part1\n'+<?=$row['wr_11']?>, <?=$row['wr_11']?>, e_part1],
['Part2\n'+<?=$row['wr_12']?>, <?=$row['wr_12']?>, e_part2],
['Part3\n'+<?=$row['wr_13']?>, <?=$row['wr_13']?>, e_part3],
['Part4\n'+<?=$row['wr_14']?>,  
답변 3
너무 긴데 chatGPT한테 물어보는게 빠를지도요^^
일정 부분의 불필요한 코드를 제외처리 하고 다음과 같이 해 볼 수 있을 것 같습니다.
<?php
require 'db_connect.php';
$user_id = $_GET['user_id'];
$query = "SELECT * FROM toefl_scores WHERE user_id = $user_id";
$result = mysqli_query($connection, $query);
$score_data = mysqli_fetch_assoc($result);
if ($score_data) {
$user_name = $score_data['user_name'];
$test_date = $score_data['test_date'];
$score = $score_data['score'];
// 여기서 웹 페이지 출력
echo "<html>";
echo "<head>";
echo "<link rel='stylesheet' type='text/css' href='style.css'>";
echo "</head>";
echo "<body>";
echo "<h1>토익 성적</h1>";
echo "<p>이름: $user_name</p>";
echo "<p>시험 날짜: $test_date</p>";
echo "<p>토익 성적: $score</p>";
// 그래프 및 기타 정보 출력
echo "<div id='graph'></div>";
echo "<div id='features'></div>";
echo "<div id='weaknesses'></div>";
echo "<div id='comments'></div>";
// 이미지 출력
echo "<img src='chart.png' alt='토익 성적 그래프'>";
echo "</body>";
echo "</html>
위 처럼하면 가독성과 최적화를 개선 할 수 있을 거라 생각합니다.
!-->내용이 긴데 어떤 부분을 어떻게 하고 싶은지 좀더 소스도 줄이고 해서 단계별로 질문을 하는게 도움이 되실거 같습니다.