<?php



/* 

 * Author       : Jai K

 * Purpose      : The common view template for both KIOSK & CMS

 * Created On   : 2016-09-30 15:44    

 */

 $design_setting 	= get_design_setting();
 $display_pole_set 	= get_display_pole_data();
 $booking_name	 	= service_type_name();

$billing_model_page 	= $this->uri->segment(2);   //To get 'ahahaha'
$billing_model_type 	= $this->uri->segment(3);
$billing_model_type1 	= $this->uri->segment(4);

if(($billing_model_page != 'index') && ($billing_model_page == 'add')){
	$display_text = strtoupper($booking_name[$billing_model_type]);
}
else if(($billing_model_page != 'index') && ($billing_model_page != 'add')){
	$display_text = strtoupper($booking_name[$billing_model_type1]);
}else{
	$display_text = $display_pole_set['pole_msg1']['value']."\n\r".$display_pole_set['pole_msg2']['value'];
}
//DISPLAY POLE TEXT CONTENT
if($display_pole_set['pole_setting']['status'] == 1){
	exec("mode ".$display_pole_set['port_val']['value'].": BAUD=9600 PARITY=n DATA=8 STOP=1 to=off dtr=off rts=off");
	//$fp =fopen("C:/xampp/htdocs/smmt/application/views/billing/com.txt", "w+");
	$fp =fopen($display_pole_set['port_val']['value'], "w+");
	fwrite($fp,"\x0c");
	fwrite($fp, $display_text);
	//fclose($fp);
}
?>

<style>



.student_bg {

    background: #FFF;

    box-shadow: 0px 0px 20px #CCC;

    padding: 2% 4% !important;

}



.popup-dialg-title, .bked-details > div.active {

    color: <?php echo $design_setting->login_page_color; ?>;

}



.popup-dialg .wrap {

    border-top: 1px solid <?php echo $design_setting->login_page_color; ?>;

}



#booking-cal-wrap table th, #booking-cal-wrap .cell.active, #booking-cal-wrap table .cell .bked-details .hdr, .popup-dialg .ctrls .bttn.primary {

    background: <?php echo $design_setting->login_page_color; ?>;

}

.cell.evenclassactive.bked {
	background: #3f713f !important;
	color:white !important;
}


#booking-cal-wrap .cell.act {

    border: 1px solid rgba(18, 124, 115, 0.6);

}



#booking-cal-wrap .cell.day {

    border: 1px dotted <?php echo $design_setting->login_page_color; ?>;

}



#booking-cal-dialog .book-lbl {

    color: <?php echo $design_setting->login_page_color; ?>;

    border: 1px solid <?php echo $design_setting->login_page_color; ?>;

}



#frm-dwnld-dialog thead th {

    border-bottom: 2px solid <?php echo $design_setting->login_page_color; ?>;

}



#frm-dwnld-dialog tbody tr:last-child td {

    border-bottom: 1px solid <?php echo $design_setting->login_page_color; ?>;

}



[name="rs_form"] table th {

    background: <?php echo $design_setting->login_page_color; ?>;

}



[name="rs_form"] table td, [name="rs_form"] table {

    border: 1px solid <?php echo $design_setting->login_page_color; ?>;

}

</style>



<div class="dialog" id="get-dev-dialog">

    <div class="main-wrapper devotee_bg">

        <div class="dev-hdr"><h3><i class="fa fa-search"></i> Devotee Search</h3></div>

        <form>

            <div class="row">

                <div class="col-xs-12">

                    <div class="col-xs-6">

                        <div class="form-group">

                            <label style="width: 100%;">Contact No / Ref. No</label>

                            <input type="text" class="input include-contact number dev-ref-no" name="cnt_ref_no" placeholder="" value="">

                        </div>

                    </div>



                    <div class="col-xs-6 ctrls" style="text-align: right;">

                        <div class="bttn primary dev-search-btn"><i class="fa fa-search"></i> Search</div>

                        <div class="bttn clse-btn"><i class="fa fa-times"></i> Close</div>

                        <div class="bttn dev-reset-btn"><i class="fa fa-refresh"></i> Reset</div>

                    </div>    



                </div>

            </div>



            <div id="dev-plot" class="grid plot-mem">





            </div>



        </form>

    </div>    

</div>



