[php] 통계 관련 report 작성 기법 – join, query 분류 등등..

<?

session_start ();

?>

<?

$mem_name = $HTTP_SESSION_VARS[“mem_name”];

$mem_grp = $HTTP_SESSION_VARS[“mem_grp”];

$mem_level = $HTTP_SESSION_VARS[“mem_level”];

$mem_id = $HTTP_SESSION_VARS[“mem_id”];

if ( !$c_time and !$c_time1 and !$a_grp and !$a_user ) {

$page_stats = “first”;

} else {

$page_stats = “next”;

}

if ( ($a_user == “서진우”) or ($a_user == “우서준”) or ($a_user == “김정언”) or ($a_user == “최영준”) or ($a_user == “김범준”) or ($a_grp == “기술부”) ) {

$mem_sec = “engineer”;

}

?>

<html>

<head>

<title>- 고객 발굴 업무 평가 리포트 </title>

<script type=”text/javascript” src=”./inc/js_date.js”></script>

<script type=”text/javascript” src=”./inc/js_calendar.js” ></script>

<link href=”./inc/js_calendar.css” rel=”stylesheet” type=”text/css”>

<style type=”text/css”>

<!–

@font-face {font-family:티티체; src:url(/fonts/TTche.eot);}

body {font-family:티티체;font-size:9pt;line-height:120%;}

td {font-family:티티체;font-size:9pt;line-height:120%;word-break:break-all;}

a {font-family:티티체;color:darkblue;font-size:9pt;text-decoration:none;}

