MMCT TEAM
Server IP : 192.185.129.71  /  Your IP : 18.216.160.84
Web Server : Apache
System : Linux bh-ht-3.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : svymadmin ( 4072)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home4/svymadmin/public_html/vivekaexcel.edu.in/bkp/school/application/views/backend/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home4/svymadmin/public_html/vivekaexcel.edu.in/bkp/school/application/views/backend/admin/book.php
<hr />
<div class="row">
	<div class="col-md-12">

    	<!---CONTROL TABS START-->
		<ul class="nav nav-tabs bordered">
			<li class="active">
            	<a href="#list" data-toggle="tab"><i class="entypo-menu"></i>
					<?php echo get_phrase('book_list');?>
                    	</a></li>
			<li>
            	<a href="#add" data-toggle="tab"><i class="entypo-plus-circled"></i>
					<?php echo get_phrase('add_book');?>
                    	</a></li>
            <li>
            	<a href="#bulkbook" data-toggle="tab"><i class="entypo-plus-circled"></i>
					<?php echo get_phrase('add_bulk_book');?>
                    	</a></li>  
		</ul>
    	<!---CONTROL TABS END-->


		<div class="tab-content">
        <br>
            <!----TABLE LISTING STARTS-->
            <div class="tab-pane box active" id="list">

                <table class="table table-bordered datatable" id="table_export">
                	<thead>
                		<tr>
                		    <th width="40"><div><?php echo get_phrase('sl_no.');?></div></th>
                            <th><div><?php echo get_phrase('title');?></div></th>
                            <th><div><?php echo get_phrase('author'). '/'. get_phrase('published_by');?></div></th>
                            <th><div><?php echo get_phrase('price');?></div></th>
                            <th><div><?php echo get_phrase('category_name');?></div></th>
                            <th><div><?php echo get_phrase('material_name');?></div></th>
                            <th><div><?php echo get_phrase('Number_of_Copies');?></div></th>
                            <th><div><?php echo get_phrase('accession_number');?></div></th>
                            <th><div><?php echo get_phrase('call_number');?></div></th>
                            <th><div><?php echo get_phrase('shelves_number');?></div></th>
                            <th><div><?php echo get_phrase('rack_number');?></div></th>
                            <th><div><?php echo get_phrase('publisher_name');?></div></th>
                            <th><div><?php echo get_phrase('options');?></div></th>
						</tr>
					</thead>
					<tbody>
                        <?php $count = 1;
                            
                                foreach($books as $row):?>
                        <tr>
                            <td><?php echo $count;?></td>
                            <td><?php echo $row['title'];?></td>
                            <td><?php echo $row['author'] .' / '. $row['publisher_name'];?></td>
                            <td><?php echo $row['per_unit_price'];?></td>
                            <td><?php echo $row['category_name'];?></td>
                            <td><?php echo $row['material_name'];?></td>
                            <td><?php echo $row['total_copies'];?></td>
                            <td><?php echo $row['accession_number'];?></td>
                            <td><?php echo $row['call_number'];?></td>
                            <td><?php echo $row['shelves_number'];?></td>
                            <td><?php echo $row['rack_number'];?></td>
                            <td><?php echo $row['publisher_name'];?></td>
                            <td>
                            <div class="btn-group">
                                <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
                                    Action <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu dropdown-default pull-right" role="menu">

                                    <!-- EDITING LINK -->
                                    <li>
                                        <a href="#" onclick="showAjaxModal('<?php echo site_url('modal/popup/modal_edit_book/'.$row['book_id']);?>');">
                                            <i class="entypo-pencil"></i>
                                                <?php echo get_phrase('edit');?>
                                            </a>
                                                    </li>
                                    <li class="divider"></li>
                                    <li><?php $book = $row['title']; ?>
                                        <a href="#" class="qrcode" data-id="<?php echo $row['book_id'] ?>"
                                            data-val="<?php echo 'book Name :'.$row['title'].'
                                            book ID :'.$row['book_id'].'
                                            Author Name: '.$row['author'] .'
                                            Publisher Name: '.$row['publisher_name'] .'
                                            ISBN: '.$row['isbn']; ?>"  data-acc="Acc.no :<?php echo $row['accession_number'] ;?>,call No.:<?php echo $row['call_number'];?>" target="_blank" >
                                            <i class="entypo-pencil"></i>
                                                <?php echo get_phrase('Generate_QR_code');?>
                                            </a>
                                                    </li>
                                                    
                                    <li class="divider"></li>

                                    <!-- DELETION LINK -->
                                    <li>
                                        <a href="#" onclick="confirm_modal('<?php echo site_url('admin/book/delete/'.$row['book_id']);?>');">
                                            <i class="entypo-trash"></i>
                                                <?php echo get_phrase('delete');?>
                                            </a>
                                                    </li>
                                </ul>
                            </div>
                            </td>
                        </tr>
                        <?php $count++; endforeach;?>
                    </tbody>
                </table>
			</div>
            <!----TABLE LISTING ENDS--->


			<!----CREATION FORM STARTS---->
			<div class="tab-pane box" id="add" style="padding: 5px">
                <div class="box-content">
                    <?php echo form_open(site_url('admin/book/create') , array('class' => 'form-horizontal form-groups-bordered validate','target'=>'_top','enctype'=>'multipart/form-data'));?>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('title');?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="title" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('author');?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="author" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <!--<div class="form-group">-->
                            <!--    <label class="col-sm-3 control-label"><?php echo get_phrase('description');?></label>-->
                            <!--    <div class="col-sm-5">-->
                            <!--        <input type="text" class="form-control" name="description" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>-->
                            <!--    </div>-->
                            <!--</div>-->
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('category');?></label>
                                <div class="col-sm-5">
                                    <select name="category_name" class="form-control selectboxit select2" style="width:100%;" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>">
                                    <option value=""><?php echo get_phrase('select_category'); ?></option>
                                     <?php
                                        $category = $this->db->get('category')->result_array();
                                        foreach($category as $row):
                                        ?>
                                            <option value="<?php echo $row['category_name'];?>"><?php echo $row['category_name'];?></option>
                                        <?php
                                        endforeach;
                                        ?>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('type_of_material');?></label>
                                <div class="col-sm-5">
                                    <select name="material_name" class="form-control selectboxit select2" style="width:100%;" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>">
                                    <option value=""><?php echo get_phrase('select_type_of_material'); ?></option>
                                     <?php
                                        $material = $this->db->get('material')->result_array();
                                        foreach($material as $row):
                                        ?>
                                            <option value="<?php echo $row['material_name'];?>"><?php echo $row['material_name'];?></option>
                                        <?php
                                        endforeach;
                                        ?>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('price_of_book_/_materials');?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="per_unit_price" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <!--<div class="form-group">-->
                            <!--    <label class="col-sm-3 control-label"><?php echo get_phrase('published_by');?></label>-->
                            <!--    <div class="col-sm-5">-->
                            <!--        <select name="published_by" class="form-control selectboxit select2" style="width:100%;" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>">-->
                            <!--        <option value=""><?php echo get_phrase('select_published'); ?></option>-->
                            <!--        <option value="0"><?php echo get_phrase('not_define'); ?></option>-->
                            <!--            ?php-->
                            <!--            $classes = $this->db->get('publisher')->result_array();-->
                            <!--            foreach($classes as $row):-->
                            <!--            ?>-->
                            <!--                <option value="<?php echo $row['publisher_id'];?>"><?php echo $row['publisher_name'];?></option>-->
                            <!--            ?php-->
                            <!--            endforeach;-->
                            <!--            ?>-->
                            <!--        </select>-->
                            <!--    </div>-->
                            <!--</div>-->
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('location')?></label>
                                <div class="col-sm-5">
                                    <input type="number" class="form-control" name="location" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('rack_number')?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="rack_number" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('shelf_number')?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="shelves_number" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('ISBN_No.')?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="isbn" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('number_of_pages.')?></label>
                                <div class="col-sm-5">
                                    <input type="number" class="form-control" name="number_of_page" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('number_of_copies.')?></label>
                                <div class="col-sm-5">
                                    <input type="number" class="form-control" name="number_of_copies" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>" id="number_of_copies" onkeyup = "accessionNo()"/>
                                </div>
                            </div>
                            <div class="accession_number"></div>
                            <!-- <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('accession_number')?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="accession_number" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div> -->
                            <hr>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('call_number.')?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="call_number" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('language.')?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="language" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('subject.')?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="subject" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                             <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('publisher_name');?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="publisher_name" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('publication_place');?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="publication_place" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label"><?php echo get_phrase('publication_year');?></label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="publication_year" data-validate="required" data-message-required="<?php echo get_phrase('value_required');?>"/>
                                </div>
                            </div>
                            <div class="form-group"> 
                                <label class="col-sm-3 control-label"><?php echo get_phrase('Book_Image')?></label> 
                                <div class="col-sm-5"> 
                                    <input type="file" name="file_name" class="form-control"> 
                                </div> 
                            </div>
                            <div class="form-group">
                              <div class="col-sm-offset-3 col-sm-5">
                                  <button type="submit" class="btn btn-info"><?php echo get_phrase('add_book');?></button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
			
			
			<!-----BULK BOOKS STARTS------>
			<div class="tab-pane box" id="bulkbook" style="padding: 5px">
			    <?php echo form_open(site_url('admin/bulk_book_add_using_csv/import') , array('class' => 'form-inline validate', 'style' => 'text-align:center;',  'enctype' => 'multipart/form-data'));?>
                <div class="row">
                	<div class="col-md-offset-4 col-md-4" style="padding: 15px;">
                		<button type="button" class="btn btn-primary" name="generate_csv" id="generate_csv"><?php echo get_phrase('generate_').'CSV '.get_phrase('file'); ?></button>
                	</div>
                	<div class="col-md-offset-4 col-md-4" style="padding-bottom:15px;">
                	<input type="file" name="userfile" class="form-control file2 inline btn btn-info" data-label="<i class='entypo-tag'></i> Select CSV File "
                	                   	data-validate="required" data-message-required="<?php echo get_phrase('required'); ?>"
                	               		accept="text/csv, .csv" />
                	</div>
                	<div class="col-md-offset-4 col-md-4">
                		<button type="submit" class="btn btn-success" name="import_csv" id="import_csv"><?php echo get_phrase('import_CSV'); ?></button>
                	</div>
                </div>
                <br><br>
                <?php echo form_close();?>
                <div class="row">
                	<div class="col-md-12" style="padding: 10px; background-color: #B3E5FC; color: #424242;">
                		<p style="font-weight: 700; font-size: 15px;">
                			<?php echo get_phrase('please_follow_the_instructions_for_adding_bulk_books:'); ?>
                		</p>
                			<ol>
                				<li style="padding: 5px;"><?php echo get_phrase('click_on').'"Generate CSV File".'; ?></li>
                				<li style="padding: 5px;"><?php echo get_phrase('open_the_downloaded_').'"bulk_books.csv" File. '.get_phrase('enter_books_details_as_written_in_there').'.';?></li>
                				<li style="padding: 5px;"><?php echo get_phrase('save_the_edited_').'"bulk_books.csv" File.';?></li>
                				<li style="padding: 5px;"><?php echo get_phrase('click_the_').'"Select CSV File" '.get_phrase('and_choose_the_file_you_just_edited').'.';?></li>
                				<li style="padding: 5px;"><?php echo get_phrase('import_that_file.');?></li>
                				<li style="padding: 5px;"><?php echo get_phrase('hit_').'"Import CSV File".';?></li>
                			</ol>
                			<p style="color: #FF5722; font-weight: 500;">
                				***<?php echo get_phrase('there_is_a_unique_book_type_such_as_1.story_book_2.story_book_3.biographies_4.poetry_books_5.Joke_and_riddle_books_6.mathematics_7.science_8.social_science.').' '.get_phrase('for_published_by_have_to_add_published_id_it_as_been_in_published_table').'.'; ?>
                			</p>
                	</div>
                </div>
			</div> 
		</div>
        <a href="" download="bulk_book.csv" style="display: none;" id = "bulk">Download</a>
	</div>
