Пример #1
0
' class='mainoption'>
<Input type='submit' name='cmdRevoke' value='<?php 
        echo GetStringFromStringTable("IDS_GAME_BTN_REVOKE_CHALLANGE", $config);
        ?>
' class='mainoption'>
</td>
</tr>
</table>
</form>

<?php 
    }
} else {
    if ($move_promotion_figur && strlen($movestr2) == 5) {
        $url = "chess_game3.php?txtmovefrom=" . $movefrom . "&txtmoveto=" . $moveto;
        if (trim(get_turn()) == "b") {
            //black
            $queen_img = "08.gif";
            $rook_img = "09.gif";
            $bishop_img = "10.gif";
            $knight_img = "11.gif";
        } else {
            //white
            $queen_img = "02.gif";
            $rook_img = "03.gif";
            $bishop_img = "04.gif";
            $knight_img = "05.gif";
        }
        ?>

<table border='0' cellpadding='2' cellsapcing='0' width='80%' align='center'>
Пример #2
0
function pro_print1($order_id)
{
    $sql = "select o.order_sn,o.best_time,o.scts,o.card_name,o.card_message,g.goods_name as gname,g.goods_sn,g.goods_attr,g.goods_number,c.*, " . "o.country,o.address from ecs_order_info as o " . "left join ecs_order_goods as g on o.order_id=g.order_id " . "left join print_goods as c on g.goods_id=c.goods_id " . "where o.order_id = '{$order_id}' and (g.goods_price>100 or g.goods_sn='34')";
    $goods = $GLOBALS['db_read']->getAll($sql);
    $sql2 = "select sum(goods_number) from ecs_order_goods where order_id = '{$order_id}' and goods_id=60 and goods_price != 0";
    $canju = $GLOBALS['db_read']->getOne($sql2);
    $sql3 = "select sum(goods_number) from ecs_order_goods where order_id = '{$order_id}' and goods_id=61";
    $candle = $GLOBALS['db_read']->getOne($sql3);
    $sql4 = "select goods_number,goods_attr from ecs_order_goods where order_id = '{$order_id}' and goods_id=67";
    $num_candle_arr = $GLOBALS['db_read']->getAll($sql4);
    $sum_num_candle = 0;
    $num_candle_attr = "";
    foreach ($num_candle_arr as $val) {
        for ($i = 0; $i < $val['goods_number']; $i++) {
            if ($val['goods_attr'] > 9) {
                $sum_num_candle += 2;
            } else {
                if ($val['goods_attr'] > 0 && $val['goods_attr'] <= 9 || $val['goods_attr'] === 0) {
                    $sum_num_candle += 1;
                }
            }
            $num_candle_attr .= $val['goods_attr'] . ",";
        }
    }
    $res = $a = array();
    $count = array_sum_rec($goods, 'goods_number');
    //echo $count;
    @($cards = explode(';', $goods['0']['card_name']));
    @($cmsgs = explode(';', $goods['0']['card_message']));
    //上海八款蛋糕,蛋糕标签修改--(裱花蛋糕-冰点心)...
    $msArray = array(51, 52, 55, 58, 63, 64, 92, 93);
    foreach ($goods as $key => $val) {
        //取得冰包编号
        $sql = "select ice_bag_num from order_ice_bag where order_id={$order_id} and goods_attr='" . $val['goods_attr'] . "'";
        $ice_bag_arr = $GLOBALS['db_read']->getAll($sql);
        if ($val['goods_number'] > 1) {
            for ($i = 0; $i < $val['goods_number']; $i++) {
                $turn = get_turn($val['best_time'], $val['country']);
                $a['order_sn'] = $val['order_sn'];
                $a['country'] = $val['country'];
                $a['end_time'] = date('Y-m-d H:i', strtotime($val['best_time']) - 4 * 3600);
                //$a['end_time']    = date('H:i',strtotime($val['best_time'])-4*3600);
                $a['scts'] = $val['scts'];
                $a['card_name'] = empty($cards[$key]) ? '无' : $cards[$key];
                $a['cmessage'] = empty($cmsgs[$key]) ? '无' : $cmsgs[$key];
                $a['goods_attr'] = $val['goods_attr'];
                $a['goods_sn'] = $val['goods_sn'];
                $a['goods_name'] = $val['goods_name'];
                $a['ice_bag_num'] = $ice_bag_arr[$i]['ice_bag_num'];
                $a['cj'] = get_free_count($val['goods_attr']);
                //???????
                $a['gname'] = $val['gname'];
                $a['bdate'] = substr($val['best_time'], 0, 4) . '/' . substr($val['best_time'], 5, 2) . '/' . substr($val['best_time'], 8, 2);
                //$a['bdate']       = substr($val['best_time'],0,4).'&nbsp;/&nbsp;'.substr($val['best_time'],5,2).'&nbsp;/&nbsp;'.substr($val['best_time'],8,2);
                $a['picitime'] = $turn['outime'];
                $a['i'] = $key + $i + 1;
                $a['goods_count'] = $count;
                $a['goods_pl'] = $val['raw'];
                $a['goods_tjj'] = $val['adds'];
                $a['goods_sav'] = $val['saves'];
                $a['goods_eat'] = $val['eats'];
                $a['energy_g'] = round($val['energy_g']);
                $a['energy_r'] = $val['energy_r'];
                $a['protein_g'] = $val['protein_g'];
                $a['protein_r'] = $val['protein_r'];
                $a['fat_g'] = $val['fat_g'];
                $a['fat_r'] = $val['fat_r'];
                $a['na_g'] = round($val['na_g']);
                $a['na_r'] = $val['na_r'];
                $a['carb_g'] = $val['carb_g'];
                $a['carb_r'] = $val['carb_r'];
                $a['weight'] = get_goods_weight($val['goods_attr']);
                $a['ptime'] = $GLOBALS['db_read']->getOne("select ptime from print_log_x where order_id = " . $order_id);
                $a['ptime2'] = date('Y-m-d H:i:s');
                //$a['candle']      = $candle ? $candle : 0;
                if ($_SESSION['city_group'] == '442') {
                    $a['cit'] = 's';
                    if (in_array($val['goods_id'], $msArray)) {
                        $a['ms'] = 'm';
                    }
                }
                $a['best_time'] = $val['best_time'];
                $res[] = $a;
            }
        } else {
            $turn = get_turn($val['best_time'], $val['country']);
            $a['order_sn'] = $val['order_sn'];
            $a['country'] = $val['country'];
            $a['end_time'] = date('Y-m-d H:i', strtotime($val['best_time']) - 4 * 3600);
            //$a['end_time']    = date('H:i',strtotime($val['best_time'])-4*3600);
            $a['scts'] = $val['scts'];
            $a['card_name'] = empty($cards[$key]) ? '无' : $cards[$key];
            $a['cmessage'] = empty($cmsgs[$key]) ? '无' : $cmsgs[$key];
            $a['goods_attr'] = $val['goods_attr'];
            @($a['ice_bag_num'] = $ice_bag_arr[0]['ice_bag_num']);
            $a['cj'] = get_free_count($val['goods_attr']);
            //???????
            $a['goods_sn'] = $val['goods_sn'];
            $a['goods_name'] = $val['goods_name'];
            $a['gname'] = $val['gname'];
            $a['bdate'] = substr($val['best_time'], 0, 4) . '/' . substr($val['best_time'], 5, 2) . '/' . substr($val['best_time'], 8, 2);
            $a['picitime'] = $turn['outime'];
            $a['i'] = $key + 1;
            $a['goods_count'] = $count;
            $a['goods_pl'] = $val['raw'];
            $a['goods_tjj'] = $val['adds'];
            $a['goods_sav'] = $val['saves'];
            $a['goods_eat'] = $val['eats'];
            $a['energy_g'] = round($val['energy_g']);
            $a['energy_r'] = $val['energy_r'];
            $a['protein_g'] = $val['protein_g'];
            $a['protein_r'] = $val['protein_r'];
            $a['fat_g'] = $val['fat_g'];
            $a['fat_r'] = $val['fat_r'];
            $a['na_g'] = round($val['na_g']);
            $a['na_r'] = $val['na_r'];
            $a['carb_g'] = $val['carb_g'];
            $a['carb_r'] = $val['carb_r'];
            $a['weight'] = get_goods_weight($val['goods_attr']);
            $a['ptime'] = $GLOBALS['db_read']->getOne("select ptime from print_log_x where order_id = " . $order_id);
            $a['ptime2'] = date('Y-m-d H:i:s');
            //$a['candle']      = $candle ? $candle : 0;
            if ($_SESSION['city_group'] == '442') {
                $a['cit'] = 's';
                if (in_array($val['goods_id'], $msArray)) {
                    $a['ms'] = 'm';
                }
            }
            $a['best_time'] = $val['best_time'];
            $res[] = $a;
        }
    }
    @($res[0]['cj'] = $res[0]['cj'] + $canju);
    $res[0]['candle'] = $candle;
    $res[0]['sum_num_candle'] = $sum_num_candle;
    $res[0]['num_candle_attr'] = "(" . $num_candle_attr . ")";
    //return get_goods_canju($res,$canju);
    return $res;
}