$ext = "." . trim(pathinfo($a['base'], PATHINFO_EXTENSION)); $filename_bar = basename($a['base'], $ext); if ($filename_bar === 'combo-1-75' || $filename_bar === 'dark-1-75' || $filename_bar === 'milk-1-75') { $barpath = tinyBar($a); } if ($filename_bar === 'combo-14-8' || $filename_bar === 'dark-14-8' || $filename_bar === 'milk-14-8') { $barpath = smallBar($a); } if ($filename_bar === 'combo-5-2' || $filename_bar === 'dark-5-2' || $filename_bar === 'milk-5-2') { $barpath = mediumBar($a); } if ($filename_bar === 'combo-4-6' || $filename_bar === 'dark-4-6' || $filename_bar === 'milk-4-6') { $barpath = largeBar($a); } if ($filename_bar === 'combo-9-5-8' || $filename_bar === 'dark-9-5-8' || $filename_bar === 'milk-9-5-8') { $barpath = kingBar($a); } // $img = '/var/www/mch'.$post['base']; // $size = getimagesize($img); // $h = ($size[0])/3; // $w = ($size[1])/3; // $h = 100; // $w = 100; // $date = date('Y_m_d_H_i_s'); // if(isset($post['layer_top']) && $post['layer_top'] != ""){ // $layout->resizeImage($w, $h, Imagick::FILTER_LANCZOS, 1); // $base->compositeImage($layout, Imagick::COMPOSITE_OVERLAY, 100, 30); // } // $bar = $base->writeImage("/var/www/mch/env/html5_configurator/img/design/$post[sessionid]-$date-output.png"); // $barpath = "env/html5_configurator/img/design/$post[sessionid]-$date-output.png"; $sql = "INSERT into temp_orders\r\n\t\tSET sessionID = '{$post['sessionid']}',\r\n\t\t\tproductID = '{$post['productsid']}',\r\n\t\t\tflavorID = '{$post['bar_type']}',\r\n\t\t\tfoilID = 9,\r\n\t\t\torder_msg_text1 = '{$post['line_one']}',\r\n\t\t\torder_msg_text2 = '{$post['line_two']}',\r\n\t\t\torder_msg_text3 = '{$post['line_three']}',\r\n\t\t\torder_msg_text4 = '{$post['line_four']}',\r\n\t\t\torder_msg_font1 = '{$post['line_one_font']}',\r\n\t\t\torder_msg_font2 = '{$post['line_two_font']}',\r\n\t\t\torder_msg_font3 = '{$post['line_three_font']}',\r\n\t\t\torder_msg_font4 = '{$post['line_four_font']}',\r\n\t\t\torder_msg_size1 = '{$post['line_one_size']}',\r\n\t\t\torder_msg_size2 = '{$post['line_two_size']}',\r\n\t\t\torder_msg_size3 = '{$post['line_three_size']}',\r\n\t\t\torder_msg_size4 = '{$post['line_four_size']}',\r\n\t\t\tstyleID = 1,\r\n\t\t\torder_clip_path = '{$post['layer_top']}',\r\n\t\t\torder_bg_path = null,\r\n\t\t\torder_design_path = '{$barpath}',\r\n\t\t\torder_qty = 200,\r\n\t\t\torder_rate = 1,\r\n\t\t\torder_total = 200*1,\r\n\t\t\tadded = 0,\r\n\t\t\tcust_type = '{$post['conf_type']}'";
if ($bar) { $barpath = "env/html5_configurator/img/design/{$post['sessionid']}-{$date}-output.png"; // echo "x-axis : ".$x." y-axis : ".$y; echo "<img src='{$barpath}'>"; return $bar; } else { return false; } } // echo $post['layer_top_x']." "; // echo $post['layer_top_y']." "; //tinyBar($a); //1-75.png(s) //smallBar($a); // mediumBar($a); // largeBar($a); kingBar($a); $ext = "." . trim(pathinfo($a['base'], PATHINFO_EXTENSION)); echo basename($a['base'], $ext) . "<br>"; function convert($imgdir) { ob_start(); list($width, $height) = getimagesize($imgdir); $new_width = $width; $new_height = $height; // Resample $image_p = imagecreatetruecolor($new_width, $new_height); $ext = trim(pathinfo($imgdir, PATHINFO_EXTENSION)); if ($ext === 'png') { $im = imagecreatefrompng($imgdir); } else { if ($ext === 'jpeg' || $ext === 'jpg') {