a:hover {font-family:티티체;color:#FCD251;font-size:9pt;text-decoration:none;}

input { font-family:티티체;font-size:9pt;position:relative; border:expression( (this.type==’image’||this.type==’checkbox’||this.type==’radio’)?”:’solid 1px #878787′); padding:1px;color:#011A30;background-color:white;height:20px;}

select { font-family:티티체;font-size:9pt; border:solid 1px #cccccc; }

textarea { font-family:티티체;font-size:9pt; border:solid 1px #cccccc; padding:1px;}

form { border:0; margin:5; }

.table1 {border-collapse:collapse;}

–>

</style>

</head>

<body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0>

<table align=center cellspacing=0 cellpadding=0 border=0 width=90%>

<tr>

<form name=searchform method=get action=index.php>

<td height=25><img src=’./image/i_edot_blue.gif’ align=absmiddle> <b><a href=index.php>고객 발굴 업무 평가 리포트</a></b>

</td><td></td></tr>

<tr><td colspan=2>

  

<img src=./image/calendar.gif>

<b>검색기간 </b>:

<?

        $res = time ();

        if (!$c_time) {

        $c_time = date (“Y-m-d”,$res);

        }

        $c_date = explode (“-“,$c_time);

        if ( !$s_year and !$e_year ) {

        $res1 = time ();

        $res1 = $res1 – (86400*7);

        if (!$c_time1) {

        $c_time1 = date (“Y-m-d”,$res1);

        }

        $c_date1 = explode (“-“,$c_time1);

        $s_year = $c_date1[0];

        $s_mon = $c_date1[1];

        $s_day = $c_date1[2];

        $e_year = $c_date[0];

        $e_mon = $c_date[1];

        $e_day = $c_date[2];

        }

        if ( !$job_stat ) {

                $job_stat = 0;

        }

?>

<input name=”c_time1″ type=”text” id=”cal0″ value=<? echo $c_time1; ?> size=”12″ maxlength=”12″> –

 <input name=”c_time” type=”text” id=”cal1″ value=<? echo $c_time; ?> size=”12″ maxlength=”12″>

<script type=”text/javascript”>

var calendat0 = new js_calendar(document.getElementById(‘cal0’));

var calendat0 = new js_calendar(document.getElementById(‘cal1’));

</script>

 

<b>검색대상 : </b>

<?

if ( ($a_user == “null”) or (!$a_user)) {

echo (”

<select name=a_user>

        <option value=’null’ selected>개인</option>

        <option value=’우서준’>우서준</option>

        <option value=’김정언’>김정언</option>

        <option value=’최영준’>최영준</option>

        <option value=’김범준’>김범준</option>

        <option value=’정순익’>정순익</option>

        <option value=’조만휘’>조만휘</option>

        <option value=’박진현’>박진현</option>

        <option value=’현미정’>현미정</option>

        <option value=’서진우’>서진우</option>

</select>

“);

} else {

echo (”

<select name=a_user>

        <option value=’$a_user’ selected>$a_user</option>

        <option value=’null’>개인</option>

        <option value=’우서준’>우서준</option>

        <option value=’김정언’>김정언</option>

        <option value=’최영준’>최영준</option>

        <option value=’김범준’>김범준</option>

        <option value=’정순익’>정순익</option>

        <option value=’조만휘’>조만휘</option>

        <option value=’박진현’>박진현</option>

        <option value=’현미정’>현미정</option>

        <option value=’서진우’>서진우</option>

</select>

“);

}

if (($a_grp == “null”) or (!$a_grp)) {

echo (”

<select name=a_grp>

        <option value=’null’ selected>부서</option>

        <option value=’영업부’>영업부</option>

        <option value=’기술부’>기술부</option>

</select>

“);

} else {

echo (”

<select name=a_grp>

        <option value=’$a_grp’ selected>$a_grp</option>

        <option value=’null’>부서</option>

        <option value=’영업부’>영업부</option>

        <option value=’기술부’>기술부</option>

</select>

“);

}

?>

 

<input type=submit value=”검색”>

</td>

</form>

</tr>

</table>

<P>

<?

if ( $page_stats == “first” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr height=25 align=center bgcolor=#A6C2E2>

<td>T성공건수</td>

<td>TD메일</td>

<td>TD전화</td>

<td>TD방문</td>

<td>데모건수</td>

<td>N진입건수</td>

<td>사업성공건수</td>

<td>추가구매건수</td>

<td>수익성업무건수</td>

<td>TD업무건수</td>

<td>수익성업무시간</td>

<td>TD업무시간</td>

<td>TD사업건수</td>

</tr>

<tr height=25>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

</tr>

</table>

“);

} else {

// 실제 통계 시작 부분

$db_inc = “../common/config_inc.php”;

        if (file_exists($db_inc)) {

                require($db_inc);

                       } else {

                error(“NOT_FOUND_CONFIG_FILE”);

                exit;

                }

$db = mysql_select_db ($dbname);

        if (!$db) {

            error(“FAIDED_TO_SELECT_DB”);

            exit;

          }

$s_date = mktime (0,0,1,$s_mon,$s_day,$s_year);

$e_date = mktime (23,59,59,$e_mon,$e_day,$e_year);

// 전체 공통 쿼리

$query_s = “select p_uid,p_sec,c_name,issue,p_mng,s_date,p_code,p_step,product from project where p_sec=’수익성’ and s_date between $s_date and $e_date”;

$query_p = “select a_uid,p_uid,p_name,a_user,a_step,a_type,a_time,a_subject,a_date from activity where ( a_step=’1′ or a_step=’2′) and a_type like ‘%전화%’ and a_date between $s_date and $e_date”;

$query_m = “select a_uid,p_uid,p_name,a_user,a_step,a_type,a_time,a_subject,a_date from activity where ( a_step=’1′ or a_step=’2′) and a_type like ‘%메일%’ and a_date between $s_date and $e_date”;

$query_v = “select a_uid,p_uid,p_name,a_user,a_step,a_type,a_time,a_subject,a_date from activity where ( a_step=’1′ or a_step=’2′) and a_type like ‘%방문%’ and a_date between $s_date and $e_date”;

if ( $mem_sec != “engineer” ) {

$query_d = “select p_uid,p_sec,c_name,issue,p_mng,demo_date,p_step,product,p_code from project where p_sec=’수익성’ and demo_date between $s_date and $e_date”;

} else {

$query_d = “select a_uid,p_uid,p_name,a_user,a_subject,a_type,a_time,a_kind,a_date,a_step from activity where a_kind=’고객데모’ and a_date between $s_date and $e_date”;

}

if ( $mem_sec == “engineer” ) {

$query_n = “select distinct project.p_uid,p_sec,c_name,issue,p_mng,s_date,est_date2,p_code,p_step,product from project”;

} else {

$query_n = “select p_uid,p_sec,c_name,issue,p_mng,s_date,est_date2,p_code,p_step,product from project where p_sec=’수익성’ and est_date2 between $s_date and $e_date”;

}

if ( $mem_sec == “engineer” ) {

$query_c = “select distinct project.p_uid,p_sec,c_name,issue,p_mng,s_date,cont_date,p_code,p_step,product from project”;

} else {

$query_c = “select p_uid,p_sec,c_name,issue,p_mng,s_date,cont_date,p_code,p_step,product from project where p_sec=’수익성’ and cont_date between $s_date and $e_date”;

}

$query_c1 = “select p_uid,p_sec,c_name,issue,p_mng,s_date,cont_date,p_code,p_step,product from project where p_sec=’수익성’ and p_code=’기존고객’ and cont_date between $s_date and $e_date”;

$query_bc = “select a_uid,p_uid,p_name,a_user,a_step,a_type,a_time,a_subject,a_date from activity where p_name like ‘수익성%’ and a_date between $s_date and $e_date”;

$query_tdc = “select a_uid,p_uid,p_name,a_user,a_step,a_type,a_time,a_subject,a_date from activity where ( a_step=’1′ or a_step=’2′) and p_name like ‘수익성%’ and a_date between $s_date and $e_date”;

$query_bt = “select sum(a_time) from activity where p_name like ‘수익성%’ and a_date between $s_date and $e_date”;

$query_tdt = “select sum(a_time) from activity where ( a_step=’1′ or a_step=’2′) and p_name like ‘수익성%’ and a_date between $s_date and $e_date”;

$query_tdbc = “select distinct activity.p_uid,p_name,p_product,project.p_mng,project.s_date from activity left join project on activity.p_uid = project.p_uid where ( a_step=’1′ or a_step=’2′) and p_name like ‘수익성%’ and a_date between $s_date and $e_date”;

if ( $mem_sec == “engineer” ) {

$query_res = “select a_uid,p_uid,p_name,a_user,a_step,a_type,a_time,a_kind,a_date,a_subject from activity where ( a_step=’0′ or a_step=’1′ or a_step=’2′ or a_step=’3′) and p_name like ‘수익성%’ and a_kind=’기술연구’ and a_date between $s_date and $e_date”;

$query_dev = “select a_uid,p_uid,p_name,a_user,a_step,a_type,a_time,a_kind,a_date,a_subject from activity where ( a_step=’0′ or a_step=’1′ or a_step=’2′ or a_step=’3′) and p_name like ‘수익성%’ and a_kind=’제품개발’ and a_date between $s_date and $e_date”;

$query_cre = “select a_uid,p_uid,p_name,a_user,a_step,a_type,a_time,a_kind,a_date,a_subject from activity where ( a_step=’0′ or a_step=’1′ or a_step=’2′ or a_step=’3′) and p_name like ‘수익성%’ and a_kind=’자료작성PR’ and a_date between $s_date and $e_date”;

$query_exa = “select a_uid,p_uid,p_name,a_user,a_step,a_type,a_time,a_kind,a_date,a_subject from activity where ( a_step=’0′ or a_step=’1′ or a_step=’2′ or a_step=’3′) and p_name like ‘수익성%’ and a_kind=’자료검토PR’ and a_date between $s_date and $e_date”;

}

// 전체 공통 쿼리 끝

// 조건 별 쿼리 시작

        if ( $a_grp != “null” ) {

                $query_p.=” and a_grp=’$a_grp’ order by a_date desc”;

                $query_m.=” and a_grp=’$a_grp’ order by a_date desc”;

                $query_v.=” and a_grp=’$a_grp’ order by a_date desc”;

                if ( $mem_sec == “engineer” ) {

                        $query_d.=” and a_grp=’$a_grp’ order by a_date desc”;

                        }

                if ( $mem_sec == “engineer” ) {

                        $query_n.=” left join activity on project.p_uid = activity.p_uid where p_sec=’수익성’ and est_date2 between $s_date and $e_date and activity.a_grp=’$a_grp’ and activity.a_step < 3 order by est_date2 desc;”;

                        } else {

                        $query_n.=” order by est_date2 desc”;

                        }

                

                if ( $mem_sec == “engineer” ) {

                        $query_c.=” left join activity on project.p_uid = activity.p_uid where p_sec=’수익성’ and cont_date between $s_date and $e_date and activity.a_grp=’$a_grp’ and activity.a_step < 4 order by cont_date desc;”;

                        }        

                $query_bc.=” and a_grp=’$a_grp’ order by a_date desc”;

                $query_tdc.=” and a_grp=’$a_grp’ order by a_date desc”;

                $query_bt.=” and a_grp=’$a_grp'”;

                $query_tdt.=” and a_grp=’$a_grp'”;

                $query_tdbc.=” and a_grp=’$a_grp’ order by project.s_date desc”;

                if ( $mem_sec == “engineer” ) {

                        $query_res.=” and a_grp=’$a_grp’ order by a_date desc”;

                        $query_dev.=” and a_grp=’$a_grp’ order by a_date desc”;

                        $query_cre.=” and a_grp=’$a_grp’ order by a_date desc”;

                        $query_exa.=” and a_grp=’$a_grp’ order by a_date desc”;

                        }

        

                

        } else if (( $a_grp == “null” ) and ( $a_user != “null” )) {

                if ( $mem_sec == “engineer” ) {

                        $query_s.=” and p_user like ‘%$a_user%’ order by s_date desc”;

                        } else {

                        $query_s.=” and p_mng=’$a_user’ order by s_date desc”;

                        }

                $query_p.=” and a_user=’$a_user’ order by a_date desc”;

                $query_m.=” and a_user=’$a_user’ order by a_date desc”;

                $query_v.=” and a_user=’$a_user’ order by a_date desc”;

                if ( $mem_sec == “engineer” ) {

                        $query_d.=” and a_user=’$a_user’ order by a_date desc”;

                        } else         {

                        $query_d.=” and p_mng=’$a_user’ order by demo_date desc”;

                        }

                if ( $mem_sec == “engineer” ) {

                        $query_n.=” left join activity on project.p_uid = activity.p_uid where p_sec=’수익성’ and est_date2 between $s_date and $e_date and activity.a_user=’$a_user’ and activity.a_step < 3  order by est_date2 desc;”;

                        } else {

                        $query_n.=” and p_mng=’$a_user’ order by est_date2 desc;”;

                        }

                if ( $mem_sec == “engineer” ) {

                        $query_c.=” left join activity on project.p_uid = activity.p_uid where p_sec=’수익성’ and cont_date between $s_date and $e_date and activity.a_user=’$a_user’ and activity.a_step < 4 order by cont_date desc;”;

                        } else {

                        $query_c.=” and p_mng=’$a_user’ order by cont_date desc;”;

                        }

                if ( $mem_sec == “engineer” ) {

                        $query_c1.=” and p_user like ‘%$a_user%'”;

                        } else {

                        $query_c1.=” and p_mng=’$a_user'”;

                        }

                $query_bc.=” and a_user=’$a_user’ order by a_date desc”;

                $query_tdc.=” and a_user=’$a_user’ order by a_date desc”;

                $query_bt.=” and a_user=’$a_user'”;

                $query_tdt.=” and a_user=’$a_user'”;

                $query_tdbc.=” and a_user=’$a_user’ order by project.s_date desc”;

               if ( $mem_sec == “engineer” ) {

                        $query_res.=” and a_user=’$a_user’ order by a_date desc”;

                        $query_dev.=” and a_user=’$a_user’ order by a_date desc”;

                        $query_cre.=” and a_user=’$a_user’ order by a_date desc”;

                        $query_exa.=” and a_user=’$a_user’ order by a_date desc”;

                        }

        }

// 조건 별 쿼리 끝

        $result_s = mysql_query($query_s);

        $result_p = mysql_query($query_p);

        $result_m = mysql_query($query_m);

        $result_v = mysql_query($query_v);

        $result_d = mysql_query($query_d);

        $result_n = mysql_query($query_n);

        $result_c = mysql_query($query_c);

        $result_c1= mysql_query($query_c1);

        $result_bc= mysql_query($query_bc);

        $result_tdc= mysql_query($query_tdc);

        $result_bt= mysql_query($query_bt);

        $result_tdt= mysql_query($query_tdt);

        $result_tdbc= mysql_query($query_tdbc);

        if ( $mem_sec == “engineer” ) {

                $result_res= mysql_query($query_res);

                $result_dev= mysql_query($query_dev);

                $result_cre= mysql_query($query_cre);

                $result_exa= mysql_query($query_exa);

                }

        

        if (!$result_p or !$result_m or !$result_v or !$result_d or !$result_n or !$result_c) {

            error (“QUERRY_ERROR”);

            exit;

          }

        $rows_s = mysql_num_rows($result_s);

        $rows_p = mysql_num_rows($result_p);

        $rows_m = mysql_num_rows($result_m);

        $rows_v = mysql_num_rows($result_v);

        $rows_d = mysql_num_rows($result_d);

        $rows_n = mysql_num_rows($result_n);

        $rows_c = mysql_num_rows($result_c);

        $rows_c1 = mysql_num_rows($result_c1);

        $rows_bc = mysql_num_rows($result_bc);

        $rows_tdc = mysql_num_rows($result_tdc);

        $rows_bt = mysql_result($result_bt,0,0);

        $rows_tdt = mysql_result($result_tdt,0,0);

        $rows_tdbc = mysql_num_rows($result_tdbc);

        if (!$rows_bt) {

                $rows_bt = 0;

        }

        if (!$rows_tdt) {

                $rows_tdt = 0;

        }

        if ( $mem_sec == “engineer” ) {

                $rows_res = mysql_num_rows($result_res);

                $rows_dev = mysql_num_rows($result_dev);

                $rows_cre = mysql_num_rows($result_cre);

                $rows_exa = mysql_num_rows($result_exa);

                }

                

echo (“$query_s<br>”);

echo (“$query_p<br>”);

echo (“$query_m<br>”);

echo (“$query_v<br>”);

echo (“$query_d<br>”);

echo (“$query_n<br>”);

echo (“$query_c<br>”);

echo (“$query_c1<br>”);

echo (“$query_bc<br>”);

echo (“$query_tdc<br>”);

echo (“$query_bt<br>”);

echo (“$query_tdt<br>”);

echo (“$query_tdbc<br>”);

        if ( $mem_sec == “engineer” ) {

echo (“$query_res<br>”);

echo (“$query_dev<br>”);

echo (“$query_cre<br>”);

echo (“$query_exa<br>”);

        }

// HTML 표현 부분

        if ( $mem_sec == “engineer” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr height=25 align=center bgcolor=#A6C2E2>

<td>T성공건수</td>

<td>TD메일</td>

<td>TD전화</td>

<td>TD방문</td>

<td>데모건수</td>

<td>N진입건수</td>

<td>사업성공건수</td>

<td>추가구매건수</td>

<td>수익성업무건수</td>

<td>TD업무건수</td>

<td>수익성업무시간</td>

<td>TD업무시간</td>

<td>TD사업건수</td>

<td>기술연구</td>

<td>제품개발</td>

<td>자료작성</td>

<td>자료검토</td>

</tr>

<tr height=25 align=center>

<td><a href=./index.php?view_type=1&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_s</a></td>

<td><a href=./index.php?view_type=2&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_m</a></td>

<td><a href=./index.php?view_type=3&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_p</a></td>

<td><a href=./index.php?view_type=4&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_v</a></td>

<td><a href=./index.php?view_type=5&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_d</a></td>

<td><a href=./index.php?view_type=6&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_n</a></td>

<td><a href=./index.php?view_type=7&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_c</a></td>

<td><a href=./index.php?view_type=8&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_c1</a></td>

<td><a href=./index.php?view_type=9&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_bc</a></td>

<td><a href=./index.php?view_type=10&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_tdc</a></td>

<td>$rows_bt</td>

<td>$rows_tdt</td>

<td><a href=./index.php?view_type=11&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_tdbc</a></td>

<td><a href=./index.php?view_type=12&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_res</a></td>

<td><a href=./index.php?view_type=13&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_dev</a></td>

<td><a href=./index.php?view_type=14&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_cre</a></td>

<td><a href=./index.php?view_type=15&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_exa</a></td>

</tr>

</table>

<br>

“);

        } else {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr height=25 align=center bgcolor=#A6C2E2>

<td>T성공건수</td>

<td>TD메일</td>

<td>TD전화</td>

<td>TD방문</td>

<td>데모건수</td>

<td>N진입건수</td>

<td>사업성공건수</td>

<td>추가구매건수</td>

<td>수익성업무건수</td>

<td>TD업무건수</td>

<td>수익성업무시간</td>

<td>TD업무시간</td>

<td>TD사업건수</td>

</tr>

<tr height=25 align=center>

<td><a href=./index.php?view_type=1&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_s</a></td>

<td><a href=./index.php?view_type=2&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_m</a></td>

<td><a href=./index.php?view_type=3&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_p</a></td>

<td><a href=./index.php?view_type=4&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_v</a></td>

<td><a href=./index.php?view_type=5&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_d</a></td>

<td><a href=./index.php?view_type=6&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_n</a></td>

<td><a href=./index.php?view_type=7&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_c</a></td>

<td><a href=./index.php?view_type=8&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_c1</a></td>

<td><a href=./index.php?view_type=9&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_bc</a></td>

<td><a href=./index.php?view_type=10&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_tdc</a></td>

<td>$rows_bt</td>

<td>$rows_tdt</td>

<td><a href=./index.php?view_type=11&c_time=$c_time&c_time1=$c_time1&a_user=$a_user&a_grp=$a_grp>$rows_tdbc</a></td>

</tr>

</table>

<br>

“);

        }

/// T 성공 리스트 보기 ////

if ( $view_type == “1” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>진행담당</td>

<td>고객분류</td>

<td>진행단계</td>

<td>주요제품</td>

<td>T시작일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_s,MYSQL_ASSOC)) {

$p_uid = $row[p_uid];

$p_sec = $row[p_sec];

$c_name = $row[c_name];

$issue = $row[issue];

$p_mng = $row[p_mng];

$p_code = $row[p_code];

$p_step = $row[p_step];

$product = $row[product];

$s_date = date(“Y-m-d”,$row[s_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>${p_sec}-${c_name}-${issue}</a></td>

<td>$p_mng</td>

<td>$p_code</td>

<td>$p_step</td>

<td>$product</td>

<td>$s_date</td>

</tr>

“);

        }

}

/// T 성공 리스트 보기 끝 ////

/// TD 메일  리스트 보기 ////

if ( $view_type == “2” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>업무제목</td>

<td>업무단계</td>

<td>업무형태</td>

<td>업무시간</td>

<td>업무담당</td>

<td>업무시작일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_m,MYSQL_ASSOC)) {

$a_uid = $row[a_uid];

$p_uid = $row[p_uid];

$p_name = $row[p_name];

$a_user = $row[a_user];

$a_step = $row[a_step];

$a_type = $row[a_type];

$a_time = $row[a_time];

$a_subject = $row[a_subject];

$a_date = date(“Y-m-d”,$row[a_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>$p_name</a></td>

<td><a href=../act1_view.php?aid=$a_uid target=new>$a_subject</a></td>

<td>$a_step</td>

<td>메일</td>

<td>$a_time</td>

<td>$a_user</td>

<td>$a_date</td>

</tr>

“);

        }

}

/// T 메일  리스트 보기 끝 ////

/// TD 전화  리스트 보기 ////

if ( $view_type == “3” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>업무제목</td>

<td>업무단계</td>

<td>업무형태</td>

<td>업무시간</td>

<td>업무담당</td>

<td>업무시작일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_p,MYSQL_ASSOC)) {

$a_uid = $row[a_uid];

$p_uid = $row[p_uid];

$p_name = $row[p_name];

$a_user = $row[a_user];

$a_step = $row[a_step];

$a_type = $row[a_type];

$a_time = $row[a_time];

$a_subject = $row[a_subject];

$a_date = date(“Y-m-d”,$row[a_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>$p_name</a></td>

<td><a href=../act1_view.php?aid=$a_uid target=new>$a_subject</a></td>

<td>$a_step</td>

<td>전화</td>

<td>$a_time</td>

<td>$a_user</td>

<td>$a_date</td>

</tr>

“);

        }

}

