You are on page 1of 16

/**

* @var MagentoStoreModelSystemStore

*/

protected $_systemStore;

/**

* @var MagentoStoreModelSystemStore

*/

protected $_produit;

/**

* @param MagentoBackendBlockTemplateContext $context

* @param MagentoFrameworkRegistry $registry

* @param MagentoFrameworkDataFormFactory $formFactory

* @param MagentoStoreModelSystemStore $systemStore

* @param BOPrixModelSourceFamily $family

* @param BOPrixModelSourceChoix $choix

* @param array $data

*/

public function __construct(

MagentoBackendBlockTemplateContext $context,

MagentoFrameworkRegistry $registry,

MagentoFrameworkDataFormFactory $formFactory,

MagentoStoreModelSystemStore $systemStore,

parent::__construct($context, $registry, $formFactory, $data);

}
/**

* Init form

* @return void

*/

protected function _construct()

parent::_construct();

$this->setId('paquet_form');

$this->setTitle(__('Packet Informations'));

/**

* Prepare form

* @return $this

*/

protected function _prepareForm()

/** @var BOPrixModelPrix $model */

$model = $this->_coreRegistry->registry('paquet_paquet');

/** @var MagentoFrameworkDataForm $form */

$form = $this->_formFactory->create(

['data' => ['id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post']]

);

$form->setHtmlIdPrefix('prix_');
$fieldset = $form->addFieldset(

'base_fieldset',

['legend' => __('General Information'), 'class' => 'fieldset-wide']

);

