관리-도구
편집 파일: confirmedticketAdmin.php
<?php session_start(); $dbhost = 'internal-db.s3783.gridserver.com'; $dbusername = 'aaronmeyer'; $dbuserpassword = 'CQDZZDsu'; $default_dbname = 'db3783_ticketingSystem'; $link_id = mysql_connect($dbhost, $dbusername, $dbuserpassword); $dbid = mysql_select_db($default_dbname); $TxnId = $_SESSION['TraxId']; $EvtId = $_SESSION['event_eid']; $Esql = "select * from eventmaster where id='" . $_SESSION['event_eid'] . "'"; $Eres = mysql_query($Esql); $Erow = mysql_fetch_row($Eres); $sql = "select * from tempseating where sessionticketid='" . $_SESSION['visitIp'] . "'"; $res = mysql_query($sql); $row = mysql_fetch_row($res); $Ssql = "select ESP.* from tempseating_details TSD, eventseatingplan ESP where TSD.sessionticketid='" . $_SESSION['visitIp'] . "' and TSD.resseatid=ESP.id Order by TSD.resseatid"; $Sres = mysql_query($Ssql); while ($Srow = mysql_fetch_row($Sres)) { $seatid = $Srow[2]; $seatid = trim(substr($seatid,0,6)) . ' '; $seatrow = substr($seatid, 0,1); $seatnum = $seatnum . substr($seatid, 4,2) . ','; } $seatnum = substr($seatnum,0,strlen($seatnum)-1); if ($seatrow=='G') $seatfloor = 'Balcony level'; else $seatfloor = 'Floor Level'; if ($row[1] > 0) $seatType = 'Reserved Seating'; else $seatType = 'General Seating'; if ($EvtId=='1') $eventdate = 'Friday December 17 at 7:30 pm'; if ($EvtId=='2') $eventdate = 'Saturday December 18 at 2:00 pm'; if ($EvtId=='3') $eventdate = 'Saturday December 18 at 8:00 pm'; //$seatcount = CLASS_Numbertoword::convert($row[1],'en'); $words = array('0'=> '' ,'1'=> 'one' ,'2'=> 'two' ,'3' => 'three','4' => 'four','5' => 'five','6' => 'six','7' => 'seven','8' => 'eight','9' => 'nine','10' => 'ten','11' => 'eleven','12' => 'twelve','13' => 'thirteen','14' => 'fouteen','15' => 'fifteen','16' => 'sixteen','17' => 'seventeen','18' => 'eighteen','19' => 'nineteen','20' => 'twenty','30' => 'thirty','40' => 'fourty','50' => 'fifty','60' => 'sixty','70' => 'seventy','80' => 'eighty','90' => 'ninty','100' => 'hundred &','1000' => 'thousand','100000' => 'lakh','10000000' => 'crore'); function no_to_words($no) { global $words; if($no == 0) return ' '; else { $novalue='';$highno=$no;$remainno=0;$value=100;$value1=1000; while($no>=100) { if(($value <= $no) &&($no < $value1)) { $novalue=$words["$value"]; $highno = (int)($no/$value); $remainno = $no % $value; break; } $value= $value1; $value1 = $value * 100; } if(array_key_exists("$highno",$words)) return $words["$highno"]." ".$novalue." ".no_to_words($remainno); else { $unit=$highno%10; $ten =(int)($highno/10)*10; return $words["$ten"]." ".$words["$unit"]." ".$novalue." ".no_to_words($remainno); } } } $seatcount = no_to_words($row[1]); $maildata = ''; $maildata = $maildata . '<html>'; $maildata = $maildata . '<head>'; $maildata = $maildata . '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />'; $maildata = $maildata . '<link rel="stylesheet" href="http://www.aaronmeyer.com/inc/ticketing.css" type="text/css" media="screen" />'; $maildata = $maildata . '</head>'; $maildata = $maildata . '<body>'; $maildata = $maildata . '<table width="100%" border="0" cellspacing="3" cellpadding="5">'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td height="57"><div align="center" class="style2"><u>Violinist Aaron Meyer 2010 Holiday Concerts</u></div></td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td height="53" valign="top"><div align="center" class="style3">Ticketless Confirmation – ' . $seatType . '</div></td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td><font color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif" size="4"><strong>This serves as your <u>' . $seatcount . '</u> reserved tickets for the:</strong></font></td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td height="31" align="left" class="style5">2010 Aaron Meyer Holiday Concert Series</td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td height="24" class="style6">This confirms <u>Aaron Meyers guests may be admitted and may occupy ' . $seatcount . ' ('. $row[1].') reserved seats Section ' . $seatfloor . ' / Row ' . $seatrow . '/ Seats ' . $seatnum . ' for:</td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td height="24" class="style6"><strong>Date:</strong> '.$eventdate.' </td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td height="24" class="style6">Doors open 45-minutes prior to the show. </td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td height="102" class="style7"><strong class="style6"><u>Event:</u></strong><br />'; $maildata = $maildata . ' 10th Annual Aaron Meyer Holiday Concert Series<br />'; $maildata = $maildata . ' Presented by the Hedinger Family Foundation<br />'; $maildata = $maildata . ' '.$eventdate.'*<br />'; $maildata = $maildata . ' Featuring Concert Rock Violinist Aaron Meyer with his band and special guests Guitarist Tim Ellis, and The Brown Sisters</td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td height="63"><strong class="style6"><u>Location:</u></strong><br />'; $maildata = $maildata . ' <span class="style7">First Congregational Church <br />'; $maildata = $maildata . ' 1126 SW Park Ave. at Main St. (across from Portland Art Museum – and one block south of Schnitzer Hall) - between Madison & Main St.</span></td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td height="53"><strong class="style6"><u>For questions or inquiries contact:</u></strong><br />'; $maildata = $maildata . ' <span class="style7">Email: info@aaronmeyer.com</span></td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td height="48"><font color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif" size="4">This is your ticket for your seats! Please print and bring this confirmation to the concert with your party to present at the door. </font></td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td height="58"><strong class="style6">Tickets are non-refundable.</strong><br />'; $maildata = $maildata . ' <span class="style6">In the event of bad weather and the show is canceled, there will be a make up show in January 2011 and that information will be posted on www.aaronmeyer.com</span></td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . ' <tr>'; $maildata = $maildata . ' <td align="center" class="style3">www.aaronmeyer.com</td>'; $maildata = $maildata . ' </tr>'; $maildata = $maildata . '</table>'; $maildata = $maildata . '</body>'; $maildata = $maildata . '</html>'; if ($_GET['action'] == 'view') { echo $maildata; } else { $to = 'anshulbhaigupta@yahoo.co.in'; $subject = "e-Ticket Confirmation - Violinist Aaron Meyer 2010 Holiday Concerts"; $from = "webmaster@aaronmeyer.com"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "Cc: anshulbhaigupta@yahoo.co.in\r\n"; $headers .= "From: $from"; $message = $maildata; mail($to,$subject,$message,$headers); } ?>