?>
</td>
	              <td><?php 
    echo DhsHelper::formatPrice($row['subtotal']);
    ?>
</td>
	              <td><?php 
    echo DhsHelper::formatDate($row['mfg_date']);
    ?>
</td>
	              <td><?php 
    echo DhsHelper::formatDate($row['expiry_date']);
    ?>
</td>
	              <td><?php 
    echo DhsHelper::formatPrice($row['total']);
    ?>
</td>
	              <td>
	              	<?php 
    if ($a > 0) {
        ?>
	              	<a href="<?php 
        echo DHS_ROOT;
        ?>
index.php?view=return_stock&menu=medicine&medicine_id=<?php 
        echo $row['medicine_id'];
        ?>
&inventory_id=<?php 
        echo $row['inventory_id'];
        ?>
    $store_id = $_POST['store_id'];
    $search = stripslashes($search);
    $store_id = stripslashes($store_id);
    $store_id = mysql_real_escape_string($store_id);
    $search = mysql_real_escape_string($search);
    $result = mysqli_query($con, "select m.`medicine_id`, m.`medicine_name`, c.`name`, m.`manufacturer` \n\t\t\t\t\t\tfrom `medicine` as m join `category` as c \n\t\t\t\t\t\ton (m.category_id = c.category_id and m.`store_key` = '{$store_id}' and c.`store_key` = '{$store_id}' and m.`medicine_name` like '%{$search}%')");
    $medicines = array();
    $medicine_ids = array();
    error_reporting(0);
    while ($row = mysqli_fetch_array($result)) {
        $medicines[$row['medicine_id']]['med_name'] = $row['medicine_name'];
        $medicines[$row['medicine_id']]['cat_name'] = $row['name'];
        $medicines[$row['medicine_id']]['mfg'] = $row['manufacturer'];
        $medicine_ids[] = $row['medicine_id'];
    }
    list($records, $purchased, $sold, $return) = DhsHelper::getInventoryDetails($medicine_ids);
    ?>
			<?php 
    if (!empty($medicines)) {
        ?>
				<div style="font-size: 1.3em; border-bottom:1px solid #ccc;"><strong>Search Results</strong></div>
				<table class="table table-stripped">
					<thead>
					<tr>
						<th>#</th>
						<th>Medicine Name</th>
						<th>Type</th>
						<th>Manufacturer</th>
						<th>Available Quantity</th>
					</tr>
					</thead>
		
		<div class="control-group">
		    <label class="control-label" for="discount">Discount:</label>
		    <div class="controls">
		      <input type="text" name="discount" required="" value="<?php 
echo DhsHelper::formatPrice($inventory['discount']);
?>
">
		    </div>
		</div>
		
		<div class="control-group">
		    <label class="control-label" for="total">Total:</label>
		    <div class="controls">
		      <input type="text" name="total" required="" value="<?php 
echo DhsHelper::formatPrice($inventory['total']);
?>
" readonly="readonly">
		    </div>
		</div>
		
		<div class="control-group">
		    <label class="control-label" for="mfg_date">Manufacturing Date:</label>
		    <div class="controls">
		    	<div class="input-append dhs-datetimepicker" style="margin-bottom: 0;">
			    	<input data-format="yyyy-MM-dd" type="text" name="mfg_date" id="mfg_date" required="" value="<?php 
echo $inventory['mfg_date'];
?>
"></input>
				    <span class="add-on">
				      <i data-time-icon="icon-time" data-date-icon="icon-calendar">
     $sql = 'select m.medicine_name, invt.* from medicine as m inner join (select * from `inventory` ';
     $sql .= 'where `store_key` = ' . "'" . $store_key . "'" . ' and `status` = ' . DHS_DISTRIBUTOR_INVENTORY_STATUS_VERIFIED;
     $sql .= " and `barcode` = {$barcode} ) as invt on (m.medicine_id = invt.medicine_id)";
     $result = mysqli_query($con, $sql);
     $record = mysqli_fetch_array($result);
     $record['unit_cost'] = DhsHelper::formatPrice($record['unit_cost']);
     $record['subtotal'] = DhsHelper::formatPrice($record['subtotal']);
     $record['total'] = DhsHelper::formatPrice($record['total']);
     $record['mfg_date'] = DhsHelper::formatDate($record['mfg_date'], 'Y-m-d');
     $record['expiry_date'] = DhsHelper::formatDate($record['expiry_date'], 'Y-m-d');
     //$sold_rs = mysqli_query($con,'select sum(quantity) as sold from `cust_inventory` group by `barcode` where ');
     echo '####' . json_encode($record) . '@@@@';
     die;
     break;
 case "barcode_medicine":
     $records = DhsHelper::getBarcodeDetails($barcode, $store_key);
     echo '####' . json_encode($records) . '@@@@';
     die;
     break;
 case "delete_medicine":
     $id = $_REQUEST['medicine_id'];
     if (!empty($id)) {
         $sql = "update `medicine` set status=0 where medicine_id={$id}";
         if (!($rs = mysqli_query($con, $sql))) {
             die('Error' . mysql_error());
         }
     }
     echo "<script>";
     echo "window.location='index.php?view=medicine_details&menu=medicine'";
     echo "</script>";
     break;
  <div class="control-group">
    <label class="control-label" for="mfg_date">Manufactured Date:</label>
    <div class="controls">
      <input type="text" id="mfg_date" name="mfg_date" placeholder="Manufactured Date" value="<?php 
echo DhsHelper::formatDate($record['mfg_date']);
?>
" readonly="readonly" />
  	</div>
  </div>
  
        
  <div class="control-group">
    <label class="control-label" for="expiry_date">Expiry Date:</label>
    <div class="controls">
      <input type="text" id="expiry_date" name="expiry_date" placeholder="Expiry Date" value="<?php 
echo DhsHelper::formatDate($record['expiry_date']);
?>
" readonly="readonly" />
  </div></div>
  
  <div class="control-group">
    <label class="control-label" for="verify">Do Verify:</label>
    <div class="controls">
      <input type="radio" name="verify" value="1" checked="checked">Yes
      <input type="radio" name="verify" value="0" <?php 
echo isset($verify) && $verify == 0 ? 'checked="checked"' : '';
?>
>No
  	</div>
  </div>
  
                	<a href="#" class="cust_delete" data-source-id="<?php 
    echo $record['bill_id'];
    ?>
">
                        <i class="icon-remove"></i>
                	</a>
                </td>
            </tr>
	<?php 
}
?>
</table>
	
<div class="well well-small">
	<strong>Total Sales: Rs. <?php 
echo DhsHelper::formatPrice($con, $total);
?>
</strong>
</div>	

<?php 
if ($count > 0) {
    ?>
 <div class="pagination text-center">
	<ul>
	    <?php 
    for ($i = 0; $i < $paginationCount; $i++) {
        ?>
	        <li class="<?php 
        echo $page_id == $i ? 'active' : 'disabled';
        ?>
		<div class="row-fluid">
			<div class="span8" style="text-align: right;">Tax</div>
			<div class="span4" style="text-align: right;"><?php 
echo DhsHelper::formatPrice($billing[3]) . ' Rs';
?>
</div>
		</div>
		
		<div class="row-fluid">
			<div class="span8" style="text-align: right;">Discount</div>
			<div class="span4" style="text-align: right;"><?php 
echo DhsHelper::formatPrice($billing[4]) . ' Rs';
?>
</div>
		</div>
		
		<hr style="margin:0px; margin-bottom:10px;">
		
		<div class="row-fluid">
			<div class="span8" style="text-align: right;">Total</div>
			<div class="span4" style="text-align: right;"><?php 
echo DhsHelper::formatPrice($billing[5]) . ' Rs';
?>
</div>
		</div>
	</div>
</div>

	
</body>
</html>
Exemple #8
0
echo DHS_ROOT;
?>
index.php?view=inventory_details&menu=stock">View Stock</a></li>
		                <li class="divider"></li>
		                <li><a href="<?php 
echo DHS_ROOT;
?>
index.php?view=out_of_stock&menu=stock">Finished Stock <span class="badge badge-important"><?php 
echo DhsHelper::getFinishedStock($con);
?>
</span></a></li>
		                <li><a href="<?php 
echo DHS_ROOT;
?>
index.php?view=arrived_stock&menu=stock">Arrived Stock <span class="badge badge-info"><?php 
echo DhsHelper::getArrivedStock($con);
?>
</span></a></li>
		            </ul>
		        </li>
		        
		        <li class="dropdown <?php 
echo isset($_GET['menu']) && $_GET['menu'] == 'billing' ? 'active' : '';
?>
">
		            <a href="#" data-toggle="dropdown" class="dropdown-toggle">Billing <b class="caret"></b></a>
		            <ul class="dropdown-menu">
		                <li><a href="<?php 
echo DHS_ROOT;
?>
index.php?view=billing&menu=billing">Create Bills</a></li>
        ?>
</td>
			<td><?php 
        echo $row['medicine_name'];
        ?>
</td>
			<td><?php 
        echo $category[$row['category_id']];
        ?>
</td>
			<td><?php 
        echo $row['requested_quantity'];
        ?>
</td>
			<td><?php 
        echo DhsHelper::formatDate($row['requested_date']);
        ?>
</td>
			<td><a class="btn btn-small btn-danger" target="_blank" href="index.php?view=process_stock_request&menu=requests&inventory_id=<?php 
        echo $row['inventory_id'];
        ?>
&store_key=<?php 
        echo $store_key;
        ?>
">Done</a></td>
		</tr>
		
	<?php 
    }
}
?>
Exemple #10
0
                                  </a>
            </div>
            
            
            <div class="span2" style="background-color: #CC0000;">
                 <a href="<?php 
    echo DHS_ROOT;
    ?>
index.php?view=out_of_stock&menu=stock">
                <div class="thumbnail text-center admin-dashboard-stats-box" style="height:150px; color:#fff;">
                    <div style="margin-top:15px;">
                        <strong><span style="font-size:1.25em;">Out of Stock</span></strong><hr/>
                        <div>&nbsp;</div>
                        <div style="font-size:1.0em;">
                        	<?php 
    echo 'COUNT = ' . DhsHelper::getFinishedStock($con);
    ?>
                        </div>
                    </div>	
                </div>
                     </a>
            </div>
        </div>
     </div>

<br/>
<br/>  
      <div class="row-fluid">
          <div class="span4" style="border: 1px solid #ccc; box-shadow: 2px 2px #ccc; padding:3px; border-radius:4px;">
                <h3>Recent Transactions</h3>
                
		<td><?php 
    echo $row['doctor_name'];
    ?>
</td>
		<td><?php 
    echo $row['mobile'];
    ?>
</td>
		
		<td>
			<?php 
    $sql = "select sum(`total`) as income, `doctor_name`, `store_key` from `cust_inventory` group by `doctor_name` having `store_key` = '{$store_key}' and `doctor_name` = " . "'" . $row['doctor_name'] . "'";
    //echo $sql;
    $inc = mysqli_query($con, $sql);
    $income = mysqli_fetch_array($inc);
    echo DhsHelper::formatPrice($income['income']);
    ?>
		</td>
		<td>
			<a href="index.php?view=doctor_registration&menu=user&doctor_id=<?php 
    echo $row['doctor_id'];
    ?>
">
				<i class="icon-edit"></i>
			</a>
			<a href="index.php?view=manage_doctor&action=delete_doctor&doctor_id=<?php 
    echo $row['doctor_id'];
    ?>
"  onclick="javascript:void(0)"> 
				<i class="icon-remove"></i>
			</a>
		<div class="row-fluid">
			<div class="span8" style="text-align: right;">Tax</div>
			<div class="span4" style="text-align: right;"><?php 
echo ' Rs.' . DhsHelper::formatPrice($con, $billing[3]);
?>
</div>
		</div>
		
		<div class="row-fluid">
			<div class="span8" style="text-align: right;">Discount</div>
			<div class="span4" style="text-align: right;"><?php 
echo ' Rs.' . DhsHelper::formatPrice($con, $billing[4]);
?>
</div>
		</div>
		
		<hr style="margin:0px; margin-bottom:10px;">
		
		<div class="row-fluid">
			<div class="span8" style="text-align: right;">Total</div>
			<div class="span4" style="text-align: right;"><?php 
echo ' Rs.' . DhsHelper::formatPrice($con, $billing[5]);
?>
</div>
		</div>
	</div>
</div>

	
</body>
</html>
        ?>
</td>
			<td><?php 
        echo $row['requested_quantity'];
        ?>
</td>
			<td><?php 
        echo $row['quantity'];
        ?>
</td>
			<td><?php 
        echo DhsHelper::formatDate($row['requested_date']);
        ?>
</td>
			<td><?php 
        echo DhsHelper::formatDate($row['completed_date']);
        ?>
</td>
			<td><?php 
        echo $row['message'];
        ?>
</td>
			<td>
			<?php 
        if ($row['status'] == 30) {
            ?>
				Verifed
			<?php 
        } else {
            ?>
	
    ?>
</td>
				<td><?php 
    echo $record['quantity'];
    ?>
</td>
				<td><?php 
    echo DhsHelper::formatPrice($record['purchased_price']);
    ?>
</td>
				<td><?php 
    echo DhsHelper::formatPrice($record['returning_total']);
    ?>
</td>
				<td><?php 
    echo DhsHelper::formatPrice($record['loss']);
    ?>
</td>
				<td><?php 
    echo $record['return_date'];
    ?>
</td>
				<td><?php 
    echo $users_list[$record['returned_by']];
    ?>
</td>
			</tr>
			<?php 
}
?>
		</tbody>
$pageResult = mysqli_query($con, $pageSql);
$count = mysqli_num_rows($pageResult);
if ($count > 0) {
    $paginationCount = DhsHelper::getPagination($count);
}
// ***** Pagination Work End ******
if (isset($_GET['page_id']) && !empty($_GET['page_id'])) {
    $page_id = $_GET['page_id'];
} else {
    $page_id = '0';
}
$pageLimit = PAGE_PER_NO * $page_id;
$sql .= " limit {$pageLimit}," . PAGE_PER_NO;
$result = mysqli_query($con, $sql);
$n = 0;
$categories = DhsHelper::getCategories($con);
while ($row = mysqli_fetch_array($result)) {
    $n++;
    ?>
    <tr class="row<?php 
    echo $row['medicine_id'];
    ?>
">
        <td><?php 
    echo $n;
    ?>
</td>
        <td><?php 
    echo $row['medicine_name'];
    ?>
</td>
Exemple #16
0
        <th>BillNo.</th>
        <th>Total Amount</th> 
        <th>Pending Amount</th>
		<th>Payment Date</th>
        <th>stock Arrive Date</th>
        <th>&nbsp;</th>
	</tr>
	
	<?php 
$sql = "SELECT VP.ven_pay_id,VN.Name,VP.BillNo,VP.Amount,VP.PendiangAmount,VP.paymentDate,VP.date FROM  vendor_payment AS VP  \n            INNER JOIN vendors AS VN ON VN.Id=VP.ven_id\n            WHERE VN.store_key='" . $store_key . "'";
// ***** Pagination Work Start ******
$pageSql = $sql;
$pageResult = mysqli_query($con, $pageSql);
$count = $pageResult->num_rows;
if ($count > 0) {
    $paginationCount = DhsHelper::getPagination($count);
}
// ***** Pagination Work End ******
if (isset($_GET['page_id']) && !empty($_GET['page_id'])) {
    $page_id = $_GET['page_id'];
} else {
    $page_id = '0';
}
$pageLimit = PAGE_PER_NO * $page_id;
$sql .= " limit {$pageLimit}," . PAGE_PER_NO;
$result = mysqli_query($con, $sql);
$n = 0;
while ($row = mysqli_fetch_assoc($result)) {
    ?>
        <tr>
               <td><?php 
<?php 
$store_key = $_SESSION['mystoreid'];
$data = $_POST;
$medicine_name = $data['medicine_name'];
$batch_code = $data['batch_code'];
$mfg_date = $data['mfg_date'];
$expiry_date = $data['expiry_date'];
$mrp = $data['mrp'];
$action = $data['action'];
if (empty($medicine_name) || empty($batch_code) || empty($mfg_date) || empty($expiry_date) || empty($mrp)) {
    return true;
}
switch ($action) {
    case "insert_barcodes":
        $barcode = DhsHelper::getUniqueBarcode();
        $bc = new Barcode39($barcode);
        // set text size
        $bc->barcode_text_size = 5;
        // set barcode bar thickness (thick bars)
        $bc->barcode_bar_thick = 4;
        // set barcode bar thickness (thin bars)
        $bc->barcode_bar_thin = 2;
        // save barcode GIF file
        $bc->draw("admin/barcodes/{$barcode}.gif");
        $sql = "insert into `barcodes` (`barcode`, `medicine_name`, `batch_code`, `mfg_date`, `expiry_date`, `mrp`, `store_key`)\n\t\t\t\t\tvalues ({$barcode}, '{$medicine_name}', '{$batch_code}', '{$mfg_date}', '{$expiry_date}', {$mrp}, '{$store_key}')";
        if (!mysqli_query($con, $sql)) {
            die('Error' . mysql_error());
        }
        $max_id = mysql_insert_id();
        break;
Exemple #18
0
 public function inventory_details($request)
 {
     $compulsory = array('storeid', 'medicine_id');
     $data = self::processRequestData($request, $compulsory, array());
     if (!is_array($data)) {
         return array('success_code' => '404', 'result' => $data);
     }
     $store_key = $data['storeid'];
     $medicine_id = $data['medicine_id'];
     $result = mysqli_query($con, "select medicine.medicine_name, inventory.* from `medicine` inner join\n\t\t\t\t(select * from inventory where `store_key` = '{$store_key}' and status = 30 and medicine_id = {$medicine_id}) as inventory \n\t\t\t\ton (medicine.`medicine_id` = inventory.`medicine_id`)");
     $inventory = array();
     while ($row = mysqli_fetch_array($result)) {
         $barcode = $row['barcode'];
         $sql = 'SELECT ';
         $sql .= '( ';
         $sql .= "(select COALESCE(`quantity`, 0) from `inventory` where `barcode` = {$barcode} and status = " . DHS_DISTRIBUTOR_INVENTORY_STATUS_VERIFIED . ") ";
         $sql .= " - ";
         $sql .= "(select COALESCE(sum(`quantity`), 0) as quantity from `cust_inventory` where `barcode` = {$barcode}) ";
         $sql .= ' - ';
         $sql .= "(select COALESCE(sum(`quantity`), 0) as quantity from `return_stock` where `barcode` = {$barcode} and status <> 0) ";
         $sql .= ') as remaining';
         $res = mysqli_query($con, $sql);
         $rem = mysqli_fetch_array($res);
         $i['available_quantity'] = $rem['remaining'];
         $i['medicine_name'] = $row['medicine_name'];
         $i['barcode'] = $row['barcode'];
         $i['unit_cost'] = DhsHelper::formatPrice($row['unit_cost']);
         $i['subtotal'] = DhsHelper::formatPrice($row['subtotal']);
         $i['mfg_date'] = DhsHelper::formatDate($row['mfg_date']);
         $i['expiry_date'] = DhsHelper::formatDate($row['expiry_date']);
         $i['total'] = DhsHelper::formatPrice($row['total']);
         $i['medicine_id'] = $row['medicine_id'];
         $i['distributor_id'] = $row['distributor_id'];
         $i['inventory_id'] = $row['inventory_id'];
         $inventory[] = $i;
     }
     return array('success_code' => '200', 'result' => $inventory);
 }
	  
	  <div class="control-group">
	    <label class="control-label" for="available">Available Quantity</label>
	    <div class="controls">
	      <input type="text" id="available" readonly="readonly" value="<?php 
echo $a;
?>
" />
	    </div>
	  </div>
	  
	  <div class="control-group">
	    <label class="control-label" for="unit_cost">Unit Cost</label>
	    <div class="controls">
	      <input type="text" id="unit_cost" name="unit_cost" readonly="readonly" value="<?php 
echo DhsHelper::formatPrice($unit_cost);
?>
" />
	    </div>
	  </div>	  
	  
	  <div class="control-group">
	    <label class="control-label" for="quantity">Quantity to Return</label>
	    <div class="controls">
	      <select id="quantity" name="quantity">
	      		<option>Select Quantity</option>
	      		<?php 
for ($i = $a; $i > 0; $i--) {
    ?>
	      			<option><?php 
    echo $i;
    echo DhsHelper::formatPrice($con, $row['salary']);
    ?>
</td>
				<td><?php 
    echo $row['month'];
    ?>
</td>
				<td><?php 
    echo $row['year'];
    ?>
</td>
				<td><?php 
    echo $row['present_days'];
    ?>
</td>
				<td><?php 
    echo $row['absent_days'];
    ?>
</td>
				<td><?php 
    echo DhsHelper::formatPrice($con, $row['actual_payment']);
    ?>
</td>
			</tr>
			<?php 
}
?>
		</tbody>
	</table>
</fieldset>