<?php 
include('../config/config.php');
include("../classes/classShift.php");
include("../classes/classDoctor.php");
include("../classes/classVisits.php");
include('../classes/classPatient.php');
include("../classes/classImages.php");
include('../classes/classTransaction.php');
include('../classes/classSaleInvoice.php');
include('../classes/classProductClosingReconcilation.php');

unset($_SESSION['print']);
if(@$_POST['from']!=''&&@$_POST['to']!='')
{
	$from = $_POST['from'];
	$to = $_POST['to'];
}
else
{
	$from = NULL;
	$to = NULL;
}

$_SESSION['print']['from'] = $from;
$_SESSION['print']['to'] = $to;
################################################################################
#########################Pagination Starts here. {########################
################################################################################
$retrieveVisitOb = new classVisits;
$retrieveVisitOb->setLocationID($_SESSION['security']['location_id']);
$array['item_count'] = $retrieveVisitOb->retrieveCountAllVisits($from,$to);
if(isset($_GET['page']) && isset($_GET['items']))
{
	if($array['item_count'] > $_GET['items'])
	{
		$array['pages'] = ceil($array['item_count']/$_GET['items']);
		if($_GET['page'] >$array['pages'])
		{
			$_GET['page'] = 1;
		}
		$array['current_page'] = $_GET['page'];
		if($_GET['page'] > 1)
		{
			$starting_record = $_GET['items']*($_GET['page']-1);
			$ending_record = $_GET['items'];
			$array['limit'] = $starting_record . "," . $ending_record;
			$limit = $array['limit'];
		}
		else
		{
			$limit = $_GET['items'];
		}
	}
	else
	{
		$array['current_page'] = $_GET['current_page'] = 1;
		$array['pages'] = 1;
		$array['limit'] = $_GET['items'];
		$limit = $array['limit'];
	}
}
else
{
	if($array['item_count'] > 20)
	{
		$array['pages'] = ceil($array['item_count']/20);
	}
	else
	{
		$array['pages'] = 1;
	}
	$array['current_page'] = 1;
	$array['limit'] = 20;
	$limit = $array['limit'];
}

$_SESSION['pagination']['item_count']=$array['item_count'];
$_SESSION['pagination']['pages']=$array['pages'];
$_SESSION['pagination']['current_page']=$array['current_page'];
$_SESSION['pagination']['limit']=$limit;

################################################################################
######################### Pagination Ends here. }##########################
################################################################################

################## Search Patients Start ####################################
try
{
	if(@$_POST['by_id']!=''||@$_POST['by_name']!=''||@$_POST['by_phone']!='')
	{
		$_SESSION['print']['search'] = $_POST['search'];
		$_SESSION['print']['by_id'] = $_POST['by_id'];
		$_SESSION['print']['by_name'] = $_POST['by_name'];
		$_SESSION['print']['by_phone'] = $_POST['by_phone'];
		
		$retrievePatientOb = new classVisits;
		$visits_array = $retrievePatientOb->retrieveVisitByPatient($_POST['by_id'],$_POST['by_name'],$_POST['by_phone'],$_SESSION['security']['location_id'],$from,$to);
	}
	else
	{
		$retrieveVisitOb = new classVisits;
		$retrieveVisitOb->setLocationID($_SESSION['security']['location_id']);
		$visits_array = $retrieveVisitOb->retrieveAllVisits($from,$to,$limit);
	}
	
	$total_patients = 0;
	$total_payables = 0;
	$total_payments = 0;
	if(isset($visits_array[0]['visit_id'])&&$visits_array[0]['visit_id']!='')
	{
		for($int=0;$int<count($visits_array);$int++)
		{
			$total_patients ++;
			$total_payables += $visits_array[$int]['payable'];
			$total_payables += $visits_array[$int]['payment'];
		}
	}

}

catch (MyException $e)
{
	$error_message = $e->getUserMsg();
}	

