Created
March 19, 2017 14:56
-
-
Save ShanakaWickramaarachchi/cdcc3b990c17e41dcc7d6600a615c51a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tr><td style="padding: 0px; line-height: 17px;"><center>00:00 - 01:00 </center></td> | |
{{--1--}} | |
<td> <input type="text" class="form-control textfeilds" id="cost" name="cost" required></td> | |
<td style="display: none;"><input type="text" class="form-control textfeilds" id="1" name="hour_belt_id" value="1"></td> | |
<td style="display: none;"><input type="text" class="form-control textfeilds" id="1" name="com_type_id" value="1"></td> | |
<td style="display: none;"><input type="text" class="form-control textfeilds" id="1" name="com_sub_type_id" value="1"></td> | |
<td style="display: none;"><input type="text" class="form-control textfeilds" id="1" name="seconds_id" value="1"></td> | |
<td> <input type="text" class="form-control textfeilds" id="cost" name="cost" required></td> | |
<td style="display: none;"><input type="text" class="form-control textfeilds" id="2" name="hour_belt_id" value="1"></td> | |
<td style="display: none;"><input type="text" class="form-control textfeilds" id="2" name="com_type_id" value="1"></td> | |
<td style="display: none;"><input type="text" class="form-control textfeilds" id="2" name="com_sub_type_id" value="1"></td> | |
<td style="display: none;"><input type="text" class="form-control textfeilds" id="2" name="seconds_id" value="2"></td> | |
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function insertratecard(Request $req){ | |
$cost=$req->input('cost'); | |
$hour_belt_id=$req->input('hour_belt_id'); | |
$com_type_id=$req->input('com_type_id'); | |
$com_sub_type_id=$req->input('com_sub_type_id'); | |
$seconds_id=$req->input('seconds_id'); | |
$rate_card_master_ids = DB::select( | |
"SELECT MAX(rate_card_master_id) as incremaentid FROM rate_card;"); | |
foreach($rate_card_master_ids as $rate_card_master_id){ | |
$incrementid=$rate_card_master_id->incremaentid; | |
} | |
$incrementid=$incrementid+1; | |
$data=array('cost'=>$cost,'hour_belt_id'=>$hour_belt_id,'rate_card_master_id'=>$incrementid,'com_type_id'=>$com_type_id,'com_sub_type_id'=>$com_sub_type_id,'seconds_id'=>$seconds_id); | |
DB::table('rate_card')->insert($data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment