'Jean Delarue', 'Email' => 'denis.olivier@gmail.com', 'Phone' => '+33650189827', 'Address' => '28 avenue du Général Leclerc'.CRLF.'69001 LYON'.CRLF.'France', 'Discount' => 'DC123456789-0', 'Comment' => 'Merci pour tout, superbes photographies ! :)', ); } // debug(var_export($_GET,1)); $PhotoId=intval($_GET['pid']); $PrintId=intval($_GET['print']); $Row=get_photograph(array( 'ConnId' => $db, 'ImageId' => $PhotoId, 'CultureId' => $_SESSION['UserCulture'], 'CollectionId' => '', )); // debug(var_export($Row,1)); if ($Row==null || empty($Row['Prints'][$PrintId])) { require_once('/home/www/denisolivier/error/404/index.php'); exit(); } $Meta['Property']['Type']='product'; if ($Row['Prints'][$PrintId]['Price']>0) { $Meta['Property']['Price']['Amount']=$Row['Prints'][$PrintId]['Price']; $Meta['Property']['Price']['Currency']=$CurrencyName[$Units[$_SESSION['UserCulture']]['Currency']['ShortId']][0]; } $MetaCanonical=$MetaLink=$Row['Prints'][$PrintId]['OrderUrl']; if (HTTP_WWW.SITE_DOMAIN.$_SERVER['REQUEST_URI']!=$MetaLink) { header('HTTP/1.1 301 Moved Permanently',TRUE,301); header('location: '.$MetaLink); exit(); } $UniqueNumber = abs(crc32($Row['Title']).$PhotoId.$PrintId); $TitleId=$UniqueNumber % count($RsDic['ARTWORK_PRINT_PURCHASE_TITLE']); $MetaTitle=sprintf( $RsDic['ARTWORK_PRINT_PURCHASE_TITLE'][$TitleId],$Row['Prints'][$PrintId]['Size']['Width'].' x '.$Row['Prints'][$PrintId]['Size']['Height'].' '.$Row['Prints'][$PrintId]['Size']['Unit'].', '.$Row['Title'].'. Ref-'.$PhotoId.'-'.$PrintId); $MetaDescription=sprintf( $RsDic['ARTWORK_PRINT_PURCHASE_TITLE'][$TitleId],$Row['Prints'][$PrintId]['Label'].', '.$Row['FullTitle'].'-'.$PrintId); $MetaKeywords=$Row['Keywords_'.$_SESSION['UserLang']]; $MetaImage[0]=$Row['ImageFull']; // ---- Build Schema offers $Prints=$Row['Prints'][$PrintId]; $PrintOffers=','.CRLF.' "offers": { "@type": "Offer", "price":"'.round($Prints['Price']*$Units[$_SESSION['UserCulture']]['Currency']['Change']).'", "priceCurrency":"'.$CurrencyName[$Units[$_SESSION['UserCulture']]['Currency']['ShortId']][0].'", "priceValidUntil":"'.sprintf('%4d-%02d-%02d',(date('Y')+10),random_int(1,12),random_int(1,28)).'", "availability":"http://schema.org/InStock", "itemCondition":"https://schema.org/NewCondition", "acceptedPaymentMethod":["http://purl.org/goodrelations/v1#PayPal","http://purl.org/goodrelations/v1#PaymentMethodCreditCard"], "sameas":"http://www.productontology.org/id/Photograph", "name":"'.$Row['FullTitle'].'", "description":"'.htmlspecialchars($Prints['Label'],ENT_COMPAT,'UTF-8').'", "url":"'.$Prints['OrderUrl'].'", "seller":{"type":"Organization","name":"'.$RsDic['PHOTOGRAPH_BY'].'"}, "mpn":"'.$Row['Id'].'-'.$PrintId.'", "sku":"'.$Row['Id'].'-'.$PrintId.'" }'; $Schema[]='{"@context":"http://schema.org", "@type":"Photograph", "about":"'.$RsDic['ARTWORK_TONE_VALUES'][$Row['Color']].', '.$Row['MediumName'].', '.$Row['MediumDescription'].'.", "name":"'.$Row['FullTitle'].'", "genre":"http://vocab.getty.edu/aat/300021143", "accountablePerson":"Denis Olivier", "locationCreated":"France", "creator":"Denis Olivier", "keywords":"'.$MetaKeywords.'", "description":"'.htmlspecialchars($MetaDescription,ENT_COMPAT,'UTF-8').'", "image":"'.$MetaImage[0].'", "url":"'.$MetaLink.'" '.$PrintOffers.' }'; $Schema[]='{"@context":"http://schema.org/", "@type":"Product", "name":"'.$Row['FullTitle'].'", "image":"'.$MetaImage[0].'", "description":"'.htmlspecialchars($MetaDescription,ENT_COMPAT,'UTF-8').'", "productID":"'.$Row['Id'].'", "mpn":"'.$Row['Id'].'", "sku":"'.$Row['Id'].'", "brand": { "@type": "Brand", "name": "'.$RsDic['PHOTOGRAPH_BY'].'" }'. ($Row['VoteCount']>20 ? ', "aggregateRating": { "@type": "AggregateRating", "ratingValue": "'.$Row['VoteRate'].'", "reviewCount": "'.$Row['VoteCount'].'" }':''). $PrintOffers.' }'; require_once(DIR_PATH.'include/i_page_haut.php'); echo '