<div class="dialog" id="dev-dialog">

    <div class="main-wrapper devotee_bg">

        <div class="dev-hdr" style=" background: #fff; border-bottom: 1px solid #f33; width: 85%; margin-left: 5%;">

            <h3 style="float: left; border-bottom: none;  box-shadow: none; text-align: left; padding-left: 15px;"><i class="fa fa-user"></i> Devotee Registration</h3>

            <div class="ctrls" style="text-align: right;">

                <div class="bttn primary save-btn"><i class="fa fa-check"></i> <span>Save</span></div>

                <div class="bttn primary dev-search-btn" style="display: none;"><i class="fa fa-search"></i> Search</div>

                <div class="bttn clse-btn"><i class="fa fa-times"></i> Cancel</div>

            </div> 

        </div>    

        <form>

            <div class="row">

                <div class="col-xs-12">

                    <div class="col-xs-6">

                        <div class="form-group">

                            <label>Contact No / Ref. No</label>

                            <input type="text" class="input dev-ref-no amount num-pad" name="ref_no" placeholder="Auto Generated" value="">

                        </div>



                        <div class="form-group">

                            <label>Name</label>

                            <input type="text" class="input req ignore" name="name" placeholder="" value="">

                        </div>



                        <div class="form-group">

                            <label>Star</label>

                            <select class="input stars req ignore" name="star">

                                <option value="">-- Select Star --</option>

                            </select>

                        </div>



                        <div class="form-group">

                            <label>Contact No</label>

                            <input type="text" class="input req ignore contact-no check-unique" name="contact_no" placeholder="" value="">

                        </div>



                        <div class="form-group">

                            <label>Address</label>

                            <textarea class="input keyboard" name="address"></textarea>

                        </div>

                    </div>



                    <div class="col-xs-6">

                        <div class="form-group">

                            <label>NRIC No</label>

                            <input type="text" class="input check-unique nric-no" name="nric_no" placeholder="" value="">

                        </div>



                        <div class="form-group">

                            <label>Name (T)</label>

                            <input type="text" class="input tamil-name input-tamil" name="tamil_name" placeholder="jkpH;bgah;" value="">

                        </div>



                        <div class="form-group">

                            <label>SMS Type</label>

                            <select class="input multi-select" name="sms_types">

                                <option value="">-- Select type --</option>

                            </select>

                        </div>



                        <div class="form-group">

                            <label>Email</label>

                            <input type="text" class="input email ignore check-unique" name="email" placeholder="" value="">

                        </div>

                    </div>

                </div>

            </div>



            <div class="row" id="dev-childs">

          

                <div class="blck">

                    <div class="col-xs-6">

                        <div class="form-group">

                            <label>Name</label>

                            <input type="text" class="input" name="mem_name[]" placeholder="" value="">

                        </div>



                        <div class="form-group">

                            <label>Star</label>

                            <select class="input stars" name="mem_star[]">

                                <option value="">-- Select Star --</option>

                            </select>

                        </div>

                    </div>    



                    <div class="col-xs-6">

                        <div class="form-group">

                            <label>Name (T)</label>

                            <input type="text" class="input input-tamil" name="mem_tamil_name[]" placeholder="" value="" >

                        </div>



                        <div class="form-group ctrls">

                            <i class="fa fa-times rm-btn" style="display: none;"></i>

                            <i class="fa fa-plus-circle add-btn"></i>

                        </div>

                    </div>    



                </div>    



            </div> 



            <div class="ctrls">

                <div class="bttn primary save-btn"><i class="fa fa-check"></i> <span>Save</span></div>

                <div class="bttn primary dev-search-btn" style="display: none;"><i class="fa fa-search"></i> Search</div>

                <div class="bttn clse-btn"><i class="fa fa-times"></i> Cancel</div>

            </div>    

        </form>

    </div>   



</div>



<div id="rec-sett-dialog" class="popup-dialg">

    <i class="fa fa-times popup-dialg-clse-btn"></i>

    <div class="popup-dialg-title">Receipt Settings</div>

    <div class="wrap">

        <div class="col-xs-12">

            

        </div>

        <div class="col-xs-12" style="margin-top: 1%;">

            <form name="rs_form" method="post"> 

                <table>

                    <thead>

                        <th width="60%">Category</th>

                        <th>Is Separate Receipt</th>

                    </thead>

                    

                    <tbody>

                        <tr><td colspan="2"><div class="no-results" style="width: 100%;">Loading ...</div></td></tr>

                    </tbody>

                </table>



                

            </form>

            

            <div id="rs-msg" style="width: 100%; text-align: center; margin: 20px 0px;"></div>

            

            

        </div>

        

        <div class="col-xs-12 ctrls" style="display: none;">

            <div class="">

                <button class="bttn popup-dialg-clse-btn">Cancel</button>

                <button class="bttn primary">Update</button>

            </div>

        </div>  

    </div>

</div>



