当前位置: 首页>>代码示例>>PHP>>正文


PHP order::get_print_material方法代码示例

本文整理汇总了PHP中order::get_print_material方法的典型用法代码示例。如果您正苦于以下问题:PHP order::get_print_material方法的具体用法?PHP order::get_print_material怎么用?PHP order::get_print_material使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在order的用法示例。


在下文中一共展示了order::get_print_material方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: print3d

 public function print3d()
 {
     $return_array = $this->obj_order->return_array();
     $view = new View('service/print1');
     $view->set('user', $this->_user);
     if ($_POST) {
         include_once WEBROOT . 'application/libraries/recaptchalib.php';
         $privatekey = "6LeEcuASAAAAAAdzMZqxXewlJJhn50HSA4sD9_yG";
         $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["rcf"], $_POST["rrf"]);
         if (!$resp->is_valid) {
             $return_array['msg'] = '验证码错误';
             echo json_encode($return_array);
             return;
         }
         $model_file = $this->obj_session->get('PRINT_3D_MODELSTL');
         if ($model_file == FALSE) {
             $return_array['msg'] = '先上传3D模型文件';
             echo json_encode($return_array);
             return;
         }
         $preview = $this->obj_session->get('PRINT_3D_PREVIEW');
         if ($preview == FALSE) {
             $return_array['msg'] = '先上传预览图';
             echo json_encode($return_array);
             return;
         }
         $name = $this->input->post('name');
         if ($name == FALSE) {
             $return_array['msg'] = '请填写真实姓名!';
             echo json_encode($return_array);
             return;
         }
         $email = $this->input->post('email');
         if ($email == FALSE || !preg_match('/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\\.[a-zA-Z0-9_-]{2,3}){1,2})$/', $email)) {
             $return_array['msg'] = '请填写正确的电子邮箱地址!';
             echo json_encode($return_array);
             return;
         }
         $mobile = $this->input->post('mobile');
         if ($mobile == FALSE || !preg_match('/^1[3|4|5|8][0-9]\\d{4,8}$/', $mobile)) {
             $return_array['msg'] = '手机号码格式错误!';
             echo json_encode($return_array);
             return;
         }
         //用户注册
         $r = $this->obj_user_lib->get_user_by_email($email);
         if ($r == FALSE) {
             $reg_data = array('username' => $email, 'email' => $email, 'mobile' => $mobile, 'name' => $name, 'passwd' => $this->obj_user_help->encrypt_passwd($mobile), 'tk' => $this->obj_user_help->create_token($email), 'lastlogin_time' => date('Y-m-d H:i:s'), 'status' => User_Model::STATUS_0);
             //var_dump($reg_data);die();
             $uid = $this->obj_user_lib->add_user($reg_data);
             if ($uid == FALSE) {
                 $return_array['msg'] = '用户信息错误!';
                 echo json_encode($return_array);
                 return;
             }
             $reg_data['id'] = $uid;
             $this->obj_user_help->send_reg_mail($uid, $email, $email);
             $this->_user = $reg_data;
         } else {
             $this->_user = $r;
             if ($this->_user['name'] == FALSE) {
                 $this->obj_user_lib->update_user_name($this->_user['id'], $name);
             }
             if ($this->_user['mobile'] == FALSE) {
                 $this->obj_user_lib->update_user_mobile($this->_user['id'], $mobile);
             }
         }
         $lengh = intval($this->input->post('sizel'));
         $width = intval($this->input->post('sizew'));
         $heigh = intval($this->input->post('sizeh'));
         if ($lengh == FALSE || $lengh < 30) {
             $return_array['msg'] = '最小为30mm!';
             echo json_encode($return_array);
             return;
         }
         if ($width == FALSE || $width < 30) {
             $return_array['msg'] = '最小为30mm!';
             echo json_encode($return_array);
             return;
         }
         if ($heigh == FALSE || $heigh < 30) {
             $return_array['msg'] = '最小为30mm!';
             echo json_encode($return_array);
             return;
         }
         $size = $lengh . '*' . $width . '*' . $heigh;
         $material = $this->input->post('material');
         if (order::get_print_material($material) == FALSE) {
             $return_array['msg'] = '材料数据错误!';
             echo json_encode($return_array);
             return;
         }
         $color = $this->input->post('color');
         if (order::get_print_color($color) == FALSE) {
             $return_array['msg'] = '颜色数据错误!';
             echo json_encode($return_array);
             return;
         }
         $precision = $this->input->post('precision');
         if (order::get_print_precision($precision) == FALSE) {
//.........这里部分代码省略.........
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:101,代码来源:service.php

示例2:

                                    </td>
                                </tr>
                                <tr>
                                    <th>打印尺寸:</th>
                                    <td>
                                     <label><?php 
echo $data['size'];
?>
</label>
                                    </td>
                                </tr>
                                <tr>
                                    <th>打印材料:</th>
                                    <td>
                                     <label><?php 
echo order::get_print_material($data['material']);
?>
</label>
                                    </td>
                                </tr>
                                <tr>
                                    <th>打印颜色:</th>
                                    <td>
                                     <label>
                                    <?php 
$color = order::get_print_color($data['color']);
if ($color != '') {
    echo '<img src="' . $color . '" width="30px" height="40px"/>';
}
?>
                                     <?php 
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:31,代码来源:show_detail.php


注:本文中的order::get_print_material方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。