Пример #1
0
     } else {
         $is_show = 0;
     }
     $sql = "select vid from vote where vote_title = '{$_REQUEST['title']}'";
     $vote_vid = $db->getOne($sql);
     $vid = $vote_vid['vid'];
     if ($vid) {
         $sql = "select * from vote_content where vid = '{$vid}'";
         $content = $db->getOne($sql);
         if (empty($content)) {
         } else {
             MooMessageAdmin('该题目已经存在', 'vote.php', 1);
         }
     } else {
         $start_time = Time_handling($_REQUEST['start_time']);
         $end_time = Time_handling($_REQUEST['end_time']);
         $sql = "insert into vote(vote_title,vote_style,is_show,`group`,vote_starttime,vote_endtime) values ('{$_REQUEST['title']}','{$style}','{$is_show}','{$_REQUEST['group']}','{$start_time}','{$end_time}')";
         $db->query($sql);
     }
     $sql = "select vid,vote_style from vote where vote_title = '{$_REQUEST['title']}'";
     $vote_vid = $db->getOne($sql);
     $vid = $vote_vid['vid'];
     if ($vote_vid['vote_style']) {
         $style = $vote_vid['vote_style'];
     } else {
         $style = $_REQUEST['style'];
     }
     require_once adminTemplate('vote_style');
 } else {
     if ($action == 'vote' && $_REQUEST['h']) {
         if ($_REQUEST['check'] != 1) {
Пример #2
0
function array_handle($array)
{
    foreach ($array as $k => $v) {
        if ($array[$k] == '') {
            $array[$k] = 0;
        }
        $array['start_time'] = Time_handling($array['start_time']);
        $array['end_time'] = Time_handling($array['end_time']);
    }
    foreach ($array as $k => $v) {
        if (substr($k, 0, 6) == 'option') {
            $array['content'] .= substr($k, 6) . ':' . $v . ';';
        }
    }
    return $array;
}