<?php 
/*
$config = array('role' =>'form', 'class'=>'form-horizontal','id'=>'create_category_form', 'name'=>'create_category_form');
echo form_open_multipart(base_url("#"),$config);
*/
?>

	<form class="form-login" action="#" method="post" id="form-login">
<?php //print_r($category_details) ?>
            <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title">Verify Cost Pricing</h4>
           
            </div>
            <div class="modal-body">
                <div id="error"></div>
            <div class="row form-group">
             <div class="col-md-12">
                 
                 <!-- start: LOGIN BOX -->
			<div class="box-login">
			<!-- 	<h3>Verify Cost Pricing</h3> -->
				<p>
					Please enter your name and password 
				</p>
				<form class="form-login" action="#" method="post" id="form-login">
					<div class="errorHandler alert alert-danger no-display" id="error_msg">
						<i class="fa fa-remove-sign"></i> Login Failed, Please try again
					</div>
                     <?php //echo validation_errors('<p class="error">'); ?>
					<fieldset>
						<div class="form-group">
							<span class="input-icon">
								<input id="user_username" type="text" class="form-control" name="user_username" placeholder="Username" value="">
								<i class="fa fa-user"></i> </span>
						</div>
						<div class="form-group form-actions">
							<span class="input-icon">
								<input type="password" class="form-control password" name="password" placeholder="Password" value="">
									<i class="fa fa-lock"></i>
							</span>
						</div>
						<div class="form-actions">
						
							<button type="submit" class="btn btn-bricky pull-right">
								Verify <i class="fa fa-arrow-circle-right"></i>
							</button>
						</div>
					</fieldset>
				</form>
			</div>
			<!-- end: LOGIN BOX -->
			
           
            </div>
            </div>
            </div>
            
            <input id="cost_admin_verified_c" value="<?php echo $cost_admin_verified_c;?>" type="hidden">

  </form>

		<!-- start: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY VALIDATION-->
	<!-- 	<script src="<?php echo asset_url(); ?>js/form-validation-create_category.js"></script> -->
		
		<script src="<?php echo asset_url(); ?>plugins/jquery-validation/dist/jquery.validate.min.js"></script>
		<script src="<?php echo asset_url(); ?>js/login.js"></script>
		
		<!-- end: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY  VALIDATION-->
                        
			<script>
			jQuery(document).ready(function() {
				Main.init();
				Login.init();
			});
			
			function login(form) {
				
               $('body').modalmanager('loading');
                setTimeout(function () {
                    $.ajax({
                    url: "<?php echo base_url('users/login_sale?type=cost'); ?>", // Url to which the request is send
                    type: "POST",             // Type of request to be send, called as method
                    data: new FormData(form), // Data sent to server, a set of key/value pairs (i.e. form fields and values)
                    contentType: false,       // The content type used when sending data to the server.
                    cache: false,             // To unable request pages to be cached
                    processData:false,        // To send DOMDocument or non processed data file it is set to false
                        success: function(data)   // A function to be called if request succeeds
                        {
                            var obj = jQuery.parseJSON(data);
                            if (obj.status==0) 
                                {
									$('#error_msg').show();
                                    $('body').modalmanager('removeLoading');
                                   // $('body').attr('class','');
                                } 
                                else
                                {
                                    
                                    var cost_admin_verified_c=$("#cost_admin_verified_c").val();
                                    
                                    //set new val
                                    var tmpsellingval=$("#tmpsellingval").val();
                                  //  alert(tmpsellingval);
                                   $("#item_ac_price_p_"+cost_admin_verified_c).val(tmpsellingval);
                                    
                                     
                                    
                                      $('body').modalmanager('removeLoading');
                                   // $('div#ajax-modal-5').modal('hide');
                                    set_message('categories notice!','Successfully Verifyed');
                                    
                                    var cost_admin_verified_fld="#cost_admin_verified_"+cost_admin_verified_c;
                                    $(cost_admin_verified_fld).val(1);
                                    $("#cost_admin_verified_user_"+cost_admin_verified_c).val(obj.ss_user_id);
                                    
                                    //alert(obj.ss_user_id);
                                    
                                     calculateTotal();
                                     $("#tmpsellingval").val(0)
                                    
                                    
                                    
                                    $('.close').trigger('click');
                                   // alert(11);
									//window.location = "<?php echo base_url('dashboard');?>";
                                };

                        }
                    });
                }, 1000);
		}
		</script>       