</div>
<form action="<?php  echo site_url('qrController/qrcodeGenerator')?>" method="post" id="postcode">
    <input type="hidden" name="qrtext" id="qrtext"/>
    <input type="hidden" name="bookid" id="bookid"/>
    <input type="hidden" name="accno" id="accno"/>
</form>    

<script>

</script>
<script type = 'text/javascript'>

    function check_validation(){
        if(class_id !== ''){
            $('#submit').removeAttr('disabled');
        }
        else{
            $("#submit").attr('disabled', 'disabled');
        }
    }
    $('#class_id').change(function(){
        class_id = $('#class_id').val();
        check_validation();
    });
</script>
<script type="text/javascript">
var class_selection = '';
jQuery(document).ready(function($) {
$('#submit_button').attr('disabled', 'disabled');

});

	$("#generate_csv").click(function(){
		
			$.ajax({
			  	url: '<?php echo site_url('admin/generate_bulk_book_csv');?>',
			  	success: function(response) {
			    	toastr.success("<?php echo get_phrase('file_generated'); ?>");
						$("#bulk").attr('href', response);
						jQuery('#bulk')[0].click();
			    	//document.location = response;
			  	}
			});
       });
       
    $(".qrcode").click(function(){
        $text=$(this).data("val");
        $id=$(this).data("id");
        $acc=$(this).data("acc");
        $("#qrtext").val($text);
        $("#bookid").val($id);
        $("#accno").val($acc)
        $("#postcode").submit();
    });  
       
       
       
</script>
<script type="text/javascript">
    function accessionNo(){
        var number_of_copies = $("#number_of_copies").val();
        var accessionNo = $(".accession_number");
        $('.accesNo').remove();
        for($i=1;$i<=number_of_copies;$i++){
            var accHTML = '<div class="accesNo"><div class="form-group"><label class="col-sm-8 control-label" style="color:#fff;"><?php echo get_phrase("accession_number")?></label><div class="col-sm-4"><input type="text" class="form-control" name="accession_number[]" data-validate="required" data-message-required="<?php echo get_phrase("value_required");?>"/></div></div></div>';  
            
            $(accessionNo).append(accHTML);
        }
    }
</script>

MMCT - 2023