function addCompany() { //showLog("handleLogin"); $ret = array('op' => 'addcompany', 'msg' => 'Company Added Successfully', 'error_code' => '0'); $session_dao = new DAOsession(); $session_dao->get($current_session); $dao = new DAOcompany(); $vo = new company($_SESSION["uid"], $_POST["title"], $_POST["phone"], $_POST["city"], $_POST["state"], $_POST["pin_code"], $_POST["country"], $_POST["address"]); if (isset($_POST["comp_id"])) { $vo->comp_id = $_POST["comp_id"]; } $dao->save($vo); $comp = $dao->get($_SESSION["uid"]); if ($comp == NULL) { $ret["error_code"] = "1"; $ret["msg"] = "Error Occured Or Company Not Created "; } else { $ret["comp_id"] = $comp->comp_id; } echo json_encode($ret); }
return true; } </script> <?php include "header.php"; include "class.company.dao.php"; ?> <center> <h3>Add Company</h3> <form name = "frmCompany" method="POST" action="save.company.php" onsubmit = "return validateCompany();"> <table cellspacing="5" cellpadding="5"> <?php if (isset($_GET["id"])) { $dao = new DAOcompany(); $vo = $dao->get($_GET["id"]); ?> <tr> <td> Title </td> <td><input type = "text" name = "title" value= "<?php echo $vo->title; ?> "/></td> </tr> <tr> <td> Phone </td> <td><input type = "text" name = "phone" value= "<?php echo $vo->phone; ?> "/></td> </tr>
<?php include "db.php"; include "class.dispatch.dao.php"; include "class.company.dao.php"; $dao = new DAOdispatch(); $daoCompany = new DAOcompany(); if (isset($_GET["id"])) { $vo = $dao->get($_GET["id"]); } $vo_comp = $daoCompany->get($vo->carrier); $inv_date = date('Y-m-d'); $bal = $vo->total - $vo->advance; ?> <!DOCTYPE html> <html lang="en"> <head> <title>Your Invoice</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </head> <body> <div style="width:595px;"> <div class="container">