'.sprintf( $RsDic['ARTWORK_PRINT_PURCHASE_TITLE'][$TitleId],strtolower($Row['Prints'][$PrintId]['Label']).CRLF.'
'.$Row['FullTitle'].'').'

'; echo '

'.$Row['Prints'][$PrintId]['Label'].'

'; // ---- image echo '
'; echo '
'.htmlentities($MetaTitle).'
'; echo '
'.$RsDic['ARTWORK_PRINT_ORDER_TOTAL_AMOUNT_LABEL'].'
€ / $
'; echo '
'; // ---- start form echo '
'; echo ''; echo ''; echo ''; // ---- options echo ''; $SQL='SELECT Name_'.$_SESSION['UserLang'].' AS Name,Detail_'.$_SESSION['UserLang'].' AS Detail,PackGroup,Multiple,Selected,Price FROM print_options INNER JOIN print_profiles ON print_profiles.Id='.$PrintId.' INNER JOIN print_profiles_options ON print_profiles_options.ProfileId=print_profiles.Id WHERE print_options.Id=print_profiles_options.OptionId ORDER BY PackPos,ItemPos'; // debug($SQL); $Result=db_query(__FILE__,__LINE__,$SQL,$db); while ($Option=mysqli_fetch_assoc($Result)) { if ($Option['PackGroup']!=$LastPackGroup && $LastPackGroup!='') { echo '
'; } $LastPackGroup=$Option['PackGroup']; $Label=$Option['Price'].'€ / $'.round($_SESSION['DollarRate']*$Option['Price']).' - '.$Option['Name']; puce('',1,'medium'); if ($Option['Detail']) { $Details=json_decode($Option['Detail'],1); foreach ($Details as $Detail) { echo '
'; if ($Detail['Name']) echo '

'.$Detail['Name'].'

'; if ($Detail['Description']) echo '
'.$Detail['Description'].'
'; echo '
'; } } } // ---- prepare information echo ''; echo ''; // ---- Get a security key $Key=uniqid(); echo ''; echo ''; // ---- User information echo '
'; echo '
'.$RsDic['ARTWORK_PRINT_DELIVERY_TIME'].'
'; echo set_ul(); echo set_li($RsDic['ARTWORK_PRINT_ORDER_SHIPPING_INCLUDED']); echo set_li($RsDic['ARTWORK_PRINT_FORM_WARNING']); echo set_li($RsDic['ARTWORK_PRINT_PAYMENT_LATER']); echo set_li($RsDic['ARTWORK_PRINT_ORDER_CONFIRM']); echo set_li($RsDic['ARTWORK_PRINT_PAYMENT_PRODUCTION']); echo set_li($RsDic['ARTWORK_PRINT_ORDER_CURRENCY_RATE']); echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; // honeypot spmmer field, doesn't display on interface echo ''; echo ''; echo ''; echo ''; // echo '

'; echo '

'; create_button('button',$RsDic['ARTWORK_PRINT_FORM_SUBMIT_LABEL'],' onclick="submit_order();"'); // ---- end form echo '