/*print_r($visits_array);*/
?>
<!DOCTYPE html>
<html><!-- InstanceBegin template="/Templates/main.dwt.php" codeOutsideHTMLIsLocked="false" -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<head> 
    <link rel="shortcut icon" href="../images/favicon.png">
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Med2TEC Hospital Management Information System</title>
    <!-- InstanceEndEditable -->
    <!--Core CSS -->
    <link href="../bs3/css/bootstrap.min.css" rel="stylesheet"> 
    <link href="../css/style.css" rel="stylesheet">
    <link href="../css/style-responsive.css" rel="stylesheet"/> 
    <link href="../popUp/popUp.css" rel="stylesheet">
    <link href="../css/bootstrap-fullcalendar.css" rel="stylesheet"/> 
    
    <link href="../css/clndr.css" rel="stylesheet">
    
    <link href="../css/css/font-awesome.css" rel="stylesheet">
    
    <link href="../assets/jquery-ui/jquery-ui-1.10.1.custom.min.css" rel="stylesheet">
    <link href="../assets/jvector-map/jquery-jvectormap-1.2.2.css" rel="stylesheet">    
    <link href="../assets/jquery-multi-select/css/multi-select.css" rel="stylesheet" type="text/css">
    <!--clock css-->
    <link href="../assets/css3clock/css/style.css" rel="stylesheet"> 
    <!--Morris Chart CSS -->
    <link rel="stylesheet" href="../assets/morris-chart/morris.css">
    <!-- Custom styles for this template -->
   
    <link href="../datepicker/jquery-ui.css" rel="stylesheet" >   
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>
<body>

<section id="container">
    <!--header start-->
    <header class="header fixed-top clearfix">
        <!--logo start-->
        <div class="brand">

            <a href="home.php" class="logo">
                <img src="../images/logo.png" alt="">
            </a>
            <div class="sidebar-toggle-box">
                <div class="fa fa-bars"></div>  
            </div>
        </div> 
        <!--logo end-->

        <div class="nav notify-row" id="top_menu" style="float: right; margin-top: 16px; margin-left: 0px; margin-right: 10px;">
            <!--  notification start -->
             <img alt="" src="../images/org_logos/<?php echo $_SESSION['security']['org_id']?>.png">
            <!--  notification end -->
        </div>
        <div class="top-nav clearfix">
            <!--search & user info start-->
            <ul class="nav pull-right top-menu">
                <li>
                    <div class="toggle-right-box"><!-- InstanceBeginEditable name="print" -->
                    <a href="javascript:Popup('printpharmpresc.php')"><i class="fa fa-print" style="margin-left: 11px; margin-top: 11px;"></i></a>
					<!-- InstanceEndEditable --></div>
                </li>
                <!-- user login dropdown start-->
                <li class="dropdown">
                    <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                        <img alt="" src="../images/avatar1_small.jpg"> 
                        <span class="username"><?php echo $username;?></span>
                        <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu extended logout">
                        <li><a href="profile.php"><i class=" fa fa-suitcase"></i>Profile</a></li>
                        <li><a href="#update_password-box" class="update_password-window"><i class="fa fa-cog"></i> Change Password</a></li>
                        <li><a href="../logout.php"><i class="fa fa-key"></i> Log Out</a></li>
                    </ul>
                </li>
                <!-- user login dropdown end -->
                <li>
                    <div class="toggle-right-box">
                        <div class="fa fa-bars"></div>
                    </div>
                </li>
            </ul>
            <!--search & user info end-->
        </div>
    </header>
    <!--header end-->
    <!--sidebar start-->
   <aside>
        <div id="sidebar" class="nav-collapse">
            <!-- sidebar menu start-->
            <ul class="sidebar-menu" id="nav-accordion">
					  	<li>
                    	<a class="active" href="db.php" style="background:#0072BC;">
                        <i class="fa fa-dashboard"></i>
                        <span>Dashboard</span>
                    	</a>
                		</li>
					  <?php
					  
				
					  
