<?php include("parent/callMe.php"); ?>

<?php  include("sessioncheck.php"); 



// code start script for admin dashboard access



$usrID=$_SESSION['user_id'];

$b=$_SESSION['branch'];



// it will be check tab access against user

$chekUserAccess="SELECT acc.page_id,acc.module_id,acc.user_id,acc.branch_id,acc.page_tab_id FROM eduportal_page_tab_access as acc WHERE acc.branch_id='$b' and acc.user_id = '$usrID' and acc.page_id='51'";

$UserAccess=$m->query($chekUserAccess);





// it will be check allow access this page (admin dashboard) against user



$UserPrivilege="SELECT * FROM users_privilege_detail WHERE branch_id='$b' and user_id = '$usrID' and page_id='51'"; 

$UserPri=$m->query($UserPrivilege);





if (count($UserAccess) == 0 && count($UserPri) > 0 ) {

    

    $lin="SELECT *  FROM eduportal_page_tabe_links WHERE page_id='51'";   

    $links = $m->query($lin);



    foreach ($links as $link) {



        $data = array(



        'page_id' => $link['page_id'],



        'module_id' => $link['module_id'],



        'user_id' => $usrID,



        'branch_id' => $_SESSION['branch'],     



        'page_tab_id' => $link['page_tab_id']);



       // echo "<pre>"; print_r($data); echo "</pre>";





        $m->insert ('eduportal_page_tab_access', $data);

       

    }





}



// End start script for admin dashboard access



$qr="select * from eduportal_notification_details where status='0' order by notification_id desc ";

$notifications1=$m->query($qr); 

           

// print_r($qr);



// code to update the credit limit at every new month

$branch_details=getBranch($m);

if(date("d")==01 || date("d")==1 || date("d")=="01" || date("d")=="1" && $branch_details[0]['payment_type']=="Monthly" ){    



   // echo "==".date("d")."==";

    $data = array('sms_limit' => $branch_details[0]['monthly_credit']);

    $m->where("branch_id", $_SESSION['branch']);

    $result =  $m->update ('edu_branch_config', $data);



}  // ending if    



    $m->where("session_id", $_SESSION['current_session']);

    $sessionname = $m->get("edu_session_config");

    $yr=explode("-",$sessionname[0]['session_year']);



    $branch=$_SESSION['branch'];





/*$m->where("user_id", $_SESSION['user_id']);

$m->where("module_id", 17);

$m->where ("branch_id", $_SESSION['branch']);

//$m->where("page_id", $user_page['page_id']);

$userAccess = $m->get("users_privilege_detail");*/





$usrID=$_SESSION['user_id'];

$b=$_SESSION['branch'];

$chekUserAccess="SELECT acc.page_id,acc.module_id,acc.user_id,acc.branch_id,acc.page_tab_id, link.page_id,link.module_id,link.tab_title,link.tab_link FROM eduportal_page_tab_access as acc, eduportal_page_tabe_links as link WHERE acc.page_tab_id=link.page_tab_id and acc.branch_id='$b' and acc.user_id = '$usrID' and acc.page_id='51'"; 

 

   $UserAccess=$m->query($chekUserAccess);

   

?>

<!DOCTYPE html>

<html lang="en">

  <head>

    <title> Dashboard | EduPortal </title>

    <!-- bootstrap-progressbar -->

    <link href="../vendors/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">

    <?php include('RootMe/css_links.php');?>

    <script src="https://cdn.zingchart.com/zingchart.min.js"></script>

    <script src="https://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>



     <!-- Flaticon CSS -->

    <link rel="stylesheet" href="fonts/flaticon.css">

       

    <link rel="stylesheet" href="stylebox.css">





<style>



@media only screen and (max-width: 768px) {



    /* For mobile phones: */



     .quiklink{

      width: 48%;

      float: left;

    }



}



@media (min-width:801px)  { /* tablet, landscape iPad, lo-res laptops ands desktops */



  .quiklink{

      width: 12%;

      float: left;

      margin-bottom: 10px;

    }



  }



ul.widget_tally .month {

    width: 70%;

    float: left;

    text-align: left;

}

#myChart {

  height:100%;

  width:100%;

  min-height:400px;

}



.zc-ref {

  display: none;

}

zing-grid[loading]{height:450px;}</style>

  </head>

  <style type="text/css">

      .tile-stats .icon i{

        font-size: 35px; 

      }

    </style>

  <style>

.vl {

  border-left: 1px solid lightgray;

  height: 40px;

  position: absolute;

  left: 50%;

  margin-left: -3px;

  margin-top: 24px;

}

