private void loadMeta()
        {
            List <string> items = MySQLServer.get_orders_information();

            orders.Text += String.Format("<tr><th>User</th><th>Film title</th><th>Date and time</th><th>Places</th><th>Cost</th><th>Status</th></tr>");
            for (int i = 0; i < items.Count / 7; ++i)
            {
                string id     = items[i * 7 + 0];
                string user   = items[i * 7 + 1];
                string film   = items[i * 7 + 2];
                string date   = items[i * 7 + 3];
                string status = items[i * 7 + 4];
                string cost   = items[i * 7 + 5];
                string places = items[i * 7 + 6];
                if (status == "pending confirmation")
                {
                    orders.Text += String.Format("<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{5}</td><td class=\"flex\"><input class=\"sub-button\" onClick=\"approve(this)\" id=\"a{4}\" type = \"submit\" value=\"Accept\"/><input class=\"dec-button\" onClick=\"approve(this)\" id=\"d{4}\" type = \"submit\" value=\"Decline\"/></td></tr>", user, film, date, places, id, cost);
                }
                else
                {
                    orders.Text += String.Format("<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{5}</td><td class=\"flex\">{4}</td></tr>", user, film, date, places, status, cost);
                }
            }
            orders.Text = "<table  cellspacing=\"0\">" + orders.Text + "</table>";
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/pdf";
            context.Response.AddHeader("content-disposition", "inline; filename=ticket.pdf");

            List <string> items = MySQLServer.get_orders_information(int.Parse(context.Request["id"]));

            if (items.Count == 0 ||
                items[1] != context.Request.Cookies["login"].Value.ToUpper() ||
                items[4] != "confirmed")
            {
                context.Response.Redirect("~/Account/Profile");
            }

            QRCodeEncoder encoder = new QRCodeEncoder();
            Bitmap        QRImage = encoder.Encode(SignGenerator.GetSign(items[0] + items[1]));

            Document  doc    = new Document(iTextSharp.text.PageSize.A4, 40, 40, 42, 35);
            PdfWriter writer = PdfWriter.GetInstance(doc, context.Response.OutputStream);

            doc.Open();

            doc.Add(new Paragraph("User: "******"Film: " + items[2]));
            doc.Add(new Paragraph("Date: " + items[3].Split(' ')[0]));
            doc.Add(new Paragraph("Time: " + items[3].Split(' ')[1]));
            doc.Add(new Paragraph("\n"));
            doc.Add(new Paragraph("Cost: " + items[5]));
            doc.Add(new Paragraph("\n"));
            doc.Add(new Paragraph("Places: " + items[6]));
            doc.Add(new Paragraph("\n"));
            iTextSharp.text.Image i = iTextSharp.text.Image.GetInstance(QRImage, ImageFormat.Jpeg);
            doc.Add(i);
            doc.Close();
        }
        private void loadMeta()
        {
            List <string> items = MySQLServer.get_orders_information(name);

            orders.Text += String.Format("<tr><th>Film title</th><th>Date and time</th><th>Places</th><th>Cost</th><th>Status</th><th>Get PDF</th></tr>");
            for (int i = 0; i < items.Count / 7; ++i)
            {
                string id     = items[i * 7 + 0];
                string user   = items[i * 7 + 1];
                string film   = items[i * 7 + 2];
                string date   = items[i * 7 + 3];
                string status = items[i * 7 + 4];
                string cost   = items[i * 7 + 5];
                string places = items[i * 7 + 6];
                string PDF    = "<a runat=\"server\" class = \"pdf\" href=\"Ticket.ashx?id=" + id + "\">Download</a>";
                if (status != "confirmed")
                {
                    PDF = "";
                }
                orders.Text += String.Format("<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{4}</td><td class=\"flex\">{3}</td><td>{5}<td></tr>", film, date, places, status, cost, PDF);
            }
            orders.Text = "<table  cellspacing=\"0\">" + orders.Text + "</table>";
        }