$orgOb = new classUser;
$orgOb->retrieveOrgDataByOrgID($_SESSION['security']['org_id']);
           
		  
				if($_SESSION['security']['userrole_id']==1||$_SESSION['security']['userrole_id']==2||$_SESSION['security']['userrole_id']==3||$_SESSION['security']['userrole_id']==5||$_SESSION['security']['userrole_id']==9||$_SESSION['security']['userrole_id']==10)
				{
					?>
					    <li class="sub-menu">
                    	<a href="dbpatient.php" style="background:#BC1C4A;">
                        <i class="fa fa-user"></i>
                        <span>Patient Registration</span>
                    	</a>
                    	</li>
					  <?php
				}
		  
		  if($orgOb->getOPD())
		  {
				if($_SESSION['security']['userrole_id']==1||$_SESSION['security']['userrole_id']==2||$_SESSION['security']['userrole_id']==3||$_SESSION['security']['userrole_id']==4||$_SESSION['security']['userrole_id']==5||$_SESSION['security']['userrole_id']==9)
				{
					?>
						<li class="sub-menu">
						<a href="dbopd.php" style="background:#003366;">
						<i class="fa fa-th"></i>
						<span>Out-Patient (OPD)</span>
						</a>
						</li>
						<?php
				}
		  }
		  if($orgOb->getIPD())
		  {
			  	?>
						<li class="sub-menu">
						<a href="dbipd.php" style="background:#3AC7F9;">
						<i class="fa fa-th"></i>
						<span>In-Patient (IPD)</span>
						</a>
						</li>
						<?php
					
		  }
		  if($orgOb->getOT())
		  {
			   		?>
						<li class="sub-menu">
						<a href="dbot.php" style="background:#D6502A;">
						<i class="fa fa-th"></i>
						<span>Operation Theater</span>
						</a>
						</li>
                        <?php
		  }			
		  if($orgOb->getPharmacy())
		  {
				if($_SESSION['security']['userrole_id']==1||$_SESSION['security']['userrole_id']==2||$_SESSION['security']['userrole_id']==3||$_SESSION['security']['userrole_id']==6||$_SESSION['security']['userrole_id']==7||$_SESSION['security']['userrole_id']==8||$_SESSION['security']['userrole_id']==9)
				{
			  		?>
						<li class="sub-menu">
						<a href="dbpharmacy.php" style="background:#00869C;">
						<i class="fa fa-th"></i>
						<span>Pharmacy</span>
						</a>
						</li>
						<?php
				}
		  }
		  if($orgOb->getDiagnostic())
		  {
				if($_SESSION['security']['userrole_id']==1||$_SESSION['security']['userrole_id']==2||$_SESSION['security']['userrole_id']==3||$_SESSION['security']['userrole_id']==14||$_SESSION['security']['userrole_id']==9)
				{
			  	?>
						<li>
						<a href="dbdiagnostics.php" style="background:#380E4D;">
						<i class="fa fa-th"></i>
						<span>Diagnostics </span>
						</a>
						</li>
						<?php
				}
		  }
		  if($orgOb->getEmergency())
		  {
					  ?>
						<li class="sub-menu">
						<a href="dbemergency.php" style="background:#8EC63F;">
						<i class="fa fa-tasks"></i>
						<span>Emergency </span>
						</a>
						</li>
						<?php
		  }
          if($orgOb->getAdmin())
		  {
				if($_SESSION['security']['userrole_id']==1||$_SESSION['security']['userrole_id']==2||$_SESSION['security']['userrole_id']==9)
				{
					?>
						<li class="sub-menu">
						<a href="dbadmin.php" style="background:#28282E;">
						<i class="fa fa-laptop"></i>
						<span>Admin Panel</span>
						</a>
						</li>
						<?php
				}
		  }
		  ?>
               
            </ul> 
            <div style="position: absolute; bottom: 2%; padding-left:10%;"><a href="http://www.softusion.com/" target="_blank"><img width="30" height="40" src="../images/SoftusionLOGO.png" alt=""><span style="font-size: 11px; float: right; margin-top: 15%;">Designed by Softusion Inc.</span></a></div><br>
            <!-- sidebar menu end-->
        </div>
    </aside>
    <!--sidebar end-->
    <!--main content start-->
	<!-- InstanceBeginEditable name="center" -->
  <section id="main-content">
    <section class="wrapper">
    
    <table cellspacing="0" cellpadding="0" width="100%" border="0" style="font-size:11px;">
  <tbody>
    <tr>
      <td width="12%" align="center"><a href="dbpharmacy.php"><img src="../images/icondb.png"></a></td>
      <td width="12%" align="center"><a href="mgmtsales.php"><img src="../images/iconcash.png"></a></td>
      <td width="12%" align="center">
      <?php
	  $checkReportOb = new classProductClosingReconcilation;
	  if($checkReportOb->checkClosingReportAlreadyInProgress('in_progress',$_SESSION['security']['location_id']))
	  {
		  	?>
		 	<a href="pharmsaleinv.php?ref=<?php echo base64_encode('new');?>"><img src="../images/iconsale.png"></a>
		  	<?php
	  }
	  else
	  {
			?>
			<a href="#" onClick="return inventoryclosing();"><img src="../images/iconsale.png" /></a>
			<?php
	  }
	  ?>
      	
      </td>
      <td width="12%" align="center"></td>
       <td width="12%" align="center"></td>
      <td width="12%" align="center"></td>
      <td width="12%" align="center"></td>
      <td width="12%" align="center"></td>
      <td width="12%" align="center"></td>
      <td width="2%" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td align="center"><a href="dbpharmacy.php">Pharmacy</a></td>
      <td align="center"><a href="mgmtsales.php">Point of Sale</a></td>
      <td align="center">
      <?php
	  $checkReportOb = new classProductClosingReconcilation;
	  if($checkReportOb->checkClosingReportAlreadyInProgress('in_progress',$_SESSION['security']['location_id']))
	  {
		  	?>
		 	<a href="pharmsaleinv.php?ref=<?php echo base64_encode('new');?>">Create Sale Invoice</a>
		  	<?php
	  }
	  else
	  {
			?>
			<a href="#" onClick="return inventoryclosing();">Create Sale Invoice</a>
			<?php
	  }
	  ?>
      	
      </td> 
      <td align="center"></td>
      <td align="center"></td>
      <td align="center"></td>
      <td align="center"></td>
      <td align="center"></td>
      <td align="center"></td>
      <td height="24" align="center">&nbsp;</td>
    </tr>
  </tbody>