/// T 메일  리스트 보기 끝 ////

/// TD 전화  리스트 보기 ////

if ( $view_type == “4” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>업무제목</td>

<td>업무단계</td>

<td>업무형태</td>

<td>업무시간</td>

<td>업무담당</td>

<td>업무시작일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_v,MYSQL_ASSOC)) {

$a_uid = $row[a_uid];

$p_uid = $row[p_uid];

$p_name = $row[p_name];

$a_user = $row[a_user];

$a_step = $row[a_step];

$a_type = $row[a_type];

$a_time = $row[a_time];

$a_subject = $row[a_subject];

$a_date = date(“Y-m-d”,$row[a_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>$p_name</a></td>

<td><a href=../act1_view.php?aid=$a_uid target=new>$a_subject</a></td>

<td>$a_step</td>

<td>방문</td>

<td>$a_time</td>

<td>$a_user</td>

<td>$a_date</td>

</tr>

“);

        }

}

/// T 메일  리스트 보기 끝 ////

/// 데모 건수  리스트 보기 ////

if ( $view_type == “5” ) {

        if ( $mem_sec == “engineer” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>업무내용</td>

<td>업무단계</td>

<td>업무형태</td>

<td>업무담당</td>

<td>업무종류</td>

<td>업무시간</td>

<td>업무일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_d,MYSQL_ASSOC)) {

$a_uid = $row[a_uid];

$p_uid = $row[p_uid];

$p_name = $row[p_name];

$a_user = $row[a_user];

$a_type = $row[a_type];

$a_kind = $row[a_kind];

$a_step = $row[a_step];

$a_subject = $row[a_subject];

$a_date = date(“Y-m-d”,$row[a_date]);

$a_time = $row[a_time];

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>${p_name}</a></td>

<td><a href=../act1_view.php?aid=$a_uid target=new>$a_subject</a></td>

<td>$a_step</td>

<td>$a_type</td>

<td>$a_user</td>

<td>$a_kind</td>

<td>$a_time</td>

<td>$a_date</td>

</tr>

“);

               }

        } else {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>진행담당</td>

<td>진행단계</td>

<td>고객분류</td>

<td>주요제품</td>

<td>데모일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_d,MYSQL_ASSOC)) {

$p_uid = $row[p_uid];

$p_sec = $row[p_sec];

$c_name = $row[c_name];

$issue = $row[issue];

$p_mng = $row[p_mng];

$demo_date = date(“Y-m-d”,$row[demo_date]);

$p_step = $row[p_step];

$product = $row[product];

$p_code = $row[p_code];

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>${p_sec}-${c_name}-${issue}</a></td>

<td>$p_mng</td>

<td>$p_step</td>

<td>$p_code</td>

<td>$product</td>

<td>$demo_date</td>

</tr>

“);

               }

        }

}

/// 데모  리스트 보기 끝 ////

/// N 진입  리스트 보기 ////

if ( $view_type == “6” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>진행담당</td>

<td>고객분류</td>

<td>진행단계</td>

<td>주요제품</td>

<td>T시작일</td>

<td>N시작일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_n,MYSQL_ASSOC)) {

$p_uid = $row[p_uid];

$p_sec = $row[p_sec];

$c_name = $row[c_name];

$issue = $row[issue];

$p_mng = $row[p_mng];

$p_code = $row[p_code];

$p_step = $row[p_step];

$product = $row[product];

$est_date2 = date(“Y-m-d”,$row[est_date2]);

$s_date = date(“Y-m-d”,$row[s_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>${p_sec}-${c_name}-${issue}</a></td>

<td>$p_mng</td>

<td>$p_code</td>

<td>$p_step</td>

<td>$product</td>

<td>$s_date</td>

<td>$est_date2</td>

</tr>

“);

        }

}

/// N 진입  리스트 보기 끝 ////

/// C 진입  리스트 보기 ////

if ( $view_type == “7” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>진행담당</td>

<td>고객분류</td>

<td>진행단계</td>

<td>주요제품</td>

<td>T시작일</td>

<td>사업성공일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_c,MYSQL_ASSOC)) {

$p_uid = $row[p_uid];

$p_sec = $row[p_sec];

$c_name = $row[c_name];

$issue = $row[issue];

$p_mng = $row[p_mng];

$p_code = $row[p_code];

$p_step = $row[p_step];

$product = $row[product];

$cont_date = date(“Y-m-d”,$row[cont_date]);

$s_date = date(“Y-m-d”,$row[s_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>${p_sec}-${c_name}-${issue}</a></td>

<td>$p_mng</td>

<td>$p_code</td>

<td>$p_step</td>

<td>$product</td>

<td>$s_date</td>

<td>$cont_date</td>

</tr>

“);

        }

}

