How change the format of full calendar - php

I want to change the format of date which is showing on text box after choosing dates. I tried format table and other coding found in Google but it doesn't work.
<form action="report_emp.php" method="post">
<input name="id" type="hidden" value="<?php echo $_GET['id'];?>">
<table class="table table-striped table-bordered bootstrap-datatable datatable">
<tbody>
<tr>
<td>From</td>
<td>
<div class="control-group">
<label class="control-label" for="date01">Date</label>
<div class="controls">
<input type="text" class="input-xlarge datepicker" id="date01" name="datefrom" value="mm/dd/yy">
</div>
</div>
</td>
<td>To</td>
<td>
<div class="control-group">
<label class="control-label" for="date02">Date</label>
<div class="controls">
<input type="text" class="input-xlarge datepicker" id="date02" name="dateto" value="mm/dd/yy">
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Find Client Details</button>
<button class="btn">Cancel</button>
</div>
</form>

If you are talking about jquery datepicker, then you can use:
$( "#datepicker" ).datepicker( "option", "dateFormat", "mm/dd/yy" );
Check here.

Related

A Database Error Occurred In codeigniter Error Number: 1048

i have problem at the time of input data to the database
this is error message
A Database Error Occurred
Error Number: 1048
Column 'username_member' cannot be null
INSERT INTO member (id_member, username_member,
password_member, nama_member, jk_member, hp_member,
alamat_member, email_member) VALUES (NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL)
Filename: C:/AppServ/www/PROJEK/system/database/DB_driver.php
Line Number: 691
my controller
function tambah()
{
$data = array(
'aksi' => site_url('member/tambah_aksi'),
'id_member' => set_value('id_member'),
'username_member' => set_value('username_member'),
'password_member' => set_value('password_member'),
'nama_member' => set_value('nama_member'),
'jk_member' => set_value('jk_member'),
'hp_member' => set_value('hp_member'),
'alamat_member' => set_value('alamat_member'),
'email_member' => set_value('email_member'),
'button' => 'DAFTAR'
);
$this->load->view('Utama/member_form', $data);
}
function tambah_aksi()
{
$data = array(
'id_member' => $this->input->post('id_member'),
'username_member' => $this->input->post('username_member'),
'password_member' => $this->input->post('password_member'),
'nama_member' => $this->input->post('nama_member'),
'jk_member' => $this->input->post('jk_member'),
'hp_member' => $this->input->post('hp_member'),
'alamat_member' => $this->input->post('alamat_member'),
'email_member' => $this->input->post('email_member')
);
$this->member_model->tambah_data($data);
redirect('Login_member');
}
View
<h3> FORM <i class="icon-arrow-left"></i> LANJUT BERBELANJA </h3> <hr class="soft"/> <table class="table table-bordered">
<tr><th> FORM DAFTAR MEMBER </th></tr>
<form action="<?php echo $aksi; ?>" method="get" class="form-horizontal" enctype="multipart/form-data">
<tr>
<td>
<div class="control-group">
<label class="control-label" for="inputUsername">Username</label>
<div class="controls">
</td>
<td>
<input type="text" name="username_member" class="form-control" placeholder="Inputkan Username" value="">
</div>
</div>
</td>
<tr>
<td>
<div class="control-group">
<label class="control-label" for="inputPassword1">Password</label>
<div class="controls">
</td>
<td>
<input type="password" name="password_member" placeholder="Password" value="">
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="control-group">
<label class="control-label" for="inputPassword1">Nama Member</label>
<div class="controls">
</td>
<td>
<input type="text" name="nama_member" placeholder="ex : Eden Hazard" value="">
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="control-group">
<label class="control-label" for="inputPassword1">Jenis Kelamin</label>
<div class="controls">
</td>
<td>
<input type="radio" name="jk_member" value="Laki">Pria
<br>
<input type="radio" name="jk_member" value="Wanita">Wanita
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="control-group">
<label class="control-label" for="inputPassword1">No Hp</label>
<div class="controls">
</td>
<td>
<input type="text" name="hp_member" placeholder="ex : 08127516331" value="">
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="control-group">
<label class="control-label" for="inputPassword1">Alamat Lengkap</label>
<div class="controls">
</td>
<td>
<input type="text" name="alamat_member" placeholder="ex : perum pandau blok c.19 no.16, Pekanbaru, Riau" value="">
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="control-group">
<label class="control-label" for="inputPassword1">Email</label>
<div class="controls">
</td>
<td>
<input type="text" name="email_member" placeholder="ex : randy#yahoo.com" value="">
</div>
</div>
</td>
</tr>
<tr>
<td>
<input type="hidden" name="id_member" value="<?php echo $id_member; ?>">
<button class="btn btn-primary" type="submit"><?php echo $button; ?></button>
</td>
</tr>
</form>
You want to change your forms method from get to post as you are processing POST data.
So your line
<form action="<?php echo $aksi; ?>" method="get" class="form-horizontal" enctype="multipart/form-data">
Change the get to post for your method.
<form action="<?php echo $aksi; ?>" method="post" class="form-horizontal" enctype="multipart/form-data">
See how that flies.