if ($model->getId()) {

$fieldset->addField('id_paq', 'hidden', ['name' => 'id_paq']);

// code a barre - Type Text

$fieldset->addField(

'code_a_barre',

'text',

['name' => 'code_a_barre', 'label' => __('Barcode'), 'title' => __('Barcode'), 'required' => true]

);

// designation paquet- Type Text

$fieldset->addField(

'designation_paq',

'text',

['name' => 'designation_paq', 'label' => __('Packet Designation'), 'title' => __('Packet Designation'),
'required' => true]

);

$fieldset->addField(

'id_pdt',

'text',

'name' => 'id_pdt',


'label' => __('Code Article'),

'title' => __('Code Article'),

'required' => true,

'class' => 'validate-number'

)->setAfterElementHtml('

<script>

require([

"jquery",

], function($){

$(document).ready(function () {

var input_value = document.getElementById("code_a_barre").value;

var res = input_value.substring(0,9);

document.getElementById("id_pdt").value = res ;

});

});

</script>

');

// quantity

$fieldset->addField(

'quantity_paq',

'text',

['name' => 'quantity_paq', 'label' => __('Quantity'), 'title' => __('Quantity'), 'required' => true, 'class'
=> 'validate-number']

);
// poids estimé

$fieldset->addField(

'poids_paq',

'text',

['name' => 'poids_paq', 'label' => __('Estimated Weight'), 'title' => __('Estimated Weight'), 'required'
=> true, 'class' => 'validate-number']

);

// Reservé

$fieldset->addField(

'reservé',

'text',

['name' => 'reservé', 'label' => __('Reserved'), 'title' => __('Reserved'), 'required' => true, 'class' =>
'validate-number']

);

// in stock

$fieldset->addField(

'in_stock',

'text',

['name' => 'in_stock', 'label' => __('IN stock'), 'title' => __('IN stock'), 'required' => true, 'class' =>
'validate-number']

);
$form->setValues($model->getData());

$form->setUseContainer(true);

$this->setForm($form);

return parent::_prepareForm();

(*[...omissi...]*)

function ReadPacket(var s:string): Boolean;

function _internal_LoadAAST(var b: String): Boolean;

begin

try

Result := True;

pkVCF.AAST := StrToInt(Copy(b, 1, 1));

Delete(b, 1, 1);

except

on E: Exception do begin

Result := False;

end;

end;

end;

(*[...omissi...]*)

begin

Result := False;

if (_internal_LoadAAST(s)) then begin

if (_internal_LoadVCF(s)) then begin

if (_internal_LoadFEV1(s)) then begin

if (_internal_LoadPEF(s)) then begin


if (_internal_LoadF75(s)) then begin

if (_internal_LoadF2575(s)) then begin

if (_internal_LoadFET(s)) then begin

if (_internal_LoadPEFF(s)) then begin

if (_internal_LoadFVVC(s)) then begin

if (_internal_LoadFVV1(s)) then begin

if (_internal_LoadFEV1p(s)) then begin

if (_internal_LoadFEV6(s)) then begin

if (_internal_LoadFEV6p(s)) then begin

if (_internal_RemoveFree(s)) then begin

if (_internal_LoadF25(s)) then begin

if (_internal_LoadF50(s)) then begin

if (_internal_LoadVEXT(s)) then begin

if (_internal_LoadFIVC(s)) then begin

if (_internal_LoadFIV1(s)) then begin

if (_internal_LoadFIV1p(s)) then begin

if (_internal_LoadPIF(s)) then begin

if (_internal_LoadIT(s)) then begin

if (_internal_LoadELA(s)) then begin

if (_internal_LoadFVVC2(s)) then begin

if (_internal_LoadFVV12(s)) then begin

if (_internal_LoadPEFF2(s)) then begin

if (_internal_LoadFVV6(s)) then begin

if (_internal_LoadFVV62(s)) then begin

if (_internal_LoadVCC2(s)) then begin

if (_internal_LoadFEV3(s)) then begin

if (_internal_LoadFEV3p(s)) then
begin
if (_internal_RemovePar(s)) then
begin

if (_internal_LoadMVVCalc(s))
then begin

if (_internal_LoadEVC(s))
then begin

if (_internal_LoadIVC(s))
then begin

if (_internal_LoadIC(s))
then begin

if
(_internal_LoadVCC(s)) then begin

if
(_internal_LoadERV(s)) then begin

if
(_internal_LoadTV(s)) then begin

if
(_internal_LoadMV(s)) then begin

if
(_internal_LoadRR(s)) then begin

if
(_internal_LoadTI(s)) then begin

if
(_internal_LoadTE(s)) then begin

if
(_internal_LoadVTTI(s)) then begin

if
(_internal_LoadTETI(s)) then begin

if
(_internal_LoadMVV(s)) then begin

if (_internal_RemovePar14(s)) then begin

if (_internal_LoadNUMVT(s)) then begin


if (_internal_RemoveFree2(s)) then begin

if (_internal_LoadNUMEXP(s)) then begin

if (_internal_RemoveFree3(s)) then begin

if (_internal_LoadNUMINS(s)) then begin

if (_internal_RemoveFree4(s)) then begin

if (_internal_LoadNUMEXP2(s)) then begin

if (_internal_RemoveFree5(s)) then begin

if (_internal_LoadNUMINS2(s)) then begin

if (_internal_LoadRRS1(s)) then begin

if (_internal_LoadRRS2(s)) then begin

if (_internal_LoadRRS3(s)) then begin

if (_internal_LoadRRS4(s)) then begin

if (_internal_LoadRRS5(s)) then begin

if (_internal_LoadRRS6(s)) then begin

if (_internal_LoadRRS7(s)) then begin

if (_internal_LoadRRS8(s)) then begin

if (_internal_LoadRRS9(s)) then begin


if (_internal_LoadRRS10(s)) then begin

if (_internal_LoadRRSCRC(s)) then begin

if (_internal_LoadBLenO(s)) then begin

if (_internal_LoadBLenF(s)) then begin

if (_internal_LoadBLenW(s)) then begin

if (_internal_LoadBLenW2(s)) then begin

if (_internal_LoadCLenO(s)) then begin

if (_internal_LoadCLenF(s)) then begin

if (_internal_LoadCLenW(s)) then begin

if (_internal_LoadCLenW2(s)) then begin

if (DB_to_INT(pkVCF.numexp) > 0) then begin

_internal_LoadHYPER_VCF_EX(s);

end;

if (DB_to_INT(pkVCF.numins) > 0) then begin

_internal_LoadHYPER_VCF_IN(s);

end;

if (DB_to_INT(pkVCF.numvt) > 0) then begin


_internal_LoadHYPER_VCF_VT(s);

end;

_internal_RemoveTerminatore(s);

Result := True;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;
end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;
end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;
end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

end;

uses crt;

var i,j,n,min,max,d:longint;

a:array[1..1000000] of longint;

begin

read(n); min:=high(longint);

for i:=1 to n do

begin

read(j);

if a[j] < 1 then

begin

inc(d);

a[j]:=i;

end;
if j > max then max:=j;

if j < min then min:=j;

end;

clrscr;

write(d);

writeln;

for i:=min to max do write(a[i],' ');

end.

uses crt;

var i,j,n,min,max,d:longint;

a:array[1..1000000] of longint;

begin

read(n); min:=high(longint);

for i:=1 to n do

begin

read(j);

if a[j] < 1 then

begin

inc(d);

a[j]:=i;

end;

if j > max then max:=j;

if j < min then min:=j;

end;

clrscr;

write(d);

writeln;

for i:=min to max do write(a[i],' ');

end.
uses crt;

var i,j,n,min,max,d:longint;

a:array[1..1000000] of longint;

begin

read(n); min:=high(longint);

for i:=1 to n do

begin

read(j);

if a[j] < 1 then

begin

inc(d);

a[j]:=i;

end;

if j > max then max:=j;

if j < min then min:=j;

end;

clrscr;

write(d);

writeln;

for i:=min to max do write(a[i],' ');

end.

You might also like