Exemplo n.º 1
0
 public static function getItemBarcode($valueArray)
 {
     $barcodeDetailsRow = Barcodedetail::model()->find('organisation_id=:organisation_id', array('organisation_id' => Yii::app()->user->getState("org_id")));
     if (isset($valueArray['commodity_id'])) {
         $stockname = Stockname::model()->findByAttributes(array('commodity_id' => $valueArray['commodity_id']));
         $prefix = $stockname['prefix'];
     } else {
         $prefix = '';
     }
     $optionsArray = array('elementId' => $valueArray['itemId'] . "_bcode", 'value' => $prefix . '/' . $valueArray['barcode'], 'type' => $barcodeDetailsRow['type'], 'settings' => array('output' => $barcodeDetailsRow['format'], 'barWidth' => $barcodeDetailsRow['bar_width'], 'barHeight' => $barcodeDetailsRow['bar_height']));
     self::getBarcode($optionsArray);
     return CHtml::tag('div', array('id' => $valueArray['itemId'] . "_bcode"));
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Barcodedetail the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Barcodedetail::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }