EVOLUTION-NINJA
Edit File: reportsnew.php
<?php echo view('includes/header');?> <link href="<?php echo base_url('public/assets/admin_dashboard/css/jquery-ui.css');?>" rel="stylesheet"> <script src="<?php echo base_url('public/assets/js/jquery-ui.js');?>"></script> <script src="<?php echo base_url('public/assets/admin_dashboard/js/jquery.table2excel.js');?>"></script> <section class="content-header"> <h1>Reports</h1> </section> <section class="content"> <div class="row"> <div class="col-md-12"> <div> <!-- Nav tabs --> <ul class="nav nav-tabs" id="myTab" role="tablist"> <li id="m36" role="presentation"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Booking</a></li> <li id="m37" role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Payment</a></li> <li id="m38" role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">Cancellation</a></li> <li id="m39" role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">Associate/Broker</a></li> <li id="m40" role="presentation"><a href="#enquiry" aria-controls="settings" role="tab" data-toggle="tab">Enquiry</a></li> <li id="m41" role="presentation"><a href="#clients" aria-controls="settings" role="tab" data-toggle="tab">Clients</a></li> <li id="m42" role="presentation"><a href="#sites" aria-controls="settings" role="tab" data-toggle="tab">Sites</a></li> <li id="m43" role="presentation"><a href="#loans" aria-controls="settings" role="tab" data-toggle="tab">Loans</a></li> <li id="m44" role="presentation"><a href="#reception" aria-controls="settings" role="tab" data-toggle="tab">Reception</a></li> <li id="m45" role="presentation"><a href="#graph" aria-controls="settings" role="tab" data-toggle="tab">Graph</a></li> <li id="m46" role="presentation"><a href="#status" aria-controls="settings" role="tab" data-toggle="tab">Status Report</a></li> <li id="m47" role="presentation"><a href="#site_details" aria-controls="settings" role="tab" data-toggle="tab">Site Details</a></li> </ul> <!-- Tab panes --> <div class="tab-content"> <div role="tabpanel" class="tab-pane" id="home"> <form id="land_owner" method="post" class="form-inline booking_report_form"> <!--<div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4">Name/Email</label> <input type="text" class="form-control col-sm-8" name="name"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Project</label> <select class="form-control col-sm-8 bg_project" name="project_id" id="sel1"> <option value="">All</option> <?php /*foreach($projects as $val) { ?> <option value="<?php echo $val->project_id;?>"><?php echo $val->project_name;?></option> <?php }*/ ?> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Associate</label> <select class="form-control col-sm-8 bg_associate" name="associate" id="sel1"> <option value="">Select</option> <?php /*foreach($associates as $val) { ?> <option value="<?php echo $val->broker_id;?>"><?php echo $val->associate_name;?></option> <?php }*/ ?> </select> </div> </div> row 2--> <!--<div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Sub Associate</label> <select class="form-control col-sm-8 bg_associate" name="subassociate" id="sel1"> <option value="">Select</option> <?php /*foreach($subassociates as $val) { ?> <option value="<?php echo $val->broker_id;?>"><?php echo $val->associate_name;?></option> <?php }*/ ?> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Executive</label> <select class="form-control col-sm-8 bg_executive" name="reference" id="sel1"> <option value="">Select</option> <?php /*foreach($reference as $val) { ?> <option value="<?php echo $val->broker_id;?>"><?php echo $val->associate_name;?></option> <?php }*/ ?> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Logistic</label> <select class="form-control col-sm-8 bg_logistic" id="sel1" name="logistics"> <option value="">Select</option> <?php /* foreach($logistics as $val) { ?> <option value="<?php echo $val->broker_id;?>"><?php echo $val->associate_name;?></option> <?php }*/ ?> </select> </div> </div> row 2--> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">From date</label> <input type="text" class="form-control col-sm-8 from_date_picker bg_from" id="booking_from" name="from_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4">To date</label> <input type="text" class="form-control col-sm-5 to_date_picker bg_to" id="booking_to" name="to_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4"></label> <button type="submit" id="booking_submit" style="margin-top: 0px !important;" class="btn btn-primary center-block submit">Submit</button> </div> </div> <!-- row 2--> </form> <div id="total_div"></div> <div id="menu1" class="tab-panecol-sm-12 col-md-12 "> <div id = "jaytabbooking" style="margin-top:3%;margin-left: -28px;" class="col-sm-12 grid"> <div class="grid_div"></div><table id="list3"></table> <div id="pager3"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="export_table" class="export_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="export_contact_table" class="export_contact_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="export_email_table" class="export_email_table"></table></div> <div style="display:none;"> <table border="1" style="border-spacing: 0px !important;" id="print_table" class="print_table"></table> </div> <div id="print_booking_report"> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 bg_name_choosen"></div> <div class="form-group col-sm-12 col-md-4 bg_project_choosen"></div> </div> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 bg_associate_choosen"></div> <div class="form-group col-sm-12 col-md-4 bg_executive_choosen"></div> <div class="form-group col-sm-12 col-md-4 bg_logistic_choosen"></div> </div> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 bg_from_choosen"></div> <div class="form-group col-sm-12 col-md-4 bg_to_choosen"></div> </div> <h3><center>Booking reports</center></h3> <div style:overflow:scroll;height:350px;> <table class="table table-striped table-hover booking_table_print" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2">Name & Address</th> <th class="col-xs-2">Mobile & Email</th> <th class="col-xs-2">Booking date</th> <th class="col-xs-2">Project</th> <th class="col-xs-1">Site</th> <th class="col-xs-1">Dimension</th> <th class="col-xs-1">Associate</th> <th class="col-xs-1">Sub Associate</th> <th class="col-xs-1">Logistic</th> <th class="col-xs-1">Reference</th> <th class="col-xs-3">Portal</th> </tr> </thead> <tbody id="booking_table_body_print"> </tbody> </table> </div> </div> <div class="col-md-3" id="booking_contacts_export"> <table class="table table-striped table-hover booking_contacts_export" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2 b_contacts">Mobile</th> </tr> </thead> <tbody id="booking_table_body_contacts_export"> </tbody> </table> </div> <div class="col-md-3" id="booking_email_export"> <table class="table table-striped table-hover booking_email_export" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2 b_contacts">Emails</th> </tr> </thead> <tbody id="booking_table_body_email_export"> </tbody> </table> </div> </div> <div role="tabpanel" class="tab-pane" id="profile"> <form id="land_owner" class="form-inline payment_report_form"> <!-- <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Type</label> <select class="form-control col-sm-8 pt_type" name="type" id="type"> <option value="">Select</option> <option value="1">Received</option> <option value="0">Receivable</option> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Project</label> <select class="form-control col-sm-8 pt_project" name="project_id" id="sel1"> <option value="">All</option> <?php /*foreach($projects as $val) { ?> <option value="<?php echo $val->project_id;?>"><?php echo $val->project_name;?></option> <?php }*/ ?> </select> </div> </div> row 2--> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">From date</label> <input type="text" class="form-control col-sm-8 from_date_picker pt_from" id="payment_from" name="from_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4">To date</label> <input type="text" class="form-control col-sm-5 to_date_picker pt_to" id="payment_to" name="to_date"> </div> <!-- <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Sites</label> <select class="form-control col-sm-5 sites_list pay_sites" name="site_number" id="sel1"> </select> </div> --> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4"></label> <button type="submit" id="payment_submit" style="margin-top:0px !important" class="btn btn-primary center-block submit">Submit</button> </div> </div> </form> <div id="payment_button_div"></div> <div> <div id = "jaytab3" style="margin-top:3%;" class="col-sm-12 grid"> <div class="grid_div"></div><table id="list4"></table> <div id="pager4"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="payment_export_table" class="payment_export_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="payment_export_contact_table" class="payment_export_contact_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="payment_export_email_table" class="payment_export_email_table"></table></div> <div style="display:none;"> <table border="1" style="border-spacing: 0px !important;" id="payment_print_table" class="payment_print_table"></table> </div> </div> <div id="print_payment_report"> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 pt_type_choosen"></div> <div class="form-group col-sm-12 col-md-4 pt_project_choosen"></div> </div> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 pt_from_choosen"></div> <div class="form-group col-sm-12 col-md-4 pt_to_choosen"></div> </div> <h3><center>Payment reports</center></h3> <table class="table table-striped table-hover payment_table_print" style="width:100%;" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2">Name & Address</th> <th class="col-xs-2">Contact &Email</th> <th class="col-xs-1">Booked on</th> <th class="col-xs-2">Project</th> <th class="col-xs-1">Site</th> <th class="col-xs-1">Dimension</th> <th class="col-xs-3">Booking Payment </th> <th class="col-xs-3">Agreement Payment </th> <th class="col-xs-3">Installment Payment </th> <th class="col-xs-3">Registration Payment </th> <th class="col-xs-3">Subtotal</th> </tr> </thead> <tbody id="payment_table_body_print"> </tbody> </table> </div> <div class="col-md-3" id="payment_contacts_export"> <table class="table table-striped table-hover payment_contacts_export" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2 b_contacts">Mobile</th> </tr> </thead> <tbody id="payment_table_body_contacts_export"> </tbody> </table> </div> <div class="col-md-3" id="payment_email_export"> <table class="table table-striped table-hover payment_email_export" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2 b_contacts">Emails</th> </tr> </thead> <tbody id="payment_table_body_email_export"> </tbody> </table> </div> </div> <div role="tabpanel" class="tab-pane" id="messages"> <form id="land_owner" class="form-inline cancellation_report_form"> <!-- <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Type</label> <select class="form-control col-sm-8 cn_type" name="type" id="sel1"> <option value="">Select</option> <option value="No">Cancelled</option> <option value="Yes">Refunded</option> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Executive</label> <select class="form-control col-sm-8 cn_executive" name="reference" id="sel1"> <option value="">Select</option> <?php /*foreach($reference as $val) { ?> <option value="<?php echo $val->broker_id;?>"><?php echo $val->associate_name;?></option> <?php }*/ ?> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Project</label> <select class="form-control col-sm-8 cn_project" name="project_id" id="sel1"> <option value="">All</option> <?php /*foreach($projects as $val) { ?> <option value="<?php echo $val->project_id;?>"><?php echo $val->project_name;?></option> <?php }*/ ?> </select> </div> </div> --> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">From date</label> <input type="text" class="form-control col-sm-8 from_date_picker cn_from" id="cancellation_from" name="from_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4">To date</label> <input type="text" class="form-control col-sm-5 to_date_picker cn_to" id="cancellation_to" name="to_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4"></label> <button type="submit" id="cancellation_submit" style="margin-top: 0px !important" class="btn btn-primary center-block submit">Submit</button> </div> </div> </form> <div id="cancellation_button_div"></div> <div> <div id = "jaytab3" style="margin-top:3%;" class="col-sm-12 grid"> <div class="grid_div"></div><table id="list5"></table> <div id="pager5"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="cancellation_export_table" class="cancellation_export_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="cancellation_export_contact_table" class="cancellation_export_contact_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="cancellation_export_email_table" class="cancellation_export_email_table"></table></div> <div style="display:none;"> <table border="1" style="border-spacing: 0px !important;" id="cancellation_print_table" class="cancellation_print_table"></table> </div> <div id="print_cancellation_report"> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 cn_type_choosen"></div> <div class="form-group col-sm-12 col-md-4 cn_executive_choosen"></div> </div> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 cn_from_choosen"></div> <div class="form-group col-sm-12 col-md-4 cn_to_choosen"></div> </div> <h3><center>Cancellation/Refund reports</center></h3> <table class="table table-striped table-hover cancellation_table_print" style="width:100%;" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2">Name & Address</th> <th class="col-xs-2">Contact &Email</th> <th class="col-xs-2">Project</th> <th class="col-xs-1">Site</th> <th class="col-xs-1">Dimension</th> <th class="col-xs-3">Refund </th> <th class="col-xs-1">Payment mode</th> <th class="col-xs-2">Amount</th> <th class="col-xs-3">Cheque details</th> <th class="col-xs-3">Refunded Date</th> <th class="col-xs-1">Executive</th> <th class="">Associate</th> <th class="">Sub Associate</th> <th class="col-xs-2">Due with</th> <th class="col-xs-2">Cancelled on</th> </tr> </thead> <tbody id="cancellation_table_body_print"> </tbody> </table> </div> <div class="col-md-3" id="cancellation_contacts_export"> <table class="table table-striped table-hover cancellation_contacts_export" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2 b_contacts">Mobile</th> </tr> </thead> <tbody id="cancellation_table_body_contacts_export"> </tbody> </table> </div> <div class="col-md-3" id="cancellation_email_export"> <table class="table table-striped table-hover cancellation_email_export" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2 b_contacts">Emails</th> </tr> </thead> <tbody id="cancellation_table_body_email_export"> </tbody> </table> </div> </div> <div role="tabpanel" class="tab-pane" id="settings"> <form id="land_owner" class="form-inline associate_report_form"> <!-- <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Associate</label> <select class="form-control col-sm-8 ab_associate" name="associate" id="sel1"> <option value="">Select</option> <?php /* foreach($associates as $val) { ?> <option value="<?php echo $val->broker_id;?>"><?php echo $val->associate_name;?></option> <?php }*/ ?> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">From date</label> <input type="text" class="form-control col-sm-8 from_date_picker ab_from" name="from_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4">To date</label> <input type="text" class="form-control col-sm-5 to_date_picker ab_to" name="to_date"> </div> </div> <!-- row 2 --> <div class="row land_owner_a"> <!-- <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Sub Associate</label> <select class="form-control col-sm-8 ab_subassociate" name="subassociate" id="sel1"> <option value="">Select</option> <?php /*foreach($subassociates as $val) { ?> <option value="<?php echo $val->broker_id;?>"><?php echo $val->associate_name;?></option> <?php }*/ ?> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Project</label> <select class="form-control col-sm-8 project_list broker_project" name="project_id" id="sel1"> <option value="">All</option> <?php /*foreach($projects as $val) { ?> <option value="<?php echo $val->project_id;?>"><?php echo $val->project_name;?></option> <?php }*/ ?> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Sites</label> <select class="form-control col-sm-5 sites_list broker_sites" name="site_number" id="sel1"> </select> </div> --> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">From date</label> <input type="text" class="form-control col-sm-8 from_date_picker ab_from" id="broker_from" name="from_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4">To date</label> <input type="text" class="form-control col-sm-5 to_date_picker ab_to" id="broker_to" name="to_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4"></label> <button type="submit" id="associate_submit" style ="margin-top: 0px !important" class="btn btn-primary center-block submit">Submit</button> </div> </div> <div class="row land_owner_a"> </div> <!-- row 2--> </form> <div id="associate_button_div"></div> <div> <div id = "jaytab3" style="margin-top:3%;" class="col-sm-12 grid"> <div class="grid_div"></div><table id="list6"></table> <div id="pager6"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="broker_export_table" class="broker_export_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="broker_export_contact_table" class="broker_export_contact_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="broker_export_email_table" class="broker_export_email_table"></table></div> <div style="display:none;"> <table border="1" style="border-spacing: 0px !important;" id="broker_print_table" class="broker_print_table"></table> </div> </div> <div id="print_associate_report"> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 ab_associate_choosen"></div> </div> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 ab_from_choosen"></div> <div class="form-group col-sm-12 col-md-4 ab_to_choosen"></div> </div> <h3><center>Associate reports</center></h3> <table class="table table-striped table-hover associate_table_print" style="width:100%;" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2">Name & Address</th> <th class="col-xs-2">Contact &Email</th> <th class="col-xs-2">Project</th> <th class="col-xs-1">Site</th> <th class="col-xs-1">Dimension</th> <th class="col-xs-1">Associate</th> <th class="col-xs-1">Commission</th> <th class="col-xs-3">Payment</th> </tr> </thead> <tbody id="associate_table_body_print"> </tbody> </table> </div> <div class="col-md-3" id="associate_contacts_export"> <table class="table table-striped table-hover associate_contacts_export" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2 b_contacts">Mobile</th> </tr> </thead> <tbody id="associate_table_body_contacts_export"> </tbody> </table> </div> <div class="col-md-3" id="associate_email_export"> <table class="table table-striped table-hover associate_email_export" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2 b_contacts">Emails</th> </tr> </thead> <tbody id="associate_table_body_email_export"> </tbody> </table> </div> </div> <div role="tabpanel" class="tab-pane" id="enquiry"> <form id="land_owner" class="form-inline enquiry_report_form"> <!--<div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Executive</label> <select class="form-control col-sm-8 en_executive" name="reference" id="sel1"> <option value="">Select</option> <?php /*foreach($reference as $val) { ?> <option value="<?php echo $val->broker_id;?>"><?php echo $val->associate_name;?></option> <?php }*/ ?> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Web portal</label> <select class="form-control col-sm-8 en_web" name="web_portal" id="sel1"> <option value="">Select</option> <?php /*foreach($webportals as $val) { ?> <option value="<?php echo $val->portal_id;?>"><?php echo $val->webportal;?></option> <?php }*/ ?> </select> </div> </div> row 2--> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">From date</label> <input type="text" class="form-control col-sm-8 from_date_picker en_from" id="enquiry_from"name="from_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4">To date</label> <input type="text" class="form-control col-sm-5 to_date_picker en_to" id="enquiry_to" name="to_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Select Type</label> <select class="form-control col-sm-8 en_executive" name="type" id="type"> <option value="">Select</option> <option value="Webportal">Web Portal</option> <option value="Database">Database</option> </select> </div> </div> <!-- row 2--> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4"></label> <button type="submit" id="enquiry_submit" style="margin-top: 0px !important" class="btn btn-primary center-block submit">Submit</button> </div> </form> <div id="enquiry_button_div"></div> <div> <div id = "jaytab3" style="margin-top:3%;" class="col-sm-12 grid"> <div class="grid_div"></div><table id="list7"></table> <div id="pager7"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="enquiry_export_table" class="enquiry_export_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="enquiry_export_contact_table" class="enquiry_export_contact_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="enquiry_export_email_table" class="enquiry_export_email_table"></table></div> <div style="display:none;"> <table border="1" style="border-spacing: 0px !important;" id="enquiry_print_table" class="enquiry_print_table"></table> </div> </div> <div id="print_enquiry_report"> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 en_executive_choosen"></div> <div class="form-group col-sm-12 col-md-4 en_web_choosen"></div> </div> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 en_from_choosen"></div> <div class="form-group col-sm-12 col-md-4 en_to_choosen"></div> </div> <h3><center>Enquiry reports</center></h3> <table class="table table-striped table-hover enquiry_table_print" style="width:100%;" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-3">Name & Address</th> <th class="col-xs-4">Contact &Email</th> <th class="col-xs-2">Web portal</th> <th class="">Reference</th> <th class="col-xs-3">Allocated date</th> </tr> </thead> <tbody id="enquiry_table_body_print"> </tbody> </table> </div> <div class="col-md-3" id="enquiry_contacts_export"> <table class="table table-striped table-hover enquiry_contacts_export" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2 b_contacts">Mobile</th> </tr> </thead> <tbody id="enquiry_table_body_contacts_export"> </tbody> </table> </div> <div class="col-md-3" id="enquiry_email_export"> <table class="table table-striped table-hover enquiry_email_export" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2 b_contacts">Emails</th> </tr> </thead> <tbody id="enquiry_table_body_email_export"> </tbody> </table> </div> </div> <div role="tabpanel" class="tab-pane" id="clients"> <div id = "jaytab3" style="margin-top:3%;" class="col-sm-12 grid"> <div class="grid_div"></div><table id="list8"></table> <div id="pager8"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div role="tabpanel" class="tab-pane" id="sites"> <form id="land_owner" class="form-inline sites_report_form"> <!-- <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Type</label> <select class="form-control col-sm-8 si_type" name="type" id="type"> <option value="">Select</option> <option value="BOOKED">Registered</option> <!-- <option value="CANCELLED">Cancelled</option> <!-- <option value="REFUNDED">Refunded</option> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Project</label> <select class="form-control col-sm-8 si_project" name="project_id" id="sel1"> <option value="">All</option> <?php /*foreach($projects as $val) { ?> <option value="<?php echo $val->project_id;?>"><?php echo $val->project_name;?></option> <?php }*/ ?> </select> </div> </div>--> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">From date</label> <input type="text" class="form-control col-sm-8 from_date_picker si_from" id="site_from"name="from_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4">To date</label> <input type="text" class="form-control col-sm-5 to_date_picker si_to" id="site_to" name="to_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4"></label> <button type="submit" id="sites_submit" style="margin-top: 0px !important" class="btn btn-primary center-block submit">Submit</button> </div> </div> </form> <div id="sites_button_div"></div> <div> <div id = "jaytab3" style="margin-top:3%;" class="col-sm-12 grid"> <div class="grid_div"></div><table id="list10"></table> <div id="pager10"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="clients_export_table" class="clients_export_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="clients_export_contact_table" class="clients_export_contact_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="clients_export_email_table" class="clients_export_email_table"></table></div> <div style="display:none;"> <table border="1" style="border-spacing: 0px !important;" id="clients_print_table" class="clients_print_table"></table> </div> </div> <div id="print_sites_report"> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 si_type_choosen"></div> <div class="form-group col-sm-12 col-md-4 si_project_choosen"></div> </div> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 si_from_choosen"></div> <div class="form-group col-sm-12 col-md-4 si_to_choosen"></div> </div> <h3><center>Sites reports</center></h3> <table class="table table-striped table-hover sites_table_print" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2">Name & Address</th> <th class="col-xs-2">Mobile & Email</th> <th class="col-xs-2">Date & Status</th> <th class="col-xs-2">Project</th> <th class="col-xs-1">Site</th> <th class="col-xs-1">Dimension</th> <th class="col-xs-1">Associate</th> <th class="col-xs-1">Sub Associate</th> <th class="col-xs-1">Logistic</th> <th class="col-xs-1">Reference</th> <th class="col-xs-3">Portal</th> </tr> </thead> <tbody id="sites_table_body_print"> </tbody> </table> </div> </div> <div role="tabpanel" class="tab-pane" id="loans"> <div id = "jaytab3" style="margin-top:3%;" class="col-sm-12 grid"> <div class="grid_div"></div><table id="list11"></table> <div id="pager11"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="loan_export_table" class="loan_export_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="loan_export_contact_table" class="loan_export_contact_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="loan_export_email_table" class="loan_export_email_table"></table></div> <div style="display:none;"> <table border="1" style="border-spacing: 0px !important;" id="loan_print_table" class="loan_print_table"></table> </div> </div> <div role="tabpanel" class="tab-pane" id="reception"> <form id="land_owner" class="form-inline reception_report_form"> <!-- <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Project</label> <select class="form-control col-sm-8 project_list rec_project" name="project_id" id="sel1"> <option value="">All</option> <?php foreach($projects as $val) { ?> <option value="<?php echo $val->project_id;?>"><?php echo $val->project_name;?></option> <?php } ?> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Sites</label> <select class="form-control col-sm-5 sites_list rec_sites" name="site_number" id="sel1"> </select> </div> </div> --> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">From date</label> <input type="text" class="form-control col-sm-8 from_date_picker rec_from" id="reception_from" name="from_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4">To date</label> <input type="text" class="form-control col-sm-5 to_date_picker rec_to" id="reception_to" name="to_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4"></label> <button type="submit" id="reception_submit" style="margin-top: 0px !important" class="btn btn-primary center-block submit">Submit</button> </div> </div> </form> <div id="reception_button_div"></div> <div> <div id = "jaytab3" style="margin-top:3%;" class="col-sm-12 grid"> <div class="grid_div"></div><table id="list12"></table> <div id="pager12"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="reception_export_table" class="reception_export_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="reception_export_contact_table" class="reception_export_contact_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="reception_export_email_table" class="reception_export_email_table"></table></div> <div style="display:none;"> <table border="1" style="border-spacing: 0px !important;" id="reception_print_table" class="reception_print_table"></table> </div> </div> <div id="print_reception_report"> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 rec_project_choosen"></div> <div class="form-group col-sm-12 col-md-4 rec_sites_choosen"></div> </div> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 rec_from_choosen"></div> <div class="form-group col-sm-12 col-md-4 rec_to_choosen"></div> </div> <h3><center>Reception reports</center></h3> <table class="table table-striped table-hover reception_table_print" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2">Name & Address</th> <th class="col-xs-1">Contact</th> <th class="col-xs-2">Project</th> <th class="">Site</th> <th class="">Dimension</th> <th class="col-xs-2">Document dispatched</th> <th class="col-xs-2">Dispatched date</th> <th class="col-xs-1">Created at</th> </tr> </thead> <tbody id="reception_table_body_print"> </tbody> </table> </div> </div> <!-- //////////////////////////////////////////////Individual Site//////////////////////////////////////////////// --> <div role="tabpanel" class="tab-pane" id="site_details"> <form id="land_owner" class="form-inline sites_report_form"> <div class="row land_owner_a"> <div class="col-sm-12 col-md-3"> <label class="col-sm-4 ">Project</label> <select class="form-control col-sm-5 project_list" name="project" id="sel1" required="required"> <option value="0">Select project</option> <?php foreach($projects as $val) { ?> <option value="<?php echo $val->project_id;?>"><?php echo $val->project_name;?></option> <?php } ?> </select> </div> <div class="col-sm-12 col-md-3"> <label class="col-sm-4 ">Site No.</label> <select class="form-control col-sm-5 sites_list" name="sites" id="sel1" required="required"> </select> </div> </div> </form> <div id="sites_button_div"></div> <div> <div id = "jaytab3" style="margin-top:3%;" class="col-sm-12 grid"> <div class="grid_div"></div><table id="list10"></table> <div id="pager10"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="sites_export_table" class="sites_export_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="sites_export_contact_table" class="sites_export_contact_table"></table></div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="sites_export_email_table" class="sites_export_email_table"></table></div> <div style="display:none;"> <table border="1" style="border-spacing: 0px !important;" id="sites_print_table" class="sites_print_table"></table> </div> </div> <div id="print_sites_report"> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 si_type_choosen"></div> <div class="form-group col-sm-12 col-md-4 si_project_choosen"></div> </div> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4 si_from_choosen"></div> <div class="form-group col-sm-12 col-md-4 si_to_choosen"></div> </div> <h3><center>Sites reports</center></h3> <table class="table table-striped table-hover sites_table_print" border="1"> <thead style="background:#b00101;"> <tr class="default" style="height:40px;padding-bottom:10px;"> <th class="col-xs-2">Name & Address</th> <th class="col-xs-2">Mobile & Email</th> <th class="col-xs-2">Date & Status</th> <th class="col-xs-2">Project</th> <th class="col-xs-1">Site</th> <th class="col-xs-1">Dimension</th> <th class="col-xs-1">Associate</th> <th class="col-xs-1">Sub Associate</th> <th class="col-xs-1">Logistic</th> <th class="col-xs-1">Reference</th> <th class="col-xs-3">Portal</th> </tr> </thead> <tbody id="sites_table_body_print"> </tbody> </table> </div> </div> <!-- //////////////////////////////////////////Status///////////////////////////////////////////////////////////// --> <div role="tabpanel" class="tab-pane" id="status"> <!-- <form id="land_owner" class="form-inline status_report_form"> --> <!-- <div class="row land_owner_a"> --> <!-- <div class="col-sm-12 col-md-3"> --> <!-- <label class="col-sm-4 ">Project</label> --> <!-- <select class="form-control col-sm-5 status_report" name="project" id="sel1" required="required"> --> <!-- <option value="0">Select project</option> --> <?php // foreach($projects as $val) // { // ?> <option value="<?php //echo $val->project_id;?>"><?php //echo $val->project_name;?></option> <?php // } // ?> <!-- </select> --> <!-- </div> --> <!-- <div class="col-sm-12 col-md-3"> --> <!-- <label class="col-sm-4 ">Site No.</label> --> <!-- <select class="form-control col-sm-5 sites_list" name="sites" id="sel1" required="required"> --> <!-- </select> --> <!-- </div> --> <!-- <div class="form-group col-sm-12 col-md-4"> --> <!-- <label class="col-sm-4"></label> <button type="submit" id="status_submit" style="margin-top: 0px !important" class="btn btn-primary center-block submit">Submit</button> <!-- </div> --> <!-- </div> --> <!-- </form> --> <div id="sites_button_div"></div> <div> <div id = "jaytab3" style="margin-top:3%;overflow-y:scroll;" class="col-sm-12 grid"> <div class="grid_div"></div> <table id="list13"></table> <div id="pager13"></div> <div id="dialogSelectRow13" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> </div> <!-- //////////////////////////////////////////GRAPH/////////////////////////////////////////////////////////// --> <div role="tabpanel" class="tab-pane" id="graph"> <form id="land_owner" class="form-inline sales_form"> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">Executive</label> <select class="form-control col-sm-8 bg_executive" name="reference" id="sel1"> <option value="">Select</option> <?php foreach($reference as $val) { ?> <option value="<?php echo $val->broker_id;?>"><?php echo $val->associate_name;?></option> <?php } ?> </select> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4 ">From date</label> <input type="text" class="form-control col-sm-8 from_date_picker bg_from" name="from_date"> </div> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4">To date</label> <input type="text" class="form-control col-sm-5 to_date_picker bg_to" name="to_date"> </div> </div> <!-- row 2--> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-4"> <label class="col-sm-4"></label> <button type="submit" id="sales_submit" class="btn btn-primary center-block submit">Submit</button> </div> <div class="form-group col-sm-12 col-md-4"> <h3>Total Booked Sqft <input type="text" class="form-control col-sm-5 total" name="total" readonly></h3> </div> </div> <!-- row 2--> </form> <div id="total_div"> <div class="row"> <section class="col-lg-12 connectedSortable"> <div class="nav-tabs-custom"> <!-- Tabs within a box --> <div class="tab-content no-padding"> <!-- Morris chart - Sales --> <div class="chart tab-pane active" id="revenue-chart" style="position: relative; height: 300px;"></div> </div> </div> <!--- Chat box ----> </section> <!--- left side ----> </div> <!-- row 2 ----> </div> </div> </div> </div> </div> </section> <!-- This is the Javascript file of jqGrid --> <script type="text/ecmascript" src="<?php echo base_url('public/jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <!-- This is the localization file of the grid controlling messages, labels, etc. <!-- We support more than 40 localizations --> <script type="text/ecmascript" src="<?php echo base_url('public/jqgrid/js/i18n/grid.locale-en.js'); ?>"></script> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('public/assets/css/jquery-ui.css'); ?>" /> <!-- The link to the CSS that the grid needs --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('public/jqgrid/css/ui.jqgrid.css'); ?>" /> <script src="<?php echo base_url('public/assets/js/jquery-ui.js'); ?>" type="text/javascript"></script> <style type="text/css"> .form-control:focus, input[type="Submit"]:focus, input[type="button"]:focus { border-color: #FF0000; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(255, 0, 0, 0.6); } #FrmGrid_list2 { width: 100% !important; } .ui-jqdialog .ui-jqdialog-titlebar { height: 29px !important; background-color: #001a00; color: white; padding-left: 10px; } .fm-button { height: 21px !important; padding: 1px; margin-right: 10px !important; height: 21px !important; width: 50%; margin-top: -7px !important; } .ui-jqdialog-content td.navButton { padding-top: 12px !important; } .ui-jqgrid .ui-jqgrid-titlebar { height: 27px !important; background:#AF0100 !important; color:white !important; } .ui-jqgrid-bdiv { //height: 232px !important; height: auto !important; } .ui-widget-overlay { z-index:0 !important; } .ui-widget-header { background: #1e7ad7 !important; } .ui-jqgrid-hdiv ui-state-default { width: 873px !important; cursor: default!important } ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #fed22f; background: #ffe45c; } .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { font-weight: bold; color: black; } .ui-jqgrid .ui-jqgrid-bdiv { overflow-y: scroll; //overflow-x: hidden; } </style> <style type="text/css"> .calendar-table thead{ background: #fff !important; color:#777 !important; } #print_booking_report{ display:none; } #print_enquiry_report{ display:none; } #print_associate_report{ display:none; } #print_cancellation_report{ display:none; } #booking_contacts_export{ display:none; } #booking_email_export { display:none; } #cancellation_contacts_export{ display:none; } #cancellation_email_export{ display:none; } #associate_contacts_export{ display:none; } #associate_email_export{ display:none; } #enquiry_contacts_export{ display:none; } #enquiry_email_export{ display:none; } #print_payment_report{ display:none; } #payment_contacts_export{ display:none; } #payment_email_export{ display:none; } #print_client_report{ display:none; } #print_sites_report{ display:none; } #print_loans_report{ display:none; } #print_reception_report{ display:none; } #myTab li.active a{ background:#af0100; color:white; } </style> <?php $admin_id = $this->session->userdata('admin_id'); $user_type = $this->session->userdata('user_type'); $user_type_id = $this->session->userdata('user_type_id'); // echo $user_type_id.'</br>'; $access = $this->session->userdata('powers'); $admin_array = ''; $accounts_array = ''; $executive_array = ''; $management_array = ''; $documentation_array = ''; $loan_array = ''; if($access) { foreach($access as $val) { $access_array = unserialize($val->menu_id); } } else { $access_array = ''; } ?> <script type="text/javascript"> $(document).ready(function(){ arr = '<?php if($access_array != ''){echo json_encode($access_array);}?>'; if(arr) { console.log(arr); var controls = jQuery.parseJSON(arr); } project_name = ''; $('#myTabs a').click(function (e) { e.preventDefault() $(this).tab('show') }) $('#myTabs a[href="#profile"]').tab('show') // Select tab by name $('#myTabs a:first').tab('show') // Select first tab $('#myTabs a:last').tab('show') // Select last tab $('#myTabs li:eq(2) a').tab('show') // Select third tab (0-indexed) $('.from_date_picker').datepicker({ changeMonth:true, changeYear:true, yearRange: "2000:c", dateFormat: 'dd-mm-yy' }); $('.to_date_picker').datepicker({ changeMonth:true, changeYear:true, yearRange: "2000:c", dateFormat: 'dd-mm-yy' }); //------------------Booking reports---------------------------------// $('.booking_report_form').submit(function(e){ e.preventDefault(); var from= $("#booking_from").val(); var to= $("#booking_to").val(); //alert(from); jQuery("#list3").jqGrid({ url:"<?php echo base_url('get-booking-reports');?>?from_date="+from+"&to_date="+to, type : "GET", datatype: "json", colNames:['SI','Name','Address','Mobile','Mobile2','Email','Booking date','Project','Site','Dimension','Associate','Sub Associate','Logistic','Reference','Portal'], colModel:[ {name:'booking_id',index:'booking_id', width:150, hidden:true,editable:false,key:true}, {name:'customer_name',index:'customer_name', width:125, editable:false}, {name:'address',index:'address', width:175, editable:false}, {name:'mobile1',index:'mobile1', width:150, editable:false}, {name:'mobile2',index:'mobile2', width:150, editable:false}, {name:'customer_email',index:'customer_email', width:175, editable:false}, {name:'booked_on',index:'booked_on', width:100,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'}, editable:false}, {name:'project_name',index:'project_name', width:120, editable:false}, {name:'site_number',index:'site_number', width:75,editable:false}, {name:'dimension',index:'dimension', width:75, editable:false}, {name:'associate',index:'associate', width:125, editable:false}, {name:'subassociate',index:'subassociate', width:125, editable:false}, {name:'logistics',index:'logistics', width:125, editable:false}, {name:'reference',index:'reference', width:125, editable:false}, {name:'web_portal',index:'web_portal', width:125, editable:false}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager3", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:" Booking Report", }); $("#list3").jqGrid("setLabel", "rn", "SL"); $("#list3").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list3").jqGrid('navGrid','#pager3', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { closeOnEscape: true, closeAfterSearch: true, ignoreCase: true, multipleSearch: false, multipleGroup: false, showQuery: false, sopt: ['cn', 'eq', 'ne'], defaultSearch: 'cn' }).navButtonAdd('#pager3', { caption:"Print", buttonicon:"ui-icon-print", onClickButton:print_page, position: "last", title:"", cursor: "pointer", id:"client_delete_new" } ); $("#list3").navButtonAdd('#pager3', { caption:"Export", buttonicon:"", onClickButton: export_page, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); $("#list3").navButtonAdd('#pager3', { caption:"Export Contact", buttonicon:"", onClickButton: export_contact_page, position: "last", title:"", cursor: "pointer", id:"client_delete_row" } ); $("#list3").navButtonAdd('#pager3', { caption:"Export Email", buttonicon:"", onClickButton: export_email_page, position: "last", title:"", cursor: "pointer", id:"client_delete_email" } ); function export_email_page() { //$('.export_email_table').empty(); id = jQuery("#list3").jqGrid('getDataIDs'); var from= $("#booking_from").val(); var to= $("#booking_to").val(); $.ajax({ url:"<?php echo base_url('get-booking-email-reports');?>?from_date="+from+"&to_date="+to, type : "GET", // data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; //content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile</th><th>Email</th><th>Booking date</th><th>Project</th><th>Site</th><th>Dimension</th><th>Associate</th><th>Sub Associate</th><th>Logistic</th><th>Reference</th><th>Portal</th></tr></thead>'; content +='<thead><tr><th>Sl No</th><th>Email</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_email+'</td></tr>'; count++; // }); }); // $('.export_email_table').empty(); $('.export_email_table').append(content); export_email_data(); } }); } function export_contact_page() { $('.export_contact_table').empty(); id = jQuery("#list3").jqGrid('getDataIDs'); var from= $("#booking_from").val(); var to= $("#booking_to").val(); $.ajax({ url:"<?php echo base_url('get-booking-contact-reports');?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; //content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile</th><th>Email</th><th>Booking date</th><th>Project</th><th>Site</th><th>Dimension</th><th>Associate</th><th>Sub Associate</th><th>Logistic</th><th>Reference</th><th>Portal</th></tr></thead>'; content +='<thead><tr><th>Sl No</th><th>Mobile1</th><th>Mobile2</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.mobile1+'</td><td>'+va.mobile2+'</td></tr>'; count++; // }); }); $('.export_contact_table').append(content); export_contact_data(); } }); } function export_page() { $('.export_table').empty(); id = jQuery("#list3").jqGrid('getDataIDs'); var from= $("#booking_from").val(); var to= $("#booking_to").val(); $.ajax({ url:"<?php echo base_url('get-booking-reports');?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile1</th><th>Mobile2</th><th>Email</th><th>Booking date</th><th>Project</th><th>Site</th><th>Dimension</th><th>Associate</th><th>Sub Associate</th><th>Logistic</th><th>Reference</th><th>Portal</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.mobile1+'</td><td>'+va.mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.booked_on+'</td><td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.associate+'</td><td>'+va.subassociate+'</td><td>'+va.logistics+'</td><td>'+va.reference+'</td><td>'+va.web_portal+'</td></tr>'; count++; // }); }); $('.export_table').append(content); export_data(); } }); } function export_data(){ $("#export_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Booking List", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function export_contact_data(){ $("#export_contact_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Contact List", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function export_email_data(){ $("#export_email_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Email List", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function print_page() { //alert(); var from= $("#booking_from").val(); var to= $("#booking_to").val(); id = jQuery("#list3").jqGrid('getDataIDs'); //alert(id); $.ajax({ url:"<?php echo base_url('get-booking-reports');?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile1</th><th>Mobile2</th><th>Email</th><th>Booking date</th><th>Project</th><th>Site</th><th>Dimension</th><th>Associate</th><th>Sub Associate</th><th>Logistic</th><th>Reference</th><th>Portal</th></tr></thead>'; $.each(response,function(key,va){ //$.each(val,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.mobile1+'</td><td>'+va.mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.booked_on+'</td><td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.associate+'</td><td>'+va.subassociate+'</td><td>'+va.logistics+'</td><td>'+va.reference+'</td><td>'+va.web_portal+'</td></tr>'; count++; //}); }); // alert(content); $('.print_table').append(content); print_page1(); } }); } function print_page1() { var divToPrint=document.getElementById('print_table'); newWin= window.open(""); newWin.document.write('<html><head><title></title>'); newWin.document.write('</head>'); newWin.document.write(divToPrint.outerHTML); newWin.document.write('</html>'); newWin.print(); document.getElementById('print_table').style.display=''; newWin.close(); location.reload(); } }); ////////////////////////// Graph ///////////////////////// $('.graph_report_form').submit(function(e){ e.preventDefault(); formdata = new FormData($(this)[0]); $("#booking_submit").attr('disabled', 'disabled'); $("#booking_submit").text("submitting..."); $.ajax({ type : 'post', url : '<?php echo site_url("get-booking-reports")?>', data : formdata, contentType: false, processData: false, success:function(response){ response=jQuery.parseJSON(response); console.log(response); } }); }); //------------------Enquiry reports---------------------------------// $('.enquiry_report_form').submit(function(e){ e.preventDefault(); //formdata = new FormData($(this)[0]); $("#enquiry_submit").attr('disabled', 'disabled'); $("#enquiry_submit").text("submitting..."); $("#enquiry_submit").text("Submit"); $("#enquiry_submit").removeAttr('disabled'); var from= $("#enquiry_from").val(); var to= $("#enquiry_to").val(); var type= $("#type").val(); //alert(type); if(type=='Webportal') { //alert('a'); var url="<?php echo site_url('get-enquiry-reports')?>?from_date="+from+"&to_date="+to+"&type="+type; } else if(type=='Database') { //alert('b'); var url="<?php echo site_url('get-dataenquiry-reports')?>?from_date="+from+"&to_date="+to+"&type="+type; } jQuery("#list7").jqGrid({ url:url, type : "GET", datatype: "json", colNames:['SI','Name','Address','Mobile','Mobile2','Email','Web portal/Database','Reference','Allocated date'], colModel:[ {name:'enquiry_id',index:'enquiry_id', width:150, hidden:true,editable:false,key:true}, {name:'customer_name',index:'customer_name', width:150, editable:false}, {name:'customer_address',index:'customer_address', width:150, editable:false}, {name:'customer_mobile',index:'customer_mobile', width:125, editable:false}, {name:'mobile2',index:'mobile2', width:125, editable:false}, {name:'customer_email',index:'customer_email', width:175, editable:false}, {name:'web_data',index:'web_data', width:150, editable:false}, {name:'reference',index:'reference', width:125,editable:false}, {name:'allocated_date',index:'allocated_date', width:150, formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'},editable:false}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager7", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:" Enquiry Report", }); $("#list7").jqGrid("setLabel", "rn", "SL"); $("#list7").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list7").jqGrid('navGrid','#pager7', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ).navButtonAdd('#pager7', { caption:"Print", buttonicon:"ui-icon-print", onClickButton:enquiry_print_table, position: "last", title:"", cursor: "pointer", id:"client_delete_new" } ); $("#list7").navButtonAdd('#pager7', { caption:"Export", buttonicon:"", onClickButton: enquiry_export_table, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); $("#list7").navButtonAdd('#pager7', { caption:"Export contact", buttonicon:"", onClickButton: enquiry_export_contact_table, position: "last", title:"", cursor: "pointer", id:"client_delete_con" } ); $("#list7").navButtonAdd('#pager7', { caption:"Export email", buttonicon:"", onClickButton: enquiry_export_email_table, position: "last", title:"", cursor: "pointer", id:"client_delete_email" } ); function enquiry_export_email_table() { $('.enquiry_export_email_table').empty(); id = jQuery("#list7").jqGrid('getDataIDs'); var from= $("#enquiry_from").val(); var type= $("#type").val(); //alert(type); var to= $("#enquiry_to").val(); $.ajax({ url:"<?php echo site_url('get-enquiry-email-reports')?>?from_date="+from+"&to_date="+to+"&type="+type, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Email</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_email+'</td></tr>'; count++; // }); }); $('.enquiry_export_email_table').append(content); export_table7_email(); } }); } function enquiry_export_contact_table() { $('.enquiry_export_contact_table').empty(); id = jQuery("#list7").jqGrid('getDataIDs'); var from= $("#enquiry_from").val(); var type= $("#type").val(); var to= $("#enquiry_to").val(); $.ajax({ url:"<?php echo site_url('get-enquiry-contact-reports')?>?from_date="+from+"&to_date="+to+"&type="+type, type : "GET", //data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Mobile1</th><th>Mobile2</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_mobile+'</td> <td>'+va.mobile2+'</td></tr>'; count++; // }); }); $('.enquiry_export_contact_table').append(content); export_table7_contact(); } }); } function enquiry_export_table() { $('.enquiry_export_table').empty(); id = jQuery("#list7").jqGrid('getDataIDs'); var from= $("#enquiry_from").val(); var type= $("#type").val(); var to= $("#enquiry_to").val(); if(type=='Webportal') { //alert('a'); var url="<?php echo site_url('get-enquiry-reports')?>?from_date="+from+"&to_date="+to+"&type="+type; } else if(type=='Database') { //alert('b'); var url="<?php echo site_url('get-dataenquiry-reports')?>?from_date="+from+"&to_date="+to+"&type="+type; } $.ajax({ url:url, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile1</th><th>Mobile2</th><th>Email</th><th>Web portal</th><th>Reference</th><th>Allocated date</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.customer_address+'</td><td>'+va.customer_mobile+'</td><td>'+va.mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.web_portal+'</td><td>'+va.reference+'</td><td>'+va.allocated_date+'</td></tr>'; count++; // }); }); $('.enquiry_export_table').append(content); export_table7(); } }); } function export_table7(){ $("#enquiry_export_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Enquiry Report", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function export_table7_contact(){ $("#enquiry_export_contact_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Enquiry contact", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function export_table7_email(){ $("#enquiry_export_email_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Enquiry email", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function enquiry_print_table() { //alert(); id = jQuery("#list7").jqGrid('getDataIDs'); var from= $("#enquiry_from").val(); var type= $("#type").val(); var to= $("#enquiry_to").val(); if(type=='Webportal') { alert('a'); var url="<?php echo site_url('get-enquiry-reports')?>?from_date="+from+"&to_date="+to+"&type="+type; } else if(type=='Database') { alert('b'); var url="<?php echo site_url('get-dataenquiry-reports')?>?from_date="+from+"&to_date="+to+"&type="+type; } $.ajax({ url:url, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile2</th><th>Mobile2</th><th>Email</th><th>Web portal/Database</th><th>Reference</th><th>Allocated date</th></tr></thead>'; $.each(response,function(key,va){ //$.each(val,function(key,va){ //alert(va.customer_name); content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.customer_address+'</td><td>'+va.customer_mobile+'</td> <td>'+va.mobile2+'</td><td>'+va.customer_email+'</td><td>'+va.web_data+'</td><td>'+va.reference+'</td><td>'+va.allocated_date+'</td></tr>'; count++; //}); }); // alert(content); $('.enquiry_print_table').append(content); print_page7(); } }); } function print_page7() { var divToPrint=document.getElementById('enquiry_print_table'); newWin= window.open(""); newWin.document.write('<html><head><title></title>'); newWin.document.write('</head>'); newWin.document.write(divToPrint.outerHTML); newWin.document.write('</html>'); newWin.print(); document.getElementById('enquiry_print_table').style.display=''; newWin.close(); location.reload(); } }); //------------------Associate broker reports---------------------------------// $('.associate_report_form').submit(function(e){ e.preventDefault(); //formdata = new FormData($(this)[0]); $("#associate_submit").attr('disabled', 'disabled'); $("#associate_submit").text("submitting..."); $("#associate_submit").text("Submit"); $("#associate_submit").removeAttr('disabled'); var from= $("#broker_from").val(); var to= $("#broker_to").val(); jQuery("#list6").jqGrid({ url:"<?php echo site_url('get-associate-reports');?>?from_date="+from+"&to_date="+to, type : "GET", datatype: "json", colNames:['SI','Name','Address','Mobile','Mobile2','Email','Project','Site','Dimension','Associate','Sub Associate','Commission','Payment'], colModel:[ {name:'booking_id',index:'booking_id', width:150, hidden:true,editable:false,key:true}, {name:'customer_name',index:'customer_name', width:150, editable:false}, {name:'address',index:'address', width:175, editable:false}, {name:'customer_mobile',index:'customer_mobile', width:100, editable:false}, {name:'customer_mobile2',index:'customer_mobile2', width:100, editable:false}, {name:'customer_email',index:'customer_email', width:150, editable:false}, {name:'project_name',index:'project_name', width:125, editable:false}, {name:'site_number',index:'site_number', width:100, editable:false}, {name:'dimension',index:'dimension', width:100,editable:false}, {name:'associate',index:'associate', width:100, editable:false}, {name:'subassociate',index:'subassociate', width:100, editable:false}, {name:'commission_type',index:'commission_type', width:100, editable:false}, {name:'payment_type',index:'payment_type', width:100, editable:false}, ], height: 'auto', rowNum:20, rowTotal: 2000, rowList : [20,30], rownumbers: true, rownumWidth: 40, pager:"#pager6", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", loadonce:true, caption:"Associate /Broker Report", subGrid: true, subGridRowExpanded: function(subgrid_id, row_id) { var subgrid_table_id; //alert(row_id); swan_id=row_id; //alert(swan_id); subgrid_table_id = subgrid_id+"_t"; jQuery("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>"); jQuery("#"+subgrid_table_id).jqGrid({ url:"<?php echo site_url('get-associate-payments');?>?id="+row_id, type : "GET", datatype: "json", colNames:['Id','Payment Type','Cheque No','Cheque Date','Bank Name','VTR No','Date','DD No','DD Date','Bank Name'], colModel:[ {name:'management_id',index:'management_id',hidden:true, width:50,editable:true,width:100}, {name:'payment_type',index:'payment_type', width:150,editable:true,editrules:{required: true}}, {name:'cheque_no',index:'cheque_no', width:100,editable:true,editrules:{required: true}}, {name:'cheque_date',index:'cheque_date', formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'},editable:true,editrules:{required: true},width:70}, {name:'bank_name',index:'bank_name', editable:true,editrules:{required: true},width:70}, {name:'utr_no', index:'utr_no', width:100,editable:true,editrules:{required: true}}, {name:'online_date',index:'online_date', formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'},editable:true,editrules:{required: true},width:100}, {name:'dd_no',index:'dd_no', editable:true,editrules:{required: true},width:100}, {name:'dd_date',index:'dd_date', formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'},editable:true,editrules:{required: true},width:100}, {name:'dd_bank',index:'dd_bank', editable:true,editrules:{required: true},width:100}, ], height: 'auto', rowNum:20, sortname: 'num', sortorder: "asc" }); } }); $("#list6").jqGrid("setLabel", "rn", "SL"); $("#list6").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list6").jqGrid('navGrid','#pager6', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ).navButtonAdd('#pager6', { caption:"Print", buttonicon:"ui-icon-print", onClickButton:broker_print_table, position: "last", title:"", cursor: "pointer", id:"client_delete_new" } ); $("#list6").navButtonAdd('#pager6', { caption:"Export", buttonicon:"", onClickButton: broker_export_table, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); $("#list6").navButtonAdd('#pager6', { caption:"Export Contact", buttonicon:"", onClickButton: broker_export_contact_table, position: "last", title:"", cursor: "pointer", id:"client_delete_con" } ); $("#list6").navButtonAdd('#pager6', { caption:"Export email", buttonicon:"", onClickButton: broker_export_email_table, position: "last", title:"", cursor: "pointer", id:"client_delete_email" } ); function broker_export_email_table() { $('.broker_export_email_table').empty(); id = jQuery("#list6").jqGrid('getDataIDs'); var from= $("#broker_from").val(); var to= $("#broker_to").val(); $.ajax({ url:"<?php echo site_url('get-associate-email-reports');?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Email</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_email+'</td></tr>'; count++; // }); }); $('.broker_export_email_table').append(content); export_table2_email(); } }); } function broker_export_contact_table() { $('.broker_export_contact_table').empty(); id = jQuery("#list6").jqGrid('getDataIDs'); var from= $("#broker_from").val(); var to= $("#broker_to").val(); $.ajax({ url:"<?php echo site_url('get-associate-contact-reports');?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Mobile</th><th>Mobile2</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td></tr>'; count++; // }); }); $('.broker_export_contact_table').append(content); export_table2_contact(); } }); } function broker_export_table() { $('.broker_export_table').empty(); id = jQuery("#list6").jqGrid('getDataIDs'); var from= $("#broker_from").val(); var to= $("#broker_to").val(); $.ajax({ url:"<?php echo site_url('get-associate-reports');?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile</th><th>Mobile2</th><th>Email</th><th>Project</th><th>Site</th><th>Dimension</th><th>Associate</th><th>Sub Associate</th><th>Commission</th><th>Payment</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.customer_mobile+'</td> <td>'+va.customer_mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.associate+'</td><td>'+va.subassociate+'</td><td>'+va.commission_type+'</td><td>'+va.payment_type+'</td></tr>'; count++; // }); }); $('.broker_export_table').append(content); export_table2(); } }); } function export_table2(){ $("#broker_export_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Associate/Broker Report", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function export_table2_contact(){ $("#broker_export_contact_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Export contact", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function export_table2_email(){ $("#broker_export_email_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Export email", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function broker_print_table() { //alert(); id = jQuery("#list6").jqGrid('getDataIDs'); var from= $("#broker_from").val(); var to= $("#broker_to").val(); //alert(id); $.ajax({ url:"<?php echo site_url('get-associate-reports');?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile</th><th>Mobile2</th><th>Email</th><th>Project</th><th>Site</th><th>Dimension</th><th>Associate</th><th>Sub Associate</th><th>Commission</th><th>Payment</th></tr></thead>'; $.each(response,function(key,va){ //$.each(val,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.associate+'</td><td>'+va.subassociate+'</td><td>'+va.commission_type+'</td><td>'+va.payment_type+'</td></tr>'; count++; //}); }); // alert(content); $('.broker_print_table').append(content); broker_print(); } }); } function broker_print() { var divToPrint=document.getElementById('broker_print_table'); newWin= window.open(""); newWin.document.write('<html><head><title></title>'); newWin.document.write('</head>'); newWin.document.write(divToPrint.outerHTML); newWin.document.write('</html>'); newWin.print(); document.getElementById('broker_print_table').style.display=''; newWin.close(); location.reload(); } }); //------------------Cancellation reports---------------------------------// $('.cancellation_report_form').submit(function(e){ e.preventDefault(); // formdata = new FormData($(this)[0]); $("#cancellation_submit").attr('disabled', 'disabled'); $("#cancellation_submit").text("submitting..."); $("#cancellation_submit").text("Submit"); $("#cancellation_submit").removeAttr('disabled'); var from= $("#cancellation_from").val(); var to= $("#cancellation_to").val(); jQuery("#list5").jqGrid({ url:"<?php echo site_url('get-cancellation-reports')?>?from_date="+from+"&to_date="+to, type : "GET", datatype: "json", colNames:['SI','Name','Address','Mobile','Mobile2','Email','Project','Site','Dimension','Refund Status','Payment mode','Amount','Refunded Date','Executive','Associate','Sub Associate','Due with','Cancelled on'], colModel:[ {name:'booking_id',index:'booking_id', width:150, hidden:true,editable:false,key:true}, {name:'customer_name',index:'customer_name', width:150, editable:false}, {name:'address',index:'address', width:150, editable:false}, {name:'customer_mobile',index:'customer_mobile', width:150, editable:false}, {name:'customer_mobile2',index:'customer_mobile2', width:150, editable:false}, {name:'customer_email',index:'customer_email', width:150, editable:false}, {name:'project_name',index:'project_name', width:125, editable:false}, {name:'site_number',index:'site_number', width:75, editable:false}, {name:'dimension',index:'dimension', width:75, editable:false}, {name:'refunded',index:'refunded', width:100, editable:false}, {name:'payment_type',index:'payment_type', width:100, editable:false}, {name:'refunded_amount',index:'refunded_amount', width:100, editable:false}, {name:'refunded_date',index:'refunded_date', width:100,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'}, editable:false}, {name:'executive',index:'executive', width:100, editable:false}, {name:'associate',index:'associate', width:100, editable:false}, {name:'subassociate',index:'subassociate', width:100, editable:false}, {name:'due_with',index:'due_with', width:100, editable:false}, {name:'cancelled_on',index:'cancelled_on', width:100,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'}, editable:false}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager5", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: false, subGrid: true, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:" Cancellation Report", subGridRowExpanded: function(subgrid_id, row_id) { var subgrid_table_id; //alert(row_id); swan_id=row_id; // alert(swan_id); subgrid_table_id = subgrid_id+"_t"; jQuery("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>"); jQuery("#"+subgrid_table_id).jqGrid({ url:"<?php echo site_url('cancellations-details')?>?id="+swan_id, type : "GET", datatype: "json", colNames:['SI','Refunded Payment mode','Cheque No','Cheque Date','bank_name','Vtr No','Vtr Date'], colModel:[ {name:'booking_id',index:'booking_id', width:50, hidden:true,editable:false,key:true}, {name:'payment_type',index:'payment_type', width:150, editable:false}, {name:'cheque_no',index:'cheque_no', width:150, editable:false}, {name:'cheque_date',index:'cheque_date', width:150,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'}, editable:false}, {name:'bank_name',index:'bank_name', width:150, editable:false}, {name:'vtr_no',index:'vtr_no', width:150, editable:false}, {name:'vtr_date',index:'vtr_date', width:150,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'}, editable:false}, ], height: 'auto', rowNum:20, sortname: 'num', sortorder: "asc" }); } }); $("#list5").jqGrid("setLabel", "rn", "SL"); $("#list5").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list5").jqGrid('navGrid','#pager5', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ).navButtonAdd('#pager5', { caption:"Print", buttonicon:"ui-icon-print", onClickButton:cancellation_print_table, position: "last", title:"", cursor: "pointer", id:"client_delete_new" } ); $("#list5").navButtonAdd('#pager5', { caption:"Export", buttonicon:"", onClickButton: cancellation_export_table, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); $("#list5").navButtonAdd('#pager5', { caption:"Export contact", buttonicon:"", onClickButton: cancellation_export_contact_table, position: "last", title:"", cursor: "pointer", id:"client_delete_con" } ); $("#list5").navButtonAdd('#pager5', { caption:"Export email", buttonicon:"", onClickButton: cancellation_export_email_table, position: "last", title:"", cursor: "pointer", id:"client_delete_email" } ); function cancellation_export_email_table() { $('.cancellation_export_email_table').empty(); id = jQuery("#list5").jqGrid('getDataIDs'); var from= $("#cancellation_from").val(); var to= $("#cancellation_to").val(); $.ajax({ url:"<?php echo site_url('get-cancellation-email-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Email</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_email+'</td></td></tr>'; count++; // }); }); $('.cancellation_export_email_table').append(content); cancellation_export_email(); } }); } function cancellation_export_contact_table() { $('.cancellation_export_contact_table').empty(); id = jQuery("#list5").jqGrid('getDataIDs'); var from= $("#cancellation_from").val(); var to= $("#cancellation_to").val(); $.ajax({ url:"<?php echo site_url('get-cancellation-contact-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Mobile</th><th>Mobile2</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td></td></tr>'; count++; // }); }); $('.cancellation_export_contact_table').append(content); cancellation_export_contact(); } }); } function cancellation_export_table() { $('.cancellation_export_table').empty(); id = jQuery("#list5").jqGrid('getDataIDs'); var from= $("#cancellation_from").val(); var to= $("#cancellation_to").val(); $.ajax({ url:"<?php echo site_url('get-cancellation-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile</th><th>Mobile2</th><th>Email</th><th>Project</th><th>Site</th><th>Dimension</th><th>Refund Status</th><th>Payment mode</th><th>Amount</th><th>Cheque details</th><th>Refunded Date</th><th>Executive</th><th>Associate</th><th>Sub Associate</th><th>Due with</th><th>Cancelled on</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.refunded+'</td><td>'+va.payment_type+'</td><td>'+va.refunded_amount+'</td><td>'+va.cheque_date+'</td><td>'+va.refunded_date+'</td><td>'+va.executive+'</td><td>'+va.associate+'</td><td>'+va.subassociate+'</td><td>'+va.due_with+'</td><td>'+va.cancelled_on+'</td></tr>'; count++; // }); }); $('.cancellation_export_table').append(content); cancellation_export(); } }); } function cancellation_export(){ $("#cancellation_export_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Cancellation List", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function cancellation_export_contact(){ $("#cancellation_export_contact_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Cancellation Contact List", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function cancellation_export_email(){ $("#cancellation_export_email_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Cancellation Email List", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function cancellation_print_table() { //alert(); id = jQuery("#list5").jqGrid('getDataIDs'); var from= $("#cancellation_from").val(); var to= $("#cancellation_to").val(); //alert(id); $.ajax({ url:"<?php echo site_url('get-cancellation-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile</th><th>Mobile2</th><th>Email</th><th>Project</th><th>Site</th><th>Dimension</th><th>Refund Status</th><th>Payment mode</th><th>Amount</th><th>Cheque details</th><th>Refunded Date</th><th>Executive</th><th>Associate</th><th>Sub Associate</th><th>Due with</th><th>Cancelled on</th></tr></thead>'; $.each(response,function(key,va){ //$.each(val,function(key,va){ //alert(va.customer_name); content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.refunded+'</td><td>'+va.payment_type+'</td><td>'+va.refunded_amount+'</td><td>'+va.cheque_date+'</td><td>'+va.refunded_date+'</td><td>'+va.executive+'</td><td>'+va.associate+'</td><td>'+va.subassociate+'</td><td>'+va.due_with+'</td><td>'+va.cancelled_on+'</td></tr>'; count++; //}); }); // alert(content); $('.cancellation_print_table').append(content); cancellation_print(); } }); } function cancellation_print() { var divToPrint=document.getElementById('cancellation_print_table'); newWin= window.open(""); newWin.document.write('<html><head><title></title>'); newWin.document.write('</head>'); newWin.document.write(divToPrint.outerHTML); newWin.document.write('</html>'); newWin.print(); document.getElementById('cancellation_print_table').style.display=''; newWin.close(); location.reload(); } }); //------------------Payment reports---------------------------------// $('.payment_report_form').submit(function(e){ e.preventDefault(); // formdata = new FormData($(this)[0]); $("#payment_submit").attr('disabled', 'disabled'); $("#payment_submit").text("submitting..."); $("#payment_submit").text("Submit"); $("#payment_submit").removeAttr('disabled'); var from= $("#payment_from").val(); var to= $("#payment_to").val(); jQuery("#list4").jqGrid({ url:"<?php echo site_url('get-payment-reports')?>?from_date="+from+"&to_date="+to, type : "GET", datatype: "json", colNames:['SI','Name','Address','Contact','Contact2','Email','Booked on','Project','Site','Dimension','Booking Payment','Agreement Payment','Installment Payment','Registration Payment','Subtotal'], colModel:[ {name:'booking_id',index:'booking_id', width:150, hidden:true,editable:false,key:true}, {name:'customer_name',index:'customer_name', width:150, editable:false}, {name:'address',index:'address', width:150, editable:false}, {name:'customer_mobile',index:'customer_mobile', width:150, editable:false}, {name:'customer_mobile2',index:'customer_mobile2', width:150, editable:false}, {name:'customer_email',index:'customer_email', width:175, editable:false}, {name:'booked_on',index:'booked_on', width:100,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'}, editable:false}, {name:'project_name',index:'project_name', width:125, editable:false}, {name:'site_number',index:'site_number', width:100,editable:false}, {name:'dimension',index:'dimension', width:100, editable:false}, {name:'booking_amount',index:'booking_amount ', width:100, editable:false}, {name:'agreement_amount',index:'agreement_amount', width:100, editable:false}, {name:'installment_amount',index:'installment_amount', width:100, editable:false}, {name:'registration_amount',index:'registration_amount', width:100, editable:false}, {name:'subtotal',index:'subtotal', width:100, editable:false}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager4", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:" Payment Report", }); $("#list4").jqGrid("setLabel", "rn", "SL"); $("#list4").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list4").jqGrid('navGrid','#pager4', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ).navButtonAdd('#pager4', { caption:"Print", buttonicon:"ui-icon-print", onClickButton:payment_print_table, position: "last", title:"", cursor: "pointer", id:"client_delete_new" } ); $("#list4").navButtonAdd('#pager4', { caption:"Export", buttonicon:"", onClickButton: payment_export_table, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); $("#list4").navButtonAdd('#pager4', { caption:"Export contacts", buttonicon:"", onClickButton: payment_export_contact_table, position: "last", title:"", cursor: "pointer", id:"client_delete_pay_con" } ); $("#list4").navButtonAdd('#pager4', { caption:"Export emails", buttonicon:"", onClickButton: payment_export_email_table, position: "last", title:"", cursor: "pointer", id:"client_delete_pay_email" } ); function payment_export_email_table() { $('.payment_export_email_table').empty(); id = jQuery("#list4").jqGrid('getDataIDs'); var from= $("#payment_from").val(); var to= $("#payment_to").val(); $.ajax({ url:"<?php echo site_url('get-payment-email-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Email</th></tr></thead>'; $.each(response,function(key,va){ // alert(va.subassociate); //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_email+'</td></tr>'; count++; // }); }); $('.payment_export_email_table').append(content); payment_export_email(); } }); } function payment_export_contact_table() { $('.payment_export_contact_table').empty(); id = jQuery("#list4").jqGrid('getDataIDs'); var from= $("#payment_from").val(); var to= $("#payment_to").val(); $.ajax({ url:"<?php echo site_url('get-payment-contact-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Mobile</th><th>Mobile2</th></tr></thead>'; $.each(response,function(key,va){ // alert(va.subassociate); //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td></tr>'; count++; // }); }); $('.payment_export_contact_table').append(content); payment_export_contact(); } }); } function payment_export_table() { $('.payment_export_table').empty(); id = jQuery("#list4").jqGrid('getDataIDs'); var from= $("#payment_from").val(); var to= $("#payment_to").val(); $.ajax({ url:"<?php echo site_url('get-payment-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile</th><th>Mobile2</th><th>Email</th><th>Booking date</th><th>Project</th><th>Site</th><th>Dimension</th><th>Booking Payment</th><th>Agreement Payment</th><th>Installment Payment</th><th>Registration Payment</th><th>Subtotal</th></tr></thead>'; $.each(response,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.booked_on+'</td><td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.booking_amount+'</td><td>'+va.agreement_amount+'</td><td>'+va.installment_amount+'</td><td>'+va.registration_amount+'</td><td>'+va.subtotal+'</td></tr>'; count++; // }); }); $('.payment_export_table').append(content); payment_export(); } }); } function payment_export(){ $("#payment_export_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Payment List", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function payment_export_contact(){ $("#payment_export_contact_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Payment Contact List", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function payment_export_email(){ $("#payment_export_email_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Payment Email List", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function payment_print_table() { var from= $("#payment_from").val(); var to= $("#payment_to").val(); //alert(); id = jQuery("#list4").jqGrid('getDataIDs'); //alert(id); $.ajax({ url:"<?php echo site_url('get-payment-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile</th><th>Mobile2</th><th>Email</th><th>Booking date</th><th>Project</th><th>Site</th><th>Dimension</th><th>Booking Payment</th><th>Agreement Payment</th><th>Installment Payment</th><th>Registration Payment</th><th>Subtotal</th></tr></thead>'; $.each(response,function(key,va){ //$.each(val,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.booked_on+'</td><td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.booking_amount+'</td><td>'+va.agreement_amount+'</td><td>'+va.installment_amount+'</td><td>'+va.registration_amount+'</td><td>'+va.subtotal+'</td></tr>'; count++; //}); }); // alert(content); $('.payment_print_table').append(content); payment_print(); } }); } function payment_print() { var divToPrint=document.getElementById('payment_print_table'); newWin= window.open(""); newWin.document.write('<html><head><title></title>'); newWin.document.write('</head>'); newWin.document.write(divToPrint.outerHTML); newWin.document.write('</html>'); newWin.print(); document.getElementById('payment_print_table').style.display=''; newWin.close(); location.reload(); } }); //------------------Client reports---------------------------------// $(document).ready(function (){ jQuery("#list8").jqGrid({ url:"<?php echo site_url('get-client-reports')?>", mtype : "post", datatype: "json", colNames:['SI','Name','Address','Mobile','Mobile2','Email','DOB','DOA','Project','Site number','Dimension','Booked on'], colModel:[ {name:'project_id',index:'project_id', width:150, hidden:true,editable:false,key:true}, {name:'customer_name',index:'customer_name', width:150, editable:false}, {name:'address',index:'address', width:175, editable:false}, {name:'customer_mobile',index:'customer_mobile', width:100, editable:false}, {name:'customer_mobile2',index:'customer_mobile2', width:100, editable:false}, {name:'customer_email',index:'customer_email', width:150, editable:false}, {name:'dob',index:'dob', width:100, formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'},editable:false}, {name:'doa',index:'doa', width:100,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'}, editable:false}, {name:'project_name',index:'project_name', width:125,editable:false}, {name:'site_number',index:'site_number', width:100, editable:false}, {name:'dimension',index:'dimension', width:75, editable:false}, {name:'booking_status',index:'booking_status', width:75, editable:false}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager8", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:" Client Report", }); $("#list8").jqGrid("setLabel", "rn", "SL"); $("#list8").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list8").jqGrid('navGrid','#pager8', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ).navButtonAdd('#pager8', { caption:"Print", buttonicon:"ui-icon-print", onClickButton:clients_print_table, position: "last", title:"", cursor: "pointer", id:"client_delete_new" } ); $("#list8").navButtonAdd('#pager8', { caption:"Export", buttonicon:"", onClickButton: clients_export_table, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); $("#list8").navButtonAdd('#pager8', { caption:"Export contact", buttonicon:"", onClickButton: clients_export_contact_table, position: "last", title:"", cursor: "pointer", id:"client_delete_con" } ); $("#list8").navButtonAdd('#pager8', { caption:"Export email", buttonicon:"", onClickButton: clients_export_email_table, position: "last", title:"", cursor: "pointer", id:"client_delete_email" } ); }); function clients_export_email_table() { $('.clients_export_email_table').empty(); id = jQuery("#list8").jqGrid('getDataIDs'); $.ajax({ type : 'post', url : '<?php echo site_url("get-client-email-reports")?>', data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Email</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_email+'</td></tr>'; count++; // }); }); $('.clients_export_email_table').append(content); clients_export_email(); } }); } function clients_export_contact_table() { $('.clients_export_contact_table').empty(); id = jQuery("#list8").jqGrid('getDataIDs'); $.ajax({ type : 'post', url : '<?php echo site_url("get-client-contact-reports")?>', data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Mobile</th><th>Mobile2</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td></tr>'; count++; // }); }); $('.clients_export_contact_table').append(content); clients_export_contact(); } }); } function clients_export_table() { //alert(); id = jQuery("#list8").jqGrid('getDataIDs'); $.ajax({ type : 'post', url : '<?php echo site_url("get-client-reports")?>', data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile</th><th>Mobile2</th><th>Email</th><th>DOB</th><th>DOA</th><th>Project</th><th>Site number</th><th>Dimension</th><th>Booked on</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.customer_mobile+'</td> <td>'+va.customer_mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.dob+'</td><td>'+va.doa+'</td><td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.booking_status+'</td></tr>'; count++; // }); }); $('.clients_export_table').append(content); clients_export(); } }); } function clients_export(){ $("#clients_export_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Client Report", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function clients_export_contact(){ $("#clients_export_contact_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Client contact", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function clients_export_email(){ $("#clients_export_email_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Client email", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function clients_print_table() { //alert(); id = jQuery("#list8").jqGrid('getDataIDs'); //alert(id); $.ajax({ type : 'post', url : '<?php echo site_url("get-client-reports")?>', // data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile</th><th>Mobile2</th><th>Email</th><th>DOB</th><th>DOA</th><th>Project</th><th>Site number</th><th>Dimension</th><th>Booked on</th></tr></thead>'; $.each(response,function(key,va){ //$.each(val,function(key,va){ //alert(va.customer_name); content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.dob+'</td><td>'+va.doa+'</td><td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.booking_status+'</td></tr>'; count++; //}); }); // alert(content); $('.clients_print_table').append(content); clients_print(); } }); } function clients_print() { var divToPrint=document.getElementById('clients_print_table'); newWin= window.open(""); newWin.document.write('<html><head><title></title>'); newWin.document.write('</head>'); newWin.document.write(divToPrint.outerHTML); newWin.document.write('</html>'); newWin.print(); document.getElementById('clients_print_table').style.display=''; newWin.close(); location.reload(); } //------------------Sites reports---------------------------------// $('.sites_report_form').submit(function(e){ e.preventDefault(); //formdata = new FormData($(this)[0]); $("#sites_submit").attr('disabled', 'disabled'); $("#sites_submit").text("submitting..."); $("#sites_submit").text("Submit"); $("#sites_submit").removeAttr('disabled'); var from= $("#site_from").val(); var to= $("#site_to").val(); jQuery("#list10").jqGrid({ url:"<?php echo site_url('get-sites-reports')?>?from_date="+from+"&to_date="+to, type : "GET", datatype: "json", colNames:['SI','Name','Address','Mobile','Mobile2','Email','Date','Status','Project','Site','Dimension',' Associate','Sub Associate','Logistic','Reference','Portal'], colModel:[ {name:'booking_id',index:'booking_id', width:150, hidden:true,editable:false,key:true}, {name:'customer_name',index:'customer_name', width:150, editable:false}, {name:'address',index:'address', width:150, editable:false}, {name:'customer_mobile',index:'customer_mobile', width:100, editable:false}, {name:'customer_mobile2',index:'customer_mobile2', width:100, editable:false}, {name:'customer_email',index:'customer_email', width:150, editable:false}, {name:'registration_date',index:'registration_date', width:100,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'}, editable:false}, {name:'booking_status',index:'booking_status', width:100, editable:false}, {name:'project_name ',index:'project_name', width:150,editable:false}, {name:'site_number',index:'site_number', width:75, editable:false}, {name:'dimension',index:'dimension', width:75, editable:false}, {name:'associate',index:'associate', width:100, editable:false}, {name:'subassociate',index:'subassociate', width:100, editable:false}, {name:'logistics',index:'logistics', width:100, editable:false}, {name:'reference',index:'reference', width:100, editable:false}, {name:'web_portal',index:'web_portal', width:100, editable:false}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager10", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:" Site Report", }); $("#list10").jqGrid("setLabel", "rn", "SL"); $("#list10").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list10").jqGrid('navGrid','#pager10', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ).navButtonAdd('#pager10', { caption:"Print", buttonicon:"ui-icon-print", onClickButton:sites_print_table, position: "last", title:"", cursor: "pointer", id:"client_delete_new" } ); $("#list10").navButtonAdd('#pager10', { caption:"Export", buttonicon:"", onClickButton: sites_export_table, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); $("#list10").navButtonAdd('#pager10', { caption:"Export contact", buttonicon:"", onClickButton: sites_export_contact_table, position: "last", title:"", cursor: "pointer", id:"client_delete_con" } ); $("#list10").navButtonAdd('#pager10', { caption:"Export email", buttonicon:"", onClickButton: sites_export_email_table, position: "last", title:"", cursor: "pointer", id:"client_delete_email" } ); function sites_export_email_table() { $('.sites_export_email_table').empty(); id = jQuery("#list10").jqGrid('getDataIDs'); var from= $("#site_from").val(); var to= $("#site_to").val(); $.ajax({ url:"<?php echo site_url('get-sites-email-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Email</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_email+'</td></tr>'; count++; // }); }); $('.sites_export_email_table').append(content); sites_export_email(); } }); } function sites_export_contact_table() { $('.sites_export_contact_table').empty(); id = jQuery("#list10").jqGrid('getDataIDs'); var from= $("#site_from").val(); var to= $("#site_to").val(); $.ajax({ url:"<?php echo site_url('get-sites-contact-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Mobile</th><th>Mobile2</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td></tr>'; count++; // }); }); $('.sites_export_contact_table').append(content); sites_export_contact(); } }); } function sites_export_table() { $('.sites_export_table').empty(); id = jQuery("#list10").jqGrid('getDataIDs'); var from= $("#site_from").val(); var to= $("#site_to").val(); $.ajax({ url:"<?php echo site_url('get-sites-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile</th><th>Mobile2</th><th>Email</th><th>Date</th><th>Status</th><th>Project</th><th>Site</th><th>Dimension</th><th>Associate</th><th>Sub Associate</th><th>Logistic</th><th>Reference</th><th>Portal</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.registration_date+'</td><td>'+va.booking_status+'</td><td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.associate+'</td><td>'+va.subassociate+'</td><td>'+va.logistics+'</td><td>'+va.reference+'</td><td>'+va.web_portal+'</td></tr>'; count++; // }); }); $('.sites_export_table').append(content); sites_export(); } }); } function sites_export(){ $("#sites_export_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Site Report", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function sites_export_contact(){ $("#sites_export_contact_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Site contact", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function sites_export_email(){ $("#sites_export_email_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Site email", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function sites_print_table() { //alert(); id = jQuery("#list10").jqGrid('getDataIDs'); var from= $("#site_from").val(); var to= $("#site_to").val(); //alert(id); $.ajax({ url:"<?php echo site_url('get-sites-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Mobile</th><th>Mobile2</th><th>Email</th><th>Date</th><th>Status</th><th>Project</th><th>Site</th><th>Dimension</th><th>Associate</th><th>Sub Associate</th><th>Logistic</th><th>Reference</th><th>Portal</th></tr></thead>'; $.each(response,function(key,va){ //$.each(val,function(key,va){ //alert(va.customer_name); content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td> <td>'+va.customer_email+'</td><td>'+va.registration_date+'</td><td>'+va.booking_status+'</td><td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.associate+'</td><td>'+va.subassociate+'</td><td>'+va.logistics+'</td><td>'+va.reference+'</td><td>'+va.web_portal+'</td></tr>'; count++; //}); }); // alert(content); $('.sites_print_table').append(content); sites_print(); } }); } function sites_print() { var divToPrint=document.getElementById('sites_print_table'); newWin= window.open(""); newWin.document.write('<html><head><title></title>'); newWin.document.write('</head>'); newWin.document.write(divToPrint.outerHTML); newWin.document.write('</html>'); newWin.print(); document.getElementById('sites_print_table').style.display=''; newWin.close(); location.reload(); } }); //------------------Loans reports---------------------------------// $(document).ready(function (){ jQuery("#list11").jqGrid({ url:"<?php echo site_url('get-loans-reports')?>", mtype : "post", datatype: "json", colNames:['SI','Customer','Contact','Contact2','Project','Site','Dimension','Booked On','Disbursed amount','Financial institution','Applied on','Sanctioned Date','Disbursed Date','Remarks'], colModel:[ {name:'project_id',index:'project_id', width:150, hidden:true,editable:false,key:true}, {name:'customer_name',index:'customer_name', width:150, editable:false}, {name:'customer_mobile',index:'customer_mobile', width:150, editable:false}, {name:'customer_mobile2',index:'customer_mobile2', width:150, editable:false}, {name:'project_name',index:'project_name', width:150, editable:false}, {name:'site_number',index:'site_number', width:75, editable:false}, {name:'dimension',index:'dimension', width:75, editable:false}, {name:'booked_on',index:'booked_on', width:100,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'}, editable:false}, {name:'disbursed_cheque_amount',index:'disbursed_cheque_amount', width:100, editable:false}, {name:'financial_institution',index:'financial_institution', width:150,editable:false}, {name:'applied_on',index:'applied_on', width:100,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'}, editable:false}, {name:'sanctioned_date',index:'sanctioned_date', width:100,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'}, editable:false}, {name:'disbursed_date',index:'disbursed_date', width:100,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'}, editable:false}, {name:'remarks',index:'remarks', width:100, editable:false}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager11", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:" Loan Report", }); $("#list11").jqGrid("setLabel", "rn", "SL"); $("#list11").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list11").jqGrid('navGrid','#pager11', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ).navButtonAdd('#pager11', { caption:"Print", buttonicon:"ui-icon-print", onClickButton:loans_print_table, position: "last", title:"", cursor: "pointer", id:"client_delete_new" } ); $("#list11").navButtonAdd('#pager11', { caption:"Export", buttonicon:"", onClickButton: loans_export_table, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); $("#list11").navButtonAdd('#pager11', { caption:"Export contact", buttonicon:"", onClickButton: loans_export_contact_table, position: "last", title:"", cursor: "pointer", id:"client_delete_con" } ); $("#list11").navButtonAdd('#pager11', { caption:"Export email", buttonicon:"", onClickButton: loans_export_email_table, position: "last", title:"", cursor: "pointer", id:"client_delete_email" } ); }); function loans_export_email_table() { $('.loan_export_email_table').empty(); id = jQuery("#list11").jqGrid('getDataIDs'); $.ajax({ type : 'post', url : '<?php echo site_url("get-loans-email-reports")?>', data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Email</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_email+'</td></tr>'; count++; // }); }); $('.loan_export_email_table').append(content); loans_export_email(); } }); } function loans_export_contact_table() { //alert(); id = jQuery("#list11").jqGrid('getDataIDs'); $.ajax({ type : 'post', url : '<?php echo site_url("get-loans-contact-reports")?>', data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Contact</th><th>Contact2</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td></tr>'; count++; // }); }); $('.loan_export_contact_table').append(content); loans_export_contact(); } }); } function loans_export_table() { $('.loan_export_table').empty(); id = jQuery("#list11").jqGrid('getDataIDs'); $.ajax({ type : 'post', url : '<?php echo site_url("get-loans-reports")?>', data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Customer</th><th>Contact</th><th>Contact2</th><th>Project</th><th>Site</th><th>Dimension</th><th>Booked On</th><th>Disbursed amount</th><th>Financial institution</th><th>Applied on</th><th>Sanctioned Date</th><th>Disbursed Date</th><th>Remarks</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.customer_mobile+'</td> <td>'+va.customer_mobile2+'</td><td>'+va.project_name+'</td> <td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.booked_on+'</td><td>'+va.disbursed_cheque_amount+'</td><td>'+va.financial_institution+'</td><td>'+va.applied_on+'</td><td>'+va.sanctioned_date+'</td><td>'+va.disbursed_date+'</td><td>'+va.remarks+'</td></tr>'; count++; // }); }); $('.loan_export_table').append(content); loans_export(); } }); } function loans_export(){ $("#loan_export_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Loan Report", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function loans_export_contact(){ $("#loan_export_contact_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Loan contact", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function loans_export_email(){ $("#loan_export_email_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Loan email", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function loans_print_table() { //alert(); id = jQuery("#list11").jqGrid('getDataIDs'); //alert(id); $.ajax({ type : 'post', url : '<?php echo site_url("get-loans-reports")?>', data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Customer</th><th>Contact</th><th>Contact2</th><th>Project</th><th>Site</th><th>Dimension</th><th>Booked On</th><th>Disbursed amount</th><th>Financial institution</th><th>Applied on</th><th>Sanctioned Date</th><th>Disbursed Date</th><th>Remarks</th></tr></thead>'; $.each(response,function(key,va){ //$.each(val,function(key,va){ //alert(va.customer_name); content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.customer_mobile+'</td> <td>'+va.customer_mobile2+'</td><td>'+va.project_name+'</td> <td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.booked_on+'</td><td>'+va.disbursed_cheque_amount+'</td><td>'+va.financial_institution+'</td><td>'+va.applied_on+'</td><td>'+va.sanctioned_date+'</td><td>'+va.disbursed_date+'</td><td>'+va.remarks+'</td></tr>'; count++; //}); }); // alert(content); $('.loan_print_table').append(content); loans_print(); } }); } function loans_print() { var divToPrint=document.getElementById('loan_print_table'); newWin= window.open(""); newWin.document.write('<html><head><title></title>'); newWin.document.write('</head>'); newWin.document.write(divToPrint.outerHTML); newWin.document.write('</html>'); newWin.print(); document.getElementById('loans_print_table').style.display=''; newWin.close(); location.reload(); } //-----------------------------------------------------Report Status-----------------------------------// $(document).ready(function(){ jQuery("#list13").jqGrid({ url:"<?php echo site_url('get-status-reports')?>", mtype : "post", datatype: "json", colNames:['SI','Customer','Contact','Project','Site','Booked Date','Agree Due Date','Reg Due Date','Source','Bank','Associate','Sub Associate','Reference','Logistic','Portal'], colModel:[ {name:'broker_id',index:'broker_id', width:150, hidden:true,editable:false,key:true}, {name:'customer_name',index:'customer_name', width:150, editable:false}, {name:'customer_mobile',index:'customer_mobile', width:150, editable:false}, {name:'project_name',index:'project_name', width:150, editable:false}, {name:'site_number',index:'site_number', width:75, editable:false}, {name:'booked_on',index:'booked_on', width:100, editable:false}, {name:'sales_agreement_due_date',index:'sales_agreement_due_date', width:100, editable:false}, {name:'registration_due_date',index:'registration_due_date', width:100,editable:false}, {name:'source_type',index:'source_type', width:100, editable:false}, {name:'source_bank_name',index:'source_bank_name', width:150,editable:false}, {name:'associate',index:'associate', width:100, editable:false}, {name:'subassociate',index:'subassociate', width:150,editable:false}, {name:'reference',index:'reference', width:100, editable:false}, {name:'logistics',index:'logistics', width:150,editable:false}, {name:'web_portal',index:'web_portal', width:150,editable:false}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager13", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:"Report Status", }); $("#list13").jqGrid("setLabel", "rn", "SL"); $("#list13").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list13").jqGrid('navGrid','#pager13', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ).navButtonAdd('#pager13', { caption:"Print", buttonicon:"ui-icon-print", onClickButton:status_print_table, position: "last", title:"", cursor: "pointer", id:"client_delete_new" } ); $("#list13").navButtonAdd('#pager13', { caption:"Export", buttonicon:"", onClickButton: status_export_table, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); function loans_export_table() { $('.loans_export_table').empty(); id = jQuery("#list13").jqGrid('getDataIDs'); $.ajax({ type : 'post', url : '<?php echo site_url("get-loans-reports")?>', data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Customer</th><th>Contact</th><th>Project</th><th>Site</th><th>Dimension</th><th>Booked On</th><th>Disbursed amount</th><th>Financial institution</th><th>Applied on</th><th>Sanctioned Date</th><th>Disbursed Date</th><th>Remarks</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.customer_mobile+'</td><td>'+va.project_name+'</td> <td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.booked_on+'</td><td>'+va.disbursed_cheque_amount+'</td><td>'+va.financial_institution+'</td><td>'+va.applied_on+'</td><td>'+va.sanctioned_date+'</td><td>'+va.disbursed_date+'</td><td>'+va.remarks+'</td></tr>'; count++; // }); }); $('.loans_export_table').append(content); loans_export(); } }); } function loans_export(){ $("#loans_export_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Loan Report", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function loans_print_table() { //alert(); id = jQuery("#list13").jqGrid('getDataIDs'); //alert(id); $.ajax({ type : 'post', url : '<?php echo site_url("get-loans-reports")?>', data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Customer</th><th>Contact</th><th>Project</th><th>Site</th><th>Dimension</th><th>Booked On</th><th>Disbursed amount</th><th>Financial institution</th><th>Applied on</th><th>Sanctioned Date</th><th>Disbursed Date</th><th>Remarks</th></tr></thead>'; $.each(response,function(key,va){ //$.each(val,function(key,va){ //alert(va.customer_name); content +='<tr><td>'+count+'</td> <td>'+va.customer_name+'</td> <td>'+va.customer_mobile+'</td><td>'+va.project_name+'</td> <td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.booked_on+'</td><td>'+va.disbursed_cheque_amount+'</td><td>'+va.financial_institution+'</td><td>'+va.applied_on+'</td><td>'+va.sanctioned_date+'</td><td>'+va.disbursed_date+'</td><td>'+va.remarks+'</td></tr>'; count++; //}); }); // alert(content); $('.loans_print_table').append(content); loans_print(); } }); } function loans_print() { var divToPrint=document.getElementById('loans_print_table'); newWin= window.open(""); newWin.document.write('<html><head><title></title>'); newWin.document.write('</head>'); newWin.document.write(divToPrint.outerHTML); newWin.document.write('</html>'); newWin.print(); document.getElementById('loans_print_table').style.display=''; newWin.close(); location.reload(); } }); //--------------------------Reception-----------------------------------// $(".project_list").change(function(){ var project_id = $('.project_list :selected').val(); Sites(project_id); }); $(".rec_project").change(function(){ var project_id = $('.rec_project :selected').val(); Sites(project_id); }); $(".status_report").change(function(){ var project_id = $('.status_report :selected').val(); Sites(project_id); }); $('.reception_report_form').submit(function(e){ e.preventDefault(); //formdata = new FormData($(this)[0]); $("#reception_submit").attr('disabled', 'disabled'); $("#reception_submit").text("submitting..."); $("#reception_submit").text("Submit"); $("#reception_submit").removeAttr('disabled'); var from= $("#reception_from").val(); var to= $("#reception_to").val(); jQuery("#list12").jqGrid({ url:"<?php echo site_url('get-reception-reports')?>?from_date="+from+"&to_date="+to, type : "GET", datatype: "json", colNames:['SI','Name','Address','Contact','Contact2','Project','Site','Dimension','Document dispatched','Dispatched date','Created at'], colModel:[ {name:'project_id',index:'project_id', width:150, hidden:true,editable:false,key:true}, {name:'customer_name',index:'customer_name', width:150, editable:false}, {name:'address',index:'address', width:150, editable:false}, {name:'customer_mobile',index:'customer_mobile', width:150, editable:false}, {name:'customer_mobile2',index:'customer_mobile2', width:150, editable:false}, {name:'project_name',index:'project_name', width:150, editable:false}, {name:'site_number',index:'site_number', width:75, editable:false}, {name:'dimension',index:'dimension', width:75, editable:false}, {name:'dispatched_type',index:'dispatched_type', width:100, editable:false}, {name:'dispatched_date',index:'dispatched_date', width:100,formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'},editable:false}, {name:'reception_at',index:'reception_at', width:100, formatter: 'date', formatoptions: { srcformat: 'Y/m/d', newformat: 'd/m/Y'},editable:false}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager12", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:" Reception Report", }); $("#list12").jqGrid("setLabel", "rn", "SL"); $("#list12").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list12").jqGrid('navGrid','#pager12', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ).navButtonAdd('#pager12', { caption:"Print", buttonicon:"ui-icon-print", onClickButton: reception_print_table, position: "last", title:"", cursor: "pointer", id:"client_delete_new" } ); $("#list12").navButtonAdd('#pager12', { caption:"Export", buttonicon:"", onClickButton: reception_export_table, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); $("#list12").navButtonAdd('#pager12', { caption:"Export contact", buttonicon:"", onClickButton: reception_export_contact_table, position: "last", title:"", cursor: "pointer", id:"client_delete_con" } ); $("#list12").navButtonAdd('#pager12', { caption:"Export email", buttonicon:"", onClickButton: reception_export_email_table, position: "last", title:"", cursor: "pointer", id:"client_delete_email" } ); function reception_export_email_table() { $('.reception_export_email_table').empty(); id = jQuery("#list12").jqGrid('getDataIDs'); var from= $("#reception_from").val(); var to= $("#reception_to").val(); $.ajax({ url:"<?php echo site_url('get-reception-email-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Email</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_email+'</td> </tr>'; count++; // }); }); $('.reception_export_email_table').append(content); reception_export_email(); } }); } function reception_export_contact_table() { $('.reception_export_contact_table').empty(); id = jQuery("#list12").jqGrid('getDataIDs'); var from= $("#reception_from").val(); var to= $("#reception_to").val(); $.ajax({ url:"<?php echo site_url('get-reception-contact-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Contact</th><th>Contact2</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td> </tr>'; count++; // }); }); $('.reception_export_contact_table').append(content); reception_export_contact(); } }); } function reception_export_table() { $('.reception_export_table').empty(); id = jQuery("#list12").jqGrid('getDataIDs'); var from= $("#reception_from").val(); var to= $("#reception_to").val(); $.ajax({ url:"<?php echo site_url('get-reception-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Contact</th><th>Contact2</th><th>Project</th><th>Site</th><th>Dimension</th><th>Document dispatched</th><th>Dispatched date</th><th>Created at</th></tr></thead>'; $.each(response,function(key,va){ //$.each(vas,function(key,va){ content +='<tr><td>'+count+'</td><td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td> <td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.dispatched_type+'</td><td>'+va.dispatched_date+'</td><td>'+va.reception_at+'</td></tr>'; count++; // }); }); $('.reception_export_table').append(content); reception_export(); } }); } function reception_export(){ $("#reception_export_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Reception Report", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function reception_export_contact(){ $("#reception_export_contact_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Reception contact", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function reception_export_email(){ $("#reception_export_email_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Reception email", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } function reception_print_table() { //alert(); id = jQuery("#list12").jqGrid('getDataIDs'); var from= $("#reception_from").val(); var to= $("#reception_to").val(); //alert(id); $.ajax({ url:"<?php echo site_url('get-reception-reports')?>?from_date="+from+"&to_date="+to, type : "GET", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); console.log(response); var count =1; var content = ''; content +='<thead><tr><th>Sl No</th><th>Name</th><th>Address</th><th>Contact</th><th>Contact2</th><th>Project</th><th>Site</th><th>Dimension</th><th>Document dispatched</th><th>Dispatched date</th><th>Created at</th></tr></thead>'; $.each(response,function(key,va){ //$.each(val,function(key,va){ //alert(va.customer_name); content +='<tr><td>'+count+'</td><td>'+va.customer_name+'</td> <td>'+va.address+'</td><td>'+va.customer_mobile+'</td><td>'+va.customer_mobile2+'</td> <td>'+va.project_name+'</td><td>'+va.site_number+'</td><td>'+va.dimension+'</td><td>'+va.dispatched_type+'</td><td>'+va.dispatched_date+'</td><td>'+va.reception_at+'</td></tr>'; count++; //}); }); // alert(content); $('.reception_print_table').append(content); reception_print(); } }); } function reception_print() { var divToPrint=document.getElementById('reception_print_table'); newWin= window.open(""); newWin.document.write('<html><head><title></title>'); newWin.document.write('</head>'); newWin.document.write(divToPrint.outerHTML); newWin.document.write('</html>'); newWin.print(); document.getElementById('reception_print_table').style.display=''; newWin.close(); location.reload(); } }); function Sites(project_id){ $.ajax({ type : 'post', url : '<?php echo site_url("single-project-sites")?>', data : {project_id:project_id}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { var options = ''; options += '<option value="0">Select site</option>'; $.each(response.sites,function(idx,vx){ options += '<option value="'+vx.site_number+'">'+vx.site_number+'</option>'; }); $(".sites_list").html(options); } else { $(".sites_list").empty(); } } }); } $.ajax({ type : 'get', url : '<?php echo site_url("get-menu-list")?>', success:function(response){ response=jQuery.parseJSON(response); if(response.result==1) { $.each(response.menu_list,function(idx,vx){ $("#m"+vx.menu_id).css("display","none"); }); CallAccess(); } } }); function CallAccess() { $.each(controls,function(key,val){ $("#m"+val).css("display","block"); }); } $(".pt_project").change(function(){ var project_id = $('.pt_project :selected').val(); Sites1(project_id); }); function Sites1(project_id){ $.ajax({ type : 'post', url : '<?php echo site_url("single-project-sites")?>', data : {project_id:project_id}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { var options = ''; options += '<option value="0">Select site</option>'; $.each(response.sites,function(idx,vx){ options += '<option value="'+vx.site_number+'">'+vx.site_number+'</option>'; }); $(".pay_sites").html(options); } else { $(".pay_sites").empty(); } } }); } $(".brok_project").change(function(){ var project_id = $('.brok_project :selected').val(); Sites2(project_id); }); function Sites2(project_id){ $.ajax({ type : 'post', url : '<?php echo site_url("single-project-sites")?>', data : {project_id:project_id}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { var options = ''; options += '<option value="0">Select site</option>'; $.each(response.sites,function(idx,vx){ options += '<option value="'+vx.site_number+'">'+vx.site_number+'</option>'; }); $(".broker_sites").html(options); } else { $(".broker_sites").empty(); } } }); } }); $('.sales_form').submit(function(e){ e.preventDefault(); formdata = new FormData($(this)[0]); $("#sales_submit").attr('disabled', 'disabled'); $("#sales_submit").text("submitting..."); $.ajax({ type : 'post', url : '<?php echo site_url("executive-sales-for-chart")?>', data : formdata, contentType: false, processData: false, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { $("#sales_submit").text("Submit"); $("#sales_submit").removeAttr('disabled'); chart_data = response; drawMouseoverVisualization(); } else { $("#sales_submit").text("Submit"); $("#sales_submit").removeAttr('disabled'); } } }); }); // barsVisualization must be global in our script tag to be able // to get and set selection. var barsVisualization; function drawMouseoverVisualization() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Project'); data.addColumn('number', 'Total sqft booked'); var tot=0; $.each(chart_data.all_sales, function (idx, vx) { var cat = vx.project; var sales = parseFloat(vx.dimension); data.addRows([[cat, sales]]); if(vx.dimension !=null) { var tot=parseFloat(vx.dimension); $(".total").val(tot); } }); barsVisualization = new google.visualization.ColumnChart(document.getElementById('revenue-chart')); barsVisualization.draw(data, null); // Add our over/out handlers. google.visualization.events.addListener(barsVisualization, 'onmouseover', barMouseOver); google.visualization.events.addListener(barsVisualization, 'onmouseout', barMouseOut); } function barMouseOver(e) { barsVisualization.setSelection([e]); } function barMouseOut(e) { barsVisualization.setSelection([{'row': null, 'column': null}]); } //-----------------------------------------------------------------// </script> <!-- <link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet"> --> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript">google.load('visualization', '1.0', {'packages': ['corechart']});</script> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <style> #ui-datepicker-div{ z-index:999 !important; } </style> <script> $(".project_list").change(function(){ var project_id = $('.project_list :selected').val(); //CallAjax(project_id); Sites(project_id); }); $(".status_report").change(function(){ var project_id = $('.status_report :selected').val(); //CallAjax(project_id); Sites(project_id); }); function Sites(project_id){ $.ajax({ type : 'post', url : '<?php echo site_url("single-project-sites")?>', data : {project_id:project_id}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { var options = ''; options += '<option value="0">Select site</option>'; $.each(response.sites,function(idx,vx){ options += '<option value="'+vx.site_number+'">'+vx.site_number+'</option>'; }); $(".sites_list").html(options); $(".sites_list").change(function(){ var projectid = $(".project_list :selected").val(); var site_number = $(this).val(); //alert(site_number); // $.ajax({ // type : 'post', // url : '<?php echo site_url("single-site-details")?>', // data : {site_number:site_number}, // success:function(response){ // } window.location = '<?php echo site_url("single-site-details")?>/'+projectid+'/'+site_number; }); } else { $(".sites_list").empty(); } } }); } </script> <style> #jaytab3 { overflow-x: scroll !important; } </style> <style> #search_list6 { display:none !important; } #list6_122_t { height:0px !important; } .scroll { height:12px !important; } #gbox_list6_251_t { height:auto !important; } #list6 { width: 1050px; height: 0px !important; } #gbox_list6 { height: auto !important; } #gview_list6 { height: auto !important; } @media only screen and (min-width:320px) and (max-width:641px){ .ui-jqgrid { margin-left: 1px !important; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 100% !important; padding-left: 0 !important; } #editmodlist6 { width:90% !important; } #sData span, #cData span { margin-left: 0 !important; } } @media only screen and (min-width:641px) and (max-width:991px){ .ui-jqgrid { margin-left: 1px !important; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 100% !important; padding-left:0 !important; padding-right:9px !important; } } #sData span, #cData span { margin-left: 3px; } #sData { height: 29px; } #cData { height: 29px; } .jqgfirstrow { height: 0px !important; } .ui-corner-all { float:left; } </style> <?php echo view('includes/footer');?>