public function renderButtons($data, $row)
 {
     //$getAllocatedItem = Allocate::model()->findByAttributes(array('cons_id'=>$data->id,'date_out'=>NULL));
     $getAllocatedItem = Allocate::model()->find('cons_id = :cons_id AND (date_out IS NULL OR date_out = :date_out)', array(':cons_id' => $data->id, ':date_out' => '0000-00-00'));
     $getConsStatus = Consumable::model()->find('id = :id', array(':id' => $data->id));
     $status = Status::model()->find('id = :id', array(':id' => $getConsStatus['status_id']));
     $canAllocate = $getAllocatedItem['allocate_id'] && $status['status'] != 'blocked' ? true : false;
     $this->widget('bootstrap.widgets.TbButtonGroup', array('size' => 'small', 'type' => 'inverse', 'buttons' => array(array('label' => 'Manage Group', 'url' => 'http://localhost/asset_management/index.php/usergroup/listbuilder?groupId=' . $data->id . '&groupName=' . $data->name))));
 }
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Consumablestock();
     //$allocate = new Allocate;
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation($model);
     /*Executed when you have data SUBMITTED*/
     if (isset($_POST['Consumablestock'])) {
         $model->attributes = $_POST['Consumablestock'];
         $model->commodity_id = $_GET['commodity_id'];
         if (!empty($_FILES['Consumablestock']['tmp_name']['document'])) {
             $file = CUploadedFile::getInstance($model, 'document');
             $model->documentFileName = $file->name;
             $model->documentFileType = $file->type;
             $fp = fopen($file->tempName, 'r');
             $content = fread($fp, filesize($file->tempName));
             fclose($fp);
             $model->document = $content;
         }
         if ($model->save()) {
             $stocknameRow = Stockname::model()->findByAttributes(array('commodity_id' => $model->commodity_id));
             /***********Change dynamically**/
             $consumable = Consumable::model()->findByAttributes(array('id' => $model->consumable_id));
             for ($i = 1; $i <= $model->quantity; $i++) {
                 $allocate = new Allocate();
                 $allocate->commodity_id = $model->commodity_id;
                 $allocate->cons_id = $model->consumable_id;
                 $allocate->id = $i;
                 $allocate->stock_id = $model->id;
                 $allocate->date_in = $model->date_in;
                 $allocate->stockname = $stocknameRow['prefix'] . $consumable['name'] . '/' . $allocate->id;
                 $allocate->barcode = Common::getItemBarcode(array("itemId" => $allocate->allocate_id, "barcode" => $allocate->stockname));
                 $allocate->save();
                 //print_r($allocate->getErrors());die;
             }
             //Yii::app()->request->redirect('http://localhost/asset_management/index.php/consumable/admin');
             //Yii::app()->request->redirect('Yii::app()->request->returnUrl');
             //Yii::app()->request->return;
             echo "<script type='text/javascript'>self.history.go(-2);</script>";
         }
     }
     /*Executed when you want to create*/
     $this->render('create', array('model' => $model));
 }
Exemple #3
0
?>

