<?php

/* 
 * Author       : Jai K
 * Purpose      : The main view page for Kiosk Admin Settings
 * Created On   : 2016-12-21 18:52
 */

?>
<link href="<?php echo base_url(); ?>assets/css/bootstrap-toggle.min.css" rel="stylesheet">
<script src="<?php echo base_url(); ?>assets/js/bootstrap-toggle.min.js"></script>
<style>
    .inp-lang-swap-icn{
        position: absolute;
        min-width: 40px;
        min-height: 25px;
        background: #f33;
        color: #fff;
        margin-top: -25px;
        font-weight: bold;
        text-align: center;
        line-height: 25px;
        cursor: pointer;
        /*z-index: 99;*/
        
        display: none;
    }
    
    .note {
        padding: 15px 0px; 
    }
    
    .note ul li {
        font-size: 12px; color: #999;
    }
    
    .blck-content table {
        width: 100%;
        
    }
    
    .blck-content table th, .blck-content table td {
        padding: 5px;
        color: #999;
        border: 2px solid #fff;
    }
    
    .blck-content table th {
        background: #607d8b;
        color: #fff;
        text-align: center;
    }
    
    .blck-content table td {
        
    }
    
    .blck-content table td.ctrls {
        text-align: center;
        
    }
    
    .ctrls .fa {
        cursor: pointer;
        padding: 10px;
        border-radius: 20px;
        color: #fff;
        width: 35px;
        font-weight: bold;
        box-shadow: 2px 2px 6px #666;
    }
    
    .ctrls .add-btn {
        background: #607d8b;
    }
    
    .ctrls .rm-btn {
        background: #f33;
    }
    
    .blck-content table input {
        width: 100%;
        border: none;
        padding: 5px 15px;
    }
    
    .thumb-img {
        width: 60px;
        height: 35px;
        position: absolute;
        margin-left: -80px;
    }
    
    .tiny-blck {
        padding-bottom: 40px;
        border-bottom: 1px dotted;
        margin: 20px;
    }
    
    .tiny-blck .sub-title {
        padding: 5px 15px;
        width: 140px;
        color: #fff;
        box-shadow: 2px 2px 4px #666;
        margin: 0px 15px;
    }
	.toggle.btn {
	min-width: 135px;
/*	margin-left: 20px;*/
	border-radius: 50px;
}
.toggle-on.btn, .toggle-off.btn{
   padding-top: 7px;
   font-size: 16px;
   text-transform: uppercase;
}

