0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.118.0.93


Current Path : /var/www/qptran/static/js/
Upload File :
Current File : /var/www/qptran/static/js/17.fba1cb6a.chunk.js.map

{"version":3,"sources":["app/api/loader/index.js","app/uploadqp/viewqpupload.js","app/uploadqp/index.js"],"names":["Loader","style","position","margin","top","right","bottom","left","width","height","radisu","color","ariaLabel","wrapperStyle","wrapperClass","visible","ViewQPUpload","useState","examdate","setexamdate","examsession","setexamsession","examsessionOptions","setexamsessionOptions","viewdata","setviewdata","table","settable","loading","setLoading","dateOptions","setDateOptions","useEffect","getDateAndSession","API","get","localStorage","getItem","res","data","error_code","response","resdoe","map","item","index","key","value","text","respo","ressession","id","handleSubmission","Swal","fire","msg","console","log","className","display","to","type","onClick","class","Group","Field","placeholder","name","selection","options","search","onChange","e","celled","Header","Row","HeaderCell","singleLine","textAlign","Body","el","i","Cell","fexamdate","fsession","href","ffilepath","target","UploadQP","selectedFile","setSelectedFile","fileInputRef","React","createRef","corrFileChange","undefined","files","size","split","pop","toLowerCase","formData","FormData","set","post","headers","err_code","qptransmissiondoc","ref"],"mappings":"kHAAA,oCAkCeA,IA9BA,WACb,OACE,6BACE,yBACEC,MAAO,CACLC,SAAU,WACVC,OAAQ,OACRC,IAAK,EACLC,MAAO,EACPC,OAAQ,EACRC,KAAM,EACNC,MAAO,QACPC,OAAQ,UAGV,kBAAC,IAAD,CACEA,OAAO,KACPD,MAAM,KACNE,OAAQ,EACRC,MAAM,iBACNC,UAAU,eACVC,aAAc,GACdC,aAAa,GACbC,SAAS,Q,u+MCgQJC,UAzQf,WAEE,MAAgCC,mBAAS,IAAzC,mBAAOC,EAAP,KAAiBC,EAAjB,KACA,EAAsCF,mBAAS,IAA/C,mBAAOG,EAAP,KAAoBC,EAApB,KACA,EAAoDJ,mBAAS,IAA7D,mBAAOK,EAAP,KAA2BC,EAA3B,KACA,EAAg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AC,IAAD,MAEA,yBAAK8B,UAAU,OACb,yBAAKA,UAAU,sCACb,yBAAKA,UAAU,QACb,yBAAKA,UAAU,YAAYzD,MAAO,CAAE0D,QAAS,SAC3C,yCACA,yBAAKD,UAAU,WACb,kBAAC,IAAD,CAAME,GAAG,iBACP,4BAAQC,KAAK,SAASH,UAAU,uBAAhC,SAIF,4BACEI,QAAS,WA7BzBzC,EAAe,KA8BCwC,KAAK,SACLH,UAAU,uBAHZ,SAOA,kBAAC,IAAD,CAAME,GAAG,cACP,4BAAQC,KAAK,SAASH,UAAU,yBAC9B,0BAAMK,MAAM,wBADd,WAON,kBAAC,IAAD,MACA,yBAAKL,UAAU,aACb,kBAAC,IAAD,KACE,kBAAC,IAAKM,MAAN,KACE,kBAAC,IAAKC,MAAN,CAAYzD,MAAO,GACjB,4CAEA,kBAAC,IAAD,CACE0D,YAAY,YACZC,KAAK,WACLpB,MAAO7B,EACPkD,WAAS,EACTC,QAASvC,EACTwC,QAAM,EACNC,SAAU,SAACC,EAAGjC,GACZpB,EAAYoB,EAAKQ,WAevB,kBAAC,IAAKkB,MAAN,CAAYzD,MAAO,GACjB,+CACA,kBAAC,IAAD,CACE0D,YAAY,eACZC,KAAK,cACLpB,MAAO3B,EACPgD,WAAS,EACTC,QAAS/C,EACTgD,QAAM,EACNC,SAAU,SAACC,EAAGjC,GACZlB,EAAekB,EAAKQ,YAuB5B,kBAAC,IAAKiB,MAAN,KACE,kBAAC,IAAKC,MAAN,CAAYzD,MAAO,GACjB,8CACA,2BACEoG,IAAKjB,EACL9B,KAAK,OACLU,SAAU,SAACC,GAAD,OAAOsB,EAAetB,QAkCtC,4BACEV,QAAS,kBAAMV,KACfS,KAAK,SACLH,UAAU,uBAEV,0BAAMK,MAAM,wCALd,WASF","file":"static/js/17.fba1cb6a.chunk.js","sourcesContent":["import React from \"react\";\nimport { Puff } from \"react-loader-spinner\";\nimport \"react-loader-spinner/dist/loader/css/react-spinner-loader.css\";\n\nconst Loader = () => {\n  return (\n    <div>\n      <div\n        style={{\n          position: \"absolute\",\n          margin: \"auto\",\n          top: 0,\n          right: 0,\n          bottom: 0,\n          left: 0,\n          width: \"200px\",\n          height: \"200px\",\n        }}\n      >\n        <Puff\n          height=\"80\"\n          width=\"80\"\n          radisu={1}\n          color=\"rgb(0 123 255)\"\n          ariaLabel=\"puff-loading\"\n          wrapperStyle={{}}\n          wrapperClass=\"\"\n          visible={true}\n        />\n      </div>\n    </div>\n  );\n};\n\nexport default Loader;\n","import React, { useEffect, useState, useContext, Component } from \"react\";\nimport \"semantic-ui-css/semantic.min.css\";\nimport {\n  Card,\n  Button,\n  Form,\n  Table,\n  Dropdown,\n  Divider,\n} from \"semantic-ui-react\";\nimport { Link } from \"react-router-dom\";\nimport \"../../Navbar/Navbar.css\";\nimport API from \"../api/apilink\";\nimport Swal from \"sweetalert2\";\nimport InputMask, { ReactInputMask } from \"react-input-mask\";\nimport moment from \"moment\";\nimport Loader from \"../api/loader\";\n\nfunction ViewQPUpload() {\n  //   const [examdate, setexamdate] = useState(moment().format(\"DD/MM/YYYY\"));\n  const [examdate, setexamdate] = useState(\"\");\n  const [examsession, setexamsession] = useState(\"\");\n  const [examsessionOptions, setexamsessionOptions] = useState([]);\n  const [viewdata, setviewdata] = useState([]);\n  const [table, settable] = useState(false);\n  const [loading, setLoading] = useState(false);\n  const [dateOptions, setDateOptions] = useState([]);\n\n  useEffect(() => {\n    // const loadexamsession = async function () {\n    //   setLoading(true);\n    //   try {\n    //     const res = await API.get(\n    //       `app.php?a=loadQPExamSession&univcode=${localStorage.getItem(\n    //         \"univcode\"\n    //       )}&examdate=${examdate}`\n    //     );\n    //     const examsessionOptions = res.data.data.map((el, i) => {\n    //       return {\n    //         key: i,\n    //         value: el.fsession,\n    //         text: el.fsession + \" - \" + el.fdescpn,\n    //       };\n    //     });\n    //     setexamsessionOptions(examsessionOptions);\n    //   } catch (err) {\n    //     console.log(err);\n    //   }\n    //   setLoading(false);\n    // };\n    // loadexamsession();\n    getDateAndSession();\n  }, []);\n\n  const getDateAndSession = async () => {\n    const res = await API.get(\n      \"app.php?a=qpupddates&univcode=\" +\n        localStorage.getItem(\"univcode\") +\n        \"&usertype=\" +\n        localStorage.getItem(\"usertype\")\n    );\n    if (res.data.error_code === 0) {\n      const response = res.data.data.resdoe.map((item, index) => ({\n        key: index,\n        value: item.value,\n        text: item.value,\n      }));\n      setDateOptions(response);\n\n      const respo = res.data.data.ressession.map((item, index) => ({\n        key: index,\n        value: item.id,\n        text: item.value,\n      }));\n      setexamsessionOptions(respo);\n    }\n  };\n\n  const handleClear = () => {\n    setexamsession(\"\");\n    settable(false);\n    setexamdate(\"\");\n  };\n\n  const handleSubmission = async () => {\n    setLoading(true);\n    try {\n      const res = await API.get(\n        `app.php?a=viewuplodedqp&univcode=${localStorage.getItem(\n          \"univcode\"\n        )}&examdate=${examdate}&session=${examsession}`\n      );\n      if (res.data.error_code == 0) {\n        setviewdata(res.data.data);\n        settable(true);\n      } else {\n        Swal.fire(\"Failed!\", res.data.data.msg, \"error\");\n        settable(false);\n        setLoading(false);\n        return;\n      }\n    } catch (err) {\n      console.log(err);\n    }\n    setLoading(false);\n  };\n\n  const formatChars = {\n    n: \"[0-1]\",\n    m: \"[0-9]\",\n    e: \"[0-3]\",\n    d: \"[0-9]\",\n    z: \"[1-2]\",\n    y: \"[0-9]\",\n  };\n\n  return (\n    <div className=\"page\">\n      {loading ? (\n        <Loader />\n      ) : (\n        <div className=\"row\">\n          <div className=\"col-md-12 grid-margin stretch-card\">\n            <div className=\"card\">\n              <div className=\"card-body\" style={{ display: \"flex\" }}>\n                <h4>View Upload QP</h4>\n                <div className=\"ml-auto\">\n                  <Link to=\"/viewqpupload\">\n                    <button type=\"button\" className=\"btn btn-info btn-fw\">\n                      View\n                    </button>\n                  </Link>\n                  <Link to=\"/transaction/uploadqp\">\n                    <button type=\"button\" className=\"btn btn-info btn-fw\">\n                      Back\n                    </button>\n                  </Link>\n                  <button\n                    onClick={() => handleClear()}\n                    type=\"button\"\n                    className=\"btn btn-info btn-fw\"\n                  >\n                    Clear\n                  </button>\n                  <Link to=\"/dashboard\">\n                    <button type=\"button\" className=\"btn btn-danger btn-fw\">\n                      <span class=\"mdi mdi-exit-to-app\"></span>\n                      Exit\n                    </button>\n                  </Link>\n                </div>\n              </div>\n              <Divider />\n              <div className=\"col-md-12\">\n                <Form>\n                  <Form.Group>\n                    <Form.Field width={4}>\n                      {/* <label>Exam Date</label>\n                      <Form.Input\n                        formatChars={formatChars}\n                        type=\"text\"\n                        value={examdate}\n                        mask=\"ed/nm/zyyy\"\n                        placeholder=\"dd/mm/yyyy\"\n                        name=\"date\"\n                        onChange={(e, data) => {\n                          setexamdate(data.value);\n                        }}\n                      /> */}\n                      <label>Exam Date</label>\n\n                      <Dropdown\n                        placeholder=\"Exam Date\"\n                        name=\"examdate\"\n                        value={examdate}\n                        selection\n                        options={dateOptions}\n                        search\n                        onChange={(e, data) => {\n                          setexamdate(data.value);\n                        }}\n                      />\n                    </Form.Field>\n                    <Form.Field width={4}>\n                      <label>Exam Session</label>\n                      <Dropdown\n                        placeholder=\"Exam Session\"\n                        name=\"examsession\"\n                        value={examsession}\n                        selection\n                        options={examsessionOptions}\n                        search\n                        onChange={(e, data) => {\n                          setexamsession(data.value);\n                        }}\n                      />\n                    </Form.Field>\n                  </Form.Group>\n\n                  <button\n                    onClick={() => handleSubmission()}\n                    type=\"submit\"\n                    className=\"btn btn-info btn-fw\"\n                  >\n                    <span class=\"mdi mdi-file-check btn-icon-prepend\"></span>\n                    Submit\n                  </button>\n                </Form>\n                <br />\n                {table == true ? (\n                  <div className=\"ui mini form\">\n                    <Table celled>\n                      <Table.Header>\n                        <Table.Row>\n                          <Table.HeaderCell\n                            style={{ width: \"5%\" }}\n                            singleLine\n                            textAlign=\"center\"\n                          >\n                            Sl. No.\n                          </Table.HeaderCell>\n                          <Table.HeaderCell\n                            style={{ width: \"5%\" }}\n                            textAlign=\"center\"\n                          >\n                            Exam Date\n                          </Table.HeaderCell>\n                          <Table.HeaderCell\n                            style={{ width: \"5%\" }}\n                            textAlign=\"center\"\n                          >\n                            Session\n                          </Table.HeaderCell>\n\n                          <Table.HeaderCell\n                            style={{ width: \"10%\" }}\n                            textAlign=\"center\"\n                          >\n                            File\n                          </Table.HeaderCell>\n                        </Table.Row>\n                      </Table.Header>\n                      <Table.Body>\n                        {viewdata.map((el, i) => {\n                          return (\n                            <Table.Row key={i}>\n                              <Table.Cell textAlign=\"center\">\n                                {i + 1}\n                              </Table.Cell>\n                              <Table.Cell textAlign=\"center\">\n                                {el.fexamdate}\n                              </Table.Cell>\n                              <Table.Cell textAlign=\"center\">\n                                {el.fsession}\n                              </Table.Cell>\n\n                              <Table.Cell textAlign=\"center\">\n                                <a\n                                  href={\n                                    \"https://qp-tran.s3.ap-south-1.amazonaws.com/\" +\n                                    el.ffilepath\n                                  }\n                                  target=\"_blank\"\n                                >\n                                  Download\n                                </a>\n                              </Table.Cell>\n                            </Table.Row>\n                          );\n                        })}\n                      </Table.Body>\n                    </Table>\n                  </div>\n                ) : null}\n              </div>\n            </div>\n          </div>\n        </div>\n      )}\n    </div>\n  );\n}\n\nexport default ViewQPUpload;\n","import React, { useEffect, useState, useContext, Component } from \"react\";\nimport \"semantic-ui-css/semantic.min.css\";\nimport {\n  Card,\n  Button,\n  Form,\n  Table,\n  Dropdown,\n  Divider,\n} from \"semantic-ui-react\";\nimport { Link } from \"react-router-dom\";\nimport \"../../Navbar/Navbar.css\";\nimport API from \"../api/apilink\";\nimport Swal from \"sweetalert2\";\nimport { useForm } from \"react-hook-form\";\nimport InputMask, { ReactInputMask } from \"react-input-mask\";\nimport moment from \"moment\";\nimport { ViewQPUpload } from \"./viewqpupload\";\nimport Loader from \"../api/loader\";\n\nfunction UploadQP() {\n  // const [examdate, setexamdate] = useState(moment().format(\"DD/MM/YYYY\"));\n  const [examdate, setexamdate] = useState(\"\");\n  const [examsession, setexamsession] = useState(\"\");\n  const [examsessionOptions, setexamsessionOptions] = useState([]);\n  // const [qpcodeOptions, setqpcodeOptions] = useState([]);\n  // const [qpcode, setqpcode] = useState([]);\n  // const [pwd1, setpwd1] = useState(\"\");\n  // const [pwd2, setpwd2] = useState(\"\");\n  const [selectedFile, setSelectedFile] = useState();\n  const [loading, setLoading] = useState(false);\n  const [dateOptions, setDateOptions] = useState([]);\n\n  useEffect(() => {\n    // const loadexamsession = async function () {\n    //   setLoading(true);\n    //   try {\n    //     const res = await API.get(\n    //       `app.php?a=loadQPExamSession&univcode=${localStorage.getItem(\n    //         \"univcode\"\n    //       )}&examdate=${examdate}`\n    //     );\n    //     // if (res.data.error_code != 0) {\n    //     //   console.log(\"hhhhh\");\n    //     //   Swal.fire(\"Failed\", \"No Session for this Date\", \"error\");\n    //     //   return;\n    //     // } else {\n    //     // }\n    //     // if (res.data.error_code != 0) {\n    //     //   console.log(\"hhhhh\");\n    //     //   Swal.fire(\"Failed\", \"No Session for this Date\", \"error\");\n    //     //   setLoading(false);\n    //     //   return;\n    //     // } else {\n    //     // }\n\n    //     const examsessionOptions = res.data.data.map((el, i) => {\n    //       return {\n    //         key: i,\n    //         value: el.fsession,\n    //         text: el.fsession + \" - \" + el.fdescpn,\n    //       };\n    //     });\n    //     setexamsessionOptions(examsessionOptions);\n    //   } catch (err) {\n    //     console.log(err);\n    //   }\n    //   setLoading(false);\n    // };\n    // loadexamsession();\n\n    getDateAndSession();\n  }, []);\n\n  const getDateAndSession = async () => {\n    const res = await API.get(\n      \"app.php?a=qpupddates&univcode=\" +\n        localStorage.getItem(\"univcode\") +\n        \"&usertype=\" +\n        localStorage.getItem(\"usertype\")\n    );\n    if (res.data.error_code === 0) {\n      const response = res.data.data.resdoe.map((item, index) => ({\n        key: index,\n        value: item.value,\n        text: item.value,\n      }));\n      setDateOptions(response);\n\n      const respo = res.data.data.ressession.map((item, index) => ({\n        key: index,\n        value: item.id,\n        text: item.value,\n      }));\n      setexamsessionOptions(respo);\n    }\n  };\n\n  // const loadqpcode = async (session) => {\n  //   setLoading(true);\n  //   try {\n  //     const res = await API.get(\n  //       `app.php?a=loadQPExamqpcode&univcode=${localStorage.getItem(\n  //         \"univcode\"\n  //       )}&examdate=${examdate}&session=${session}`\n  //     );\n\n  //     const qpcodeOptions = res.data.data.map((el, i) => {\n  //       return {\n  //         key: i,\n  //         value: el.fqpcode,\n  //         text: el.fqpcode,\n  //       };\n  //     });\n  //     if (res.data.error_code == 0) {\n  //       setqpcodeOptions(qpcodeOptions);\n  //     } else {\n  //       Swal.fire(\"Failed\", \"No QP Code for this Date\", \"error\");\n  //       setLoading(false);\n  //       return;\n  //     }\n  //   } catch (err) {\n  //     console.log(err);\n  //   }\n  //   setLoading(false);\n  // };\n\n  const fileInputRef = React.createRef();\n\n  const corrFileChange = async (e) => {\n    if (e.target.files[0] === undefined) return;\n\n    var file_size = e.target.files[0].size;\n    var file_extn = e.target.files[0].name.split(\".\").pop();\n    file_extn = file_extn.toLowerCase();\n\n    setSelectedFile(e.target.files[0]);\n    const formData = new FormData();\n    formData.set(\"file\", e.target.files[0], e.target.files[0].name);\n\n    const res = await API.post(\n      `app.php?a=UploadQPDocument&univcode=${localStorage.getItem(\"univcode\")}`,\n      formData,\n      {\n        headers: {\n          \"Content-type\": \"multipart/form-data\",\n        },\n      }\n    );\n    if (res.data.err_code != 0) {\n      Swal.fire(\"Failed\", res.data.msg, \"error\");\n      setLoading(false);\n      return;\n    }\n    setSelectedFile(res.data.qptransmissiondoc);\n  };\n\n  const handleSubmission = async () => {\n    setLoading(true);\n    try {\n      const res = await API.get(\n        `app.php?a=saveQPUploadDeatils&&univcode=${localStorage.getItem(\n          \"univcode\"\n        )}&examdate=${examdate}&session=${examsession}&qpfile=${selectedFile}&user=${localStorage.getItem(\n          \"name\"\n        )}`\n      );\n      if (res.data.error_code == 0) {\n        Swal.fire(\"Saved!\", res.data.data.msg, \"success\");\n\n        setexamsession(\"\");\n      } else {\n        Swal.fire(\"Failed!\", res.data.data.msg, \"error\");\n        setLoading(false);\n        return;\n      }\n    } catch (err) {\n      console.log(err);\n    }\n    setLoading(false);\n  };\n\n  const handleClear = () => {\n    setexamsession(\"\");\n  };\n\n  const formatChars = {\n    n: \"[0-1]\",\n    m: \"[0-9]\",\n    e: \"[0-3]\",\n    d: \"[0-9]\",\n    z: \"[1-2]\",\n    y: \"[0-9]\",\n  };\n\n  return (\n    <div className=\"page\">\n      {loading ? (\n        <Loader />\n      ) : (\n        <div className=\"row\">\n          <div className=\"col-md-12 grid-margin stretch-card\">\n            <div className=\"card\">\n              <div className=\"card-body\" style={{ display: \"flex\" }}>\n                <h4>Upload QP</h4>\n                <div className=\"ml-auto\">\n                  <Link to=\"/viewqpupload\">\n                    <button type=\"button\" className=\"btn btn-info btn-fw\">\n                      View\n                    </button>\n                  </Link>\n                  <button\n                    onClick={() => handleClear()}\n                    type=\"button\"\n                    className=\"btn btn-info btn-fw\"\n                  >\n                    Clear\n                  </button>\n                  <Link to=\"/dashboard\">\n                    <button type=\"button\" className=\"btn btn-danger btn-fw\">\n                      <span class=\"mdi mdi-exit-to-app\"></span>\n                      Exit\n                    </button>\n                  </Link>\n                </div>\n              </div>\n              <Divider />\n              <div className=\"col-md-12\">\n                <Form>\n                  <Form.Group>\n                    <Form.Field width={4}>\n                      <label>Exam Date</label>\n\n                      <Dropdown\n                        placeholder=\"Exam Date\"\n                        name=\"examdate\"\n                        value={examdate}\n                        selection\n                        options={dateOptions}\n                        search\n                        onChange={(e, data) => {\n                          setexamdate(data.value);\n                        }}\n                      />\n                      {/* <Form.Input\n                        formatChars={formatChars}\n                        type=\"text\"\n                        value={examdate}\n                        mask=\"ed/nm/zyyy\"\n                        placeholder=\"dd/mm/yyyy\"\n                        name=\"date\"\n                        onChange={(e, data) => {\n                          setexamdate(data.value);\n                        }}\n                      /> */}\n                    </Form.Field>\n                    <Form.Field width={4}>\n                      <label>Exam Session</label>\n                      <Dropdown\n                        placeholder=\"Exam Session\"\n                        name=\"examsession\"\n                        value={examsession}\n                        selection\n                        options={examsessionOptions}\n                        search\n                        onChange={(e, data) => {\n                          setexamsession(data.value);\n                        }}\n                      />\n                    </Form.Field>\n                  </Form.Group>\n\n                  {/* <Form.Group>\n                    <Form.Field width={8}>\n                      <label>QP Code</label>\n                      <Dropdown\n                        multiple\n                        placeholder=\"QP Code\"\n                        name=\"qpcode\"\n                        value={qpcode}\n                        selection\n                        options={qpcodeOptions}\n                        search\n                        onChange={(e, data) => {\n                          setqpcode(data.value);\n                        }}\n                      />\n                    </Form.Field>\n                  </Form.Group> */}\n                  <Form.Group>\n                    <Form.Field width={8}>\n                      <label>Upload File</label>\n                      <input\n                        ref={fileInputRef}\n                        type=\"file\"\n                        onChange={(e) => corrFileChange(e)}\n                      />\n                    </Form.Field>\n                  </Form.Group>\n\n                  {/* <Form.Group>\n                    <Form.Field width={4}>\n                      <label>Password 1</label>\n                      <input\n                        className=\"field\"\n                        type=\"password\"\n                        placeholder=\"Password 1\"\n                        name=\"pwd1\"\n                        value={pwd1}\n                        onChange={(e, data) => {\n                          setpwd1(e.target.value);\n                        }}\n                      />\n                    </Form.Field>\n                    <Form.Field width={4}>\n                      <label>Password 2</label>\n                      <input\n                        className=\"field\"\n                        type=\"password\"\n                        placeholder=\"Password 2\"\n                        name=\"pwd2\"\n                        value={pwd2}\n                        onChange={(e, data) => {\n                          setpwd2(e.target.value);\n                        }}\n                      />\n                    </Form.Field>\n                  </Form.Group> */}\n\n                  <button\n                    onClick={() => handleSubmission()}\n                    type=\"submit\"\n                    className=\"btn btn-info btn-fw\"\n                  >\n                    <span class=\"mdi mdi-file-check btn-icon-prepend\"></span>\n                    Submit\n                  </button>\n                </Form>\n                <br />\n              </div>\n            </div>\n          </div>\n        </div>\n      )}\n    </div>\n  );\n}\n\nexport default UploadQP;\n"],"sourceRoot":""}