Editando: other_title_list.php
<?php $page = 'Other Head'; $page_icon = ""; @$equipment_stock = "active"; include("check.php"); include 'header.php'; if (@$_REQUEST['btn_add_material']) { $add_material = $_POST['add_material']; $current_date = date('Y-m-d'); $insert = mysql_query("INSERT INTO `dayly_used_material`(`name`, `cdate`) VALUES ('$add_material','$current_date')"); if (!$insert) { $_SESSION['msg'] = "Something is wrong..Please try again.."; $_SESSION['type'] = "Error"; } else { $_SESSION['msg'] = "Sucessefully inserted record.."; $_SESSION['type'] = "Success"; } echo '<script>window.location="other_title_list.php";</script>'; } if (@$_REQUEST['btn_material_update']) { $update_material_name = $_POST['update_material_name']; $mid = $_POST['mid']; $update = mysql_query("update dayly_used_material set name='$update_material_name' where mi_id='$mid'"); if (!$update) { $_SESSION['msg'] = "Something is wrong..Please try again.."; $_SESSION['type'] = "Error"; } else { $_SESSION['msg'] = "Sucessefully updated record.."; $_SESSION['type'] = "Success"; } echo '<script>window.location="other_title_list.php";</script>'; } ?> <!-- PAGE CONTENT WRAPPER --> <!-- PAGE CONTENT WRAPPER --> <div class="page-content-wrap"> <div class="row"> <div class="col-md-12"> <!-- START DEFAULT DATATABLE --> <div class="panel panel-colorful"> <div class="panel-body"> <form method="post" enctype="multipart/form-data" class="form-horizontal" role="form"> <div class="panel-body"> <div class="row"> <div class="col-md-12 text-left"> <a href="javascript:void(0);" class="btn btn-primary" data-toggle="modal" data-target="#myModal_work" >Add Other Head</a> </div> </div> </div> </form> <div class="col-md-6" style="padding: 10px"> <table id="material_inword_reports" class="table datatable table-hover table-striped"> <thead> <tr> <th class="text-center">#</th> <th>Name</th> <th class="text-center hidden_button">Action</th> </tr> </thead> <tbody> <?php $i = 1; $select = mysql_query("SELECT * FROM dayly_used_material ORDER BY name ASC"); while ($row = mysql_fetch_array($select)) { ?> <tr id="other_head_name<?php echo $row['mi_id']; ?>"> <td class="text-center"><?php echo $i; ?></td> <td> <?php echo $row['name']; ?></td> <td class="text-center hidden_button"> <a href="javascript:void(0);" data-toggle="modal" data-target="#modal_updatecategory<?php echo $i; ?>" class="label label-primary"> <span class="fa fa-edit"></span> </a> <a href="javascript:void(0);" onClick="delete_row('other_head_name', '<?php echo $row['mi_id']; ?>');" class="label label-danger"><span class="fa fa-trash-o"></span></a> </td> </tr> <div class="modal" id="modal_updatecategory<?php echo $i; ?>" tabindex="-1" role="dialog" aria-labelledby="defModalHead" aria-hidden="true"> <div class="modal-dialog" id="viewmachinery"> <form method="post"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <h4 class="modal-title" id="defModalHead">Update Other Head Name</h4> </div> <div class="modal-body"> <div class="row"> <div class="col-md-12" id="contact_list" > <div class="form-group"> <label class="control-label">Name </label> <input type="text" id="update_material_name" name="update_material_name" value="<?php echo $row['name']; ?>" class="form-control" /> </div> </div> </div> </div> <div class="modal-footer"> <input type="hidden" name="mid" value="<?php echo $row['mi_id']; ?>" /> <input type="submit" class="btn btn-primary" value="Update" name="btn_material_update"/> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </form> </div> </div> <?php $i++; } ?> </tbody> </table> </div> </div> </div> </div> </div> <div class="modal" id="myModal_work" tabindex="-1" role="dialog" aria-labelledby="defModalHead" aria-hidden="true"> <div class="modal-dialog" id="viewmachinery" style="width: 300px"> <form method="post"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <h4 class="modal-title" id="defModalHead">Add Other Head</h4> </div> <div class="modal-body"> <div class="row"> <div class="col-md-12" id="contact_list" > <div class="form-group"> <label class="control-label">Name </label> <input type="text" id="add_category" name="add_material" required="" class="form-control" /> </div> </div> </div> </div> <div class="modal-footer"> <input type="submit" name="btn_add_material" value="Add" class="btn btn-primary"/> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </form> </div> </div> <?php include("footer.php"); ?>
Cancelar
Kerym Chaeceran