using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.IO;
using DataOper;

public partial class admin_report_app_feedback_details : System.Web.UI.Page
{
    DataOperation dOper = new DataOperation();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["id"] != null)
            {
                PopDetails();
            }
        }
    }
    public void PopDetails()
    {
        string str_content = "";
        DataTable dt = dOper.return_dt("select * from app_feedback where feedback_id='" + Convert.ToString(Request.QueryString["id"]).Replace("'", "") + "'");
        if (dt.Rows.Count > 0)
        {
            str_content = str_content + "<table class='custom_table mt-3 mt-3' width='100%'><tr class='table_hdr'><td width='60px'>Sl No.</td><td>Question</td><td width='250px'>Answer</td></tr>";

            DataTable dtQues = dOper.return_dt("select * from app_feedback_ques where feedback_id='" + Convert.ToString(dt.Rows[0]["feedback_id"]) + "'");
            for (int i = 0; i < dtQues.Rows.Count; i++)
            {
                str_content = str_content + "<tr><td>" + (i + 1) + "</td><td>" + Convert.ToString(dtQues.Rows[i]["question"]) + "</td><td>" + Convert.ToString(dtQues.Rows[i]["answer"]) + "</td></tr>";
            }
            str_content = str_content + "</table><table class='custom_table mt-3' width='100%'>";
            str_content = str_content + "<tr><td align='left' width='200px'>Date</td><td align='left'>" + Convert.ToDateTime(dt.Rows[0]["feedback_date"]).ToString("dd.MM.yyyy") + "</td></tr>";
            str_content = str_content + "<tr><td align='left' width='200px'>Name</td><td align='left'>" + Convert.ToString(dt.Rows[0]["name"]) + "</td></tr>";
            str_content = str_content + "<tr><td align='left'>Designation</td><td align='left'>" + Convert.ToString(dt.Rows[0]["designation"]) + "</td></tr>";
            str_content = str_content + "<tr><td align='left'>Organization</td><td align='left'>" + Convert.ToString(dt.Rows[0]["organisation"]) + "</td></tr>";
            str_content = str_content + "<tr><td align='left'>Mobile</td><td align='left'>" + Convert.ToString(dt.Rows[0]["mobile"]) + "</td></tr>";
            str_content = str_content + "<tr><td align='left'>Email</td><td align='left'>" + Convert.ToString(dt.Rows[0]["email"]) + "</td></tr></table>";
        }
        litContent.Text = str_content;
    }
}