24 changed files with 560 additions and 43 deletions
@ -0,0 +1,9 @@ |
|||
<?php |
|||
|
|||
$DATAhst="localhost"; |
|||
$DATAusr="root"; |
|||
$DATApwd="root"; |
|||
$DATAdtb="iolovolio"; |
|||
|
|||
|
|||
?> |
@ -0,0 +1,162 @@ |
|||
<?php |
|||
|
|||
|
|||
function conv_date($od){ |
|||
$tmp=explode("-",substr($od,0,10)); |
|||
$stres = $tmp[2]."/".$tmp[1]."/".$tmp[0].""; |
|||
return $stres; |
|||
} |
|||
|
|||
function convert($stringa){ |
|||
$strres = $stringa; |
|||
$strres = str_replace("'","'",$strres); |
|||
return stripslashes(nl2br($strres)); |
|||
} |
|||
|
|||
function convert_mce($stringa){ |
|||
$strres = $stringa; |
|||
$strres = str_replace("'","'",$strres); |
|||
return stripslashes($strres); |
|||
} |
|||
|
|||
function conv_url($text){ |
|||
$entities = array('+','%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D'); |
|||
$replacements = array('-','_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_', '_',); |
|||
return str_replace($entities, $replacements, urlencode($text)); |
|||
} |
|||
|
|||
function save_photo($foto,$basepath,$id){ |
|||
|
|||
$filename = $foto; |
|||
// Get new sizes |
|||
list($width, $height) = getimagesize($filename); |
|||
$percent=800/$width; |
|||
$newwidth = $width * $percent; |
|||
$newheight = $height * $percent; |
|||
|
|||
// Load |
|||
$thumb = imagecreatetruecolor($newwidth, $newheight); |
|||
|
|||
switch(exif_imagetype($filename)){ |
|||
case 1: |
|||
$source = imagecreatefromgif($filename); |
|||
break; |
|||
|
|||
case 2: |
|||
$source = imagecreatefromjpeg($filename); |
|||
break; |
|||
|
|||
case 3: |
|||
$source = imagecreatefrompng($filename); |
|||
break; |
|||
|
|||
} |
|||
// Resize |
|||
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
|||
|
|||
// Output |
|||
imagejpeg($thumb, $basepath."$id.jpg"); |
|||
// echo $basepath."$id.jpg"; |
|||
} |
|||
|
|||
/* |
|||
function sendMail($SM_email,$SM_email2,$SM_email_CC,$SM_subject,$SM_message,$SM_showalert,$SM_append){ |
|||
|
|||
$host=$GLOBALS['BASE_URL'].""; |
|||
$send_date=conv_date(date("Y-m-d")); |
|||
|
|||
$top=<<<ttop |
|||
<html><head><style> |
|||
body{font-family: sans, Arial; margin: 0px; font-size: 10pt;} |
|||
td{font-family: sans-serif; font-size: 10pt;} |
|||
</style><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body bgcolor="#4e984a"><center> |
|||
<table border="0" width="720" cellspadding="20"> |
|||
<tr><td align="center" colspan="2"> |
|||
<img src="$host/images/logo-white.png" alt="Ordine dei Farmacisti di Salerno" width="150"><br><br></td></tr> |
|||
<tr><td align="left" style="padding:5px; color: white" ><b>$SM_subject</b></td> |
|||
<td align="right" style="padding:5px; color: white" >$send_date</td></tr> |
|||
<tr><td style="border-top: 8px solid #FFFFFF;border-left: 1px solid #FFFFFF;border-right: 1px solid #FFFFFF;border-bottom: 8px solid #FFFFFF;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px; padding:10px;line-height:23px" bgcolor="white" colspan="2"> |
|||
ttop; |
|||
|
|||
$bottom="</td></tr>"; |
|||
$bottom.="<tr><td colspan=\"2\" align=\"center\" style=\"text-align:justify; font-size:8pt; color: white\"><br>". |
|||
"Questa e-mail contiene informazioni di proprietà e di natura confidenziale. Se non siete il destinatario corretto di questo messaggio, vi ricordiamo che ogni diffusione, distribuzione o copia di questo messaggio è severamente proibita. Se avete ricevuto questo messaggio per errore, siete pregati di cancellarlo immediatamente. Quanto precede ai fini del rispetto del D.L. n. 196/03 sulla tutela dei dati personali.<br>-<br>". |
|||
"This e-mail (and any attachments) is strictly confidential and for use only by intendend recipients. If you are not an intended recipients, we point you that any diffusion, distribution or copy of this message is severely forbidden. If you have received t his message by mistake please destroy it immediately (under the observance of D.L. n. 196/03 which protects personal data).". |
|||
"<br>Rispetta l'ambiente. Non stampare questa mail se non è necessaria."; |
|||
|
|||
$bottom.="</td></tr></table></center></body></html>"; |
|||
|
|||
$headers = "From: \"Ordine dei Farmacisti di Salerno\" <info@ordinefarmacistisalerno.itt> \n"; |
|||
$headers .= "MIME-Version: 1.0\n"; |
|||
|
|||
$msg=""; |
|||
|
|||
if($SM_append){ |
|||
|
|||
$append_name = basename($SM_append); |
|||
$append_type = mime_content_type($SM_append); |
|||
|
|||
$data = chunk_split(base64_encode(file_get_contents($SM_append))); |
|||
|
|||
$semi_rand = md5(time()); |
|||
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; |
|||
|
|||
$headers .= "Content-Type: multipart/mixed;\n"; |
|||
$headers .= " boundary=\"{$mime_boundary}\"\n"; |
|||
$headers .= "X-Mailer: PHP " . phpversion(); |
|||
|
|||
$msg .= "This is a multi-part message in MIME format.\n\n"; |
|||
$msg .= "--{$mime_boundary}\n"; |
|||
$msg .= "Content-Type: text/html; charset=\"iso-8859-1\"\n"; |
|||
$msg .= "Content-Transfer-Encoding: 7bit\n\n"; |
|||
$msg .= $top.$SM_message.$bottom."\n\n"; |
|||
$msg .= "--{$mime_boundary}\n"; |
|||
$msg .= "Content-Type: {$append_type}; name=\"{$append_name}\"\n"; |
|||
$msg .= "Content-Transfer-Encoding: base64\n"; |
|||
$msg .= "Content-Disposition: attachment; filename=\"{$append_name}\"\n\n"; |
|||
$msg .= $data."\n\n"; |
|||
|
|||
$msg .= "--{$mime_boundary}--\n"; |
|||
|
|||
}else{ |
|||
$headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\n"; |
|||
$msg = $top.$SM_message.$bottom."\n\n"; |
|||
} |
|||
|
|||
|
|||
if(@mail(trim($SM_email),$SM_subject,$msg, $headers)){ |
|||
|
|||
if(@$SM_email2){ |
|||
if($SM_email_CC){ |
|||
$headers = "Bcc: $SM_email_CC \n".$headers; |
|||
} |
|||
@mail(trim($SM_email2),$SM_subject,$msg, $headers)or die("errore invio mail"); |
|||
} |
|||
|
|||
if($SM_showalert){ |
|||
echo "<br><center><h1><i class=\"fa fa-check\"></i></h1><h2>E-mail inviata correttamente</h2><br></center>"; |
|||
} |
|||
|
|||
}else{ |
|||
|
|||
if($SM_showalert){ |
|||
echo "<br><br><br><center><h1><i class=\"fa fa-exclamation-triangle\"></i></h1><h2>ERRORE:</h2><br>". |
|||
"Si è verificato un errore nell'invio della mail.<br>". |
|||
"Si prega contattare l'amministratore del sistema.</center>"; |
|||
} |
|||
} |
|||
|
|||
|
|||
$of=fopen("../mailoutput.html","w"); |
|||
fwrite($of, "Email:".$SM_email."\n<br>Email:".$SM_email2."\n<br>Email CC:".$SM_email_CC."\n<br>Subject:".$SM_subject."\n<br><br>CONTENT:\n".$msg); |
|||
fclose($of); |
|||
|
|||
} |
|||
*/ |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
?> |
@ -0,0 +1,4 @@ |
|||
<?php |
|||
$BASE_URL="http://".$_SERVER['HTTP_HOST'].""; |
|||
$ROOT = realpath($_SERVER["DOCUMENT_ROOT"]); |
|||
?> |
@ -1,8 +1,88 @@ |
|||
<?php |
|||
@include('components/breadcrumb/breadcrumb.php'); |
|||
setlocale(LC_MONETARY, 'it_IT.UTF-8'); |
|||
?> |
|||
|
|||
<div class="component-buy"> |
|||
<div class="row no-gutters"> |
|||
|
|||
<?php |
|||
if($getQ[1]) { |
|||
$q = mysqli_query($conn, "SELECT * FROM products WHERE id=".$getQ[1]); |
|||
$r = mysqli_fetch_array($q); |
|||
|
|||
?> |
|||
|
|||
<div class="content"> |
|||
<div class="container"> |
|||
<div class="row details"> |
|||
<div class="col-12 col-md-6"> |
|||
<div class="image-container"> |
|||
<img class="image" src="<?= '/images/products/'.$r['id'].'.png';?>"> |
|||
</div> |
|||
</div> |
|||
<div class="col-12 col-md-6"> |
|||
<span class="type"><?= $r['type'];?></span> |
|||
<span class="name"><?= $r['name'];?></span> |
|||
<span class="description"><?= $r['description'];?></span> |
|||
<div class="items"> |
|||
<div class="item"> |
|||
<span class="label">Format</span> |
|||
<span class="value"><?= $r['format'];?></span> |
|||
</div> |
|||
<div class="item"> |
|||
<span class="label">Biologico</span> |
|||
<span class="value"><?= $r['bio'] ? 'Si' : 'No';?></span> |
|||
</div> |
|||
<div class="item"> |
|||
<span class="label">Annata</span> |
|||
<span class="value"><?= $r['year'];?></span> |
|||
</div> |
|||
</div> |
|||
<span class="price"><?= money_format('%.2n',$r['price']);?></span> |
|||
|
|||
<div class="add-container"> |
|||
<div class="qty-container"> |
|||
<input class="qty" type="number" min="0" step="1" pattern="[\d]{9}"" value="1"> |
|||
<button class="plus icon-plus"></button> |
|||
<button class="minus icon-minus"></button> |
|||
</div> |
|||
|
|||
<button class="button button-brown add-to-cart"> |
|||
<span class="icon icon-buy my-auto ml-auto mr-1"></span> |
|||
<span class="my-auto mr-auto ml-1">aggiungi</a> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<?php |
|||
} |
|||
?> |
|||
|
|||
<div class="content <?= $getQ[1] ? 'has-detail' : '';?>"> |
|||
<div class="container"> |
|||
<div class="row"> |
|||
<?php |
|||
$q = mysqli_query($conn, "SELECT * FROM products"); |
|||
while($r = mysqli_fetch_array($q)){ |
|||
?> |
|||
|
|||
<div class="col-12 col-md-4"> |
|||
<div class="box"> |
|||
<a href="/acquistare/<?= $r['id'];?>/<?= $r['name'];?>"> |
|||
<img class="image" src="<?= '/images/products/'.$r['id'].'.png';?>"> |
|||
<span class="type"><?= $r['type'];?></span> |
|||
<span class="name"><?= $r['name'];?></span> |
|||
<span class="price"><?= money_format('%.2n',$r['price']);?></span> |
|||
</a> |
|||
</div> |
|||
</div> |
|||
|
|||
<?php |
|||
} |
|||
?> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
@ -1,3 +1,25 @@ |
|||
<?php |
|||
|
|||
switch($getQ[0]) { |
|||
case 'raccontare': |
|||
case 'due-cucchiai-di-salute': |
|||
case 'le-variabili-del-gusto': |
|||
case 'un-olio-da-strippare': |
|||
$section_label = 'raccontare'; |
|||
break; |
|||
case 'conoscere': |
|||
$section_label = 'conoscere'; |
|||
break; |
|||
case 'produrre': |
|||
$section_label = 'produrre'; |
|||
break; |
|||
case 'acquistare': |
|||
$section_label = 'acquistare'; |
|||
break; |
|||
} |
|||
|
|||
?> |
|||
|
|||
<div class="component-sectionHeader"> |
|||
<h2 class="label"><?= $section_label;?></label> |
|||
</div> |
|||
|
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 132 KiB |
After Width: | Height: | Size: 132 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue