<?php
include('../config/config.php');
include('../classes/classProduct.php');
include('../classes/classReceiveInvoice.php');
include('../classes/classProductClosingReconcilation.php');

/*echo '<pre>';
print_r($_POST);
print_r($_SESSION);
echo '</pre>';
exit;*/


if((isset($_GET['ref'])&&(base64_decode($_GET['ref'])=='new'))||(isset($_POST['exit'])&&($_POST['exit']=='Exit')))
{
	unset($_SESSION['temp']);
	
	if(isset($_POST['exit']))
	{
		header("Location:mgmtincoming.php");
	}
	else
	{
		header("Location:pharmrecinvvw.php");	
	}
}


################## Create Invoice Start ####################################

if(isset($_POST['add_supp'])&&$_POST['add_supp']=='Select')
{
	try
	{
		$checkSuppOb = new classProduct;
		$checkSuppOb->setSupplierID($_POST['supplier_id']);
		$_SESSION['temp']['supplier_id'] = $_POST['supplier_id'];
		
		$createInvOb = new classReceiveInvoice;
		$createInvOb->setUserID($_SESSION['security']['user_id']);
		$createInvOb->setLocationID($_SESSION['security']['location_id']);
		$createInvOb->setSupplierID($_SESSION['temp']['supplier_id']);
		$createInvOb->createReceiveInvoice();
		
		$_SESSION['temp']['invoice_id'] = $createInvOb->getReceiveInvoiceID();
	}
	catch (MyException $e)
	{
		$error_message = $e->getUserMsg();
	}
}

if(isset($_GET['recinvoice_id'])&&isset($_GET['supplier_id'])!='')
{
	$_SESSION['temp']['invoice_id'] = base64_decode($_GET['recinvoice_id']);
	$_SESSION['temp']['supplier_id'] = base64_decode($_GET['supplier_id']);
	header("Location:pharmrecinvvw.php");
}

if(isset($_SESSION['temp']['supplier_id'])&&$_SESSION['temp']['supplier_id']!='')
{
	$supplier_id = $_SESSION['temp']['supplier_id'];
}
if(isset($_SESSION['temp']['invoice_id'])&&$_SESSION['temp']['invoice_id']!='')
{
	$invoice_id = $_SESSION['temp']['invoice_id'];
}

################## Add Item In Invoice Start ####################################

if(isset($_POST['add_prod'])&&$_POST['add_prod']=='Add Product')
{
	try
	{
		$addItemOb = new classReceiveInvoice;
		$addItemOb->setProductID($_POST['prod_id']);
		$addItemOb->setReceiveInvoiceID($_POST['invoice_id']);
		$addItemOb->addReceiveItemsInInvoice();
	}
	catch (MyException $e)
	{
		$error_message = $e->getUserMsg();
	}
}

################## Retrieve Data Start ####################################

try
{
	$retrieveOb = new classProduct;
	
	///////////// retrieve supplliers ////////////////////////////////////////
	
	$retrieveOb->setLocationID($_SESSION['security']['location_id']);
	$suppliers_array = $retrieveOb->retrieveSuppliers();
	
	///////////// retrieve suppllier products ///////////////////////////////
	
	if(isset($supplier_id)&&$supplier_id!='')
	{
		$retrieveOb->setSupplierID($supplier_id);
		$product_array = $retrieveOb->retrieveProductSupplierDataBySupplierID();
		$supplier_single_detail = $retrieveOb->retrieveSupplierBySupplierID($supplier_id);
	}
	
	if(isset($invoice_id)&&$invoice_id!='')
	{
		$retrieveInvoiceOb = new classReceiveInvoice;
		$retrieveInvoiceOb->setReceiveInvoiceID($invoice_id);
		$invoice_array = $retrieveInvoiceOb->retrieveInvoiceDetail();
		$invoice_items_array = $retrieveInvoiceOb->retrieveInvoiceItemsDetail();
	}
	
}
catch (MyException $e)
{
	$error_message = $e->getUserMsg();
}	
		


/*echo '<pre>';
print_r($product_array);
echo '</pre>';
exit;
*/