<?php 
$link = Link::model()->findByAttributes(array('commodity2_id' => $model->commodity_id));
echo "<table class='table table-bordered'>";
if (count($link) == 0) {
    echo "<tr style='background:#F7819F;color:white'><td>No Commodity Linked to {$model->name}</td></tr>";
} else {
    $commodity = Commodity::model()->findByAttributes(array('id' => $link['commodity1_id']));
    $commodityItems = $commodity['name']::model()->findAllByAttributes(array('link_to' => $model->id));
    if (count($commodityItems) != 0) {
        echo "<tr style='background:#F5A9A9;'><th colspan='4' style='text-align:center'>Linked " . $commodity['name'] . " Allocate History</th></tr>";
        foreach ($commodityItems as $c) {
            $cartridgeName = $c['name'];
            $fullallocates = Allocate::model()->findAll("commodity_id =:commodity_id AND cons_id=:cons_id", array('commodity_id' => 12, 'cons_id' => $c['id']));
            $allocates = Allocate::model()->findAll("commodity_id =:commodity_id AND cons_id=:cons_id AND given_by IS NOT NULL", array('commodity_id' => 12, 'cons_id' => $c['id']));
            $total = count($fullallocates);
            $allocated = count($allocates);
            echo "<tr style='background:#F6E3CE'><th colspan='4'>{$cartridgeName} <code>{$allocated} / {$total} allocated</code></th></tr>";
            if (count($allocates) != 0) {
                echo "<tr><th>Date Out</th><th>Allocated By</th><th>Allocated To</th></tr>";
                foreach ($allocates as $a) {
                    echo "<tr>";
                    $date_out = $a['date_out'];
                    echo "<td>";
                    echo Yii::app()->dateFormatter->format(Yii::app()->locale->getDateFormat("long"), CDateTimeParser::parse($date_out, 'yyyy-mm-dd'));
                    echo "</td>";
                    $given_by = User::model()->findByPk($a['given_by']);
                    $givenBy = $given_by['name'];
                    echo "<td>{$givenBy}</td>";
                    if ($a['user_group'] == 'U') {
    <?php 
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'allocate-form', 'enableAjaxValidation' => false));
?>

    
    <p class="help-block">Fields with <span class="required">*</span> are required.</p>

    <?php 
echo $form->errorSummary($model);
?>
    <?php 
$user = User::model()->findByAttributes(array('name' => CHtml::encode(Yii::app()->user->getId())));
$row = Allocate::model()->findByAttributes(array('allocate_id' => $_GET['allocateId']));
$consId = $row['cons_id'];
$available_quantity = count(Allocate::model()->findAll('cons_id = :cons_id AND (date_out IS NULL OR date_out = :date_out)', array(':cons_id' => $consId, ':date_out' => '0000-00-00')));
$t = 'Consumable';
$item = $t::model()->findByAttributes(array('id' => $consId));
?>
    
    <?php 
//echo $form->hiddenField($model,'stock_id',array('span'=>5));
?>
    <?php 
//echo $form->hiddenField($model,'id',array('span'=>5));
?>
    <?php 
//echo $form->hiddenField($model,'given_to',array('span'=>5));
?>
    <?php 
//echo $form->hiddenField($model,'user_group',array('span'=>5,'maxlength'=>2));
 public function actionGeneratePdf()
 {
     $this->layout = 'pdf';
     $model = new Allocate('search');
     if (isset($_GET['Allocate'])) {
         $model->attributes = $_GET['Allocate'];
     }
     // to execute the filters (if is the case)
     $dataProvider = $model->search();
     $dataProvider->pagination = false;
     $mPDF1 = Yii::app()->ePdf->mpdf();
     # You can easily override default constructor's params
     $mPDF1 = Yii::app()->ePdf->mpdf('', 'A5');
     # renderPartial (only 'view' of current controller)
     $mPDF1->WriteHTML($this->renderPartial('admin', array('model' => $model), true));
     # Outputs ready PDF
     $mPDF1->Output();
 }
 public function getAvailableQuantity($data, $row)
 {
     $getAllocatedItem = Allocate::model()->findAll('cons_id = :cons_id AND commodity_id =:commodity_id AND (date_out IS NULL OR date_out = :date_out)', array(':cons_id' => $data->id, ':commodity_id' => $data->commodity_id, 'date_out' => '0000-00-00'));
     if (count($getAllocatedItem) == 0) {
         echo "<i style='font-size:12px;color:red'>Out of Stock</i>";
     } else {
         echo "<b style='font-size:18px;'>" . count($getAllocatedItem) . "</b";
     }
 }
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Report();
     if (isset($_POST['Report'])) {
         $model->attributes = $_POST['Report'];
         $report_name = $model->name;
         $description = $model->description;
         //txt_field_commodity : selected column field names
         //field_commodity : selected row ids;
         //commodity : item_ids
         $attributeArray = [];
         $fromTables = [];
         $whereClauses = [];
         /*************COMMODITY*****************/
         if (isset($_POST['txt_field_commodity'])) {
             $table = 'commodity';
             $fromTables[] = '`commodity`';
             $attributes = $_POST['txt_field_commodity'];
             foreach ($attributes as $attr) {
                 $attributeArray[] = $table . '.' . $attr;
             }
             $rows = isset($_POST['commodity']) ? $_POST['commodity'] : [];
             $whereArray1 = [];
             foreach ($rows as $item) {
                 $whereArray1[] = $item;
             }
             $whereText1 = implode(',', $whereArray1);
             if ($whereText1 != 'all') {
                 $whereClauses[] = "commodity.id IN ({$whereText1})";
             }
         }
         /*******COMMODITY CATEGORY********/
         if (isset($_POST['txt_field_category'])) {
             $table = 'commodity_category';
             $fromTables[] = '`commodity_category`';
             $attributes = $_POST['txt_field_category'];
             foreach ($attributes as $attribute) {
                 $attributeArray[] = $table . '.' . $attribute;
             }
             $rows = isset($_POST['category']) ? $_POST['category'] : [];
             $whereArray2 = [];
             foreach ($rows as $item) {
                 $whereArray2[] = $item;
             }
             $whereText2 = implode(',', $whereArray2);
             $whereClauses[] = "commodity.id = commodity_category.commodity_id";
             if ($whereText2 != 'all') {
                 $whereClauses[] = "commodity_category.id IN ({$whereText2})";
             }
         }
         /*******ITEMS********/
         if (isset($_POST['txt_field_consumable'])) {
             $table = 'consumable';
             $fromTables[] = '`consumable`';
             $attributes = $_POST['txt_field_consumable'];
             foreach ($attributes as $attribute) {
                 $attributeArray[] = $table . '.' . $attribute;
             }
             $rows = isset($_POST['consumable']) ? $_POST['consumable'] : [];
             $whereArray3 = [];
             foreach ($rows as $item) {
                 $whereArray3[] = $item;
             }
             $whereText3 = implode(',', $whereArray3);
             $whereClauses[] = "commodity.id = consumable.commodity_id AND commodity_category.path = consumable.category_id";
             if ($whereText3 != 'all') {
                 $whereClauses[] = "consumable.id IN ({$whereText3})";
             }
         }
         //blocked
         if (isset($_POST['total'])) {
             $whereClauses[] = "consumable.available_on_loan = 'Yes'";
         }
         //on loan
         if (isset($_POST['new_stock'])) {
             $whereClauses[] = "consumable.available_on_loan = 'Yes'";
         }
         /*******threshold********/
         if (isset($_POST['threshold'])) {
             //print_r ($_POST['consumable']);die;
             $rows = isset($_POST['consumable']) ? $_POST['consumable'] : [];
             $itemId = implode(',', $rows);
             $connection = Yii::app()->db;
             if ($itemId == 'all') {
                 $sql = "\n\t\t\t\t\tselect *\n\t\t\t\t\tfrom consumable";
             } else {
                 //$itemId = $_POST['consumable'][0];
                 $sql = "\n\t\t\t\t\tselect *\n\t\t\t\t\tfrom consumable \n\t\t\t\t\twhere id IN ({$itemId})";
             }
             $command = $connection->createCommand($sql);
             $dataReader = $command->queryAll();
             $id = $dataReader[0]['id'];
             $allocates = Allocate::model()->findAll('commodity_id=:commodity_id AND cons_id=:cons_id', array('commodity_id' => 3, 'cons_id' => $id));
             $numUnitsLeft = count($allocates);
             //echo $numUnitsLeft;die;
             $whereClauses[] = "consumable.threshold < {$numUnitsLeft} ";
         }
         $attributeText = implode(',', $attributeArray);
         $fromTableText = implode(',', $fromTables);
         $whereClauseText = implode(' AND ', $whereClauses);
         if ($whereClauses == NULL) {
             $whereClauseText = 1;
         }
         $model->query = "SELECT {$attributeText} FROM {$fromTableText} WHERE {$whereClauseText}";
         //echo $model->query;die;
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->rid));
         }
     }
     $this->render('create', array('model' => $model));
 }
 public function renderButtons($data, $row)
 {
     //$getAllocatedItem = Allocate::model()->findByAttributes(array('cons_id'=>$data->id,'date_out'=>NULL));
     $getAllocatedItem = Allocate::model()->find('cons_id = :cons_id AND (date_out IS NULL OR date_out = :date_out)', array(':cons_id' => $data->id, ':date_out' => '0000-00-00'));
     //$getConsStatus = Consumable::model()->find('id = :id',array(':id' => $data->id));
     //$status = Status::model()->find('id = :id',array(':id' => $getConsStatus['status_id']));
     $canAllocate = $getAllocatedItem['allocate_id'] ? true : false;
     $this->widget('bootstrap.widgets.TbButtonGroup', array('size' => 'small', 'type' => 'inverse', 'buttons' => array(array('label' => 'Action', 'items' => array(array('label' => 'Transfer Item', 'url' => Yii::app()->homeUrl . '/transferCons/create', 'linkOptions' => array('submit' => array('/transferCons/create', 'itemId' => $data->id, 'commodity_id' => $data->commodity_id))), array('label' => 'Block Item', 'url' => Yii::app()->homeUrl . '/blockeditem/create', 'linkOptions' => array('submit' => array('/blockeditem/create', 'id' => 1, 'itemId' => $data->id, 'commodity_id' => $data->commodity_id))), array('label' => 'Block User Group', 'url' => Yii::app()->homeUrl . '/blockeditem/create', 'linkOptions' => array('submit' => array('/blockeditem/create', 'id' => 2, 'itemId' => $data->id, 'commodity_id' => $data->commodity_id))), array('label' => 'Add Stock Commodity', 'url' => Yii::app()->homeUrl . '/consumablestock/create', 'linkOptions' => array('submit' => array('/consumablestock/create', 'itemId' => $data->id, 'commodity_id' => $data->commodity_id))), array('label' => 'Allocate Commodity', 'url' => $canAllocate ? Yii::app()->homeUrl . '/allocate/create' : NULL, 'linkOptions' => array('submit' => array('/allocate/update/' . $getAllocatedItem['allocate_id'] . '?allocateId=' . $getAllocatedItem['allocate_id'] . '&commodity_id=' . $data->commodity_id))), array('label' => 'View Allocate History', 'url' => Yii::app()->homeUrl . '/allocate/admin', 'linkOptions' => array('submit' => array('/allocate/admin', 'itemId' => $data->id, 'commodity_id' => $data->commodity_id))))))));
     //
 }
 public function renderButtons($data)
 {
     $getAllocatedItem = Allocate::model()->find('cons_id = :cons_id AND (date_out IS NULL OR date_out = :date_out)', array(':cons_id' => $data->ID, ':date_out' => '0000-00-00'));
     $temp = Form::model()->find("FORM_ID=:FORM_ID", array(":FORM_ID" => $data->FORM_ID));
     $canAllocate = $getAllocatedItem['allocate_id'] ? true : false;
     if ($data->FORM_ID == 16) {
         $this->widget('bootstrap.widgets.TbButtonGroup', array('size' => 'small', 'type' => 'inverse', 'buttons' => array(array('label' => 'Action', 'items' => array(array('label' => 'Transfer', 'url' => Yii::app()->homeUrl . '/transferFile/create', 'linkOptions' => array('submit' => array('/transferFile/create', 'formId' => $data->FORM_ID, 'itemId' => $data->ID, 'deptName' => $data->DEPARTMENT, 'owner' => $data->OWNER))), array('label' => 'Add details', 'url' => Yii::app()->homeUrl . '/filedetails/create', 'linkOptions' => array('submit' => array('/filedetails/create', 'formId' => $data->FORM_ID, 'itemId' => $data->ID, 'deptName' => $data->DEPARTMENT))), array('label' => 'Add Stock', 'url' => Yii::app()->homeUrl . '/consumablestock/create', 'linkOptions' => array('submit' => array('/consumablestock/create', 'itemId' => $data->ID, 'commodity_id' => $data->FORM_ID))), array('label' => 'Close File', 'url' => Yii::app()->homeUrl . '/filedetails/admin', 'linkOptions' => array('submit' => array('/filedetails/admin', 'itemId' => $data->ID))), array('label' => 'Sealed', 'url' => Yii::app()->homeUrl . '/filedetails/admin', 'linkOptions' => array('submit' => array('/filedetails/admin', 'itemId' => $data->ID))), array('label' => 'Print Label', 'url' => Yii::app()->homeUrl . '/label/printall', 'linkOptions' => array('submit' => array('/label/printallform', 'formId' => $data->FORM_ID, 'itemId' => $data->ID, 'fileType' => $data->FILE_TYPE))), array('label' => 'Print Details', 'url' => Yii::app()->homeUrl . '/fm/entry/view', 'linkOptions' => array('submit' => array('/fm/entry/view' . '?form=' . $data->FORM_ID . '&entry=' . $data->ID))))))));
     } else {
         $this->widget('bootstrap.widgets.TbButtonGroup', array('size' => 'small', 'type' => 'inverse', 'buttons' => array(array('label' => 'Action', 'items' => array(array('label' => 'Block Item', 'url' => Yii::app()->homeUrl . '/blockeditem/create', 'linkOptions' => array('submit' => array('/blockeditem/create', 'id' => 1, 'itemId' => $data->ID, 'commodity_id' => $temp['TYPE_ID']))), array('label' => 'Block User Group', 'url' => Yii::app()->homeUrl . '/blockeditem/create', 'linkOptions' => array('submit' => array('/blockeditem/create', 'id' => 2, 'itemId' => $data->ID, 'commodity_id' => $temp['TYPE_ID']))), array('label' => 'Add Stock Commodity', 'url' => Yii::app()->homeUrl . '/consumablestock/create', 'linkOptions' => array('submit' => array('/consumablestock/create', 'itemId' => $data->ID, 'commodity_id' => $temp['TYPE_ID']))), array('label' => 'Allocate Commodity', 'url' => $canAllocate ? Yii::app()->homeUrl . '/allocate/create' : NULL, 'linkOptions' => array('submit' => array('/allocate/update/' . $getAllocatedItem['allocate_id'] . '?allocateId=' . $getAllocatedItem['allocate_id'] . '&commodity_id=' . $temp['TYPE_ID']))), array('label' => 'View Allocate History', 'url' => Yii::app()->homeUrl . '/allocate/admin', 'linkOptions' => array('submit' => array('/allocate/admin', 'itemId' => $data->ID, 'commodity_id' => $temp['TYPE_ID']))))))));
     }
     //
 }