/// C 진입  리스트 보기 끝 ////

/// C1 진입  리스트 보기 ////

if ( $view_type == “8” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>진행담당</td>

<td>고객분류</td>

<td>진행단계</td>

<td>주요제품</td>

<td>T시작일</td>

<td>사업성공일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_c1,MYSQL_ASSOC)) {

$p_uid = $row[p_uid];

$p_sec = $row[p_sec];

$c_name = $row[c_name];

$issue = $row[issue];

$p_mng = $row[p_mng];

$p_code = $row[p_code];

$p_step = $row[p_step];

$product = $row[product];

$cont_date = date(“Y-m-d”,$row[cont_date]);

$s_date = date(“Y-m-d”,$row[s_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>${p_sec}-${c_name}-${issue}</a></td>

<td>$p_mng</td>

<td>$p_code</td>

<td>$p_step</td>

<td>$product</td>

<td>$s_date</td>

<td>$cont_date</td>

</tr>

“);

        }

}

/// C1 진입  리스트 보기 끝 ////

/// 수익성 업무 건수  리스트 보기 ////

if ( $view_type == “9” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>업무제목</td>

<td>업무단계</td>

<td>업무형태</td>

<td>업무시간</td>

<td>업무담당</td>

<td>업무시작일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_bc,MYSQL_ASSOC)) {

$a_uid = $row[a_uid];

$p_uid = $row[p_uid];

$p_name = $row[p_name];

$a_user = $row[a_user];

$a_step = $row[a_step];

$a_type = $row[a_type];

$a_time = $row[a_time];

$a_subject = $row[a_subject];

$a_date = date(“Y-m-d”,$row[a_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>$p_name</a></td>

<td><a href=../act1_view.php?aid=$a_uid target=new>$a_subject</a></td>

<td>$a_step</td>

<td>$a_type</td>

<td>$a_time</td>

<td>$a_user</td>

<td>$a_date</td>

</tr>

“);

        }

}