'; // ---- Submit thanks message echo '
'; echo '
Validation check mark
'; echo '
'.$RsDic['ARTWORK_PRINT_ORDER_DONE'].'
'; echo '
'; // ---- send the form echo ''; // ---- end page require_once(DIR_PATH.'include/i_page_bas.php'); //// -------------------------------------------------------------------------------------------- //// --- LANGUAGE RESOURCES --------------------------------------------------------------------- //// -------------------------------------------------------------------------------------------- // //switch ($_SESSION['UserLang']) { // case 'en': // ---- english // $RSO=array( // 1 => 'More details about the print, paper choice, payment, handling plus shipping', // 2 => 'Order', // 3 => 'Order a print of ', // 4 => 'Most photographs are available for sale. //
To buy a print, or get its price, go to the photograph of your choice then click "order". //
The informative currencies reference exchange rates are based on realtime European Central Bank regular daily concertation procedure.', // 5 => 'Available printing and pricing' // ); // $MetaDescription=$RSO[1]; // break; // // case 'fr': // ---- french // $RSO=array( // 1 => 'Détails concernant le tirage, le paiement, la protection et la livraison', // 2 => 'Commander', // 3 => 'Commander un tirage de ', // 4 => 'La plupart des photographies sont disponibles à la vente. //
Pour acheter un tirage, ou connaître son prix, allez sur la photographie de votre choix puis cliquer sur "commander". //
Les informations de prix dans différentes monnaies sont basées sur les taux temps réel de la Banque Centrale Européenne.', // 5 => 'Different types de tirages et de prix disponibles' // ); // $MetaDescription=$RSO[1]; // break; //} // INSERT INTO print_profiles_options ('Profile','Option') (SELECT 'Profile',Id FROM print_options) // //// -------------------------------------------------------------------------------------------- //// --- PRINT PROFILES ------------------------------------------------------------------------- //// -------------------------------------------------------------------------------------------- ///* //insert into print_r_photography_new (SELECT distinct PhotoId,PrintId FROM `print_r_photography` group by PhotoId,PrintId) // insert into print_profiles_options (ProfileId,OptionId) (SELECT 1,OptionId FROM `print_profiles_options` where ProfileId=6) //*/ // //$PhotoId=intval($_GET['pid']); // //if ($PhotoId>0) { // $SQL='SELECT photography.Id,PhotoId,UrlText AS Slug,1 AS Thumb,Situation, // print_profile.Id AS PrintId,Label_'.$_SESSION['UserLang'].' AS Label,print_profile.Price,Description_'.$_SESSION['UserLang'].' AS Description,Detail // FROM photography // INNER JOIN print_r_photography ON print_r_photography.PhotoId=photography.Id // INNER JOIN print_profile ON print_profile.Id=print_r_photography.PrintId // WHERE // photography.Id='.intval($_GET['pid']).' // AND print_profile.Id IN (3,4,5) // ORDER BY Price'; //} else { // box(1,$RSO[5]); // echo $RSO[4]; // box_end(); // $SQL='SELECT print_profile.Id AS PrintId,Label_'.$_SESSION['UserLang'].' AS Label,print_profile.Price,Description_'.$_SESSION['UserLang'].' AS Description,Detail // FROM print_profile // WHERE 1 // ORDER BY Price'; //} //$Result=db_query(__FILE__,__LINE__,$SQL,$db); //// echo $SQL; // //$Item=mysqli_fetch_array($Result); // //$MetaTitle=$RSO[3].$Item['Situation']; //require_once(DIR_PATH.'include/i_page_haut.php'); // //echo '

'.$Item['Situation'].''.$RSO[5].'

'; //mysqli_data_seek($Result,0); // //echo ''; // //while ($Item=mysqli_fetch_array($Result)) { // echo '
'; // // // ---- price // // echo '
'; // echo '
'.$Item['Price'].'
'; // echo '
Euros
'; // echo '
'.intval($DollarRate*$Item['Price']).'
'; // echo '
US dollars
'; // if ($PhotoId) { // echo '
'; // echo ''; // echo ''; // create_button('submit',$RSO[2],'style="margin-top:5px;"'); // echo '
'; // } // echo '
'; // // // ---- image // // if ($PhotoId) { // echo '
'; // echo 'sample image 1'; // echo '
'; // } // // // ---- description // // echo '
'; // echo '
'.$Item['Label'].'
'; // $Lines=explode("\n",$Item['Description']); // // // debug(var_export($Lines,1)); // // foreach ($Lines as $Val) { // echo set_li($Val); // } // // echo '
'.$RSO[1].'
'; // // echo '
'; // // eval($Item['Detail']); // // puce($RS[12],1,'middle'); // // echo set_ul(); // echo set_li($RS[13]); // echo set_li($RS[15]); // echo set_li($RS[14]); // echo ''; // // puce($RS[16],1,'middle'); // echo $RS[17]; // // echo set_ul(); // // for ($i=1;$i<=count($Payment);$i++) { // echo set_li($Payment[$i][0].($Payment[$i][1] ? '. '.$Payment[$i][1]:'')); // } // // echo ''; // // echo '
'; // // echo '
'; // // echo '
'; //} // require_once(DIR_PATH.'include/i_page_bas.php'); //} ?>