</table>
<br> 
      <!-- page start-->
      <div class="row">
        <div class="col-sm-12">
          <section class="panel">
           <header class="panel-heading">
              <h2>OPD/IPD PRESCRIPTIONS</h2>
            </header>
            
            <table width="100%" border="0" cellpadding="10" cellspacing="10">
              <tr>
                <td width="10%" align="left">
                	<a href='pharmpresc.php'><input name="search" type="submit" class="btn btn-warning btn-sm" value="Out Patient Prescriptions"/></a></td>
                 <td width="90%"  align="left"><a href='pharmipdpresc.php'><input name="search" type="submit" class="btn btn-success btn-sm" value="In Patient Prescriptions"/></a>
                </td>
                
               </tr>
               </table>
               <br>
           
            <form action="" method="post">
            <table width="100%" border="0" cellpadding="1" cellspacing="0">
              <tr>
              
                <td width="10%" align="right">Search Name: </td>
                <td width="15%">
                	<input type="text" name="by_name" value="" class="form-control" aria-controls="dynamic-table">
                </td>
                
                <td width="5%" align="right">ID: </td>
                <td width="10%">
                	<input type="text" name="by_id" value="" class="form-control" aria-controls="dynamic-table">
                </td>
                
                <td width="5%" align="right">Phone: </td>
                <td width="15%">
                	<input type="text" name="by_phone" value="" class="form-control" aria-controls="dynamic-table">
                </td>
                
                <td width="5%" align="right">From: </td>
                <td width="14%">
                	<input type="text" name="from" value="<?php echo $from;?>" id="datepicker" class="form-control" readonly style="display:inline; width:80%;">
                </td>
                
                <td width="0%" align="right">To: </td>
                <td width="14%">
                	<input type="text" name="to" value="<?php echo $to;?>" id="datepicker1" class="form-control" readonly style="display:inline; width:80%;">
                </td>
                
                <td><input name="search" type="submit" class="btn btn-success btn-sm" value="Search"/></td>
                
                <td width="5%" align="right"><a href="opdpresc.php">View All</a></td>
                
                <td width="20%" align="right"><!--<div class="row-fluid">
                    <div class="span6">
                        <div id="dynamic-table_length" class="dataTables_length">
                        <label>
                        <select name="dynamic-table_length" size="1" class="form-control" aria-controls="dynamic-table">
                            <option value="10" selected="selected">10</option>
                            <option value="25">25</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                        </label>
                        </div>
                    </div>
                </div>-->
                </td>
                
                <td width="10%"><!--records per page--></td>
                
              </tr>
            </table>
            </form>
            <br>
            <br>
            <br>
            <div class="panel-body" style="padding-top: 0px; margin-top: -34px;">
              <div class="adv-table">
                <table  class="display table table-bordered table-striped" id="dynamic-table">
                  <thead>
                    <tr>
                     <th width="5%" align="left">&nbsp;</th>
           			 <th width="10%" align="center">Date</th>
            		 <th width="5%" align="center">ID</th>
            		 <th width="15%" align="left">Patient's Name</th>
           		 	 <th width="10%" align="left">Phone</th>
            		 <th width="15%" align="left">Doctor's Name</th>
            		 <th width="15%" align="center">Medicines</th>
            		 <th width="10%" align="center"></th>
            		 <th width="10%" align="center">Invoice Amount</th>
            		 <th width="5%" align="center">Status</th>
                    </tr>
                  </thead>
                  <tbody>
                   <?php
                    if(isset($visits_array[0]['shift_id'])&&$visits_array[0]['shift_id']!='')
                    {
                    	for($v=0;$v<count($visits_array);$v++)
						{
							if($v%2==0){$class = 'gradeX';}{$class = 'gradeC';}
							
							$visit_id = $visits_array[$v]['visit_id'];
							$visit_id_encoded = base64_encode($visit_id);
							
							$retrieveVisitPrecOb = new classVisits;
							if($retrieveVisitPrecOb->checkMedicineLabTestProcedureInPrescription($visits_array[$v]['visit_id'],'medicine'))
                			{
							
								$patient_id = $visits_array[$v]['patient_id'];
								$patient_id_encoded = base64_encode($patient_id);
								
								$doctor_id = $visits_array[$v]['doctor_id'];
								$doctor_id_encoded = base64_encode($visits_array[$v]['doctor_id']);
								
								$retrieveVisitPrecOb = new classVisits;
								$retrieveVisitPrecOb->setVisitID($visit_id);
								$prec_array = $retrieveVisitPrecOb->retrievePrescription();
							
								$patienthistory_link = "<a href='patienthistory.php?patientid=$patient_id_encoded&visitid=$visit_id_encoded'>Prescription</a>";
								
								$patientOb = new classPatient;
								$patientOb->setPatientAutoID($patient_id);
								$patient_info = $patientOb->retrievePatientByPatientID();
								
								$doctorOb = new classDoctor;
								$doctorOb->setDoctorID($visits_array[$v]['doctor_id']);
								$doctor_detail = $doctorOb->retrieveDoctorByDoctorID();
								$doctor_name = $doctor_detail[0]['title'].' '.$doctor_detail[0]['doc_fname'].' '.$doctor_detail[0]['doc_lname'];
								
								$saleInvOb = new classSaleInvoice;
								$inv_data = $saleInvOb->retrieveInvoiceDetailByVisitID($visit_id);
								
								if(isset($inv_data[0]['visit_id'])&&$inv_data[0]['visit_id']!=0)
								{
									$saleinvoiceid = base64_encode($inv_data[0]['saleinvoice_id']);
									
									if($inv_data[0]['payment_status']=='paid')
									{
										$sale_invoice =  "<a href='pharmsaleinvvw.php?saleinvoice_id=$saleinvoiceid&patient_id=$patient_id_encoded'>View</a>";
									}
									else
									{
										$checkReportOb = new classProductClosingReconcilation;
										if($checkReportOb->checkClosingReportAlreadyInProgress('in_progress',$_SESSION['security']['location_id']))
										{
											$sale_invoice = "<a href='pharmsaleinv.php?saleinvoice_id=$saleinvoiceid&patient_id=$patient_id_encoded'>Edit</a>";
										}
										else
										{
											$sale_invoice = "";
										}
									}
								}
								else
								{
										$checkReportOb = new classProductClosingReconcilation;
										if($checkReportOb->checkClosingReportAlreadyInProgress('in_progress',$_SESSION['security']['location_id']))
										{
											$sale_invoice =  "<a href='pharmsaleinv.php?patientid=$patient_id_encoded&visitid=$visit_id_encoded'>Create Invoice</a>" ;
										}
										else
										{
											$sale_invoice = "";
										}
								} 
								
					
								
								?>
								<tr class="<?php echo $class;?>">
									<td align="center"><a href="javascript:Popup('<?php echo prec_print_file;?>?visitid=<?php echo $visit_id_encoded;?>&patientid=<?php echo $patient_id_encoded;?>&doctorid=<?php echo $doctor_id_encoded;?>')">Prescription</a></td>
									<td align="center"><?php echo date('d M Y',$visits_array[$v]['visit_date']);?></td>
									<td align="center"><?php echo $patient_info[0]['patient_id'];?></td>
									<td align="left"><?php echo $patient_info[0]['patient_fname'].' '.$patient_info[0]['patient_lname'];?></td>
									<td align="center"><?php echo $patient_info[0]['phone'];?></td>
									<td align="left"><?php echo $doctor_name;?></td>
									<td align="left">
									 <?php
									for($prm=0;$prm<count($prec_array);$prm++)
									{
										if($prec_array[$prm]['product_id']!=0)
										{	
											$retreiveMedOb = new classVisits;
											$retreiveMedOb->setMedicineID($prec_array[$prm]['product_id']);
											$med_info = $retreiveMedOb->retrieveMedicineByMedicineID();
											
											echo ucwords($med_info[0]['product_name'])." - ".$prec_array[$prm]['dosage'].'<br>';
										}
									}
									?>
									</td>
									<td align="center"><?php echo $sale_invoice;?></td>
									<td align="right"><?php if(isset($inv_data[0]['amount_payable'])){ echo "Rs. ".number_format($inv_data[0]['amount_payable'],2);}?></td>
									<td align="center" ><?php if(isset($inv_data[0]['payment_status'])){echo $inv_data[0]['payment_status'];}?></td>
								</tr>
								<?php
							}
						}
                    }
					else
					{
						?>
							<tr>
								<table>
									<tr>
										<td>No entries found!</td>
									</tr>
								</table>
							</tr>
						<?php
					}
                    ?>
                  </tbody>
                  <tfoot>
                  </tfoot>
                </table>
                <table>
                 <tr>
        <td align="right"><?php include('pagination.php'); ?></td>
      </tr>  
                </table>
              </div>
            </div>
          </section>
        </div>
      </div>
      <!-- page end-->
    </section>
  </section>
  <!-- InstanceEndEditable --><!--main content end-->