/// 수익성 업무 건수   리스트 보기 끝 ////

/// TD 업무 건수  리스트 보기 ////

if ( $view_type == “10” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>업무제목</td>

<td>업무단계</td>

<td>업무형태</td>

<td>업무시간</td>

<td>업무담당</td>

<td>업무시작일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_tdc,MYSQL_ASSOC)) {

$a_uid = $row[a_uid];

$p_uid = $row[p_uid];

$p_name = $row[p_name];

$a_user = $row[a_user];

$a_step = $row[a_step];

$a_type = $row[a_type];

$a_time = $row[a_time];

$a_subject = $row[a_subject];

$a_date = date(“Y-m-d”,$row[a_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>$p_name</a></td>

<td><a href=../act1_view.php?aid=$a_uid target=new>$a_subject</a></td>

<td>$a_step</td>

<td>$a_type</td>

<td>$a_time</td>

<td>$a_user</td>

<td>$a_date</td>

</tr>

“);

        }

}

/// 수익성 업무 건수   리스트 보기 끝 ////

/// TD 사업 건수  리스트 보기 ////

if ( $view_type == “11” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>주요제품</td>

<td>영업담당</td>

<td>T시작일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_tdbc,MYSQL_ASSOC)) {

$p_uid = $row[p_uid];

$p_name = $row[p_name];

$p_product = $row[p_product];

$p_mng = $row[p_mng];

$s_date = date(“Y-m-d”,$row[s_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>$p_name</a></td>

<td>$p_product</td>

<td>$p_mng</td>

<td>$s_date</td>

</tr>

“);

        }

}

