관리자 페이지 설문조사 일반페이지 적용

관리자 페이지 설문조사 일반페이지 적용

QA

관리자 페이지 설문조사 일반페이지 적용

답변 1

본문

관리자에 있는 투표관리를 일반페이지로 응용 작업을 해서
현재는 회원이면 등록/수정/목록에서 투표까지 다 되게 작업을 해놓았는데요..
문제는 글등록시에 회원아이디(회원 각자 글..)로 인식을 어떻게 업데이트문에서 시켜야 할지 ..
현재 업데이트문 입니다..
도와주세요..
 
<?php
include_once('./_common.php');
$items= array();
   for ($i=0; $i<=9; $i++) {
$items['po_poll'.$i] = get_text($_POST['po_poll'][$i]);
   }
$_POST['po_poll1'] = $items['po_poll0'];
$_POST['po_poll2'] = $items['po_poll1'];
$_POST['po_poll3'] = $items['po_poll2'];
$_POST['po_poll4'] = $items['po_poll3'];
$_POST['po_poll5'] = $items['po_poll4'];
$_POST['po_poll6'] = $items['po_poll5'];
$_POST['po_poll7'] = $items['po_poll6'];
$_POST['po_poll8'] = $items['po_poll7'];
$_POST['po_poll9'] = $items['po_poll8'];
$_POST['po_poll10'] = $items['po_poll9'];
if ($w == '')
{
    $sql = " insert {$g5['poll_table']}
                    ( mb_id, po_subject, po_category, po_poll1, po_poll2, po_poll3, po_poll4, po_poll5, po_poll6, po_poll7, po_poll8, po_poll9,  po_poll10, po_cnt1, po_cnt2, po_cnt3, po_cnt4, po_cnt5, po_cnt6, po_cnt7, po_cnt8, po_cnt9, po_cnt10, po_etc, po_multi, po_level, po_point, po_date )
             values ( '{$_POST['mb_id']}', '{$_POST['po_subject']}', '{$_POST['po_category']}', '{$_POST['po_poll1']}', '{$_POST['po_poll2']}', '{$_POST['po_poll3']}', '{$_POST['po_poll4']}', '{$_POST['po_poll5']}', '{$_POST['po_poll6']}', '{$_POST['po_poll7']}', '{$_POST['po_poll8']}', '{$_POST['po_poll9']}', '{$_POST['po_poll10']}', '{$_POST['po_cnt1']}', '{$_POST['po_cnt2']}', '{$_POST['po_cnt3']}', '{$_POST['po_cnt4']}', '{$_POST['po_cnt5']}', '{$_POST['po_cnt6']}', '{$_POST['po_cnt7']}', '{$_POST['po_cnt8']}', '{$_POST['po_cnt9']}', '{$_POST['po_cnt10']}', '{$_POST['po_etc']}', '{$_POST['po_multi']}', '{$_POST['po_level']}', '{$_POST['po_point']}', '".G5_TIME_YMDHIS."' ) ";
    sql_query($sql);
    $po_id = mysql_insert_id();
 
}
else if ($w == 'u')
{
    $sql = " update {$g5['poll_table']}
                 set mb_id = '{$member['mb_id']}',
      po_subject = '{$_POST['po_subject']}',
      po_category = '{$_POST['po_category']}',
                     po_poll1 = '{$_POST['po_poll1']}',
                     po_poll2 = '{$_POST['po_poll2']}',
                     po_poll3 = '{$_POST['po_poll3']}',
                     po_poll4 = '{$_POST['po_poll4']}',
                     po_poll5 = '{$_POST['po_poll5']}',
                     po_poll6 = '{$_POST['po_poll6']}',
                     po_poll7 = '{$_POST['po_poll7']}',
                     po_poll8 = '{$_POST['po_poll8']}',
                     po_poll9 = '{$_POST['po_poll9']}',
      po_poll10 = '{$_POST['po_poll10']}',
                     po_cnt1 = '{$_POST['po_cnt1']}',
                     po_cnt2 = '{$_POST['po_cnt2']}',
                     po_cnt3 = '{$_POST['po_cnt3']}',
                     po_cnt4 = '{$_POST['po_cnt4']}',
                     po_cnt5 = '{$_POST['po_cnt5']}',
                     po_cnt6 = '{$_POST['po_cnt6']}',
                     po_cnt7 = '{$_POST['po_cnt7']}',
                     po_cnt8 = '{$_POST['po_cnt8']}',
                     po_cnt9 = '{$_POST['po_cnt9']}',
      po_cnt10 = '{$_POST['po_cnt10']}',
                     po_etc = '{$_POST['po_etc']}',
      po_multi = '{$_POST['po_multi']}',
                     po_level = '{$_POST['po_level']}',
                     po_point = '{$_POST['po_point']}',
                     po_date = '{$_POST['po_date']}'
                where po_id = '{$_POST['po_id']}' ";
    sql_query($sql);
}
else if ($w == 'd')
{
    $sql = " delete from {$g5['poll_table']} where po_id = '{$_POST['po_id']}' ";
    sql_query($sql);
    $sql = " delete from {$g5['poll_etc_table']} where po_id = '{$_POST['po_id']}' ";
    sql_query($sql);
}
// 가장 큰 투표번호를 기본환경설정에 저장하여
// 투표번호를 넘겨주지 않았을 경우
// 가장 큰 투표번호를 구해야 하는 쿼리를 대체한다
$row = sql_fetch(" select max(po_id) as max_po_id from {$g5['poll_table']} ");
sql_query(" update {$g5['config_table']} set cf_max_po_id = '{$row['max_po_id']}' ");
if ($w == 'd')
    goto_url('./poll_list.php?'.$qstr);
else
    goto_url('./poll_list.php');
?>

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 10,637
© SIRSOFT
현재 페이지 제일 처음으로