?>
<!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('printpharmrecinvvw.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="mgmtincoming.php"><img src="../images/iconinvoice.png"></a></td>
       <td width="12%" align="center">
      <?php
	  $checkReportOb = new classProductClosingReconcilation;
	  if($checkReportOb->checkClosingReportAlreadyInProgress('in_progress',$_SESSION['security']['location_id']))
	  {
		  ?>
		  <a href="pharmrecinv.php?ref=<?php echo base64_encode('new');?>"><img src="../images/iconhistory.png" /></a>
		  <?php
	  }
	  else
	  {
			?>
			<a href="#" onclick="return inventoryclosing();"><img src="../images/iconhistory.png" /></a>
			<?php
	  }
	  ?>
      </td>    
      <td width="12%" align="center"><a href="addprod.php"><img src="../images/iconproduct.png"></a></td>
      <td width="12%" align="center"><a href="pharminventory.php"><img src="../images/iconinventory.png"></a></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="mgmtincoming.php">Incoming Products</a></td>
       <td align="center">
       <?php
	  $checkReportOb = new classProductClosingReconcilation;
	  if($checkReportOb->checkClosingReportAlreadyInProgress('in_progress',$_SESSION['security']['location_id']))
	  {
		  ?>
		  <a href="pharmrecinv.php?ref=<?php echo base64_encode('new');?>">Create Invoice</a>
		  <?php
	  }
	  else
	  {
			?>
			<a href="#" onclick="return inventoryclosing();">Create Invoice</a>
			<?php
	  }
	  ?>
      </td> 
      <td align="center"><a href="addprod.php">Add Product</a></td>
      <td align="center"><a href="pharminventory.php">Products Inventory</a></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">
                    <div class="panel-body invoice">
                    
                    
                        <div class="invoice-header">
                            <div class="invoice-title col-md-3 col-xs-12">
                            	<h2>RECEIVE INVOICE</h2>
                            </div>
                        </div>
                        <?php
						if(isset($error_message)&&$error_message!='')
						{
							?>
                            <table>
							<tr>
								<td><span class="message_red"><?php echo $error_message;?></span></td>
							</tr>
                            <tr><td>&nbsp;</td></tr>
                            </table>
							<?php
						}
						?>
                        
                        <?php
						if(isset($_SESSION['temp']['supplier_id'])&&$_SESSION['temp']['supplier_id']!='')
						{
							?>
							<div id="result"></div>
                            
							<table width="100%" border="0" align="left" cellspacing="0" cellpadding="0">
								<tbody>
									<tr>
										<td width="10%">Company :</td>
										<td width="90%"><?php echo $supplier_single_detail[0]['supplier_name']?></td>
									</tr>
									<tr>
										<td>Address :</td>
										<td><?php echo $supplier_single_detail[0]['supplier_address']?></td>
									</tr>
									<tr>
										<td>Phone :</td>
										<td><?php echo $supplier_single_detail[0]['company_phone']?></td>
									</tr>
									<tr>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
									<tr>
										<td>Invoice # :</td>
										<td><?php echo $invoice_id;?></td>
									</tr>
								</tbody>
								</table>
								
							<table width="100%" border="0">
								<tr>
									<td width="47%">&nbsp;</td>
									<td width="9%"></td>
								</tr>
							</table>
							
							<table class="table table-invoice" style="margin-top: 0px;">
								<thead>
									<tr>
										<th width="5%">ID</th>
										<th width="25%">Product</th>
                                        <th width="12%" class="text-center">Expiry Date</th>
										<th width="10%" class="text-center">Packing</th>
                                        <th width="10%" class="text-center">Trade Price per Unit</th>
										<th width="8%" class="text-center">Qty</th>
										<th width="10%" class="text-center">Total</th>
										<th width="10%"class="text-center">Discount</th>
										<th width="10%" class="text-center">Net Total</th>
									</tr>
								</thead>
								<tbody>
                               
                                <?php
								if(isset($invoice_items_array[0]['recitems_id'])&&$invoice_items_array[0]['recitems_id']!='')
								{
									for($ri=0;$ri<count($invoice_items_array);$ri++)
									{
										$singleProdOb = new classProduct;
										$singleProdOb->setProductID($invoice_items_array[$ri]['product_id']);
										$single_prod_detail = $singleProdOb->retrieveProductByProductID();
										
										?>
											<tr>
                                            
												<td><?php echo $invoice_items_array[$ri]['product_id'];?></td>
                                                
												<td>
                                                	<h4><?php echo $single_prod_detail[0]['product_name'];?></h4>
													<p><?php echo $single_prod_detail[0]['medicine_type'];?></p>
												</td>
                                                
                                                <td><?php if($invoice_items_array[$ri]['expiry_date']!=''){echo date('Y-m-d',$invoice_items_array[$ri]['expiry_date']);}?></td>
                                                
												<td class="text-center"><?php echo $invoice_items_array[$ri]['packing_type'];?></td>
                                                
												<td class="text-right"><?php echo "Rs. ".number_format($invoice_items_array[$ri]['trade_price'],2);?></td>
                                                
												<td class="text-center"><?php echo $invoice_items_array[$ri]['qty_received'];?></td>
                                                
												<td class="text-right">
													<?php 
                                                    if ($invoice_items_array[$ri]['packing_type']=='Unit/Tablets') 
                                                    { 
                                                        $total = $invoice_items_array[$ri]['trade_price']*$invoice_items_array[$ri]['qty_received'];
                                                    } 
                                                    elseif ($invoice_items_array[$ri]['packing_type']=='Leaf') 
                                                    {  
                                                        $total = $invoice_items_array[$ri]['trade_price']*$invoice_items_array[$ri]['qty_received'];
                                                    } 
                                                    elseif ($invoice_items_array[$ri]['packing_type']=='Box/Pack') 
                                                    { 
                                                        $total = $invoice_items_array[$ri]['trade_price']*$invoice_items_array[$ri]['qty_received'];
                                                    }
                                                    else
                                                    {
                                                        $total = 0;
                                                    }
                                                    
                                                   ?><?php echo "Rs. ".number_format($total,2);?></td>
                                                
												<td class="text-center"><?php echo $invoice_items_array[$ri]['discount']." %";?></td>
                                                
												<td class="text-right"><?php echo "Rs. ".number_format($invoice_items_array[$ri]['net_total'],2);?></td>
                                                
											</tr>
                                            
                                            
                                            
                                            <input name="product_id[]" class="product_id" id="product_id_<?php echo $ri;?>" value="<?php echo $single_prod_detail[0]['product_id'];?>" type="hidden" size="5"/>
                                            
                                            <input name="recitems_id[]" class="recitems_id" id="recitems_id_<?php echo $ri;?>" value="<?php echo $invoice_items_array[$ri]['recitems_id'];?>" type="hidden" size="5"/>
											
										<?php
									}
								}
								?>  
                                
								</tbody>
							</table>
                           
							<div class="row">
								
								<div class="col-md-3 invoice-block pull-right">
									<ul class="unstyled amounts">
										<li>Sub-Total: Rs. <span id="invoice_amount"><?php echo number_format($invoice_array[0]['invoice_amount'],2);?></span></li>
										<li>Discount: <?php echo $invoice_array[0]['discount']." %";?>
                                        </li>
										<!--<li>TAX (15%) ----- </li>-->
										<li class="grand-total">Grand Total: Rs. <span id="amount_payable"><?php echo number_format($invoice_array[0]['amount_payable'],2);?></span></li>
									</ul>
								</div>
							</div>
						  
							<div class="text-center invoice-btn">
                            <form action="" method="post">
                            <input name="exit" type="submit" class="btn btn-success btn-lg" value="Exit"/>
                            <a  href="javascript:Popup('printpharmrecinvvw.php')" class="btn btn-primary btn-lg"><i class="fa fa-print"></i> Print </a>
                            </form>
								<!--<a class="btn btn-success btn-lg"><i class="fa fa-check"></i> Submit Invoice </a>-->
								
							</div>
                            
                            <!--<div class="col-md-9 payment-method">
									<h4>Payment Details</h4>
									<p>1. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
									<p>2. Pellentesque tincidunt pulvinar magna quis rhoncus.</p>
									<p>3. Cras rhoncus risus vitae congue commodo.</p>
									<br>
									<h3 class="inv-label itatic">Thank you for your business</h3>
								</div>-->
							
							<?php
						}
						else
						{
							?>
                            <table width="100%" border="0">
                            <tr>
                                <td>
                                	<div class="form-group">
                                	<form action="" method="post">
                                        <label class="control-label col-lg-3" for="firstname" style="width:9%;">Supplier :</label>
                                        <input name="add_supp" type="submit" class="btn btn-primary" value="Select"/>
                                        <div class="col-lg-6">
                                            <select name="supplier_id" class="form-control input-sm m-bot15">
                                            <option value="">Select Supplier</option>
                                            <?php
                                            if(isset($suppliers_array[0]['supplier_id'])&&$suppliers_array[0]['supplier_id']!='')
                                            {
                                                for($s=0;$s<count($suppliers_array);$s++)
                                                {
                                                    ?>
                                                    <option value="<?php echo $suppliers_array[$s]['supplier_id'];?>"><?php echo $suppliers_array[$s]['company_name'];?></option>
                                                    <?php
                                                }
                                            }
                                            ?>
                                            </select>
                                        </div>
                                    </form>
                                </div>
                               	</td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr><td>&nbsp;</td></tr>
                        </table>
                            <?php
						}
						?>
                        
                    </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",
		changeMonth: true,
		changeYear: true,
		buttonImage: "../images/calendar.gif",
		buttonImageOnly: true,
		dateFormat: "yy-mm-dd",
		minDate:"Today"
		});
	});
	
	</script>


  