<!--right sidebar start-->
 
<!--right sidebar end-->
</section>
<!-- Placed js at the end of the document so the pages load faster -->
<!--Core js-->
<!--<script src="../js/jquery-1.10.2.min.js"></script>-->
  
 
<script src="../assets/jquery-ui/jquery-ui-1.10.1.custom.min.js"></script>
<script src="../bs3/js/bootstrap.min.js"></script>



<script src="../js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="../popUp/popUp.js"></script>
<script src="../js/ajax.js"></script>

<script src="../js/lib/jquery.js"></script>
<script src="../assets/fullcalendar/fullcalendar/fullcalendar.min.js"></script>
<script src="../js/calendar/external-dragging-calendar.js"></script>
<script src="../js/accordion-menu/jquery.dcjqaccordion.2.7.js"></script>
<script src="../js/scrollTo/jquery.scrollTo.min.js"></script>
<script src="../js/nicescroll/jquery.nicescroll.js" type="text/javascript"></script>
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/flot-chart/excanvas.min.js"></script><![endif]-->
<script src="../assets/jQuery-slimScroll-1.3.0/jquery.slimscroll.js"></script>
<script src="../assets/skycons/skycons.js"></script>
<script src="../assets/jquery.scrollTo/jquery.scrollTo.js"></script>
<script src="../js/jquery.easing.min.js"></script>
<script src="../assets/calendar/clndr.js"></script>
<script src="../js/underscore-min.js"></script>
<script src="../assets/calendar/moment-2.2.1.js"></script>
<script src="../js/calendar/evnt.calendar.init.js"></script>
<script src="../assets/jvector-map/jquery-jvectormap-1.2.2.min.js"></script>
<script src="../assets/jvector-map/jquery-jvectormap-us-lcc-en.js"></script>
<script src="../assets/gauge/gauge.js"></script>



