File manager - Edit - /home/autoph/public_html/pms_v1/dashboard/salesDash.php
Back
<?php session_start(); if(isset($_SESSION['userID'])) { // echo "Session ID is '" . $_SESSION['userID']; // echo "<br>PMS Name id " . $_SESSION['userID']; $uID = $_SESSION['userID']; } include_once("../../../cfg/conn.php"); //error_reporting(0); if(isset($_POST['dasales'])){ $currentM = '01'; $currentD = '01'; $lastM = 12; $lastD = 31; $currentS = date('Y')."-".$currentM."-".$currentD; $currentE = date('Y')."-".$lastM."-".$lastD; //echo $currentS. " - ".$currentE; //============================================================================================================== //VALIDATE ACCESS ============================================================================================== //============================================================================================================== include ("../functions/users.php"); $roleID = userProfileID($uID); $moduleID = 42; $add =checkViewAccessM1024($roleID, $moduleID)[1]; $edit =checkViewAccessM1024($roleID, $moduleID)[2]; $delete =checkViewAccessM1024($roleID, $moduleID)[3]; $print =checkViewAccessM1024($roleID, $moduleID)[4]; $download =checkViewAccessM1024($roleID, $moduleID)[5]; echo "<input type='hidden' id='addAccess' value='$add'>"; echo "<input type='hidden' id='editAccess' value='$edit'>"; echo "<input type='hidden' id='deleteAccess' value='$delete'>"; echo "<input type='hidden' id='printAccess' value='$print'>"; echo "<input type='hidden' id='downloadAccess' value='$download'>"; if($add == 1){$addButton = '';}else{$addButton='Disabled';} if($edit == 1){$editButton = '';}else{$editButton='Disabled';} if($delete == 1){$deletButton = '';}else{$deletButton='Disabled';} if($print == 1){$printButton = '';}else{$printButton='Disabled';} if($download == 1){$downloadButton = '';}else{$downloadButton='Disabled';} //echo $moduleID; //echo "<br>". $roleID; //echo "<br>". $uID; if(checkViewAccessM1024($roleID, $moduleID)[0] == 0){ echo " <center><img src='./images/locked_out_icon.png' width='100' style='margin-top:100px'><img></center> "; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p>"; exit(); } //============================================================================================================== //VALIDATE ACCESS ============================================================================================== //============================================================================================================== ?> <h6 class="text-success bold text-right p-0" style='cursor:pointer;padding-right:20px;' onclick="javascript:loadByBrandReload();"><i class="fa fa-refresh"> Reload</i></h6> <div class="shadow-sm mb-3 p-1 pageHeaderContainer content-justify-right p-0 h-auto"> <div class="p-0 bg-white h-auto"> <button id='dasByBrand' class='btn col-xl-1 col-lg-2 col-md-2 col-sm-3 col-xs-2 p-1 bg-info text-light pl-1 pr-1 m-0' style='height:50px'> By Brand</button> <button id='dasByCompany' class='btn col-xl-1 col-lg-2 col-md-2 col-sm-3 col-xs-2 p-1 bg-warning text-dark pl-1 pr-1 m-0' style='height:50px'> By Company</button> <button class='btn col-xl-1 col-lg-2 col-md-2 col-sm-3 col-xs-2 p-1 bg-primary text-light pl-1 pr-1 m-0' style='height:50px'> Synergy</button> <button class='btn col-xl-1 col-lg-2 col-md-2 col-sm-3 col-xs-2 p-1 bg-success text-light pl-1 pr-1 m-0' style='height:50px'> By S.C</button> <button class='btn col-xl-1 col-lg-2 col-md-2 col-sm-3 col-xs-2 p-1 bg-danger text-white pl-1 pr-1 m-0' style='height:50px'> Comp. Target</button> <button class='btn col-xl-1 col-lg-2 col-md-2 col-sm-3 col-xs-2 p-1 bg-dark text-light pl-1 pr-1 m-0' style='height:50px'> Plant Target</button> <a href='#' data-toggle="modal" data-target="#filterData" class='mt-1 p-2 pl-3 pr-3 text-dark bg-light float-right'>Filer Data <i class="fa fa-filter " aria-hidden="true"></i></a> </div> </div> <div id='dashboardTable' class="shadow-sm pageHeaderContainer content-justify-right p-2 w-100 h-auto"> adfasdf </div> <!--MODAL FORM FOR ADD NEW GROUP--> <!-- The Modal --> <div class="modal fade " id="filterData"> <div class="modal-dialog modal-md p-5"> <div class="modal-content"> <!-- Modal Header --> <div class="modal-header"> <h4 class="modal-title">Filter Data</h4> <button type="button" class="close" data-dismiss="modal">×</button> </div> <!-- Modal body --> <div class="modal-body"> <div class="form-group w-50 float-left pb-2"> <label for="dateFrom">Start Date:</label> <input type="date" value='<?php echo $currentS;?>' class="form-control float-left mr-5 w-100" id="dateFrom"> </div> <div class="form-group w-50 float-left pb-2"> <label for="dateTo">End Date:</label> <input type="date" value='<?php echo $currentE;?>' class="form-control float-left mr-5 w-100" id="dateTo"> </div> <div class="form-group w-100 pb-2"> <label for="usr">Company:</label> <select name='compNameID' id='compNameID' onchange='javascript:loadBranches(this.value);' class="form-select form-select-lg p-2 w-100 rounded-sm selectBG"> <option selected value="">-- SELECT --</option> <?php $sql = "SELECT * FROM vts_company WHERE comp_status=1 ORDER BY `comp_name` ASC"; $getGroup = mysqli_query($conn,$sql); $chkIfExist = mysqli_num_rows($getGroup); if($chkIfExist > 0){ while($row = mysqli_fetch_array($getGroup)){ echo "<option value='".$row['comp_id']."'>".$row['comp_name']." - ".$row['comp_code']."</option>"; } } ?> </select> </div> <div class="form-group w-100 pb-2"> <label for="dealerID">Dealership/Brand:</label> <select name='dealerID' id='dealerID' class="form-select form-select-lg p-2 w-100 rounded-sm selectBG"> </select> </div> </div> <!-- Modal footer --> <div class="modal-footer w-100"> <button <?php echo $addButton;?> type="button" class="btn btn-success pl-4 pr-4" data-dismiss="modal" id="saveNewGroup"> <span class="btn-label"><i class="fa fa-save"> Update</i></button> <button type="button" class="btn btn-danger" data-dismiss="modal"> <span class="btn-label"><i class="fa fa-close"> Close</i></button> </div> </div> </div> </div> <!--########################################################################################################--> <?php } ?> <script> function loadByBrandReload(){ var dateFrom = $("#dateFrom").val(); var dateTo = $("#dateTo").val(); var compNameID = $("#compNameID").val(); var dealerID = $("#dealerID").val(); ShowUploadBar(); $.ajax({ url: "./dashboard/salesByBrand.php", type: "POST", async: true, data: { "dateFrom":dateFrom, "dateTo":dateTo, "compNameID":compNameID, "dealerID":dealerID, "dasales": 1 }, success: function(d){ $("#dashboardTable").html(d); //$("#sidebar").toggleClass("active"); //chart.render(); ShowUploadBar(); } }) } $("#dasByBrand").click(function(){ var dateFrom = $("#dateFrom").val(); var dateTo = $("#dateTo").val(); var compNameID = $("#compNameID").val(); var dealerID = $("#dealerID").val(); //alert(dateFrom); //alert(dateTo); ShowUploadBar(); $.ajax({ url: "./dashboard/salesByBrand.php", type: "POST", async: true, data: { "dateFrom":dateFrom, "dateTo":dateTo, "compNameID":compNameID, "dealerID":dealerID, "dasales": 1 }, success: function(d){ $("#dashboardTable").html(d); //$("#sidebar").toggleClass("active"); //chart.render(); ShowUploadBar(); } }) }); $("#dasByCompany").click(function(){ var dateFrom = $("#dateFrom").val(); var dateTo = $("#dateTo").val(); var compNameID = $("#compNameID").val(); var dealerID = $("#dealerID").val(); ShowUploadBar(); $.ajax({ url: "./dashboard/salesByCompany.php", type: "POST", async: true, data: { "dateFrom":dateFrom, "dateTo":dateTo, "compNameID":compNameID, "dealerID":dealerID, "dasales": 1 }, success: function(d){ $("#dashboardTable").html(d); //$("#sidebar").toggleClass("active"); //chart.render(); ShowUploadBar(); } }) }); function loadBranches(id){ var selCompID = $("#compNameID").val(); //alert(selCompID); ShowUploadBar(); $.ajax({ url: "./ajaxCall/onchangeLoadBranches.php", method: 'POST', dataType: 'text', async:true, data: { loadBranchData: 1, selCompID: selCompID }, success: function(d){ $("#dealerID").html(d); ShowUploadBar(); } }); } </script>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings