Beispiel #1
0
function printDisclaimer($mcid, $data, $team)
{
    $updateQuery = "UPDATE `prhospi_accomodation_status` \n                  SET `hospi_printed` = 1 \n                  WHERE `page_modulecomponentid`={$mcid} AND `user_id`={$data}";
    $updateRes = mysql_query($updateQuery) or displayerror(mysql_error());
    global $sourceFolder, $moduleFolder;
    require_once $sourceFolder . "/" . $moduleFolder . "/qaos1/excel.php";
    $displayFn = assignVars($data, $mcid);
    $content = getDisclaimer($team, $mcid);
    //escape quotes
    $content = str_replace("'", "\\'", $content);
    //replace the vars in file content with those defined
    $content = preg_replace('#\\{([a-z0-9\\-_]*?)\\}#is', "' . ((isset(\$displayFn['\\1'])) ? \$displayFn['\\1'] : '') . '", $content);
    //Make the content parseable
    eval("\$content = '{$content}';");
    //  displayinfo($content);
    //get parser done
    //  displayinfo($content);
    return printContent($content);
}
Beispiel #2
0
// remove trailing and ending slashes
if ($requestUri[0] == '/') {
    $requestUri = substr($requestUri, 1);
}
if (substr($requestUri, -1) == '/') {
    $requestUri = substr($requestUri, 0, -1);
}
// define default action and controller
$controllerAndAction = $configuration['routes']['_default'];
$pathSegments = array();
// check for action requested via URL
if (strlen($requestUri) && $requestUri != 'index.php') {
    $pathSegments = explode('/', $requestUri);
    $controllerAndAction = resolvePathsegmentConfiguration($pathSegments);
}
// only proceed if action exists, else throw a 404
try {
    require_once 'includes/Controller/' . $controllerAndAction['controller'] . '.php';
    $controller = new $controllerAndAction['controller']();
    $controller->setArguments($pathSegments);
    $methodName = $controllerAndAction['action'] . 'Action';
    $content = $controller->{$methodName}();
    $content .= getDisclaimer();
} catch (Exception $e) {
    header('HTTP/1.0 404 Not Found');
    $content = renderFlashMessage('Page not found', 'We\'re sorry, but the desired page could not be found.', 'error');
}
// render and exit
$page->setContent($content);
echo $page->render();
shutdown();
Beispiel #3
0
    public function actionTreasurer()
    {
        global $urlRequestRoot, $moduleFolder, $cmsFolder, $templateFolder, $sourceFolder, $STARTSCRIPTS;
        require_once $sourceFolder . "/" . $moduleFolder . "/qaos1/qaos_common.php";
        $mcid = $this->moduleComponentId;
        $treasureraction = "";
        if (isset($_POST['CKEditor1'])) {
            disclaimerUpdate($mcid, "getTreasurerAcceptance", escape($_POST['CKEditor1']));
        }
        if (isset($_GET['subaction']) && $_GET['subaction'] == 'getsuggestions' && isset($_GET['forwhat'])) {
            echo $this->getFormSuggestions(escape($_GET['forwhat']));
            exit;
        }
        if (isset($_POST['eventNameForDownload'])) {
            downloadAsZipFile($mcid, getEventIdFromName(escape($_POST['eventNameForDownload']), $mcid));
        }
        if (isset($_POST['printthis']) && isset($_POST['printHiddenId'])) {
            if ($_POST['printHiddenId'] != "") {
                $pos = strpos($_POST['printHiddenId'], "printTreasurerBill");
                if ($pos == 0) {
                    $treasureraction = printDataForTreasurerId($mcid, substr(escape($_POST['printHiddenId']), 18));
                }
            }
        }
        if (isset($_POST['qhid']) && isset($_GET['subaction']) && $_GET['subaction'] == "finalApprove") {
            $_POST["qhid2"] = addslashes($_POST["qhid2"]);
            $_POST["qhid1"] = addslashes($_POST["qhid1"]);
            $_POST["qhid"] = addslashes($_POST["qhid"]);
            if ($_POST["qhid"] < 4 && $_POST["qhid"] >= 0) {
                if ($_POST["qhid"] != 2 || $_POST["qhid1"] != "") {
                    $query = "update qaos1_fundreq set fundreq_Status = '{$_POST["qhid"]}',fundreq_Desc ='{$_POST["qhid1"]}' where fundreq_Id ='{$_POST["qhid2"]}' AND modulecomponentid={$this->moduleComponentId}";
                    $res = mysql_query($query);
                }
            }
        }
        $query1 = "SELECT * FROM qaos1_fundreq WHERE modulecomponentid={$this->moduleComponentId}";
        $res1 = mysql_query($query1);
        $css1 = $urlRequestRoot . "/" . $cmsFolder . "/" . $moduleFolder . "/qaos1/styles/main.css";
        $smarttablestuff = smarttable::render(array('table_formstatus', 'table_funreq_treasurer', 'filestable'), null);
        $STARTSCRIPTS .= "initSmartTable();";
        $treasureraction .= <<<AB
\t\t{$smarttablestuff}
\t\t\t<link href="{$css1}" rel="stylesheet">
 \t\t\t     <script type="text/javascript">
\t     \t\t     \t     function qaosfund(a)
            \t\t\t     \t      {

\t\t\t\t\t\t\tvar k=document.getElementById("qstatus"+a+"1");
             \t\t\t\t\t\tvar k1=document.getElementById("qstatus"+a+"2");
\t     \t\t\t\t\t\tif(k.checked) document.getElementById("qhid"+a).value=3;
            \t\t\t\t\t\telse if(k1.checked) document.getElementById("qhid"+a).value=2;
             \t\t\t\t\t\telse {alert("select any one of button");return false;}
\t\t\t\t\t\t\tdocument.getElementById("1qhid"+a).value=document.getElementById("qdescription"+a).value;
\t\t\t\t\t\t\t\$.ajax({
\t\t\t\t\t\t\t\ttype: "POST",
\t\t\t\t  \t\t\t\turl: "./+treasurer&subaction=finalApprove",
\t\t\t\t  \tdata: "qhid="+\$("#qhid"+a).val()+"&qhid1="+\$("#1qhid"+a).val()+"&qhid2="+\$("#2qhid"+a).val()      \t
\t\t\t\t\t      });
\t\t\t\t\t\t\t\$("#trt"+a).css({'display':'none'});      
\t     \t\t\t\t\t\treturn false;
\t\t\t\t\t     }
\t        \t     </script>
\t\t\t     <script type="text/javascript">
  \t\t \t   \t   \$(document).ready(function() 
\t         \t\t   \t{
\t\t\t\t
\t\t\t\t\t\$(".forms").css({'display':'none'});
\t\t\t\t\t\$(".buttons").css({'display':'block'});
\t\t\t\t\t\t\$("#dtreasurerfundreq").css({'display':'block'});
\t\t\t\t\t\$("#btreasurer_fundreq").click(function()
\t\t\t\t\t\t{
\t\t\t\t\t\t\tdispfundreq();
\t\t\t\t\t\t});
\t\t\t             \t\$("#bformfund").click(function()
\t\t\t\t\t\t{
\t\t\t\t\t\tdispfundform();
\t\t\t\t \t\t});
\t\t\t             \t\$("#bviewbills").click(function()
\t\t\t\t\t\t{
\t\t\t\t\t\tdispbills();
\t\t\t\t \t\t});
\t\t\t\t\t\$("#bdisplaydisclaimer").click(function()
\t\t\t\t\t\t{
\t\t\t\t\t\t  \$(".forms").css({'display':'none'});
\t\t\t\t\t\t  \$("#displayBillDisclaimer").css({'display':'block'});

\t\t\t\t\t\t});
\t\t\t\t\tfunction dispfundreq()
\t\t \t\t \t\t {
\t\t\t\t\t\t\t\$(".forms").css({'display':'none'});
\t\t\t\t\t\t\t\$("#dtreasurerfundreq").css({'display':'block'});
\t\t\t\t\t\t}
\t\t\t\t\tfunction dispfundform()
\t\t\t\t    \t     {
\t\t\t\t\t\t\$(".forms").css({'display':'none'});
\t\t\t\t\t\t\$("#formfund").css({'display':'block'});
\t\t\t\t\t     }
\t\t\t\t\tfunction dispbills()
\t\t\t\t    \t     {
\t\t\t\t\t\t\$(".forms").css({'display':'none'});
\t\t\t\t\t\t\$("#dviewbills").css({'display':'block'});
\t\t\t\t\t     }
\t\t\t\t\t     \$("#dtreasurerfundreq").css({'width':'100%'});
\t\t\t\t\t     \$(".viewbuttons").css({'height':'25px'});
\t\t\t\t\t     \$(".viewbuttonsdiv").css({'width':'100%'});
\t\t\t\t\t});
\t\t\t\t\t</script>\t\t
\t\t\t\t\t<div id="buttonsDiv" class="buttonsClass">\t\t\t
\t\t\t\t\t<input type="button" id="bformfund" class="viewbuttons" value="Fund"/>\t\t\t\t\t
\t\t\t\t\t<input type="button" id="btreasurer_fundreq" class="viewbuttons" value="Fund Status"/>
\t\t\t\t\t<input type="button" id="bviewbills" class="viewbuttons" value="Bills"/>       \t\t\t\t
\t\t\t\t\t<input type="button" id="bdisplaydisclaimer" class="viewbuttons" value="Disclaimer"/>       \t\t\t\t
\t\t\t\t\t</div>\t\t\t\t\t
\t\t\t\t\t<div id="formfund" class="forms">
\t\t\t\t\t<h2>Form status</h2>\t\t\t\t\t
\t\t\t\t\t<table class="display" id="table_formstatus" border="1" width="100%" >
\t\t\t\t\t<thead>\t
\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t<th>EVENT NAME</th>
\t\t\t\t\t\t\t<th>ITEM</th>
\t\t\t\t\t\t\t<th>QUANTITY</th>
\t\t\t\t\t\t\t<th>AMOUNT</th>
\t\t\t\t\t\t\t<th>REASON</th>
\t\t\t\t\t\t\t<th>STATUS</th>
 \t\t\t\t\t\t\t<th>DEADLINE</th>
\t\t\t\t\t                <th>ADDED BY</th>
\t\t\t\t\t\t\t<th>DESCRIPTION</th>
\t\t\t\t\t                <th>SUBMIT</th>

\t\t\t\t\t\t</tr></thead>
AB;
        while ($result1 = mysql_fetch_array($res1)) {
            $userName = getUserName($result1['userid']);
            $event1 = $result1['fundreq_Id'];
            if ($result1['fundreq_Status'] == 1) {
                $status1 = 3;
            } else {
                $status1 = 1;
            }
            if ($status1 == 3) {
                $treasureraction .= <<<AB
      \t\t\t\t\t   \t\t\t   <tr id="trt{$event1}">
   \t\t\t\t\t       \t\t\t       <td>{$result1["fundreq_name"]}</td>
   \t\t\t\t\t       \t\t\t       <td>{$result1['fundreq_Request']}</td>
\t\t\t   \t\t\t\t\t       <td>{$result1['fundreq_Quantity']}</td>
   \t\t\t\t\t      \t\t\t       <td>Rs.{$result1["fundreq_Amount"]}</td>
\t\t\t\t      \t\t\t       <td>{$result1["fundreq_reason"]}</td>
   \t\t\t\t\t\t\t\t\t\t <td>
\t\t\t\t\t\t\t\t\t\t\t\t<input type="radio" name="qstatus{$event1}" id="qstatus{$event1}1" value="1">ACCEPT<br/ >
   \t\t\t\t\t\t    \t\t\t\t<input type="radio" name="qstatus{$event1}" id="qstatus{$event1}2" value="2">Decline<br/>
\t\t\t\t\t\t\t\t       \t</td>
\t\t\t\t\t\t\t\t       <td>{$result1['fundreq_date']}</td>
\t\t\t\t\t\t\t\t\t\t\t\t\t <td>{$userName}</td>\t\t\t\t 
  \t\t\t\t\t       \t\t\t       <td><textarea id="qdescription{$event1}"></textarea></td>
   \t\t\t\t\t       \t\t\t       <td>
\t\t\t\t\t\t\t\t       <form action="./+treasurer&subaction=finalApprove" method="post" onsubmit=" return qaosfund({$event1})">
   \t\t\t\t\t\t\t      \t       \t     <input type="hidden" value="" id="qhid{$event1}" name="qhid">
   \t\t\t\t\t\t\t      \t\t     <input type="hidden" value="{$event1}" id="2qhid{$event1}" name="qhid2">
   \t\t\t\t\t\t\t      \t\t     <input type="hidden" value=""     id="1qhid{$event1}" name="qhid1">
 \t\t\t\t\t\t\t      \t\t     <input type="submit" value="submit">
\t \t\t\t\t\t\t\t       </form>
    \t\t\t\t\t\t\t\t       </td>
     \t\t\t\t\t\t\t\t   </tr>
AB;
            }
        }
        $treasureraction .= <<<AB
\t\t\t\t\t\t</table>
\t\t\t\t\t\t</div>
\t\t\t\t\t<div  class="forms" id="dtreasurerfundreq">
\t\t\t       <h2>Fund Request Status</h2>
\t\t\t    \t\t\t      \t
 
\t\t      \t\t\t<table id="table_funreq_treasurer" class="display"  border="1" width="100%">
\t\t\t    \t\t      <thead> <tr>
\t\t\t\t\t\t\t<th>ITEM</th>
\t\t\t\t     \t\t\t<th>QUANTITY</th>
\t\t\t\t     \t\t\t<th>EVENT NAME</th>
\t\t\t\t     \t\t\t<th>REASON</th>
\t\t\t\t     \t\t\t<th>STATUS</th>
\t\t\t\t\t                <th>ADDED BY</th>
\t\t\t\t     \t\t\t<th>DEADLINE</th>
\t\t\t\t     \t\t\t<th>DESCRIPTION</th>
\t\t\t\t     \t\t\t<th>PRINT BILL</th>
 \t\t\t     \t\t\t</tr></thead>
AB;
        $hist2 = "SELECT *  FROM qaos1_fundreq WHERE modulecomponentid={$this->moduleComponentId}";
        $res1 = mysql_query($hist2);
        while ($result1 = mysql_fetch_array($res1)) {
            $userName = getUserName($result1['userid']);
            if ($result1['fundreq_Status'] == 0) {
                $status1 = "Pending";
            } else {
                if ($result1['fundreq_Status'] == 1) {
                    $status1 = "Accepted by QA";
                } else {
                    if ($result1['fundreq_Status'] == 2) {
                        $status1 = "Decline";
                    } else {
                        if ($result1['fundreq_Status'] == 3) {
                            $status1 = "collect the amt from treasurer";
                        }
                    }
                }
            }
            $treasureraction .= <<<AB
\t\t\t\t\t\t      <tr class="tr{$result1['fundreq_Status']}">
\t\t\t\t\t                  <td>{$result1['fundreq_Request']}</td>
\t\t\t\t\t\t\t  <td>{$result1['fundreq_Quantity']}</td> 
\t\t\t\t\t\t\t  <td>{$result1['fundreq_name']}</td> 
\t\t\t\t\t\t\t  <td>{$result1['fundreq_reason']}</td> 
\t\t\t\t\t\t\t  <td>{$status1}</td>
\t\t\t\t\t\t\t  <td>{$userName}</td>
\t\t\t\t\t\t\t  <td>{$result1['fundreq_date']}</td> 
  \t\t\t\t\t\t          <td>{$result1['fundreq_Desc']}</td>
\t\t\t\t\t\t\t  <td>
\t\t\t\t\t\t\t\t<form method="post" action="./+treasurer">
                                                                    <input type="submit" name="printthis" value="PRINT"/>
\t\t\t\t\t\t\t\t    <input type="hidden" name="printHiddenId" value="printTreasurerBill{$result1['fundreq_Id']}" />\t
\t\t\t\t\t\t\t\t</form>
                                                          </td> \t
\t\t\t\t\t\t      </tr>
AB;
        }
        $bills = displayBills($mcid, 1);
        $txtBoxForDownload = displaySuggestionBox("eventNameForDownload", "suggestionsBoxForDownload", "treasurer", "userBox1");
        $contentDisclaimer = getDisclaimer("getTreasurerAcceptance", $mcid);
        $displayDisclaimerBill = getCkBody($contentDisclaimer, "treasurer");
        $treasureraction .= <<<BILLS
\t\t\t\t  </table></div>
\t\t\t\t  <div class='forms' id='dviewbills'>
\t\t\t\t  {$bills}
\t\t\t\t  <form action="./+treasurer" method="post" enctype="multipart/form-data">
\t\t\t\t  <table>
\t\t\t\t  <tr>
\t\t\t\t  <td>Event Name(Blank if u want to download all bills): </td>
\t\t\t\t  <td>{$txtBoxForDownload}</td>
\t\t\t\t  </tr>
\t\t\t\t  <tr><td colspan="2"><input type="submit" value="submit" /></td></tr>
\t\t\t\t  </table>
\t\t\t\t  </form>
\t\t\t\t  </div>
\t\t\t\t  <div class="forms" id="displayBillDisclaimer">
\t\t\t\t  {$displayDisclaimerBill}
\t\t\t\t  </div>
\t\t\t\t\t\t\t\t\t
BILLS;
        return $treasureraction;
    }
Beispiel #4
0
function buildEmail($id, $data, $emailText)
{
    $top = getTop();
    $preamble = getPreamble($id, $emailText);
    $page = renderPage($id, $data);
    $disclaimer = getDisclaimer();
    $bottom = getBottom();
    $body = $top . $preamble . $page . $disclaimer . $bottom;
    return $body;
}
Beispiel #5
0
function printDataForOCId($mcid, $trId)
{
    global $sourceFolder, $moduleFolder;
    require_once $sourceFolder . "/" . $moduleFolder . "/qaos1/excel.php";
    $evtDetails = getEvtProc($trId, $mcid);
    displayinfo(print_r($evtDetails, true));
    $content = getDisclaimer("getOCAcceptance", $mcid);
    //escape quotes
    $content = str_replace("'", "\\'", $content);
    //replace the vars in file content with those defined
    $content = preg_replace('#\\{([a-z0-9\\-_]*?)\\}#is', "' . ((isset(\$evtDetails['\\1'])) ? \$evtDetails['\\1'] : '') . '", $content);
    //Make the content parseable
    eval("\$content = '{$content}';");
    //  displayinfo($content);
    //get parser done
    return printContent($content);
}