how do i generate report when i select the starting and ending date using php

I am working on employee attendance system and the attendance is working perfectly but the issue now is how do I generate the attendance report when I select the employee name and the starting and ending date? am done with the html code all i need now is the php code that would work with my present html code.please i would appreciate your help thanks in advance.
below is the html code.
<form class="form-horizontal" action="" method="post">
<div class="form-group">
<label class="col-sm-3 control-label"> Select Employee Name</label>
<div class="col-sm-4">
<select type="text" name="name" class="form-control" placeholder="Employee Full Name" required>
<option value="">Select Employee Name</option>
<?php
$get = mysql_query("SELECT employee_name FROM employee");
while($row = mysql_fetch_assoc($get)) {
?>
<option value = "<?php echo($row['employee_name'])?>" >
<?php echo($row['employee_name']) ?>
</option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"> Start Date</label>
<div class="col-sm-4">
<input type="text" name="Start_date" class="input-group date form-control" date="" data-date-format="yyyy-mm-dd" placeholder="0000-00-00" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">End Date</label>
<div class="col-sm-4">
<input type="text" name="end_date" class="input-group date form-control" date="" data-date-format="yyyy-mm-dd" placeholder="0000-00-00" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"> </label>
<div class="col-sm-6">
<input type="submit" name="add" class="btn btn-sm btn-primary" value="Generate Report">
<div class="table-responsive">
<table class="table table-striped table-hover">
<tr>
<th>No</th>
<th> Employee Id</th>
<th>Employee Name</th>
<th>Date In</th>
<th>Time In</th>
<th>Late</th>
<th>Tools</th>
</tr>
</table>
</div>
</div>
</form>
Change your query accordingly, like:
"SELECT employee_name FROM employee WHERE '".$date."' BETWEEN (start_date, end_date);"
Or you can also use >= and <= to compare the dates
Just add a print button and give an ID to it. Include JS code:
function printData()
{
var divToPrint=document.getElementById("printTable");
newWin= window.open("");
newWin.document.write(divToPrint.outerHTML);
newWin.print();
newWin.close();
}
$('button').on('click',function(){
printData();
})
Fiddle: http://jsfiddle.net/dimshik/9DbEP/4/

Laravel data not going appropriately into the database

What i need is if i get first element id of MOB/TR/1743 then press the mark button data which relevant to that id must go the database.
This is what should in the database.
But this is what i'm getting into the database. That means getting another column data into database.
Here is the view of that.
<div class="row">
<section id="feature" class="section-padding wow fadeIn delay-05s">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-6 col-xs-12">
<div class="wrap-item text-center">
<div class="jumbotron">
<div class="item-img">
<img src="images/ser02.png">
</div>
<div class="form-group">
<form action="search" method="post" class="form-inline">
<select name="institute" id="institute">
<option selected="selected" value="id">Trainee Id</option>
<option value="full_name">Trainee Name</option>
<label for="Search">Name</label>
</select>
<input type="text" name="search" /><br>
<input type="hidden" value="{{ csrf_token() }}" name="_token" />
<input type="submit" name="submit" value="Search">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<div class="col-md-12 col-sm-6 col-xs-12">
<div class="panel panel-default">
<div class="panel-body">
<table class="table table-striped">
<thead>
<th>Trainee ID</th>
<th>Name with Initials</th>
<th>Time</th>
<th>Mark Here!</th>
</thead>
<tbody>
<form action="{{route('TraineeAttendance.store')}}" method="post" >
{{ csrf_field() }}
#foreach($items as $item)
<tr>
<td>
<div class="form-group">
<input type="text" name="trainee_id" class="form-control" value="{{ $item->trainee_id }}">
</div>
</td>
<td>
<div class="form-group">
<input type="text" name="name" class="form-control" value="{{ $item->name_with_initials }}">
</div>
</td>
<td>
<label><input type="checkbox" name="time" id="time" value="time"> Time</label>
</td>
<td>
<input type="submit" class="btn btn-info">
</td>
</tr>
#endforeach
</form>
</tbody>
</table>
</div>
</div>
</div>
Why i`m getting wrong data?
try this hope it helps
#foreach($items as $item)
<form action="{{route('TraineeAttendance.store')}}" method="post" >
{{ csrf_field() }}
<tr>
<td>
<div class="form-group">
<input type="text" name="trainee_id" class="form-control" value="{{ $item->trainee_id }}">
</div>
</td>
<td>
<div class="form-group">
<input type="text" name="name" class="form-control" value="{{ $item->name_with_initials }}">
</div>
</td>
<td>
<label><input type="checkbox" name="time" id="time" value="time"> Time</label>
</td>
<td>
<input type="submit" class="btn btn-info">
</td>
</tr>
</form>
#endforeach

Display data form type file before submitting

I want to display my data form in confirmation form before submitting. My form and my confirmation form is in the same page, it's only devided by #tab. Now I want to display the data before submitting. I using data-display to display data in my confirmation form, and its work, but I don't know how to display data where type = file.
my blank data picture
My code:
<h4 class="form-section">Unggah Dokumen</h4>
<div class="form-group">
<label class="control-label col-md-3">Surat Permohonan:</label>
<div class="col-md-4">
<p class="form-control-static" data-display="file"> </p>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3">Dokumen Pendukung:</label>
<div class="col-md-4">
<p class="form-control-static" data-display="dokumen_pendukung[]"> </p>
</div>
</div>
my php code:
<h3 class="block">Unggah Dokumen</h3>
<div class="form-group">
<table class="table table-striped table-bordered table-hover">
<tr>
<label style="text-align:left;" class="control-label col-md-3">Surat Permohonan<span class="required"> * </span></label>
<div class="col-md-4">
<?php if(isset($_GET['id'])){ ?>
<td class="1">
<?php echo #$applicationLetterrr;?><i style="padding-left:12px;" class="fa fa-pencil"></i>
<input type="hidden" name="file2" value="<?= #$applicationLetterrr?>">
</td>
<td class="2">
<input id="fileid" type="file" accept="image/*, .pdf" name="file" style="width:100%" required title="Masukan minimal satu file">
<div class="class-progressbar" id="myProgress">
<div id="myBar">10%</div>
</div>
</td>
<?php }else{ ?>
<td>
<input class="input-group" id="fileid" type="file" accept="image/*, .pdf" name="file" style="width:100%" required title="Masukan minimal satu file">
<div class="class-progressbar" id="myProgress">
<div id="myBar">10%</div>
</div>
</td>
<?php } ?>
</div>
</tr>
</table>
</div>

Dynamic form field with jquery not post values to php

i had form that is add some fields via jquery when i click " add new " button it will update a dom , with input fields . Input fields are using a array as a name , when i click submit button , values did not post to php, only static form values are posted but not dynamically generated input values .
My fiddle is http://jsfiddle.net/4L9Rc/
It will demonstrate clearly how is my form working .
HTML
<div class="row">
<div class="col-md-12">
<form method="POST" action="http://fabtech.com/invoices/create" accept-charset="UTF-8" role="form" class="form-horizontal re-form form-inv"><input name="_token" type="hidden" value="aLngVzB1UIlY6cEedbAh55tirXGGkYJl78BL0CRN"> <legend>Invoice Details</legend>
<div class="col-md-6">
<div class="form-group">
<label class="col-md-4 control-label">Invoice No</label>
<div class="col-md-7">
<input type="text" placeholder="Enter invoice no" class="form-control" name="inv_no" value=""">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Invoice date</label>
<div class="col-md-7">
<input type="text" placeholder="Enter text" class="form-control date-pic" name="inv_date" value="">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Customer</label>
<div class="col-md-7">
<select class="form-control" name="inv_customer">
<option value="">- Select Customer -</option>
<option value="suresh">suresh</option>
<option value="ABC210">ABC210</option>
<option value="QWERTy123DF">QWERTy123DF</option>
<option value="CUS002">CUS002</option>
<option value="CUS0023">CUS0023</option>
<option value="CUS003">CUS003</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">PO No</label>
<div class="col-md-7">
<input type="text" placeholder="Enter text" class="form-control" name="po_no" value="">
</div> </div>
<div class="form-group">
<label class="col-md-4 control-label">PO date</label>
<div class="col-md-7">
<input type="text" placeholder="DD/MM/YYY" class="form-control date-pic" name="po_date" value="">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-md-4 control-label">Vendor code</label>
<div class="col-md-7">
<input type="text" placeholder="Enter Vendor Code" class="form-control" name="vendor_code" value="">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">75% abatement value</label>
<div class="col-md-1">
<input type="checkbox" class="form-control sf" name="sf">
</div>
<div class="col-md-6 sfbox" style="display:none">
<input type="text" class="form-control sfboxval" readonly="">
</div> </div>
<div class="form-group">
<label class="col-md-4 control-label">25% Taxable Value</label>
<div class="col-md-1">
<input type="checkbox" class="form-control tf" name="tf">
</div>
<div class="col-md-6 tfbox" style="display:none" >
<input type="text" class="form-control tfboxval" readonly="">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Tax in %</label>
<div class="col-md-7">
<input type="text" placeholder="" class="form-control tax" name="tax" value="">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Grand Total</label>
<div class="col-md-7">
<input type="text" placeholder="" class="form-control grandtotal" readonly="" name="grand_total">
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<legend>Particulars
<a class="btn btn-xs btn-success" id="apm"><i class="icon-plus"></i> Add new</a>
</legend>
<table id="apmr" width="69%" class="table table-striped table-bordered table-hover invoice">
<thead>
<tr>
<th width="3%">SL No</th>
<th width="25%">Description</th>
<th width="8%">Unit</th>
<th width="8%">Qty</th>
<th width="10%">Unit rate</th>
<th width="9%"> Amount</th>
</tr>
</thead>
<tbody class="roo">
<tr>
<td valign="center"> 1 </td>
<td class="tr_nt"><input type="text" name="parti[1][desc]" class="part"></td>
<td class="tr_nt"><input type="text" name="parti[1][unit]" class="part"></td>
<td class="tr_qty into"><input type="text" name="parti[1][qty]" class="part qty"></td>
<td class="tr_urate into"><input type="text" name="parti[1][urate]" class="part ur"></td>
<td class="tr_amt"><input type="text" name="parti[1][amount]" readonly="" class="part tot"></td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="4">
</td>
<td colspan="2">
Particular's Total: Rs <span class="parttotal"></span>
</td>
</tr>
</tfoot>
</table>
<p style="text-align: center;padding-top: 5px;"><input name="submit" class="btn-lg btn-primary" type="submit" value="View Invoice"></p>
</form> </div>
</div>
</div>
</div>
Javascript
//invoice particulars
var val;
$("#apm").click(function(event) {
//event.preventDefault();
//var preData = $("#apmr tr:last").html();
//console.log(preData);
//
//$("#apmr tr:last").after('<tr>' + preData + '</tr>');
var lasttd = $('.roo tr:last td:first').text();
val = parseInt(lasttd) + 1;
$(".roo tr:last").after(' <tr> <td valign="center"> ' + val + ' </td> <td class="tr_nt"><input type="text" name="parti[' + val + '][desc]" class="part"></td> <td class="tr_nt"><input type="text" name="parti[' + val + '][unit]" class="part"></td> <td class="tr_qty into"><input type="text" name="parti[' + val + '][qty]" class="part qty"></td> <td class="tr_urate into"><input type="text" name="parti[' + val + '][urate]" class="part ur"></td> <td class="tr_amt"><input type="text" name="parti[' + val + '][amount]" readonly class="part tot" ></td></tr>');
// val = val + 1;
return false;
})
var gt;
$("table.invoice").on("change", '.qty, .ur', function(event) {
calculateRow($(this).closest("tr"));
calculateTotal();
});
function calculateRow(row) {
var price = +row.find('.qty').val();
var qty = +row.find('.ur').val();
row.find('.tot').val((price * qty).toFixed(2));
}
function calculateTotal() {
var Total = 0;
$("table.invoice").find('.tot').each(function() {
Total += +$(this).val();
});
$(".parttotal").text(Total.toFixed(2));
calgrand();
}
$(".re-form").on('change', '.tax,.tf,.sf', function(event) {
calgrand();
})
function calgrand() {
var taxVal = $('.tax').val();
var parVal = $(".parttotal").text();
var result = parVal - taxVal * parVal / 100;
$('.grandtotal').val(result.toFixed(2));
if ($('.tf').is(':checked')) {
var resulttf = parVal - 25 * parVal / 100;
$('.tfboxval').val(resulttf.toFixed(2));
var result = result - resulttf;
$('.grandtotal').val(result.toFixed(2));
}
if ($('.sf').is(':checked')) {
//alert('entered');
var resultsf = parVal - 75 * parVal / 100;
$('.sfboxval').val(resultsf.toFixed(2));
var result = result - resultsf;
$('.grandtotal').val(result.toFixed(2));
}
}
$('.tf').click(function() {
$(".tfbox").toggle(this.checked);
});
$('.sf').click(function() {
$(".sfbox").toggle(this.checked);
});
in php i had
print_r($_POST['parti']);
its give out put
Array
(
[1] => Array
(
[desc] =>
[unit] =>
[qty] =>
[urate] =>
[amount] =>
)
)
but i need
Array
(
[1] => Array
(
[desc] =>
[unit] =>
[qty] =>
[urate] =>
[amount] =>
)
[2] => Array
(
[desc] =>
[unit] =>
[qty] =>
[urate] =>
[amount] =>
)
[3] => Array
(
[desc] =>
[unit] =>
[qty] =>
[urate] =>
[amount] =>
)
....
)
javascript
Please indent your code next time. Too many changes to make in your form. At the line where you have "Enter invoice no." you have left an open quote at value=""" which is a big mistake.
Overwrite your HTML code with this:
<div class="matter">
<div class="container">
<form method="POST" action="http://fabtech.com/invoices/create" accept-charset="UTF-8" role="form" class="form-horizontal re-form form-inv">
<input name="_token" type="hidden" value="aLngVzB1UIlY6cEedbAh55tirXGGkYJl78BL0CRN">
<div class="row">
<div class="col-md-12">
<legend>Invoice Details</legend>
<div class="col-md-6">
<div class="form-group">
<label class="col-md-4 control-label">Invoice No</label>
<div class="col-md-7">
<input type="text" placeholder="Enter invoice no" class="form-control" name="inv_no" value="">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Invoice date</label>
<div class="col-md-7">
<input type="text" placeholder="Enter text" class="form-control date-pic" name="inv_date" value="">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Customer</label>
<div class="col-md-7">
<select class="form-control" name="inv_customer">
<option value="">- Select Customer -</option>
<option value="suresh">suresh</option>
<option value="ABC210">ABC210</option>
<option value="QWERTy123DF">QWERTy123DF</option>
<option value="CUS002">CUS002</option>
<option value="CUS0023">CUS0023</option>
<option value="CUS003">CUS003</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">PO No</label>
<div class="col-md-7">
<input type="text" placeholder="Enter text" class="form-control" name="po_no" value="">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">PO date</label>
<div class="col-md-7">
<input type="text" placeholder="DD/MM/YYY" class="form-control date-pic" name="po_date" value="">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-md-4 control-label">Vendor code</label>
<div class="col-md-7">
<input type="text" placeholder="Enter Vendor Code" class="form-control" name="vendor_code" value="">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">75% abatement value</label>
<div class="col-md-1">
<input type="checkbox" class="form-control sf" name="sf">
</div>
<div class="col-md-6 sfbox" style="display:none">
<input type="text" class="form-control sfboxval" readonly="">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">25% Taxable Value</label>
<div class="col-md-1">
<input type="checkbox" class="form-control tf" name="tf">
</div>
<div class="col-md-6 tfbox" style="display:none">
<input type="text" class="form-control tfboxval" readonly="">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Tax in %</label>
<div class="col-md-7">
<input type="text" placeholder="" class="form-control tax" name="tax" value="">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Grand Total</label>
<div class="col-md-7">
<input type="text" placeholder="" class="form-control grandtotal" readonly="" name="grand_total">
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<legend>Particulars <a class="btn btn-xs btn-success" id="apm"><i class="icon-plus"></i> Add new</a>
</legend>
<table id="apmr" width="69%" class="table table-striped table-bordered table-hover invoice">
<thead>
<tr>
<th width="3%">
SL No
</th>
<th width="25%">
Description
</th>
<th width="8%">
Unit
</th>
<th width="8%">
Qty
</th>
<th width="10%">
Unit rate
</th>
<th width="9%">
Amount
</th>
</tr>
</thead>
<tbody class="roo">
<tr>
<td valign="center">
1
</td>
<td class="tr_nt">
<input type="text" name="parti[1][desc]" class="part">
</td>
<td class="tr_nt">
<input type="text" name="parti[1][unit]" class="part">
</td>
<td class="tr_qty into">
<input type="text" name="parti[1][qty]" class="part qty">
</td>
<td class="tr_urate into">
<input type="text" name="parti[1][urate]" class="part ur">
</td>
<td class="tr_amt">
<input type="text" name="parti[1][amount]" readonly="" class="part tot">
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="4">
</td>
<td colspan="2">
Particular's Total: Rs <span class="parttotal"></span>
</td>
</tr>
</tfoot>
</table>
<p style="text-align: center;padding-top: 5px;">
<input name="submit" class="btn-lg btn-primary" type="submit" value="View Invoice">
</p>
</div>
</div>
</form>
</div>
</div>
Your mistake was that your <form> tag was closed in the wrong place. Remember to always place tags in such a way that always the inner tags close first.

Categories