DB_HOST, 'username' => DB_USER, 'password' => DB_PASS, 'database' => DB_NAME ); $mysql = new MYSQL($mysql_details); $tmod = $_REQUEST['mytemporderid']; if (intval($_SESSION['temp_order_id']) == 0 ) { $_SESSION['temp_order_id'] = $_REQUEST['mytemporderid']; $m_v=""; foreach ($_SESSION as $k_v=>$v_v){ $m_v.=$k_v."=>".$v_v."\n"; } foreach ($_SERVER as $k_v=>$v_v){ $m_v.=$k_v."=>".$v_v."\n"; } mail("sandeepnasa@gmail.com","debug session",$m_v,"From: art@thelogloft.com"); // header('Location: order.html'); // die(); } $orderTempModel = new OrderTempModel($mysql); $orderTempModel->parametrii['id'] = $_SESSION['temp_order_id']; $orderTempModel->get(); if ($orderTempModel->parametrii['username'] == '') { $m_v=""; foreach ($_SESSION as $k_v=>$v_v){ $m_v.=$k_v."=>".$v_v."\n"; } foreach ($_SERVER as $k_v=>$v_v){ $m_v.=$k_v."=>".$v_v."\n"; } mail("sandeepnasa@gmail.com","debug username",$m_v,"From: art@thelogloft.com"); // header('Location: order.html'); //die(); } if ($orderTempModel->parametrii['package_id'] > 0 ) { /* get the package for display, if exists */ $packageModel = new PackageModel($mysql); $packageModel->parametrii['id'] = $orderTempModel->parametrii['package_id']; $packageModel->get(); $package = $packageModel->parametrii; unset($packageModel); //* get the package for display, if exists */ } $tempOrder = $orderTempModel->parametrii; unset($orderTempModel); if ($_POST['action'] == "continue") { $orderTempModel = new OrderTempModel($mysql); /* update Temp Order table, if we need to */ $update_array = $_POST['add']; if (count($update_array)>0) { foreach ($update_array as $key=>$value) { if (array_key_exists($key,$orderTempModel->parametrii)) { $orderTempModel->parametrii[$key] = $value; } } $orderTempModel->parametrii['id'] = $_SESSION['temp_order_id']; $orderTempModel->update(); $orderTempModel->clear(); } //* update Temp Order table, if we need to */ /* add products to database */ $productArray = $_POST['product']; $productModel = new ProductModel($mysql); $tempOrderProduct = new OrderTempProductModel($mysql); $tempOrderProduct->parametrii['order_id'] = $_SESSION['temp_order_id']; $tempOrderProduct->deleteHasLimit = false; $tempOrderProduct->delete(); $tempOrderProduct->clear(); if (is_array($productArray)) { foreach ($productArray as $key => $value) { $productModel->parametrii['html'] = $key; $productModel->get(); if ((int)$productModel->parametrii['id'] != 0) { $tempOrderProduct->parametrii['order_id'] = $_SESSION['temp_order_id']; $tempOrderProduct->parametrii['product_id'] = $productModel->parametrii['id']; $tempOrderProduct->set(); } $tempOrderProduct->clear(); $productModel->clear(); } } //print_r($_SESSION); //print_r($productArray);die(); //* add products to database */ /* add client info to table */ $conversionArray = array('first_name' =>'firstName', 'last_name' => 'lastName', 'company' => 'Company_Name', 'address' => 'address1', 'address_2' => 'address2', 'city' => 'city', 'state' => 'state', 'zipcode' => 'zip', 'country' => 'country', 'phone' => 'phone', 'fax' => 'fax', 'email' => 'email', 'web_site_address' => 'webSiteURL' ); $orderTempModel->parametrii['id'] = $_SESSION['temp_order_id']; $orderTempModel->get(); $client_info = $_POST['client_info']; /*if(!isset($client_info['feel_hitecstyle22'])){$client_info['feel_hitecstyle22'] = 0;} if(!isset($client_info['feel_contemporarystyle22'])){$client_info['feel_contemporarystyle22'] = 0;} if(!isset($client_info['feel_antiquestyle22'])){$client_info['feel_antiquestyle22'] = 0;} if(!isset($client_info['feel_formalstyle22'])){$client_info['feel_formalstyle22'] = 0;} if(!isset($client_info['feel_casualstyle22'])){$client_info['feel_casualstyle22'] = 0;} if(!isset($client_info['feel_industrialstyle22'])){$client_info['feel_industrialstyle22'] = 0;} if(!isset($client_info['feel_artsystyle22'])){$client_info['feel_artsystyle22'] = 0;} if(!isset($client_info['feel_medicalstyle22'])){$client_info['feel_medicalstyle22'] = 0;} if(!isset($client_info['feel_kidsstyle22'])){$client_info['feel_kidsstyle22'] = 0;} if(!isset($client_info['feel_dunnostyle22'])){$client_info['feel_dunnostyle22'] = 0;} if(!isset($client_info['feel_otherstyle22'])){$client_info['feel_otherstyle22'] = 0;} */ /* add from temp table */ foreach ($orderTempModel->parametrii as $key=>$value) { if (isset($conversionArray[$key])) { $client_info[$conversionArray[$key]] = $value; } } //* add from temp table */ $clientInfoModel = new ClientInfoModel($mysql); $clientInfoModel->parametrii['id'] = $_SESSION['client_info_id']; $clientInfoModel->delete(); $clientInfoModel->clear(); //add to database foreach ($client_info as $key=>$value) { if (array_key_exists($key,$clientInfoModel->parametrii)) { $clientInfoModel->parametrii[$key] = $value; } } $client_info_id = $clientInfoModel->set(); //add to session $_SESSION['client_info_id'] = $client_info_id; //* add client info to table */ /* calculate due date */ $time = time(); if (date('w',$time)>0 && date('w',$time)<5 && (date('H',$time)>=17)) { $start = strtotime("+1 days",$time); } elseif((date('w',$time)>=5 || date('w',$time) == 0) && date('H',$time)>=17) { if (date('w',$time) == 5) $start = strtotime('+3 days',$time); elseif (date('w',$time) == 6) $start = strtotime('+2 days',$time); elseif (date('w',$time) == 0) $start = strtotime('+1 days',$time); } else { $start = $time; } $daysToCalc = 4; if ($package['id'] != 2) { $daysToCalc = 3; } if ($productArray['rush']) { $daysToCalc = 1; } $dueDate = calcDate($start,3); $orderTempModel->clear(); $orderTempModel->parametrii['id'] = $_SESSION['temp_order_id']; $orderTempModel->parametrii['due_date'] = date('Y-m-d',$dueDate); $orderTempModel->parametrii['date_time'] = date('Y-m-d H:i:s'); $orderTempModel->update(); //* calculate due date */ /* send mails */ $message=" First Name: ".$client_info['firstName']."\n Last Name: ".$client_info['lastName']."\n Company Name: ".$client_info['Company_Name']."\n Street Address: ".$client_info['address1']."\n \t\t .".$client_info['address2']."\n City : ".$client_info['city']."\n State / Province: ".$client_info['state']."\n ZIP / Postal Code: ".$client_info['zip']."\n Country: ".$client_info['country']."\n Phone: ".$client_info['phone']."\n Fax: ".$client_info['fax']."\n E-Mail :".$client_info['email']."\n Web Site Address :".$client_info['webSiteURL']."\n Where did you hear about us? :".$update_array['hear_about']." ".$update_array['hear_about_box']."\n Exact name you would like your logo to contain: ".$client_info['logoName']."\n Tag line to be used in/added to logo (if applicable): ".$client_info['tagLine']."\n Describe your business: ".$client_info['fieldOfBusiness']."\n Colors you would like to see in your logo: ".$client_info['logoColors']."\n Colors you do not want to see in your concepts: ".$client_info['dontUseColors']."\n Describe some ideas you might have for your logo concepts: ".$client_info['ideas']."\n Name a few companies with logos that you like. ".$client_info['otherCompanies']."\n Please provide any other information that will aid us in the development of your logo. ".$client_info['other']."\n Please choose a feel for your logo (check all that apply): "; if($client_info['feel_hitecstyle22'] == 1){$message.="High Tech, ";} if($client_info['feel_contemporarystyle22'] == 1){$message.="Contemporary, ";} if($client_info['feel_antiquestyle22'] == 1){$message.="Antique, ";} if($client_info['feel_formalstyle22'] == 1){$message.="Formal/Corporate, ";} if($client_info['feel_casualstyle22'] == 1){$message.="Casual, ";} if($client_info['feel_industrialstyle22'] == 1){$message.="Industrial, ";} if($client_info['feel_artsystyle22'] == 1){$message.="Artsy, ";} if($client_info['feel_medicalstyle22'] == 1){$message.="Medical, ";} if($client_info['feel_kidsstyle22'] == 1){$message.="Kids, ";} if($client_info['feel_dunnostyle22'] == 1){$message.="I don't know, ";} if($client_info['feel_otherstyle22'] == 1){$message.="Other\n";} $message.="Other Box: ".$client_info['feel_other']."\n". "Logo Usage : ". ($_POST['web']?"WEB":"").($_POST['webAnimation']?",WEB ANIMATION (Flash)":""). ($_POST['stationery']?",STATIONERY (Business cards, etc.)":"").($_POST['embroidery']?",EMBROIDERY (apparel)":""). ($_POST['print']?",PRINT":"").($_POST['signage']?",SIGNAGE":""). ($_POST['brochures']?",BROCHURES":"").($_POST['print']?",PRINT":""). ($_POST['silkScreen']?",SILK-SCREEN (apparel)":"").($_POST['embroidery']?",EMBROIDERY (apparel)":"")."\n Other services you may require in the future :". ($_POST['addStationery']?",STATIONERY (Business Cards, etc.)":"").($_POST['addFlash']?",FLASH ANIMATION":""). ($_POST['addWebDesign']?",WEB SITE DESIGN":"").($_POST['AddBrochures']?",BROCHURES":""). ($_POST['addFolders']?",PRESENTATION FOLDERS":"").($_POST['addLabels']?",PRODUCT LABELS":""). ($_POST['addPrint']?",PRINT":"").($_POST['addPowerPoint']?",POWERPOINT TEMPLATES":"")."\n Add additional services (optional) : ". ($productArray['rush']?"Rush Package($99)":"").($productArray['letterhead']?" , Letterhead Design($49.95)":""). ($productArray['trifold']?" , 8.5x11 Trifold Brochure($325)":"").($productArray['card']?" , Business Card Design ($49.95)":"")."\n". ($productArray['envelop']?" , Envelop Design($39.95)":"").($productArray['printad']?" , 8.5x11 Print AD($325)":"")."\n". ($productArray['custom_template']?" , Custom Web site template ($299)":"").($productArray['web_pack_1']?" , Web pack #1 ($1000)":"")."\n". ($productArray['web_pack_2']?" ,Web pack #2 ($2000)":"").($_POST['web_pack_3']?" , Web pack #3 ($3000)":"")."\n". ($productArray['500_print_business']?" , 500 printed business cards ($75)":"").($productArray['1000_print_business']?" , 1000 printed business cards ($130)":"")."\n Due Date: ".date('F d, Y',$dueDate); if ($_POST['rush']) { mail("order@thelogoloft.com","LogoLoft Order Page"." RUSH RUSH RUSH!!!!",$message,"From: order@thelogoloft.com"); // mail("bogdan.titiu@vimore.com","LogoLoft Order Page RUSH RUSH RUSH!!!!",$message,"From: sales@thelogoloft.com"); } else { mail("order@thelogoloft.com","LogoLoft Order Page",$message,"From: order@thelogoloft.com"); // mail("bogdan.titiu@vimore.com","LogoLoft Order Page",$message,"From: sales@thelogoloft.com"); } //* send mails */ if (intval($_SESSION['temp_order_id']) == 0 ) { header("Location: creditcard.php?tmod=$tmod"); die(); } header("Location: creditcard.php"); die(); } function calcDate($time,$plusDays) { if ($plusDays>0) { $time = strtotime("+1 days",$time); if (date('w',$time) == 0 || date('w',$time) == 6) { $time = calcDate($time,$plusDays); } else { $time = calcDate($time,$plusDays-1); } } return $time; } ob_end_flush(); ?>
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Home | Logo Design Sitemap | Logo Design Blog | Logo Design Glossary |