<?php
/*
 * 注意：此文件由tpl_engine编译型模板引擎编译生成。
 * 如果您的模板要进行修改，请修改 templates/default/modules/poll/poll_show_config.html
 * 如果您的模型要进行修改，请修改 models/modules/poll/poll_show_config.php
 *
 * 修改完成之后需要您进入后台重新编译，才会重新生成。
 * 如果您开启了debug模式运行，那么您可以省去上面这一步，但是debug模式每次都会判断程序是否更新，debug模式只适合开发调试。
 * 如果您正式运行此程序时，请切换到service模式运行！
 * 
 * 如有您有问题请到官方论坛（http://tech.jooyea.com/bbs/）提问，谢谢您的支持。
 */
?><?php
//引入模块公共方法文件
require("foundation/arecent_affair.php");
require("foundation/module_poll.php");

//引入语言包
$pol_langpackage=new polllp;

//变量声明区
	$user_id=get_sess_userid();
	$set_option=short_check(get_argg('set_option'));
  $pid=short_check(get_argg('pid'));
  $poll_info=array();
  
//数据表定义区
	$t_users=$tablePreStr."users";
	$t_poll=$tablePreStr."poll";
	$t_polloption=$tablePreStr."polloption";
	$t_polluser=$tablePreStr."polluser";
	
		//定义写操作
  dbtarget('r',$dbServs);	
  $dbo=new dbex();
  
  if($set_option=="add_award"){
		$sql="select integral from $t_users where user_id=$user_id";
		$u_int=$dbo->getRow($sql);
	}
	
  $poll_info=get_poll_row($dbo,$t_poll,$pid);

?>

	<?php if($set_option=="stop_award"){?>
		<table width='180px' style='background-color:white'>
		<caption><b><?php echo $pol_langpackage->pol_grant_end;?></b></caption>
		<tr><td><?php echo $pol_langpackage->pol_grant_back;?></td></tr>
		<tr><td><input type='button' class='top_button' value='<?php echo $pol_langpackage->pol_con;?>' onclick='action_set_config("<?php echo $set_option;?>",<?php echo $pid;?>);' />
		<input type='button' class='top_button' value='<?php echo $pol_langpackage->pol_cancel;?>' onclick='cancel_window()' /></td></tr>
		</table>
	<?php }?>
	
	<?php if($set_option=="add_award"){?>
		<table id='award_table' style='background-color:white'>
		<caption><b><?php echo $pol_langpackage->pol_add_grant;?></b></caption>
		<tr><td><?php echo $pol_langpackage->pol_add_grant_total;?>：<input type='text' size=2 id='add_award_sum' value='' />（0~<?php echo $u_int['integral'];?>）</td></tr>
		<?php if($poll_info['percredit'] < 10){?>
			<tr><td><?php echo $pol_langpackage->pol_add_grant_singular;?>：<input type='text' size=2 id='add_award_sing' value='' />（<?php echo str_replace("{max_p}",10-$poll_info['percredit'],$pol_langpackage->pol_r_point);?>）</td></tr>
		<?php }?>
		<tr><td><input type='button' class='top_button' value='<?php echo $pol_langpackage->pol_con;?>' onclick='action_set_config("<?php echo $set_option;?>",<?php echo $pid;?>);' />
		<input type='button' class='top_button' value='<?php echo $pol_langpackage->pol_cancel;?>' onclick='cancel_window()' /></td></tr>
		</table>		
	<?php }?>
		
	<?php if($set_option=="add_option"){?>	
		<table style='background-color:white'>
		<caption><b><?php echo $pol_langpackage->pol_add_option;?></b></caption>
		<tr><td><?php echo $pol_langpackage->pol_add_new_option;?>：</td></tr>
		<tr><td><input type='text' id='add_new_option' /></td></tr>
		<tr><td><input type='button' class='top_button' value='<?php echo $pol_langpackage->pol_con;?>' onclick='action_set_config("<?php echo $set_option;?>",<?php echo $pid;?>);' />
		<input type='button' class='top_button' value='<?php echo $pol_langpackage->pol_cancel;?>' onclick='cancel_window()' /></td></tr>
		</table>
	<?php }?>
		
	<?php if($set_option=="del_poll"){?>	
		<table width='180px' style='background-color:white'>
		<caption><b><?php echo $pol_langpackage->pol_del;?></b></caption>
		<tr><td><?php echo $pol_langpackage->pol_del_con;?></td></tr>
		<tr><td><input type='button' class='top_button' value='<?php echo $pol_langpackage->pol_con;?>' onclick='action_set_config("<?php echo $set_option;?>",<?php echo $pid;?>);' />
		<input type='button' class='top_button' value='<?php echo $pol_langpackage->pol_cancel;?>' onclick='cancel_window()' /></td></tr>
		</table>
	<?php }?>
		
	<?php if($set_option=="change_date"){?>	
		<table style='background-color:white'>
		<caption><b><?php echo $pol_langpackage->pol_amend_end_time;?></b></caption>
		<tr><td><?php echo $pol_langpackage->pol_new_end_time;?>：</td></tr>
		<tr><td>
		<input type='text' readonly id='expiration' style='width:80px' value="<?php echo date('Y-m-d',time()+60*60*720);?>" onclick='getDateString(this,oCalendarChs)' />
		<input type='button' class='top_button' value='<?php echo $pol_langpackage->pol_con;?>' onclick='action_set_config("<?php echo $set_option;?>",<?php echo $pid;?>);' />
		<input type='button' class='top_button' value='<?php echo $pol_langpackage->pol_cancel;?>' onclick='cancel_window()' /></td></tr>	
		</table>
	<?php }?>
		
	<?php if($set_option=="add_summary"){?>	
		<table style='background-color:white'>
		<caption><b><?php echo $pol_langpackage->pol_sum;?></b></caption>
		<tr><td><?php echo $pol_langpackage->pol_write_sum;?>：</td></tr>
		<tr><td><textarea cols='25' rows='5' id='add_summary'><?php echo $poll_info['summary'];?></textarea></td></tr>
		<tr><td><input type='button' class='top_button' value='<?php echo $pol_langpackage->pol_con;?>' onclick='action_set_config("<?php echo $set_option;?>",<?php echo $pid;?>);' />
		<input type='button' class='top_button' value='<?php echo $pol_langpackage->pol_cancel;?>' onclick='cancel_window();' /></td></tr>
		</table>
	<?php }?>