/// 수익성 업무 건수   리스트 보기 끝 ////

/// res  업무 건수  리스트 보기 ////

if ( $view_type == “12” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>업무제목</td>

<td>업무단계</td>

<td>업무형태</td>

<td>업무종류</td>

<td>업무시간</td>

<td>업무담당</td>

<td>업무시작일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_res,MYSQL_ASSOC)) {

$a_uid = $row[a_uid];

$p_uid = $row[p_uid];

$p_name = $row[p_name];

$a_user = $row[a_user];

$a_step = $row[a_step];

$a_type = $row[a_type];

$a_time = $row[a_time];

$a_kind = $row[a_kind];

$a_subject = $row[a_subject];

$a_date = date(“Y-m-d”,$row[a_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>$p_name</a></td>

<td><a href=../act1_view.php?aid=$a_uid target=new>$a_subject</a></td>

<td>$a_step</td>

<td>$a_type</td>

<td>$a_kind</td>

<td>$a_time</td>

<td>$a_user</td>

<td>$a_date</td>

</tr>

“);

        }

}

/// res 업무 건수   리스트 보기 끝 ////

/// dev  업무 건수  리스트 보기 ////

if ( $view_type == “13” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>업무제목</td>

<td>업무단계</td>

<td>업무형태</td>

<td>업무종류</td>

<td>업무시간</td>

<td>업무담당</td>

<td>업무시작일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_dev,MYSQL_ASSOC)) {

$a_uid = $row[a_uid];

$p_uid = $row[p_uid];

$p_name = $row[p_name];

$a_user = $row[a_user];

$a_step = $row[a_step];

$a_type = $row[a_type];

$a_time = $row[a_time];

$a_kind = $row[a_kind];

$a_subject = $row[a_subject];

$a_date = date(“Y-m-d”,$row[a_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>$p_name</a></td>

<td><a href=../act1_view.php?aid=$a_uid target=new>$a_subject</a></td>

<td>$a_step</td>

<td>$a_type</td>

<td>$a_kind</td>

<td>$a_time</td>

<td>$a_user</td>

<td>$a_date</td>

</tr>

“);

        }

}

