<?php
/*
# ---------------------------------------------------------
# ALLOW TO HAVE SUBJECT TEMPLATES FOR EVERY EMAIL TEMPLATE
# ---------------------------------------------------------
*/

$query1 = "SELECT value FROM `setting` WHERE name = 'Invoice Subject'";
$result1 = mysql_query($query1) or die("ERROR in query: $query1");
list($value1) = mysql_fetch_row($result1);
$value1 = mysql_real_escape_string($value1);
$insert1 = "INSERT INTO `setting` SET id=NULL, name = 'Invoice Template Subject', value = '$value1', description = 'Subject Template for invoices sent through email. You may use tags', `type`=7,isrequired =1,istruefalse =0,istextarea =0,isfromoptions =0,myorder =1,helpid =2,plugin =0, ispassword =0,ishidden =0";
mysql_query($insert1) or die("ERROR in query: $insert1");

$query1b = "DELETE FROM `setting` WHERE name = 'Invoice Subject'";
$result1b = mysql_query($query1b) or die("ERROR in query: $query1b");;

$query2 = "SELECT value FROM `setting` WHERE name = 'Invoice Receipt Subject'";
$result2 = mysql_query($query2) or die("ERROR in query: $query2");
list($value2) = mysql_fetch_row($result2);
$value2 = mysql_real_escape_string($value2);
$insert2 = "INSERT INTO `setting` SET id=NULL, name = 'Payment Receipt Subject Template', value = '$value2', description = 'Subject Template for the email sent to clients after invoice is paid. You may use tags', `type`=7,isrequired =1,istruefalse =0,istextarea =0,isfromoptions =0,myorder=3,helpid =2,plugin =0, ispassword =0,ishidden =0";
mysql_query($insert2) or die("ERROR in query: $insert2");

$query2b = "DELETE FROM `setting` WHERE name = 'Invoice Receipt Subject'";
$result2b = mysql_query($query2b) or die("ERROR in query: $query2b");;

?>
