Example #1
0
// include the form element helpers
include_once "FormsUtil.php";
// include the pulldown helpers
include_once "Pulldown.php";
// get the user session helper object
include_once 'UserHelper.php';
// include the dump utils
include_once 'DumpUtils.php';
// get the user info object from the session
$userInfo = getUserSessionObj();
// get whether they clicked proceed or poosible funding info
getExtraParams(array("CompanyID", "IPODate", "IPOValue", "IPORaised", "Date", "Amount", "FinancingType", "FinancingProvider1", "FinancingProvider2", "FinancingProvider3", "FinancingProvider4", "DataSource", "MergerState", "MergerAmount", "MergerDate", "MergerSource", "AcquisitionSource", "AcquisitionAmount", "AcquisitionDate", "Refresh", "AddFunding", "AddSelectedFunding", "FundingID", "FundingSourceID", "FundingSource", "FundingTypeID", "FundingType", "AwardDate", "AwardAmount", "Comment", "Remove"));
// did we get a company name
if (isset($CompanyID)) {
    // get the company name
    $companyName = getCompanyName($CompanyID);
    // set the title name to be displayed in the header
    $title = "Funding data for company: " . $companyName . ". Company ID: " . $CompanyID;
} else {
    $title = "Funding data";
}
// add the jqx workflow list script which generates the jqxgrid
$scripts = "<script type=\"text/javascript\" src=\"CompanyFunding.js\" />";
// is this a post to add a new funding
if (isset($AddFunding)) {
    // validation
    if (isset($CompanyID) && !empty($CompanyID)) {
        // redirect to the company detail page
        header("Location: FundingDetails.php?CompanyID=" . $CompanyID);
        // terminate processing
        die;
 public function renderDataTable()
 {
     try {
         $engine = EngineAPI::singleton();
         $localvars = localvars::getInstance();
         $validate = new validate();
         $dataRecord = self::getRecords();
         $root = $localvars->get('root');
         $records = "";
         foreach ($dataRecord as $data) {
             $records .= sprintf("<tr>\n                                        <td>%s</td>\n                                        <td>%s</td>\n                                        <td>%s</td>\n                                        <td>%s</td>\n                                        <td>%s</td>\n                                        <td>%s</td>\n                                        <td> <a href='%s/projects/edit/%s'> <span class='glyphicon glyphicon-edit'></span> </a> </td>\n                                        <td> <a href='%s/projects/confirmDelete/%s'> <span class='glyphicon glyphicon-trash'></span> </a></td>\n                                    </tr>", $data['projectName'], getCompanyName($data['customerID']), $data['scope'], $data['type'], $data['description'], $data['completed'] < 1 ? 'No' : 'Yes', $root, $data['projectID'], $root, $data['projectID']);
         }
         $output = sprintf("<div class='dataTable table-responsive'>\n                                        <table class='table table-striped'>\n                                            <thead>\n                                                <tr class='info'>\n                                                    <th> Project Name </th>\n                                                    <th> Customer Name </th>\n                                                    <th> Scope </th>\n                                                    <th> Type </th>\n                                                    <th> Description  </th>\n                                                    <th> Completed</th>\n                                                    <th> </th>\n                                                    <th> </th>\n                                                </tr>\n                                            </thead>\n                                            <tbody>\n                                                %s\n                                            </tbody>\n                                        </table>\n                                    </div>", $records);
         return $output;
     } catch (Exception $e) {
         errorHandle::errorMsg($e->getMessage());
         return $e->getMessage();
     }
 }
Example #3
0
function getPostings($user)
{
    // $postings = []; // return json object:
    $ids = [];
    $titles = [];
    $urls = [];
    $locations = [];
    $companies = [];
    $sources = [];
    $mysqli = connectToDB();
    $query = "select id,title,url,location,company,source from postings where user={$user} ";
    if ($statement = $mysqli->prepare($query)) {
        $statement->execute();
        // bind results
        $statement->bind_result($id, $title, $url, $locationId, $companyId, $source);
        while ($statement->fetch()) {
            array_push($ids, $id);
            array_push($titles, $title);
            array_push($urls, $url);
            $locationName = getLocationName($locationId);
            array_push($locations, $locationName);
            $companyName = getCompanyName($companyId);
            array_push($companies, $companyName);
            # will need to edit this
            array_push($sources, $source);
        }
    }
    mysqli_close($mysqli);
    // associate arrays
    $postings = array("ids" => $ids, "titles" => $titles, "urls" => $urls, "locations" => $locations, "companies" => $companies, "sources" => $sources);
    echo json_encode($postings);
}
 public function issuepayslipsAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $session = SessionWrapper::getInstance();
     $formvalues = $this->_getAllParams();
     // debugMessage($formvalues); exit;
     $config = Zend_Registry::get("config");
     // generate the payslips silently via ajax
     $payroll = new Payroll();
     $payroll->populate($this->_getParam('id'));
     $employees = $payroll->getdetails();
     // debugMessage($employees->toArray());
     foreach ($employees as $employee) {
         if ($employee->getIsIgnored() != 1 && $employee->getNetPay() > 0) {
             // ignore users who are skipped on payroll or have 0 netpay
             $payrolldetailid = $employee->getID();
             $path = $employee->getPDFPath();
             $pdfurl = $this->view->serverUrl($this->view->baseUrl('user/view/id/' . encode($employee->getUserID()) . '/tab/payment/payrollid/' . $payrolldetailid . '/ref/view/print/1/pgc/1/payslipview/1/pdf/1/source/payroll'));
             // debugMessage($pdfurl);
             $pdfresult = trim(file_get_contents($pdfurl));
             $html = decode($pdfresult);
             // debugMessage($html); // exit;
             if (!isEmptyString($html)) {
                 try {
                     $mpdfpath = BASE_PATH . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'mpdf' . DIRECTORY_SEPARATOR . 'mpdf.php';
                     // debugMessage('pdf '.$mpdfpath);
                     ini_set('memory_limit', '128M');
                     require_once $mpdfpath;
                     // ob_get_clean();
                     $mpdf = new mPDF('win-1252', 'A4', '', '', 20, 15, 40, 20, 10, 10);
                     $mpdf->useOnlyCoreFonts = true;
                     // false is default
                     $mpdf->SetProtection(array('print'));
                     $mpdf->SetTitle("Payslip - " . $employee->getUser()->Name());
                     $mpdf->SetAuthor(getAppName());
                     $mpdf->SetWatermarkText(getCompanyName());
                     $mpdf->showWatermarkText = true;
                     $mpdf->watermark_font = 'DejaVuSansCondensed';
                     $mpdf->watermarkTextAlpha = 0.1;
                     $mpdf->SetDisplayMode('fullpage');
                     $mpdf->WriteHTML($html);
                     $mpdf->Output($path);
                     // $mpdf->Output($employee->getPDFName().'.pdf', 'I');
                 } catch (Exception $e) {
                     debugMessage('error ' . $e->getMessage());
                 }
                 if (file_exists($path)) {
                     debugMessage('pdf ' . $employee->getPDFName() . ' created ');
                     // $employee->afterPayslipGeneration();
                 } else {
                     debugMessage('pdf missing');
                 }
             }
         }
     }
     $session->setVar("issuepayslips", '0');
     // reset flag for determining if payslips are sent
 }
        $headers = 'MIME-Version: 1.0' . "\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
        $headers .= 'From:JobbReady <*****@*****.**>' . "\n";
        mail($to, $subject, $body, $headers);
    }
    echo json_encode(array('url' => $url, 'error_msg' => $error_msg));
}
if ($action == "showcandidateinterest") {
    $url = "employer_candidates_contacted.php";
    $error_msg = "";
    $employer_registraion_id = $_POST['employer_registraion_id'];
    $registration_id = $_POST['registration_id'];
    $candidatEmail = getUserEmail($conn, $registration_id);
    $candidatName = getUserName($conn, $registration_id);
    $companyEmail = getUserEmail($conn, $employer_registraion_id);
    $comanyName = getCompanyName($conn, $employer_registraion_id);
    $comanyMobile = getUserMobile($conn, $employer_registraion_id);
    $subject = $comanyName . " showing interest in your profile";
    $body = '<table width="100%" height="auto" cellspacing="0" cepadding="0" border="0" align="center" style=" font-family:Arial, Helvetica, sans-serif; font-size:14px; ">    
    <tr>
    <td width="19" ></td>
    <td colspan="2" style="padding:10px; color:#FFFFFF; font-weight:bold;"><img src="http://digitalagencymumbai.com/jobready/images/logo.png" style="width:125px;"/> </td>
    <td width="19" >&nbsp;</td>
    </tr>
    <tr>
    <td bgcolor="#ED1A21" style="padding:10px;">&nbsp;</td>
    <td colspan="2" bgcolor="#ED1A21" style="padding:10px; font-size:30px; text-align:center; color:#fff;">' . $comanyName . ' showing interest in your profile</td>
   <td bgcolor="#ED1A21" style="padding:10px;">&nbsp;</td>
    </tr>   

    <tr>
if ($registration_type == 'SA') {
    echo "checked";
}
?>
 />
    </div>
  <div class="textfield">
  	  <input type="hidden" name="action" id="" value="addRecruiter"/>
      <input type="text" name="name" onfocus="if(this.value=='Name')value='';" onblur="if(this.value=='')value='Name';" value="<?php 
echo $registration_id ? getUserName($conn, $row['id']) : 'Name';
?>
" />
    </div>
	<div class="textfield">
      <input type="text" name="company" onfocus="if(this.value=='Company')value='';" onblur="if(this.value=='')value='Company';" value="<?php 
echo $registration_id ? getCompanyName($conn, $row['id']) : 'Company';
?>
" />
    </div>
    <div class="textfield">
      <input type="text" name="designation" onfocus="if(this.value=='Designation')value='';" onblur="if(this.value=='')value='Designation';" value="<?php 
echo $registration_id ? getDesignation($conn, $row['id']) : 'Designation';
?>
" />
    </div>
    <div class="textfield">
      <input type="text" name="email" onfocus="if(this.value=='Email')value='';" onblur="if(this.value=='')value='Email';" value="<?php 
echo $registration_id ? $row['email'] : 'Email';
?>
" />
    </div>