/// dev 업무 건수   리스트 보기 끝 ////

/// cre  업무 건수  리스트 보기 ////

if ( $view_type == “14” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>업무제목</td>

<td>업무단계</td>

<td>업무형태</td>

<td>업무종류</td>

<td>업무시간</td>

<td>업무담당</td>

<td>업무시작일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_cre,MYSQL_ASSOC)) {

$a_uid = $row[a_uid];

$p_uid = $row[p_uid];

$p_name = $row[p_name];

$a_user = $row[a_user];

$a_step = $row[a_step];

$a_type = $row[a_type];

$a_time = $row[a_time];

$a_kind = $row[a_kind];

$a_subject = $row[a_subject];

$a_date = date(“Y-m-d”,$row[a_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>$p_name</a></td>

<td><a href=../act1_view.php?aid=$a_uid target=new>$a_subject</a></td>

<td>$a_step</td>

<td>$a_type</td>

<td>$a_kind</td>

<td>$a_time</td>

<td>$a_user</td>

<td>$a_date</td>

</tr>

“);

        }

}

/// dev 업무 건수   리스트 보기 끝 ////

/// exa  업무 건수  리스트 보기 ////

if ( $view_type == “15” ) {

echo (”

<table align=center width=90% cellpadding=3 cellspacing=0 border=1 bordercolor=black class=table1>

<tr bgcolor=#e0e9c0>

<td>프로젝트이름</td>

<td>업무제목</td>

<td>업무단계</td>

<td>업무형태</td>

<td>업무종류</td>

<td>업무시간</td>

<td>업무담당</td>

<td>업무시작일</td>

</tr>

“);

        while ($row = mysql_fetch_array($result_exa,MYSQL_ASSOC)) {

$a_uid = $row[a_uid];

$p_uid = $row[p_uid];

$p_name = $row[p_name];

$a_user = $row[a_user];

$a_step = $row[a_step];

$a_type = $row[a_type];

$a_time = $row[a_time];

$a_kind = $row[a_kind];

$a_subject = $row[a_subject];

$a_date = date(“Y-m-d”,$row[a_date]);

echo (”

<tr>

<td><a href=../prj1_view.php?id=$p_uid target=new>$p_name</a></td>

<td><a href=../act1_view.php?aid=$a_uid target=new>$a_subject</a></td>

<td>$a_step</td>

<td>$a_type</td>

<td>$a_kind</td>

<td>$a_time</td>

<td>$a_user</td>

<td>$a_date</td>

</tr>

“);

        }

}

/// dev 업무 건수   리스트 보기 끝 ////

}

//// MYSQL 접속 세션 종료 ///////

if ( $page_stats == “next” ) {

        mysql_free_result($result_s);

        mysql_free_result($result_p);

        mysql_free_result($result_m);

        mysql_free_result($result_v);

        mysql_free_result($result_d);

        mysql_free_result($result_n);

        mysql_free_result($result_c);

        mysql_free_result($result_c1);

        mysql_free_result($result_bc);

        mysql_free_result($result_tdc);

        mysql_free_result($result_bt);

        mysql_free_result($result_tdt);

        mysql_free_result($result_tdbc);

        if ( $mem_sec == “engineer” ) {

                mysql_free_result($result_res);

                mysql_free_result($result_dev);

                mysql_free_result($result_cre);

                mysql_free_result($result_exa);

                }

                

}

/// MYSQL 접속 세션 종료 끝 ////

?>

서진우

슈퍼컴퓨팅 전문 기업 클루닉스/ 상무(기술이사)/ 정보시스템감리사/ 시스존 블로그 운영자

You may also like...

2 Responses

  1. 2024년 10월 16일

    … [Trackback]

    […] Read More Information here to that Topic: nblog.syszone.co.kr/archives/2898 […]

  2. 2024년 10월 26일

    … [Trackback]

    […] Read More Information here to that Topic: nblog.syszone.co.kr/archives/2898 […]

페이스북/트위트/구글 계정으로 댓글 가능합니다.