$edate = new DateTime($_POST['end']); $data = array('year' => $_REQUEST['year'], 'start' => $sdate->format('Y-m-d'), 'end' => $edate->format('Y-m-d')); $db->where('id', $_REQUEST['id']); $msg = $db->update('financial_year', $data) ? '<p class="bg-success">Record Updated!</p>' : '<p class="bg-danger">Some Error!</p>'; } else { $msg = ''; } } if (isset($_REQUEST['id']) && !empty($_REQUEST['id'])) { $db->where("id", $_REQUEST['id']); $financial_year = $db->get('financial_year'); if (!empty($financial_year)) { $financial_year = $financial_year[0]; $fyear = $financial_year['year']; $fstart = getFDate($financial_year['start']); $fend = getFDate($financial_year['end']); } } ?> <form class="form-horizontal" method="post" action="" id="financial"> <?php echo $msg; $creating = isset($_REQUEST['id']) ? 0 : 1; ?> <input type="hidden" name="creating" value="<?php echo $creating; ?> "> <div class="form-group"> <label for="year" class="col-sm-2 control-label">Financial Year</label> <div class="col-sm-4">
$_POST['dob'] = $sdate->format('Y-m-d'); $db->where('id', $_REQUEST['id']); $msg = $db->update('sub_agents', $_POST) ? '<p class="bg-success">Record Updated!</p>' : '<p class="bg-danger">Some Error!</p>'; } else { $msg = ''; } } if (isset($_REQUEST['id']) && !empty($_REQUEST['id'])) { $db->where("id", $_REQUEST['id']); $agent = $db->get('sub_agents'); if (!empty($agent)) { $agent = $agent[0]; $name = $agent['name']; $agent_id = $agent['agent_id']; $code = $agent['code']; $dob = getFDate($agent['dob']); $person = $agent['contact_person']; $ofc = $agent['ofc_phone']; $res = $agent['res_phone']; $mobile = $agent['mobile']; $email = $agent['email']; $res_address = $agent['res_address']; $ofc_address = $agent['ofc_address']; } } ?> <form class="form-horizontal" method="post" action="" id="sub_agents"> <?php echo $msg; $creating = isset($_REQUEST['id']) ? 0 : 1; ?>
<th id="t"></th> <th>Year</th> <th>Start Range</th> <th>End Range</th> <th>Is Active</th> <th></th> </tr> </tfoot> <tbody> '; foreach ($years as $key => $data) { echo '<tr>'; echo '<td><input type="checkbox" name="ids" value="' . $data['id'] . '" /></td>'; echo '<td>' . $data['year'] . '</td>'; echo '<td>' . getFDate($data['start']) . '</td>'; echo '<td>' . getFDate($data['end']) . '</td>'; echo '<td>' . ($data['active'] ? '<span class="text-success glyphicon glyphicon-ok" aria-hidden="true"></span>' : '<span class="text-danger glyphicon glyphicon-remove" aria-hidden="true"></span>') . '</td>'; echo '<td><a title="Edit" href="new.php?id=' . $data['id'] . '"><span class="text-success glyphicon glyphicon-pencil" aria-hidden="true"></span></a> | <a title="Delete" class="confirmation" href="' . HTTP_PATH . '/financial/index.php?did=' . $data['id'] . '"><span class="text-danger glyphicon glyphicon-remove" aria-hidden="true"></span></a></td>'; echo '</tr>'; } echo '</tbody></table>'; } else { echo '<p class="text-center">No Record Found!</p>'; } ?> </div> </div> <form id="hiddenFrm" method="post"> <input type="hidden" name="action" value="1" /> <input type="hidden" name="dids" value="" /> <input type="hidden" name="aids" value="" />
$db->where('id', $_REQUEST['id']); $msg = $db->update('employee', $_POST) ? '<p class="bg-success">Record Updated!</p>' : '<p class="bg-danger">Some Error!</p>'; } else { $msg = ''; } } if (isset($_REQUEST['id']) && !empty($_REQUEST['id'])) { $db->where("id", $_REQUEST['id']); $employee = $db->get('employee'); if (!empty($employee)) { $employee = $employee[0]; $title = $employee['title']; $first_name = $employee['first_name']; $last_name = $employee['last_name']; $dob = getFDate($employee['dob']); $doj = getFDate($employee['doj']); $gender = $employee['gender']; $phone = $employee['phone']; $mobile = $employee['mobile']; $email = $employee['email']; $address = $employee['address']; $user = $employee['user']; $password = $employee['password']; $designation = $employee['designation']; } } ?> <form id="employee" class="form-horizontal" method="post" action=""> <?php echo $msg; $creating = isset($_REQUEST['id']) ? 0 : 1;