.toggle-handle {
    position: relative;
    margin: 0 auto;
    padding-top: 0;
    padding-bottom: 0;
    height: 32px;
    border-radius: 50px;
    width: 63px;
    /* border-width: 0 1px; */
    box-shadow: 0px 0px 15px #0000008c;
} 
    
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-timepicker/0.5.2/css/bootstrap-timepicker.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-timepicker/0.5.2/js/bootstrap-timepicker.js"></script>
<aside class="right-side">
    <section class="content-header">
        <div class="title_bar">
            <h1 class="major_txt_color"><?php echo $title; ?></h1>
            <div class="breadcrumb_container"><?php echo breadcrumb_links();?></div>
        </div>
    </section>
    <!-- Main content -->
    <?php $general = get_general_setting();?> 
    <section class="content">
        
            <div class="row" id="main-content">
                <div class="box box-danger">
                    <?php if( !empty( $success ) || !empty( $error ) ) : ?>
                        <div class="alert alert-<?php echo !empty( $success ) ? 'success' : 'danger'; ?> alert-dismissable">
                            <i class="fa fa-thumbs-o-<?php echo !empty( $success ) ? 'up' : 'down'; ?>"></i>
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                            <h4><?php echo !empty( $success ) ? $success : $error; ?></h4>
                        </div>
                    <?php endif; ?>
                </div> 

                <div class="col-xs-12">
                    <form action="<?php echo $form_action;?>" method="post"  enctype="multipart/form-data" method="post" onsubmit="return validate(); ">    
                        <input type="hidden" name="token" value="<?php echo $token; ?>" />
                        <ul class="error_container"></ul>
                        
                        <div class="col-xs-12 blck">                        	
                            <div class="sub-title" ><h4><i class="fa fa-fire" style="font-size: 14px;"></i> Display Pole Settings </h4><i class="ctrl opener opened fa fa-chevron-up" style="float: right; margin-top: -25px;"></i></div>
                            <div class="blck-content col-xs-12">
                                <div class="col-md-6">        
                                    <div class="form-group">
                                        <label>Display Pole</label>  
                                        <div class="input-group" style="text-align: left;padding: 0px 0;">                              
                                            <input id="toggle-one" name="display_pole_set" type="checkbox" <?php if($pole_setting[0]['status'] == 1){ ?> checked="checked"<?php } ?> data-onstyle="success">
                                            <script>
                                                $(function() {
                                                    $('#toggle-one').bootstrapToggle();
                                                })
                                            </script>                                        
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                   		<label>Message 1</label>
                                        <div class="input-group">
                                        	<input type="text" class="form-control" name="port_msg1" id="port_msg1" value="<?php echo $pole_msg1[0]['value']; ?>" placeholder="*SREE MAHA MARIAMMAN TEMPLE*" maxlength="30" />                                            
                                        </div>
                                   </div>
                                </div>

                                <div class="col-md-6">                                    
                                    <div class="form-group">
                                   		<label>Port</label>
                                        <div class="input-group">
                                        	<input type="text" class="form-control" name="port" id="port" value="<?php echo $port_val[0]['value']; ?>" placeholder="COM3" />                                            
                                        </div>
                                   </div>
                                   
                                   <div class="form-group">
                                   		<label>Message 2</label>
                                        <div class="input-group">
                                        	<input type="text" class="form-control" name="port_msg2" id="port_msg2" value="<?php echo $pole_msg2[0]['value']; ?>" placeholder="**Have a nice day**" maxlength="30" />                                            
                                        </div>
                                   </div>
                                </div>
                            </div> <!-- blck-content -->    
                        </div>
                        
                        <div class="col-xs-12 blck"> 
                        	<div class="sub-title" ><h4><i class="fa fa-fire" style="font-size: 14px;"></i> Auto Print Settings </h4><i class="ctrl opener opened fa fa-chevron-up" style="float: right; margin-top: -25px;"></i></div>
                            <div class="blck-content col-xs-12">
                                <div class="col-md-6">        
                                   <div class="sub-title" ><h4><i class="fa fa-fire" style="font-size: 14px;"></i> Prasadam Consolidated Report Time</h4></div>
                                   <div class="form-group">
                                   		<label>Afternoon Time</label>
                                        <div class="input-group">
                                            <input type="text" class="form-control" name="pcrt_afternoon" id="pcrt_afternoon" value="<?php echo $pcrt_afternoon[0]['value']; ?>" placeholder="12:30 PM" data-mode="12h"/>
                                            <div class="input-group-addon"><i class="fa fa-clock-o" aria-hidden="true"></i></div>
                                        </div>
                                   </div>
                                   <div class="form-group">
                                   		<label>Evening Time</label>
                                        <div class="input-group">
                                        	<input type="text" class="form-control" name="pcrt_evening" id="pcrt_evening" value="<?php echo $pcrt_evening[0]['value']; ?>" placeholder="4:30 PM" />
                                            <div class="input-group-addon"><i class="fa fa-clock-o" aria-hidden="true"></i></div>
                                        </div>
                                   </div>
                                </div>

                                <div class="col-md-6">
                                	<div class="sub-title" ><h4><i class="fa fa-fire" style="font-size: 14px;"></i> Kattalai Archanai Report Time</h4></div>   
                                    <div class="form-group">
                                   		<label>Morining Time</label>
                                        <div class="input-group">
                                        	<input type="text" class="form-control" name="kart_morning" id="kart_morning" value="<?php echo $kart_morning[0]['value']; ?>" placeholder="06:00 AM" />
                                            <div class="input-group-addon"><i class="fa fa-clock-o" aria-hidden="true"></i></div>
                                        </div>
                                    </div>
                                    
                                    <!--<div class="form-group">
                                   		<label>Auto Print Machine</label>
                                        <?php //$printers = getActivePrinters(); echo "<pre>"; print_r($printers); echo "</pre>"; echo '<pre>'; print_r(printer_list(PRINTER_ENUM_LOCAL), true); echo '</pre>';?>
                                    </div> -->                            	
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-12 blck">                        	
                            <div class="sub-title" ><h4><i class="fa fa-fire" style="font-size: 14px;"></i> Receipt </h4><i class="ctrl opener opened fa fa-chevron-up" style="float: right; margin-top: -25px;"></i></div>
                            <div class="blck-content col-xs-12">
                                <div class="col-md-6">        
                                    <div class="form-group">
                                        <label>Message<div style="color: #999; font-size: 10px; margin-right: 1px;">(Will be displayed, at the bottom of every Archanai receipt)</div></label>
                                        <div class="input-group">
                                            <?php 
                                                $rec_msg_tamil = substr( $rec_msg[0]['value'], 0, 3) == 'TAM' ? TRUE : FALSE; 
                                            ?>
                                            <textarea class="form-control" <?php echo $rec_msg_tamil ? 'data-lang="TAM"' : ''; ?> name="rec_msg" rows="3" placeholder=""><?php echo !empty($rec_msg[0]['value']) ? substr($rec_msg[0]['value'], 3 ) : ''; ?></textarea> <!--class="form-control inp-lang-swap"-->
                                        </div>
                                    </div>
                                    
                                </div>

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

                                </div>
                            </div> <!-- blck-content -->    
                        </div> <!-- blck -->
                        
                        <div class="col-xs-12 blck">
                            <div class="sub-title" ><h4><i class="fa fa-fire" style="font-size: 14px;"></i> Acknowledgement </h4><i class="ctrl opener opened fa fa-chevron-up" style="float: right; margin-top: -25px;"></i></div>
                            <div class="blck-content col-xs-12">
                                <div class="col-md-6">        
                                    <div class="form-group">
                                        <label>SMS<div style="color: #999; font-size: 10px; margin-right: 1px;">Usage: Dear ((1)), You have successfully booked ((2)) with us. Date: ((3)). </div></label>
                                        <div class="input-group">
                                            <?php 
                                                $ack_msg_tamil = substr( $ack_sms_msg[0]['value'], 0, 3) == 'TAM' ? TRUE : FALSE; 
                                            ?>
                                            <textarea class="form-control" <?php echo $ack_msg_tamil ? 'data-lang="TAM"' : ''; ?> name="ack_sms_msg" rows="3" placeholder=""><?php echo !empty($ack_sms_msg[0]['value']) ? substr($ack_sms_msg[0]['value'], 3 ) : ''; ?></textarea>
                                        </div>
                                    </div>
                                    
                                    
                                    <div class="form-group note">
                                        <span style="font-weight: bold; color: #666; font-size: 10px;">Params: </span>
                                        <ul>
                                            <li>1   -   Name of the person</li>
                                            <li>2   -   Module Name (Eg. Prasadam)</li>
                                            <li>3   -   Date (DD/MM/YYYY)</li>
                                            <li>4   -   Time (HH:MM AM)</li>
                                        </ul>
                                        
                                    </div>
                                </div>

                                <div class="col-md-6">                                    
                                    
                                    <div class="form-group">
                                        <label>Mail<div style="color: #999; font-size: 10px; margin-right: 1px;">The description for to given at top of the mail</div></label>
                                        <div class="input-group">
                                            <?php 
                                                $ack_msg_tamil = substr( $ack_mail_msg[0]['value'], 0, 3) == 'TAM' ? TRUE : FALSE; 
                                            ?>
                                            <textarea class="form-control inp-lang-swap" <?php echo $ack_msg_tamil ? 'data-lang="TAM"' : ''; ?> name="ack_mail_msg" rows="3" placeholder=""><?php echo !empty($ack_mail_msg[0]['value']) ? substr($ack_mail_msg[0]['value'], 3 ) : ''; ?></textarea>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group note">
                                        <ul>
                                            <li>5   -   Total Amount</li>
                                            <li>6   -   Contact No</li>
                                            <li>7   -   Contact E-Mail</li>
                                            <li>8   -   Receipt No</li>
                                        </ul>
                                    </div>
                                </div>
                                
                                
                            </div> <!-- blck-content -->    
                        </div> <!-- blck -->
                        <?php if($general->scan_availability == 1) : ?>
                            <!--<div class="col-xs-12 blck">
                                <div class="sub-title" ><h4><i class="fa fa-fire" style="font-size: 14px;"></i> Kiosk - Scan Card</h4><i class="ctrl opener opened fa fa-chevron-up" style="float: right; margin-top: -25px;"></i></div>
                                <div class="blck-content col-xs-12" style="padding: 0px; margin-top: -10px;">
                                    <div class="tiny-blck">
                                        <div class="sub-title">
                                             Video
                                        </div>
                                        <div class="content">
                                            <label for="video_chk" style="float: right; margin-top: -32px; color: #999; margin-right: 20px; ">
                                                <input type="checkbox" name="video_chk" <?php echo $video_url[0]['status'] == "0" ? '' : 'checked'; ?> />
                                                <span style="margin-left: 10px; font-size: 12px; border-bottom: 1px dotted; padding-bottom: 5px;">Enable Video</span>
                                            </label>
                                            <input type="text" class="form-control" style="min-width: 432px; border: none; letter-spacing: 1px; border-bottom: 1px solid; padding: 20px;" name="video_url" value="<?php echo $video_url[0]['value']; ?>" placeholder="Ex: http://example.com/my_video.mkv" />
                                            <span style="color: #999; font-size: 12px; letter-spacing: 1px; line-height: 30px; padding-left: 20px;">(or) uploads/videos/my_shots.mp4</span>
                                        </div>
                                    </div>
                                    
                                    <div class="tiny-blck">
                                        <div class="sub-title">
                                            Event(s)
                                        </div>
                                        <div class="content" id="event" >
                                            <table>
                                                <thead>
                                                    <tr>
                                                        <th width="5%">Active</th>
                                                        <th>Event Name</th>
                                                        <th>Start Date</th>
                                                        <th>End Date</th>
                                                        <th>Period</th>
                                                        <th width="5%">&nbsp;</th>
                                                    </tr>
                                                </thead>
                                                
                                                <tbody>
                                                    
                                                </tbody>
                                            </table>
                                            
                                            
                                        </div>
                                    </div>
                                    
                                    <div class="tiny-blck">
                                        <div class="sub-title">
                                            Advertisement(s)
                                        </div>
                                        <div class="content" id="ad" >
                                            <table>
                                                <thead>
                                                    <tr>
                                                        <th width="5%">Active</th>
                                                        <th>Ad. Name</th>
                                                        <th colspan="2">Image</th>
                                                        <th width="5%">&nbsp;</th>
                                                    </tr>
                                                </thead> 
                                                <tbody data-val='<?php echo json_encode( $advertisement ); ?>' data-dir="<?php echo DIR_ADVERTISEMENT; ?>">

                                                </tbody>
                                            </table>
                                            
                                        </div>
                                    </div>
                                </div>
                            </div>-->
                        <?php endif;?>
                        
                        <div class="box-footer form-actions" style="float: left; width: 100%; margin-top: 30px;">
                            <button class="btn btn-primary" type="reset"><i class="fa fa-trash"></i> Clear</button>
                            <button type="submit" class="btn btn-danger" name="submit" value="Update"><i class="fa fa-floppy-o"></i> Update</button>
                        </div>
                        
                    </form>    
                </div>
                
                
                
                    
            </div> <!-- main-content -->
        
    </section><!-- /.content -->
</aside><!-- /.right-side -->
<!-- ./wrapper -->
<script type="text/javascript" src="<?php echo BASE_URL; ?>assets/js/billing/settings.js"></script>
<script type="text/javascript">
	$('#pcrt_afternoon').timepicker({
		template: false,
		showInputs: false,
		minuteStep: 1
	});
	
	$('#pcrt_evening').timepicker({
		template: false,
		showInputs: false,
		minuteStep: 1
	});
	
	$('#kart_morning').timepicker({
		template: false,
		showInputs: false,
		minuteStep: 1
	});
</script>