forked from qo-op/G1BILLET
Add style option (./G1BILLETS.sh "" "" solian) OR index.php?style=solian
This commit is contained in:
parent
5747f1e4c7
commit
fd55c1cec8
@ -13,6 +13,7 @@ ME="${0##*/}"
|
|||||||
################################################################################
|
################################################################################
|
||||||
MONTANT="$1"
|
MONTANT="$1"
|
||||||
UNIQID="$2"
|
UNIQID="$2"
|
||||||
|
STYLE="$3"
|
||||||
|
|
||||||
[[ $MONTANT == "" ]] && MONTANT="___"
|
[[ $MONTANT == "" ]] && MONTANT="___"
|
||||||
[[ $UNIQID == "" ]] && UNIQID=$(date -u +%s%N | cut -b1-13)$RANDOM
|
[[ $UNIQID == "" ]] && UNIQID=$(date -u +%s%N | cut -b1-13)$RANDOM
|
||||||
@ -32,7 +33,7 @@ do
|
|||||||
|
|
||||||
mkdir -p "/tmp/g1billet/${UNIQID}"
|
mkdir -p "/tmp/g1billet/${UNIQID}"
|
||||||
# CREATION FICHIER IMAGE BILLET
|
# CREATION FICHIER IMAGE BILLET
|
||||||
$(${MY_PATH}/MAKE_G1BILLET.sh "${NUMBER}" "${SECRET}" "${MONTANT}" "${BILLETPUBKEY}" "${UNIQID}")
|
$(${MY_PATH}/MAKE_G1BILLET.sh "${NUMBER}" "${SECRET}" "${MONTANT}" "${BILLETPUBKEY}" "${UNIQID}" "${STYLE}")
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -42,7 +43,7 @@ montage /tmp/g1billet/${UNIQID}/*.jpg -tile 2x3 -geometry 964x459 /tmp/g1billet/
|
|||||||
# <!-- <policy domain="coder" rights="none" pattern="PDF" /> -->
|
# <!-- <policy domain="coder" rights="none" pattern="PDF" /> -->
|
||||||
|
|
||||||
# CLEANING TEMP FILES
|
# CLEANING TEMP FILES
|
||||||
# rm -Rf /tmp/g1billet/${UNIQID}
|
rm -Rf /tmp/g1billet/${UNIQID}
|
||||||
|
|
||||||
# ALLOWS ANY USER TO DELETE
|
# ALLOWS ANY USER TO DELETE
|
||||||
chmod 777 /tmp/g1billet/${UNIQID}.pdf
|
chmod 777 /tmp/g1billet/${UNIQID}.pdf
|
||||||
|
@ -18,6 +18,7 @@ SECRET="$2"
|
|||||||
MONTANT="$3"
|
MONTANT="$3"
|
||||||
NOTERIB="$4"
|
NOTERIB="$4"
|
||||||
UNIQID="$5"
|
UNIQID="$5"
|
||||||
|
STYLE="$6"
|
||||||
|
|
||||||
if [[ "$NUMERO" == "" || "$SECRET" == "" || "$MONTANT" == "" || "$NOTERIB" == "" || "$UNIQID" == "" ]]
|
if [[ "$NUMERO" == "" || "$SECRET" == "" || "$MONTANT" == "" || "$NOTERIB" == "" || "$UNIQID" == "" ]]
|
||||||
then
|
then
|
||||||
@ -28,51 +29,51 @@ mkdir -p /tmp/g1billet/$UNIQID
|
|||||||
BILLETNAME=$(echo $NUMERO | sed 's/ /_/g')
|
BILLETNAME=$(echo $NUMERO | sed 's/ /_/g')
|
||||||
|
|
||||||
# Add ${MY_PATH}/images/logo.png (250px)
|
# Add ${MY_PATH}/images/logo.png (250px)
|
||||||
composite -compose Over -gravity SouthWest -geometry +50+50 -dissolve 70% "${MY_PATH}/images/logo.png" "${MY_PATH}/images/fond.jpg" "/tmp/${BILLETNAME}.jpg"
|
composite -compose Over -gravity SouthWest -geometry +50+50 -dissolve 70% "${MY_PATH}/images/logo${STYLE}.png" "${MY_PATH}/images/fond${STYLE}.jpg" "/tmp/${BILLETNAME}.jpg"
|
||||||
|
|
||||||
# Prepare BILLET qrcode verification URL
|
# Prepare BILLET qrcode verification URL
|
||||||
qrencode -s 6 -o "/tmp/g1billet/${UNIQID}/${BILLETNAME}.QR.png" "$NOTERIB"
|
qrencode -s 5 -o "/tmp/g1billet/${UNIQID}/${BILLETNAME}.QR.png" "$NOTERIB"
|
||||||
|
|
||||||
# Add verification QRCode
|
# Add verification QRCode
|
||||||
composite -compose Over -gravity NorthEast -geometry +50+25 "/tmp/g1billet/${UNIQID}/${BILLETNAME}.QR.png" "/tmp/${BILLETNAME}.jpg" "/tmp/${BILLETNAME}.jpg"
|
composite -compose Over -gravity SouthEast -geometry +45+60 "/tmp/g1billet/${UNIQID}/${BILLETNAME}.QR.png" "/tmp/${BILLETNAME}.jpg" "/tmp/${BILLETNAME}.jpg"
|
||||||
|
|
||||||
# Change June logo color
|
# Change June logo color
|
||||||
case "$MONTANT" in
|
case "$MONTANT" in
|
||||||
1)
|
1)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill grey -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill grey -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill green -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill green -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
||||||
;;
|
;;
|
||||||
5)
|
5)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill orange -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill orange -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
||||||
;;
|
;;
|
||||||
10)
|
10)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill blue -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill blue -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
||||||
;;
|
;;
|
||||||
20)
|
20)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill purple -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill purple -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
||||||
;;
|
;;
|
||||||
50)
|
50)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill red -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill red -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
||||||
;;
|
;;
|
||||||
100)
|
100)
|
||||||
convert "${MY_PATH}/images/g1.png" -fuzz 20% -fill black -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
convert "${MY_PATH}/images/g1${STYLE}.png" -fuzz 20% -fill black -opaque '#e5912b' "/tmp/g1billet/${UNIQID}/g1.png"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
cp "${MY_PATH}/images/g1.png" "/tmp/g1billet/${UNIQID}/g1.png"
|
cp "${MY_PATH}/images/g1${STYLE}.png" "/tmp/g1billet/${UNIQID}/g1.png"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Add June LOGO to Billet
|
# Add June LOGO to Billet
|
||||||
composite -compose Over -gravity SouthEast -geometry +20+20 -dissolve 90% "/tmp/g1billet/${UNIQID}/g1.png" "/tmp/${BILLETNAME}.jpg" "/tmp/${BILLETNAME}.jpg"
|
composite -compose Over -gravity NorthEast -geometry +50+25 -dissolve 90% "/tmp/g1billet/${UNIQID}/g1.png" "/tmp/${BILLETNAME}.jpg" "/tmp/${BILLETNAME}.jpg"
|
||||||
|
|
||||||
convert -font 'Liberation-Sans' \
|
convert -font 'Liberation-Sans' \
|
||||||
-pointsize 120 -fill black -draw 'text 250,250 "'"$MONTANT DU"'"' \
|
-pointsize 120 -fill black -draw 'text 330,250 "'"$MONTANT DU"'"' \
|
||||||
-pointsize 40 -fill black -draw 'text 75,50 "'"G1 BILLET"'"' \
|
-pointsize 40 -fill black -draw 'text 75,50 "'"G1 BILLET"'"' \
|
||||||
-pointsize 30 -draw 'text 50,100 "'"Identifiant: $NUMERO"'"' \
|
-pointsize 30 -draw 'text 50,100 "'"Identifiant: $NUMERO"'"' \
|
||||||
-pointsize 22 -fill black -draw 'text 50,130 "'"Code Secret: $SECRET"'"' \
|
-pointsize 22 -fill black -draw 'text 50,130 "'"Code Secret: $SECRET"'"' \
|
||||||
-pointsize 22 -fill black -draw 'text 150,440 "'"Porte Monnaie Libre!! Utiliser avec https://cesium.app"'"' \
|
-pointsize 25 -fill black -draw 'text 150,440 "'"Porte Monnaie Libre!! Utilisez avec https://cesium.app"'"' \
|
||||||
"/tmp/${BILLETNAME}.jpg" "/tmp/g1billet/${UNIQID}/${BILLETNAME}.BILLET.jpg"
|
"/tmp/${BILLETNAME}.jpg" "/tmp/g1billet/${UNIQID}/${BILLETNAME}.BILLET.jpg"
|
||||||
|
|
||||||
rm -f /tmp/${BILLETNAME}.jpg
|
rm -f /tmp/${BILLETNAME}.jpg
|
||||||
|
BIN
images/g1.png
BIN
images/g1.png
Binary file not shown.
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 34 KiB |
@ -3,7 +3,7 @@ $mytime = new Datetime("now");
|
|||||||
$timestamp = $mytime->format('U').rand();
|
$timestamp = $mytime->format('U').rand();
|
||||||
|
|
||||||
// CREATE 6 G1BILLETS in /tmp/g1billet/$timestamp
|
// CREATE 6 G1BILLETS in /tmp/g1billet/$timestamp
|
||||||
$page = shell_exec(dirname(__FILE__)."/G1BILLETS.sh '".$_REQUEST['montant']."' '".$timestamp."'");
|
$page = shell_exec(dirname(__FILE__)."/G1BILLETS.sh '".$_REQUEST['montant']."' '".$timestamp."' '".$_REQUEST['style']."'");
|
||||||
|
|
||||||
$attachment_location = "/tmp/g1billet/".$timestamp.".pdf";
|
$attachment_location = "/tmp/g1billet/".$timestamp.".pdf";
|
||||||
if (file_exists($attachment_location)) {
|
if (file_exists($attachment_location)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user