<!--clock init-->
<script src="../assets/css3clock/js/script.js"></script>
<!--Easy Pie Chart-->
<script src="../assets/easypiechart/jquery.easypiechart.js"></script>
<!--Sparkline Chart-->
<!--Morris Chart-->
<script src="../assets/morris-chart/morris.js"></script>
<script src="../assets/morris-chart/raphael-min.js"></script>
<!--jQuery Flot Chart-->
<script src="../assets/flot-chart/jquery.flot.animator.min.js"></script>
<script src="../assets/flot-chart/jquery.flot.growraf.js"></script>
<script src="../js/dashboard.js"></script>
<script src="../js/custom-select/jquery.customSelect.min.js" ></script>
<!--common script init for all pages-->
<script src="../js/scripts.js"></script>
<!--dynamic table initialization -->
<script src="../js/dynamic_table/dynamic_table_init.js"></script>



<!--dynamic table initialization -->
<script src="../js/dynamic_table/dynamic_table_init.js"></script>
<!--<start===================>-->
<script src="../js/lib/jquery.js"></script>


<script src="../bs3/js/bootstrap.min.js"></script>



<script class="include" type="text/javascript" src="../js/accordion-menu/jquery.dcjqaccordion.2.7.js"></script>

<script src="../js/scrollTo/jquery.scrollTo.min.js"></script>
<script src="../js/nicescroll/jquery.nicescroll.js" type="text/javascript"></script>
<!--Easy Pie Chart-->
<script src="../assets/easypiechart/jquery.easypiechart.js"></script>
<!--Sparkline Chart-->
<script src="../assets/sparkline/jquery.sparkline.js"></script>
<!--jQuery Flot Chart-->
<script src="../assets/flot-chart/jquery.flot.js"></script>
<script src="../assets/flot-chart/jquery.flot.tooltip.min.js"></script>
<script src="../assets/flot-chart/jquery.flot.resize.js"></script>
<script src="../assets/flot-chart/jquery.flot.pie.resize.js"></script>
<script type="text/javascript" src="../assets/bootstrap-daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="../assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>

<!--dynamic table-->
<!--common script init for all pages-->
<script src="../js/scripts.js"></script>

<!--dynamic table initialization -->
<script src="../js/dynamic_table/dynamic_table_init.js"></script>

<script type="text/javascript" src="../datepicker/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../datepicker/jquery-ui.js"></script>

<!--<script type="text/javascript" src="../popUp/jquery-1.9.0.js"></script>-->
<script type="text/javascript">

 function Popup(apri) { 
	window.open(apri,"","top=10,left=200,width=800,height=700,status=no,menubar=no,toolbar=no,scrollbars=yes"); 
 }
</script> 

<div id="update_password-box" class="update_password-popup">
    
    <div class="pop_header">
        <span>Change Password</span>
        <a href="#" class="pop_close" style="float:right;">Close (X)</a>
    </div>
    
    <table width="100%" border="0" cellspacing="2" cellpadding="2" class="panel">
      <tr>
        <td>
          <div id="result_update_password_form"></div>
          
          <form action="" method="post" id="update_password_form" class="cmxform form-horizontal" onSubmit="return false;">
          	
            <br>
            
         	<div class="form-group">
            <label class="control-label col-lg-3" for="lastname">New Password:</label>
                <div class="col-lg-6">
                    <input type="password" name="password" class="form-control" value="" id="exampleInputPassword1">
                </div>
            </div>
           
            <p align="right">
            	<input type="hidden" name="user_id" value="<?php if(isset($user_id)&&$user_id!=''){echo $user_id;}else{ echo 
				$_SESSION['security']['user_id'];}?>">
                <input type="hidden" name="updateUserPwd" value="yes">
                <input name="ajax_submit" type="submit" class="ajax_submit btn btn-info" value="Update"/>
            </p>
            
          </form>
          </td>
          
      </tr>
    </table>
</div> 
 
</body>  
<!-- InstanceEnd --></html>
<script>
	$(function() {
		
		$("#datepicker").datepicker({
		showOn: "button",
		buttonImage: "../images/calendar.gif",
		buttonImageOnly: true,
		changeMonth: true,
		changeYear: true,
		dateFormat: "yy-mm-dd"
		});
		
		$("#datepicker1").datepicker({
		showOn: "button",
		buttonImage: "../images/calendar.gif",
		buttonImageOnly: true,
		changeMonth: true,
		changeYear: true,
		dateFormat: "yy-mm-dd"
		
		});
	
	});
	
</script>