}
                }
            }).prop('disabled', !$.support.fileInput)
                .parent().addClass($.support.fileInput ? undefined : 'disabled');
        });

        $.validate({
            form: '#approve-project-form',
            validateOnBlur: false,
            onError: function () {
                return false;
            },
            onSuccess: function ($form) {
                var $btn = $("#approve-project-form-submit-btn").button('loading');
                $.post("<?php 
ajax_url('projects/approveTechnicalSanction');
?>
",$form.serialize(), function (response) {
                    if(response.status){
                        plannedProjectTable.reload();
                        $("#approve-project-form").trigger('reset');
                        $("#approveProjectModal").modal("hide")
                    }else{
                        alert(response.errorMessage);
                    }
                }).always(function(){
                    $btn.button('reset');
                });
                return false;
            }
        });
Example #2
0
                return false;
            }
        });


        $.validate({
            form: '#fund-form',
            validateOnBlur: false,
            onError: function () {
                return false;
            },
            onSuccess: function ($form) {
                $("#fund-form-submit-btn").button("loading");

                $.post("<?php 
ajax_url('funds/savefund');
?>
",$form.serialize(),function(response){
                    if(response.status){
                        $("#scheme-id").val("");
                        $("#fund-form").trigger('reset');
                        $("#fundModal").modal("hide");
                        table.reload();
                    }else{
                        alert(response.errorMessage);
                    }
                }).always(function(){
                    $("#fund-form-submit-btn").button("reset");
                });
                return false;
            }
Example #3
0
        $("#user-add-btn").click(function () {
            $("#userModal").find(".modal-title").text("Add new User");
            $("#userModal").modal("show");
        });

        $.validate({
            form: '#user-form',
            validateOnBlur: false,
            onError: function () {
                return false;
            },
            onSuccess: function ($form) {
                var $btn = $("#user-form-submit-btn").button('loading');
                $.post("<?php 
ajax_url('users/saveuser');
?>
",$form.serialize(),function(response){
                    if(response.status){
                        $("#user-id").val("");
                        $("#user-form").trigger('reset');
                        $("#userModal").modal("hide");
                        table.reload();
                    }else{
                        alert(response.errorMessage);
                    }
                }).always(function(){
                    $btn.button('reset');
                });
                return false;
            }
Example #4
0
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>
	</div>
	<?php 
include '../footer.php';
?>
</div>
<script>
$(function () {
	$('#save').on('click', function(){
		$.post('<?php 
echo ajax_url(URL_ADMIN2_AJAX, P_CLASS, P_FUNCTION);
?>
' , {
			value : CKEDITOR.instances['about_value'].getData(),
		},function(r){
			r = $.parseJSON(r);
			if(r.result == 1) {
				_jbox(r, 'success');
			}else{
				_jbox(r, 'error');			
			}
		});
	});

	$("#example1").DataTable({
		"order": [[ 0, "desc" ]],
        saveComment();
    });

    $("#comment-text").keyup(function(e){
        if(e.which == 13){
            saveComment();
        }
    })

    function saveComment(){
        var comment = $("#comment-text").val();
        var workOrderId = <?php 
echo $project->getWorkOrder()->getId();
?>
;
        var $btn = $("#btn-chat").button('loading')
        $.post("<?php 
ajax_url('comments/add');
?>
", "workOrderId=" + workOrderId + "&comment=" + comment, function (response) {
            if(response.status){
                addComment(response.data);
                $("#comment-text").val("");
            }else{
                alert(response.errorMessage);
            }
            $btn.button('reset');
        });
    }

</script>
<script>
    $(window).load(function() {
        $(".se-pre-con").fadeOut("slow");
    });

    $.validate({
        form: '#login-form',
        validateOnBlur: false,
        onError: function () {
            return false;
        },
        onSuccess: function ($form) {
            var btn = $("#login-btn").button("loading");
            $.post('<?php 
ajax_url("validate/savepassword");
?>
',$form.serialize() ,function(response){
                if(response.status){
                    window.location = "<?php 
app_url("login");
?>
";
                }else{
                    $("#status").text(response.errorMessage);
                }
            }).always(function(){
                $(btn).button("reset");
            });
            return false;
        }
            $("#change-project-status").attr("data-toggle","collapse");
            $("#change-project-status").attr("data-parent","#project-status");
            $("#change-project-status").attr("href","#collapseOne");
        }
        $("#project-status").show();
    }

    $("#btn-bill-close").click(function(){
        $("#collapseOne").collapse('hide');
    });

    $("#change-project-status").click(function () {
        var workOrderId = $(this).attr("data-work-order");
        $.get("<?php 
ajax_url('workorders/changestatus/');
?>
" + workOrderId, function (response) {
            if (response.status) {

                setProjectStatus(response.data);
            } else {
                alert(response.errorMessage);
            }
        });
    });

    $(function () {
        'use strict';
        $('#bill-project-fileupload').fileupload({
            url: '<?php 
            $("#change-project-status").attr("data-toggle","collapse");
            $("#change-project-status").attr("data-parent","#project-status");
            $("#change-project-status").attr("href","#collapseOne");
        }
        $("#project-status").show();
    }

    $("#btn-bill-close").click(function(){
        $("#collapseOne").collapse('hide');
    });

    $("#btn-bill-submit").click(function(e){
        e.preventDefault();
        var btn = $(this).button("loading");
        $.post("<?php 
ajax_url('bills/approve');
?>
",$("#bill-approve-form").serialize(),function(response){
            if(response.status){
                $("#collapseOne").collapse('hide');
                setProjectStatus(response.data);
            }else{
                $("#project-status").removeClass("alert-info");
                $("#project-status").addClass("alert-danger");
                $("#errorMessage").text(response.errorMessage);
            }
        }).always(function(){
            $(btn).button("reset");
        });
    });
Example #9
0
    $(window).load(function() {
       $(".se-pre-con").fadeOut("slow");
    });

    $.validate({
        form: '#login-form',
        validateOnBlur: false,
        onError: function () {
            return false;
        },
        onSuccess: function ($form) {
            var username = $("#username").val();
            var password = CryptoJS.MD5($("#password").val());
            $("#login-btn").val("Please wait..");
            $.post('<?php 
ajax_url("login/validate");
?>
',"username="******"&&password="******"#login-btn").val("Redirecting..");
                    window.location = "<?php 
app_url("projects");
?>
";
                }else{
                    $("#status").text(response.errorMessage);
                }
            }).error(function(){
                    $("#login-btn").val("Login");
                });
            return false;
<script>
    $('.selectpicker').selectpicker({
        size: 5
    });

    $(document).ready(function(){
        $.validate({
            form: '#tender-approve-form',
            validateOnBlur: false,
            onError: function () {
                return false;
            },
            onSuccess: function ($form) {
                var $btn = $("#tendor-form-submit-btn").button('loading');
                $.post("<?php 
ajax_url('projects/tenderApproval');
?>
",$form.serialize(),function(response){
                    if(response.status){
                        $("#contractor-id").selectpicker("val","");
                        $("#tender-approve-form").trigger('reset');
                        tenderProjectTable.reload();
                        $("#tenderApproveModal").modal("hide")
                    }else{
                        alert(response.errorMessage);
                    }
                }).always(function(){
                    $btn.button('reset');
                });
                return false;
            }
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<script>
    $.validate({
        form: '#new-project-form',
        validateOnBlur: false,
        onError: function () {
            return false;
        },
        onSuccess: function ($form) {
            var $btn = $("#new-project-form-submit-btn").button('loading');
            $.post("<?php 
ajax_url('projects/addProject');
?>
", $form.serialize(), function(response){
                if(response.status){
                    $("#new-project-form").trigger('reset');
                    adminApprovalProjectTable.reload();
                    $("#newProjectModal").modal("hide");
                }else{
                    alert(response.errorMessage);
                }
            }).always(function(){
                $btn.button('reset');
            });
            return false;
        }
    });
        $("#user-add-btn").click(function () {
            $("#userModal").find(".modal-title").text("Add new User");
            $("#userModal").modal("show");
        });

        $.validate({
            form: '#user-form',
            validateOnBlur: false,
            onError: function () {
                return false;
            },
            onSuccess: function ($form) {
                var $btn = $("#user-form-submit-btn").button('loading');
                $.post("<?php 
ajax_url('contractors/addContractor');
?>
", $form.serialize(), function (response) {
                    if (response.status) {
                        $("#user-id").val("");
                        $("#user-form").trigger('reset');
                        $("#userModal").modal("hide");
                        table.reload();
                    } else {
                        alert(response.errorMessage);
                    }
                }).always(function () {
                    $btn.button('reset');
                });
                return false;
            }
Example #13
0
            });*/
        });

        <?php 
}
?>


        $("body").on("click", "i[data-admin-approval-project]", function(){
            var target = this;
            var projectId = $(this).attr("data-admin-approval-project");
            var icon = $(this).clone(true);
            $(this).parent().html("Please wait..");
            $.get("<?php 
ajax_url('projects/approveProject/');
?>
"+projectId,function(response){
                if(response.status){
                    adminApprovalProjectTable.reload();
                }else{
                    alert(response.errorMessage);
                }
            }).always(function(){
                $(target).parent().html(icon);
            });
        });

        $("body").on("click","i[data-sanction-project]", function(){
            var projectId = $(this).attr("data-sanction-project");
            var projectName = $(this).parent().parent().children().eq(2).text();