<div id="booking-cal-dialog" class="popup-dialg">

    <i class="fa fa-times popup-dialg-clse-btn"></i>

    <div class="popup-dialg-title">

        <i class="fa loader" style="margin-right: 10px; background: <?php echo $design_setting->login_page_color; ?>; width: 20px; height: 20px;"></i> Booking Calendar

        <div class="top-ctrls" style="float: right; margin-right: 60px;">

            <select id="booking-ctrlr" data-load="yes" style="display: none;">

                

            </select>

            

            <select id="booking-cal-y">

                <?php 

                    $Y = date("Y");

                    for( $i = $Y+3; $i >= $Y-3; $i-- ) : 

                        ?>

                            <option value="<?php echo $i; ?>" <?php echo $i == $Y ? 'selected style="color: #f33;"' : ''; ?>><?php echo $i; ?></option>

                        <?php

                    endfor;

                ?>

            </select>

            

            <select id="booking-cal-m">

                <?php 

                    $months = array(

                        '1'     => 'Jan',

                        '2'     => 'Feb',

                        '3'     => 'Mar',

                        '4'     => 'Apr',

                        '5'     => 'May',

                        '6'     => 'Jun',

                        '7'     => 'Jul',

                        '8'     => 'Aug',

                        '9'     => 'Sep',

                        '10'    => 'Oct',

                        '11'    => 'Nov',

                        '12'    => 'Dec'

                    );

                    

                    $this_month = date("m");

                    foreach( $months as $k => $mon ) :

                        ?>

                            <option value="<?php echo $k; ?>" <?php echo $k == $this_month ? 'selected' : ''; ?> ><?php echo $mon; ?></option>

                        <?php

                    endforeach;

                ?>

            </select> 

        </div>

    </div>

    <div class="wrap" id="booking-cal-wrap">

        

    </div>

</div>    



<!-- Student Registration Starts -->



<div class="dialog" id="get-student-dialog">

    <div class="main-wrapper student_bg">

        <div class="student-hdr"><h3><i class="fa fa-search"></i> Student Search</h3></div>

        <form>

            <div class="row">

                <div class="col-xs-12">

                    <div class="col-xs-6">

                        <div class="form-group">

                            <label style="width: 100%;">Contact No / Ref. No</label>

                            <input type="text" class="input include-contact number student-ref-no" name="cnt_ref_no" placeholder="" value="">

                        </div>

                    </div>



                    <div class="col-xs-6 ctrls" style="text-align: right;">

                        <div class="bttn primary student-search-btn"><i class="fa fa-search"></i> Search</div>

                        <div class="bttn clse-btn"><i class="fa fa-times"></i> Close</div>

                    </div>    



                </div>

            </div>



            <div id="student-plot" class="grid">





            </div>



        </form>

    </div>    

</div>



<div class="dialog" id="student-dialog">

    <div class="main-wrapper student_bg" style="background: #FFF; box-shadow: 0px 0px 20px #CCC;padding: 2% 4% !important;">

        <div class="student-hdr" style=" background: #fff; border-bottom: 1px solid #f33; width: 85%; margin-left: 5%;">

            <h3 style="float: left; border-bottom: none;  box-shadow: none; text-align: left; padding-left: 15px;"><i class="fa fa-user"></i> Student Registration</h3>

            <div class="ctrls" style="text-align: right;">

                <div class="bttn primary save-btn"><i class="fa fa-check"></i> <span>Save</span></div>

                <div class="bttn primary student-search-btn" style="display: none;"><i class="fa fa-search"></i> Search</div>

                <div class="bttn clse-btn" style="color: #000;"><i class="fa fa-times"></i> Cancel</div>

            </div> 

        </div>    

        <form>

            <div class="row">

                <div class="col-xs-12">

                    <div class="col-xs-6">

                        <div class="form-group">

                            <label>Ref. No</label>

                            <input type="text" class="input student-ref-no amount num-pad" name="ref_no" placeholder="Auto Generated" value="">

                        </div>



                        <div class="form-group">

                            <label>Name</label>

                            <input type="text" class="input req ignore" name="name" placeholder="" value="">

                        </div>



                        <div class="form-group">

                            <label>Contact No</label>

                            <input type="text" class="input req ignore contact-no check-unique" name="contact_no" placeholder="" value="">

                        </div>



                        <div class="form-group">

                            <label>Address</label>

                            <textarea class="input keyboard" name="address"></textarea>

                        </div>

                    </div>



                    <div class="col-xs-6">

                        <div class="form-group">

                            <label>NRIC No</label>

                            <input type="text" class="input check-unique nric-no" name="nric_no" placeholder="" value="">

                        </div>



                        <div class="form-group">

                            <label>Contact Person</label>

                            <input type="text" class="input contact-person" name="contact_person" value="">

                        </div>

                        

                        <div class="form-group">

                            <label>Email</label>

                            <input type="text" class="input email req ignore check-unique" name="email" placeholder="" value="">

                        </div>

                        

                        <div class="form-group gender-dev">

                            <label>Sex</label>

                            <select name="sex" class="input select2 req ignore">

                                <option value="">-- Select --</option>

                                <option value="1">Male</option>

                                <option value="2">Female</option>

                            </select>

                        </div>

                    </div>

                </div>

            </div>



            <div class="ctrls">

                <div class="bttn primary save-btn"><i class="fa fa-check"></i> <span>Save</span></div>

                <div class="bttn primary student-search-btn" style="display: none;"><i class="fa fa-search"></i> Search</div>

                <div class="bttn clse-btn"><i class="fa fa-times"></i> Cancel</div>

            </div>    

        </form>

    </div>   



</div>