</style>



  

  <body class="nav-md" onload="loadDoc();">

    <div class="container body">

      <div class="main_container">

        <div class="col-md-3 left_col">

     

       <div ><?php include("RootMe/sidebar.php"); ?> </div>

       <div ><?php include("RootMe/header_12_nov_2021.php"); ?> </div>

       

     

        <!-- page content -->

        <div class="right_col" role="main">

          <div class="">

            <div class="row top_tiles">









    <div class="col-md-12 tile-stats" style="background-color: white; margin-bottom: 10px;">

        <marquee style="padding-top: 8px;" width="100%" direction="left" height="30px" onmouseover="this.stop();"

                   onmouseout="this.start();">

                    

                                        

              <?php

                foreach($notifications1 as $notification) { ?>



                <a href="inbox.php?<?php echo session_id().session_id().session_id();?>&id=<?php echo $notification['notification_id'];?>">

                <?php echo ($notification['notification_title']);?>&nbsp;&nbsp;<span style="color: #27a9e3;"><u>Read More</u></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                </a> <?php } ?>



        </marquee>



    </div>



<?php

foreach ($UserAccess as $key) {



if ($key['tab_title'] == 'Short Link') { ?>



<div style="background-color: white; margin-bottom: 10px;">



  <!-- <a href="more_statistics.php" class="btn btn-round btn-primary quiklink"style="font-size:12px;">Adm & Attendance Stats</a> -->

  <a href="students_reports.php" class="btn btn-round btn-info quiklink">Students Report</a>

  <a href="mark_attend.php" class="btn btn-round btn-primary quiklink">Mark Attendance</a>

  <a href="new_sms.php" class="btn btn-round btn-success quiklink">New SMS</a>

  <a href="sent_message.php" class="btn btn-round btn-primary quiklink">View Sent SMS</a>

  <a href="view_challan.php" class="btn btn-round btn-info quiklink">View Challan</a>

  <a href="families.php" class="btn btn-round btn-warning quiklink">Families</a>

  <a href="monthly_attendance.php" class="btn btn-round btn-danger quiklink">Emp Attendance</a>

  <a href="cv_bank.php" class="btn btn-round btn-primary quiklink">CV Bank</a>

  <a data-toggle="modal" data-target="#ClosingReportDateWise" class="btn btn-round btn-warning quiklink" >

  Daily Closing</a>



<!-- start popup code -->



<div id="ClosingReportDateWise" class="modal fade" role="dialog">

<div class="modal-dialog">



<!-- Modal content-->

<div class="modal-content">

<div class="modal-header" style="border-bottom:none;">

<button type="button" class="close" data-dismiss="modal">&times;</button>

<h4 class="modal-title" style="text-align:center;">   </h4>

</div>



<div class="modal-body">



<form  action="print_daily_income_exp_report.php">

<input type="hidden" name="session" value="kjdahsfkjhasdjkfhkjasdfkjdshfkjadshfdsncnkdjashfsdafkjbdnasjkckasjdfjdsfkjdsbfkjbdsfjkbdskjfkjdshfkjdhskjcnjdas">

<div class="col-md-12" style="padding: 8px;">





<div class="form-group ">



<label class="required">From Date</label>



<input type="date" name="from_date" class="form-control"

value="<?php echo date("Y-m-d");?>"  />



</div>





<div class="form-group ">



<label class="required">To Date</label>



<input type="date" name="to_date" class="form-control"

value="<?php echo date("Y-m-d");?>"  />



</div>





</div> 







<div class="modal-footer">



<button type="submit" class="btn btn-primary" name="submit" >Submit </button>







</div>







</form>



</div>



</div>



</div>

</div>



<!-- popup ending -->



  <a href="add_expenses.php" class="btn btn-round btn-info quiklink">Expenses</a>

  <a href="print_profitloss_report.php" class="btn btn-round btn-dark quiklink">Monthly Closing</a>

  <a href="user_audit_report.php" class="btn btn-round btn-danger quiklink">Users Activities</a>  

  <a href="fee_reporting.php" class="btn btn-round btn-info quiklink">Fee Reports</a>

  <a href="user_access.php" class="btn btn-round btn-success quiklink">User Access</a>  

  <a href="parents_id.php" class="btn btn-round btn-info quiklink">View Parents IDs</a>

  <a href="old_student_profile.php" class="btn btn-round btn-dark quiklink">Old Students</a>

  

  



</div>



<?php } 



} ?>

   <div id="boxes"><?php include("RootMe/box_stats.php"); ?></div>





                

    </div>

    </div>

          

            </div>

          </div>

        </div>

        <!-- /page content -->

  



    <?php include('RootMe/js_linksscript.php');?>



  </body>

</html>

