To Generate serial number RM32-99 MYR RM32-99 MYR Paid on delivery
Hi,
To create code for auto generate number base on quantity,
For example, I put quantity '999' into form and after I click "submit" system auto generate serial number 1~999 to database table (product_serial_number).
database table : product_serial_number
serial_id | serial_group_id | product_number | serial_number
1 | 55 | 54321 | 1
2 | 55 | 54321 | 2
3 | 55 | 54321 | 3
4 | 55 | 54321 | 4
5 | 55 | 54321 | 5
6 | 55 | 51112 | 1
7 | 55 | 51112 | 2
8 | 55 | 51112 | 3
9 | 55 | 51112 | 4
10 | 55 | 51112 | 5
11 | 55 | 51112 | 6
12 | 55 | 51112 | 7
13 | 55 | 51112 | 8
14 | 55 | 51112 | 9
15 | 55 | 51112 | 10
16 | 55 | 51112 | 11
Form [login to view URL] :
<?php
echo form_open(base_url() . '[login to view URL]', array(
'class' => 'form-horizontal',
'method' => 'post',
'id' => 'generate_serial',
'enctype' => 'multipart/form-data'
));
?>
<div class="panel-body">
<input type="hidden" name="product" value="<?php echo $product; ?>">
<input type="hidden" name="category" value="<?php echo $this->crud_model->get_type_name_by_id('product',$product,'category'); ?>">
<input type="hidden" name="sub_category" value="<?php echo $this->crud_model->get_type_name_by_id('product',$product,'sub_category'); ?>">
<div class="form-group">
<label class="col-sm-4 control-label" for="demo-hor-1"><?php echo translate('current_quantity');?></label>
<div class="col-sm-6">
<input type="number" disabled value="<?php echo $this->crud_model->get_type_name_by_id('product',$product,'current_stock'); ?>" class="form-control totals">
</div>
</div>
</div>
</form>
In Controller [login to view URL] :
} else if ($para1 == 'do_generate') {
$data['serial_group_id'] = $this->input->post('serial_group_id');
$data['product_number'] = $this->input->post('product_number');
$data['serial_number'] = $this->input->post('serial_number');
$this->db->insert('product_serial_number', $data);
recache();
}
} elseif ($para1 == 'generate') {
$this->load->view('back/admin/stock_serial_generate');
Project ID: 11427977
About the project 12 proposals
Remote project
Active 8 yrs ago
Looking to make some money? Email address Apply for similar jobs Benefits of bidding on Freelancer Set your budget and timeframe
It's free to sign up and bid on jobs
12 freelancers are bidding on average RM242 MYR for this job
Hi there,
Greetings of the day!!
I am well expert Code igniter developer.I have already done so many.
Can we Chat further Please?
Best Regards,
Ashwin
RM105 MYR in 1 day
5.0 (8 reviews) Ok , we can do that , lets start .
Thanks
indy
RM93 MYR in 1 day
5.0 (4 reviews) I'm a professional web developer and WordPress expert.
I have more than 3years experience in web development and successfully built more then 100 dynamic, CMS, Blogs, eCommerce and static websites. I am also an expert in responsive websites with bootstrap framework. I also work as an Adobe Business catalyst.
Thank you.
RM82 MYR in 1 day
5.0 (2 reviews) Hi,
I have 7 years of experience in Web Development and 6 years of experience in Android Development.
I had came across similar requirement like your several times while implementing OTP validations.
Also your code snippet seems to be using Codeigniter and I am also quite familier with Codeigniter.
I have done this a number of times to generate a random number and insert into db.
I will be able to deliver what you want without any issue.
Would like to talk to you for further discussion.
Thanks.
RM96 MYR in 1 day
0.0 (0 reviews)