<div id="chart_big"></div>
<?php 
$allocated = Allocate::model()->findAll('cons_id =:cons_id AND date_out IS NOT NULL', array(':cons_id' => 2));
$allocatedDates = [];
foreach ($allocated as $a) {
    $allocatedDates[] = strtotime($a['date_out']);
}
sort($allocatedDates);
$groupedArray = array_fill(0, count($allocatedDates), 0);
foreach ($allocatedDates as $date) {
    $groupedArray[($date - $allocatedDates[0]) / 604800]++;
}
foreach ($groupedArray as $week => $num) {
    if ($num == 0) {
        unset($groupedArray[$week]);
    }
}
//$a = count($groupedArray);
//echo "<script>alert($a)</script>";die;
$x = array();
$y = array();
foreach ($groupedArray as $a => $b) {
    $x[] = 'Week ' . ($a + 1);
    $y[] = $b;
}
$x_data = json_encode($x);
$y_data = json_encode($y);
Yii::app()->clientScript->registerScript('chart_big', "\n\$(document).ready(function(){\n        \$.jqplot.config.enablePlugins = true;\n        var s1 = {$y_data};\n        var ticks = {$x_data};\n         \n        plot1 = \$.jqplot('chart_big', [s1], {\n            // Only animate if we're not using excanvas (not in IE 7 or IE 8)..\n            animate: !\$.jqplot.use_excanvas,\n            seriesDefaults:{\n                renderer:\$.jqplot.BarRenderer,\n                pointLabels: { show: true }\n            },\n            axes: {\n                xaxis: {\n                    renderer: \$.jqplot.CategoryAxisRenderer,\n                    ticks: ticks\n                }\n            },\n            highlighter: { show: false }\n        });\n     \n        \$('#chart1').bind('jqplotDataClick',\n            function (ev, seriesIndex, pointIndex, data) {\n                \$('#info1').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);\n            }\n        );\n    });\n");
<div id="chart_big1"></div>
<?php 
$x = array();
$y = array();
$allconsumables = Consumable::model()->findAllByAttributes(array('is_deleted' => 0));
foreach ($allconsumables as $cons) {
    $x[] = $cons['name'];
    $stocks = Allocate::model()->findAllByAttributes(array('cons_id' => $cons['id'], 'date_out' => NULL));
    $y[] = count($stocks);
}
$x_data = json_encode($x);
$y_data = json_encode($y);
Yii::app()->clientScript->registerScript('chart_big1', "\n\$(document).ready(function(){\n        \$.jqplot.config.enablePlugins = true;\n        var s1 = {$y_data};\n        var ticks = {$x_data};\n         \n        plot1 = \$.jqplot('chart_big1', [s1], {\n            // Only animate if we're not using excanvas (not in IE 7 or IE 8)..\n            animate: !\$.jqplot.use_excanvas,\n            seriesDefaults:{\n                renderer:\$.jqplot.BarRenderer,\n                pointLabels: { show: true }\n            },\n            axes: {\n                xaxis: {\n                    renderer: \$.jqplot.CategoryAxisRenderer,\n                    ticks: ticks\n                }\n            },\n            highlighter: { show: false }\n        });\n     \n        \$('#chart1').bind('jqplotDataClick',\n            function (ev, seriesIndex, pointIndex, data) {\n                \$('#info1').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);\n            }\n        );\n    });\n");
Exemple #12
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/Source/AllocateDB.php';
// File with DB functions class
if (!$_SESSION) {
    session_start();
}
// Start the session
$Allocate = new Allocate();
//instantiating class with DB functions
$action = $_REQUEST["action"];
//variable from GET string - shows what action to take
header("Content-type:text/xml");
//setting the content type of the response document to XML
echo '<?xml version="1.0"?><data>';
//setting the root xml tag in the response document
switch ($action) {
    case "AddIP":
        $status = $Allocate->AddIP($_REQUEST['pkIPTableIP']);
        //
        echo '<status><![CDATA[' . $status[0] . ']]></status>';
        //output login status
        echo '<Name><![CDATA[' . $status[1] . ']]></Name>';
        //output login status
        break;
    case "AddIPs":
        $status = $Allocate->AddIPs($_REQUEST['IPBlock'], $_REQUEST['SubNet'], $_REQUEST['Gateway'], $_REQUEST['UsableFrom'], $_REQUEST['UsableTo']);
        //
        echo '<status><![CDATA[' . $status[0] . ']]></status>';
        //output login status
        echo '<Name><![CDATA[' . $status[1] . ']]></Name>';
 public function getInfo()
 {
     /* Items allocated*/
     $commodity['consumable'] = Consumable::model()->findAll();
     $commodity['monitor'] = Monitor::model()->findAll();
     $commodity['printers'] = Printers::model()->findAll();
     $commodity['devices'] = Devices::model()->findAll();
     $dup = $commodity;
     /* Items available on Loan*/
     $availableOnLoan = 0;
     $thresholdItems = 0;
     $content = '';
     foreach ($commodity as $key => $commo) {
         foreach ($commo as $item) {
             if ($item['available_on_loan'] == 1 || $item['available_on_loan'] == 'Yes') {
                 ++$availableOnLoan;
             }
             if ($key == 'consumable') {
                 $commodity = Commodity::model()->findByAttributes(array('name' => $key));
                 $allocates = Allocate::model()->findAllByAttributes(array('commodity_id' => $commodity['id'], 'cons_id' => $item['id']));
                 if (count($allocates) < $item['threshold']) {
                     ++$thresholdItems;
                 }
             }
         }
     }
     /** Allocated and unallocated **/
     $countAllocated = 0;
     $countUnAllocated = 0;
     $commodity = $dup;
     $unAllocated = Allocate::model()->findAllByAttributes(array('date_out' => NULL));
     $allocated = Allocate::model()->findAll('date_out IS NOT NULL');
     $countAllocated += count($allocated);
     $countUnAllocated += count($unAllocated);
     $content .= '<b style="color:red">' . $availableOnLoan . '</b> item available on loan<br/>';
     $content .= '<b style="color:red">' . $thresholdItems . '</b> item below threshold<br/>';
     $content .= '<b style="color:red">' . $countAllocated . '</b> item allocated<br/>';
     $content .= '<b style="color:red">' . $countUnAllocated . '</b> item unallocated<br/>';
     /* Items below threshold*/
     return $content;
 }