コード例 #1
0
function hmgt_add_category_type($model)
{
    $title = "Title here";
    $table_header_title = "Table head";
    $button_text = "Button Text";
    $label_text = "Label Text";
    if ($model == 'medicine') {
        $category_obj = new Hmgtmedicine();
        $cat_result = $category_obj->get_all_category();
        $title = __("Medicine Category", 'hospital_mgt');
        $table_header_title = __("Medicine Category", 'hospital_mgt');
        $button_text = __("Add Category", 'hospital_mgt');
        $label_text = __("Category Name", 'hospital_mgt');
    }
    if ($model == 'department') {
        $user_object = new Hmgtuser();
        $cat_result = $user_object->get_staff_department();
        $title = __("Department", 'hospital_mgt');
        $table_header_title = __("Department Name", 'hospital_mgt');
        $button_text = __("Add Department", 'hospital_mgt');
        $label_text = __("Department Name", 'hospital_mgt');
    }
    if ($model == 'bedtype') {
        $bed_type = new Hmgtbedmanage();
        $cat_result = $bed_type->get_all_bedtype();
        $title = __("Bed Category", 'hospital_mgt');
        $table_header_title = __("Bed Category Name", 'hospital_mgt');
        $button_text = __("Add Bed Category", 'hospital_mgt');
        $label_text = __("Bed Category Name", 'hospital_mgt');
    }
    if ($model == 'operation') {
        $operation_type = new Hmgt_operation();
        $cat_result = $operation_type->get_all_operationtype();
        $title = __("Operaion", 'hospital_mgt');
        $table_header_title = __("Opearion Name", 'hospital_mgt');
        $button_text = __("Add Opearion", 'hospital_mgt');
        $label_text = __("Operation Name", 'hospital_mgt');
    }
    if ($model == 'specialization') {
        $user_object = new Hmgtuser();
        $cat_result = $user_object->get_doctor_specilize();
        $title = __("Specialization", 'hospital_mgt');
        $table_header_title = __("Specialization Name", 'hospital_mgt');
        $button_text = __("Add Specialization", 'hospital_mgt');
        $label_text = __("Specialization Name", 'hospital_mgt');
    }
    if ($model == 'report_type') {
        $user_object = new Hmgt_dignosis();
        $cat_result = $user_object->get_all_report_type();
        $title = __("Dignosis Report", 'hospital_mgt');
        $table_header_title = __("Dignosis Report Name", 'hospital_mgt');
        $button_text = __("Add Dignosis Report", 'hospital_mgt');
        $label_text = __("Dignosis Report Name", 'hospital_mgt');
    }
    ?>
	<div class="modal-header"> <a href="#" class="close-btn-cat badge badge-success pull-right">X</a>
  		<h4 id="myLargeModalLabel" class="modal-title"><?php 
    echo $title;
    ?>
</h4>
	</div>
	<hr>
	<div class="panel panel-white">
  	<div class="category_listbox">
  	<div class="table-responsive">
  	<table class="table">
  		<thead>
  			<tr>
                <!--  <th>#</th> -->
                <th><?php 
    echo $table_header_title;
    ?>
</th>
                <th><?php 
    _e('Action', 'hospital_mgt');
    ?>
</th>
            </tr>
        </thead>
        <?php 
    $i = 1;
    if (!empty($cat_result)) {
        foreach ($cat_result as $retrieved_data) {
            echo '<tr id="cat-' . $retrieved_data->ID . '">';
            //echo '<td>'.$i.'</td>';
            echo '<td>' . $retrieved_data->post_title . '</td>';
            echo '<td id=' . $retrieved_data->ID . '><a class="btn-delete-cat badge badge-delete" model=' . $model . ' href="#" id=' . $retrieved_data->ID . '>X</a></td>';
            echo '</tr>';
            $i++;
        }
    }
    ?>
  	</table>
  	</div>
  	</div>
  	 <form name="medicinecat_form" action="" method="post" class="form-horizontal" id="medicinecat_form">
  	 	<div class="form-group">
			<label class="col-sm-4 control-label" for="medicine_name"><?php 
    echo $label_text;
    ?>
<span class="require-field">*</span></label>
			<div class="col-sm-4">
				<input id="medicine_name" class="form-control text-input" type="text" 
				value="" name="category_name">
			</div>
			<div class="col-sm-4">
				<input type="button" value="<?php 
    echo $button_text;
    ?>
" name="save_category" class="btn btn-success" model="<?php 
    echo $model;
    ?>
" id="btn-add-cat"/>
			</div>
		</div>
  	</form>
  	</div>
	<?php 
    die;
}
コード例 #2
0
    if ($edit) {
        $operation = $result->operation_title;
    } elseif (isset($_POST['operation'])) {
        $operation = $_POST['operation'];
    } else {
        $operation = '';
    }
    ?>
				<select name="operation_title" id="category_data" class="form-control validate[required] ">
					<option value=""><?php 
    _e('Select Operation', 'hospital_mgt');
    ?>
</option>
					<?php 
    $operation_type = new Hmgt_operation();
    $operation_array = $operation_type->get_all_operationtype();
    if ($edit) {
        $operation1 = $result->operation_title;
    } elseif (isset($_REQUEST['operation_title'])) {
        $operation1 = $_REQUEST['operation_title'];
    } else {
        $operation1 = "";
    }
    if (!empty($operation_array)) {
        foreach ($operation_array as $retrieved_data) {
            ?>
							<option value="<?php 
            echo $retrieved_data->ID;
            ?>
" <?php 
            selected($operation1, $retrieved_data->ID);