當前位置: 首頁>>代碼示例>>PHP>>正文


PHP order::get_print_precision方法代碼示例

本文整理匯總了PHP中order::get_print_precision方法的典型用法代碼示例。如果您正苦於以下問題:PHP order::get_print_precision方法的具體用法?PHP order::get_print_precision怎麽用?PHP order::get_print_precision使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在order的用法示例。


在下文中一共展示了order::get_print_precision方法的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:

$color = order::get_print_color($data['color']);
if ($color != '') {
    echo '<img src="' . $color . '" width="30px" height="40px"/>';
}
?>
                                     <?php 
echo $data['color'];
?>
</label>
                                    </td>
                                </tr>
                                <tr>
                                    <th>打印精度:</th>
                                    <td>
                                     <label><?php 
echo order::get_print_precision($data['precision']);
?>
</label>
                                    </td>
                                </tr>
                                <tr>
                                    <th>打印數量:</th>
                                    <td>
                                     <label><?php 
echo $data['quantity'];
?>
</label>
                                    </td>
                                </tr>
                                <tr>
                                    <th>草圖:</th>
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:31,代碼來源:show_detail.php


注:本文中的order::get_print_precision方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。