示例#1
0
文件: Txbb.php 项目: hani1990/spider
 public function temp_txbb($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //标题
     $title = $html->find('div[class=ptd-title]', 0)->plaintext;
     $data['title'] = trim($title);
     //招聘人数
     $zp_num = $html->find('table[class=ptd-item] tbody tr td', 1)->plaintext;
     $data['zp_num'] = trim($zp_num);
     $work_dom = $html->find('table[class=ptd-item]', 1);
     // 工作日期
     $work_day = $work_dom->find('tbody tr td', 1)->plaintext;
     $data['work_day'] = trim($work_day);
     //工作地点
     $work_place = $work_dom->find('tbody tr', 2)->find('td', 1)->plaintext;
     $data['work_place'] = trim($work_place);
     //工作要求
     $work_content = $work_dom->find('tbody tr', 3)->find('td', 1)->plaintext;
     $data['work_content'] = trim($work_content);
     //联系电话
     $tel = $work_dom->find('tbody tr', 4)->find('td', 1)->plaintext;
     $data['tel'] = trim($tel);
     //报名截止时间
     $end_time = $work_dom->find('tbody tr', 5)->find('td', 1)->plaintext;
     $data['end_time'] = trim($end_time);
     var_dump($data);
 }
示例#2
0
 public function temp_zhaoshixi($url)
 {
     // header("Content-type: text/html; charset=gbk");
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=jobsshow]', 0)->plaintext;
     $data['des'] = trim($des);
     $content = $html->find('div[class=jobsshow]', 0)->innertext;
     $data['content'] = trim($content);
     //标题
     $title = $html->find('div[class=jobsshow] h1', 0)->plaintext;
     $data['title'] = trim($title);
     //薪资
     $salary = $html->find('ul[class=floatli link_bku] li', 3)->plaintext;
     $salary = trim($salary);
     $arra_salaray = explode('~', $salary);
     print_r($arra_salaray);
     preg_match('/\\d/', $arra_salaray[0], $min_salary);
     preg_match('/\\d/', $arra_salaray[1], $max_salary);
     $data['min_salary'] = $min_salary[0] * 1000;
     $data['max_salary'] = $max_salary[0] * 1000;
     $data['salary'] = trim($salary);
     //城市
     $city = $html->find('ul[class=floatli link_bku] li', 7)->plaintext;
     $data['city'] = trim($city);
     //公司
     $corp_name = $html->find('ul[class=floatli link_bku] li ', 1)->plaintext;
     $data['corp_name'] = $corp_name;
     //福利
     // $welfare            =  $html->find( 'div[id=infoview] ul' , 0 )->plaintext;
     // $data['welfare']    =  $welfare;
     $trade = $html->find('div[class=floatli link_bku] li ', 8)->plaintext;
     $data['trade'] = $trade;
     //发布时间
     $pdate = $html->find('div[class=imgtipbox] div', 0)->plaintext;
     preg_match('/\\d*-\\d*-\\d*/', $pdate, $m);
     print_r($m);
     $ptime = strtotime($m[0]);
     $pdate = date('Y年m月d号', $ptime);
     $data['pdate'] = $pdate;
     $data['ptime'] = $ptime;
     $data['time'] = $ptime;
     $data['site_name'] = 'zhaoshixi';
     //url
     $data['url'] = trim($url);
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
 public function urls()
 {
     $url = 'http://weixin.sogou.com/';
     header("Content-Type:text/html;charset:utf-8");
     import(Org . Net . simple_html_dom);
     $html = url2html($url, $this->{$header});
     $hrefs = $html->find('a');
     //获取所有的链接
     foreach ($hrefs as $url) {
         $this->insert_urls($url->href);
     }
     $html->clear();
 }
示例#4
0
 public function temp_zhaopin58($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=posMsg borb]', 0)->plaintext;
     $data['des'] = trim($des);
     $content = $html->find('div[class=posMsg borb]', 0)->innertext;
     $data['content'] = trim($content);
     //标题
     $title = $html->find('div[class=headConLeft] h1', 0)->plaintext;
     $data['title'] = trim($title);
     //薪资
     $salary = $html->find('div[class=xq] ul li div span strong', 0)->plaintext;
     $salary = trim($salary);
     $arra_salaray = explode('-', $salary);
     print_r($arra_salaray);
     preg_match('/\\d/', $arra_salaray[0], $min_salary);
     preg_match('/\\d/', $arra_salaray[1], $max_salary);
     $data['min_salary'] = $min_salary[0] * 1000;
     $data['max_salary'] = $max_salary[0] * 1000;
     $data['salary'] = trim($salary);
     //城市
     $city = $html->find('dd[class=job_request] span', 1)->plaintext;
     $data['city'] = trim($city);
     //公司
     $corp_name = $html->find('div[class=company] a ', 0)->plaintext;
     $data['corp_name'] = $corp_name;
     //福利
     $welfare = $html->find('div[id=infoview] ul', 0)->plaintext;
     $data['welfare'] = $welfare;
     $trade = $html->find('div[class=compMsg clearfix] ul li a', 0)->plaintext;
     $data['trade'] = $trade;
     //发布时间
     $pdate = $html->find('ul[class=headTag] li span strong', 0)->plaintext;
     preg_match('/\\d/', $pdate, $m);
     print_r($m);
     $ptime = strtotime("-{$m['0']} day");
     $pdate = date('Y年m月d号', $ptime);
     $data['pdate'] = $pdate;
     $data['ptime'] = $ptime;
     $data['time'] = $ptime;
     $data['site_name'] = 'zhaopin58';
     //url
     $data['url'] = trim($url);
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
示例#5
0
文件: Lagou.php 项目: hani1990/spider
 public function temp_lagou($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('dd[class=job_bt]', 0)->plaintext;
     $data['des'] = trim($des);
     $content = $html->find('dd[class=job_bt]', 0)->innertext;
     $data['content'] = trim($content);
     //标题
     $title = $html->find('div[class=content_l content_l_jobdetail] dl dt h1', 0)->plaintext;
     $data['title'] = trim($title);
     //薪资
     $salary = $html->find('dd[class=job_request] span', 0)->plaintext;
     $salary = trim($salary);
     $arra_salaray = explode('-', $salary);
     print_r($arra_salaray);
     preg_match('/\\d/', $arra_salaray[0], $min_salary);
     preg_match('/\\d/', $arra_salaray[1], $max_salary);
     $data['min_salary'] = $min_salary[0] * 1000;
     $data['max_salary'] = $max_salary[0] * 1000;
     $data['salary'] = trim($salary);
     //城市
     $city = $html->find('dd[class=job_request] span', 1)->plaintext;
     $data['city'] = trim($city);
     //公司
     $corp_name = $html->find('dl[class=job_company] dt div h2', 0)->plaintext;
     $data['corp_name'] = $corp_name;
     //福利
     $welfare = $html->find('dd[class=job_request] span', 4)->plaintext;
     $data['welfare'] = $welfare;
     //发布时间
     $pdate = $html->find('dd[class=job_request] div', 0)->plaintext;
     preg_match('/\\d/', $pdate, $m);
     print_r($m);
     $ptime = strtotime("-{$m['0']} day");
     $pdate = date('Y年m月d号', $ptime);
     $data['pdate'] = $pdate;
     $data['ptime'] = $ptime;
     $data['time'] = $ptime;
     $data['site_name'] = 'lagou';
     //url
     $data['url'] = trim($url);
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
示例#6
0
 public function temp_chinahr($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=job_desc]', 0)->plaintext;
     $data['des'] = trim($des);
     $content = $html->find('div[class=job_desc]', 0)->innertext;
     $data['content'] = trim($content);
     //标题
     $title = $html->find('div[class=fl job_infoLeft] h1', 0)->plaintext;
     $data['title'] = trim($title);
     //薪资
     $salary = $html->find('div[class=detail_C_info] span', 0)->plaintext;
     $salary = trim($salary);
     $arra_salaray = explode('-', $salary);
     print_r($arra_salaray);
     preg_match('/\\d/', $arra_salaray[0], $min_salary);
     preg_match('/\\d/', $arra_salaray[1], $max_salary);
     $data['min_salary'] = $min_salary[0] * 1000;
     $data['max_salary'] = $max_salary[0] * 1000;
     $data['salary'] = trim($salary);
     //城市
     $city = $html->find('div[class=job_desc] p', 0)->plaintext;
     $data['city'] = trim($city);
     //公司
     $corp_name = $html->find('span[class=subC_name] a', 0)->plaintext;
     $data['corp_name'] = $corp_name;
     //福利
     $welfare = $html->find('ul[class=welf_list clear toggleWelfL]', 0)->plaintext;
     $data['welfare'] = $welfare;
     //发布时间
     $pdate = $html->find('span[class=detail_C_Date fl]', 0)->plaintext;
     preg_match('/\\d*-\\d*-\\d*/', $pdate, $pdate_reg);
     $ptime = strtotime(trim($pdate_reg[0]));
     $data['ptime'] = $ptime;
     $pdate = date('Y年m月d号', $ptime);
     $data['pdate'] = $pdate;
     $data['site_name'] = 'chinahr';
     //url
     $data['url'] = trim($url);
     $data['md5_url'] = md5($url);
     $data['type'] = 2;
     $html->clear();
     var_dump($data);
     return $data;
 }
示例#7
0
 public function temp_zhilian($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=tab-inner-cont]', 0)->plaintext;
     $data['des'] = trim($des);
     $content = $html->find('div[class=tab-inner-cont]', 0)->innertext;
     $data['content'] = trim($content);
     //标题
     $title = $html->find('div[class=inner-left fl] h1', 0)->plaintext;
     $title = trim($title);
     $data['title'] = $title;
     //薪资
     $salary = $html->find('ul[class=terminal-ul clearfix] li strong', 0)->plaintext;
     $salary = trim($salary);
     $arra_salaray = explode('-', $salary);
     print_r($arra_salaray);
     preg_match('/\\d/', $arra_salaray[0], $min_salary);
     preg_match('/\\d/', $arra_salaray[1], $max_salary);
     $data['min_salary'] = $min_salary[0] * 1000;
     $data['max_salary'] = $max_salary[0] * 1000;
     $data['salary'] = trim($salary);
     //城市
     $city = $html->find('ul[class=terminal-ul clearfix] li strong a', 0)->plaintext;
     $data['city'] = trim($city);
     //公司
     $corp_name = $html->find('p[class=company-name-t]', 0)->plaintext;
     $data['corp_name'] = $corp_name;
     //福利
     $welfare = $html->find('div[class=welfare-tab-box]', 0)->plaintext;
     $data['welfare'] = $welfare;
     //发布时间
     $pdate = $html->find('ul[class=terminal-ul clearfix] li strong', 2)->plaintext;
     $ptime = strtotime(trim($pdate));
     $data['ptime'] = $ptime;
     $pdate = date('Y年m月d号', $ptime);
     $data['pdate'] = $pdate;
     $data['site_name'] = 'zhilian';
     //url
     $data['url'] = trim($url);
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
示例#8
0
文件: Epub5.php 项目: hani1990/spider
 public function temp_epub5($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=sintro]', 0)->plaintext;
     $data['des'] = trim(msubstr($des, 0, 150));
     //标题
     $data['title'] = $html->find('div[class=sinfo] ul li ', 0)->plaintext;
     //url
     $data['url'] = trim($url);
     $data['time'] = time();
     $data['md5_url'] = md5($url);
     $data['type'] = 9;
     $html->clear();
     //var_dump( $data );
     return $data;
 }
示例#9
0
 public function temp_xuexi111($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=info-content]', 0)->plaintext;
     $data['des'] = trim(msubstr($des, 0, 150));
     //标题
     $title = $html->find('table[id=download-table] tbody tr td', 0)->plaintext;
     $data['title'] = trim($title);
     //url
     $data['url'] = trim($url);
     $data['time'] = time();
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
示例#10
0
 public function temp_book118($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[id=mainSoftIntro]', 0)->plaintext;
     $data['des'] = trim(msubstr($des, 0, 150));
     //标题
     $title = $html->find('div[class=downInfoTitle]', 0)->plaintext;
     $data['title'] = trim($title);
     //url
     $data['url'] = trim($url);
     $data['time'] = time();
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
示例#11
0
文件: Feng.php 项目: hani1990/spider
 public function temp_feng($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=t_fsz]', 0)->plaintext;
     $data['des'] = trim(msubstr($des, 0, 150));
     //标题
     $title = $html->find('div[class=pl_tit_panel] h1', 0)->plaintext;
     $data['title'] = trim($title);
     //url
     $data['url'] = trim($url);
     $data['time'] = time();
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
示例#12
0
 public function temp_chaoxing($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     if ($html) {
         //内容
         $des = $html->find('div[class=boxLeft]', 0)->plaintext;
         $des = trim($des);
         $data['des'] = trim(msubstr($des, 0, 150));
         //标题
         $title = $html->find('div[class=box_title] h1', 0)->plaintext;
         $data['title'] = trim($title);
         //url
         $data['url'] = trim($url);
         $data['time'] = time();
         $data['md5_url'] = md5($url);
         $data['type'] = 9;
         $html->clear();
         var_dump($data);
         return $data;
     } else {
         return 0;
     }
 }
        $data[$field] = $row[$field];
    }
    $list[] = $data;
}
//HTML2FPDF contains the functions - headerPDF, footerPDF, createHeading, createTr
$pdf = new HTML2FPDF();
//these are some shortcut variables
$created_by = $current_user;
$created_by->retrieve($focus->created_by);
$dateModified = $focus->date_modified . "," . $app_strings["LBL_BY"] . "," . $created_by->user_name;
$modified_by = $current_user;
$modified_by->retrieve($focus->modified_user_id);
$dateEntered = $focus->date_entered . "," . $app_strings["LBL_BY"] . "," . $modified_by->user_name;
$periodic = $app_list_strings['clientrequest_samples_options'][$focus->periodic];
$samples = $app_list_strings['clientrequest_samples_options'][$focus->samples];
$description = nl2br(url2html($focus->description));
//begin the Body's html creation (the Header and Footer are called later)
$bodyHtml .= $pdf->sectionHeading($mod_strings["LBL_MODULE_NAME"], $focus->name, $focus->number);
$bodyHtml .= $pdf->createHeading($mod_strings["LBL_PRODUCT_INFORMATION"]);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_CODE"], $product->pnum, $mod_strings["LBL_ACCOUNT_NAME"], $product->account_name);
$bodyHtml .= $pdf->createTr(true, $mod_strings["LBL_NAME"], $product->name, $mod_strings["LBL_CONTACT_NAME"], $product->contact_name);
$bodyHtml .= $pdf->createHeading($mod_strings["LBL_REQUEST_INFORMATION"]);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_ASSIGNED_USER_ID"], $focus->assigned_user_name, $mod_strings["LBL_DUE_DATE"], $focus->due_date);
$bodyHtml .= $pdf->createTr(true, $mod_strings["LBL_DATE_ENTERED"], $dateEntered, $mod_strings["LBL_DATE_MODIFIED"], $dateModified);
$bodyHtml .= $pdf->createHeading($mod_strings["LBL_GENERAL"]);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_QUANTITY"], $focus->quantity, $mod_strings["LBL_PERIODIC"], $periodic);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_FILES"], $focus->files, $mod_strings["LBL_SAMPLES"], $samples);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_SPECIAL_REQUIREMENTS"], $focus->special_requirements, null, null, true);
$bodyHtml .= $pdf->createTr(true, $mod_strings["LBL_DESCRIPTION"], $description, null, null, true);
$bodyHtml .= $pdf->createHeading($mod_strings["LBL_OPERATIONS"]);
$bodyHtml .= $pdf->createTr(true, $mod_strings["LBL_OPERATIONS_DESCRIPTION"], $focus->operation_description, null, null, true);
示例#14
0
 public function temp_amazon($url, $tag)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     if ($html) {
         $li = $html->find('li[class=s-result-item celwidget]');
         // var_dump($title);
         foreach ($li as $l) {
             $href = $l->find('a', 0)->href;
             $title = $l->find('div[class=a-fixed-left-grid-col a-col-right] a h2', 0)->plaintext;
             $author = $l->find('div[class=a-row a-spacing-none]', 0)->plaintext;
             $price = $l->find('span[class=a-size-base a-color-price s-price a-text-bold]', 0)->plaintext;
             $price = str_replace('¥', '', $price);
             echo $price . '<br>';
             echo $author . '<br>';
             echo $title . '<br>';
             $data['url'] = urldecode($href) . '&tag=zhaoshu114-23';
             $data['md5_url'] = md5($href);
             $data['title'] = mb_convert_encoding($title, 'UTF-8', 'HTML-ENTITIES');
             $data['author'] = $author;
             $data['price'] = $price;
             $data['from_site'] = 'amazon';
             $data['type'] = 3;
             $data['tag'] = $tag;
             $this->insert_db($data);
         }
         $html->clear();
     } else {
         return 0;
     }
 }
    $xtpl->assign('disabled_quote', "disabled");
    $xtpl->assign('LBL_QUOTE_BUTTON_TITLE', $mod_strings['LBL_CLIENTORDER_NOT_CLIENTORDERD']);
} else {
    $xtpl->assign('disabled_quote', "");
    $xtpl->assign('LBL_QUOTE_BUTTON_TITLE', $mod_strings['LBL_CLIENTORDER_NOT_CLIENTORDERD']);
}
//$xtpl->assign('quote_action', 'quoted');
//$xtpl->assign("JAVASCRIPT", get_set_focus_js().get_validate_record_js().get_format_js() . $quicksearch_js);
//Assign DetailView Fileds
$xtpl->assign('name', $focus->name);
$xtpl->assign('account_name', $focus->account_name);
$xtpl->assign('account_id', $focus->account_id);
$xtpl->assign('contact_name', $focus->contact_name);
$xtpl->assign('contact_id', $focus->contact_id);
$xtpl->assign('assigned_user_name', $focus->assigned_user_name);
$xtpl->assign('description', nl2br(url2html($focus->description)));
$xtpl->assign('vision', $focus->vision);
$xtpl->assign('period', $app_list_strings['clientorders_period_options'][$focus->period]);
$xtpl->assign('number', $focus->number);
$xtpl->assign('category', $app_list_strings['clientorders_category_options'][$focus->category]);
$xtpl->assign('note', $focus->note);
$xtpl->assign('quantity', $focus->quantity);
$xtpl->assign('status', $app_list_strings['product_status'][$focus->get_status($focus->id)]);
if (!is_null($focus->product_id) && !empty($focus->product_id)) {
    $product = new Products();
    $product->retrieve($focus->product_id);
    $xtpl->assign("pnum", $product->pnum);
    $xtpl->assign("product_name", $product->name);
    $xtpl->assign("product_id", $product->id);
    $xtpl->assign("account_name", $product->account_name);
    $xtpl->assign("account_id", $product->account_id);
示例#16
0
    $sugar_smarty->assign("TIMEFORMAT", $sugar_config['time_formats'][$timef]);
}
$num_grp_sep = $focus->getPreference('num_grp_sep');
$dec_sep = $focus->getPreference('dec_sep');
$sugar_smarty->assign("NUM_GRP_SEP", empty($num_grp_sep) ? $sugar_config['default_number_grouping_seperator'] : $num_grp_sep);
$sugar_smarty->assign("DEC_SEP", empty($dec_sep) ? $sugar_config['default_decimal_seperator'] : $dec_sep);
$currency = new Currency();
if ($focus->getPreference('currency')) {
    $currency->retrieve($focus->getPreference('currency'));
    $sugar_smarty->assign("CURRENCY", $currency->iso4217 . ' ' . $currency->symbol);
} else {
    $sugar_smarty->assign("CURRENCY", $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
}
$sugar_smarty->assign('CURRENCY_SIG_DIGITS', $locale->getPrecedentPreference('default_currency_significant_digits', $focus));
$sugar_smarty->assign('NAME_FORMAT', $focus->getLocaleFormatDesc());
$sugar_smarty->assign("DESCRIPTION", nl2br(url2html($focus->description)));
$sugar_smarty->assign("TITLE", $focus->title);
$sugar_smarty->assign("DEPARTMENT", $focus->department);
$sugar_smarty->assign("REPORTS_TO_ID", $focus->reports_to_id);
$sugar_smarty->assign("REPORTS_TO_NAME", $focus->reports_to_name);
$sugar_smarty->assign("PHONE_HOME", $focus->phone_home);
$sugar_smarty->assign("PHONE_MOBILE", $focus->phone_mobile);
$sugar_smarty->assign("PHONE_WORK", $focus->phone_work);
$sugar_smarty->assign("PHONE_OTHER", $focus->phone_other);
$sugar_smarty->assign("PHONE_FAX", $focus->phone_fax);
if (!empty($focus->employee_status)) {
    $sugar_smarty->assign("EMPLOYEE_STATUS", $app_list_strings['employee_status_dom'][$focus->employee_status]);
}
$sugar_smarty->assign("MESSENGER_ID", $focus->messenger_id);
$sugar_smarty->assign("MESSENGER_TYPE", $focus->messenger_type);
$sugar_smarty->assign("ADDRESS_STREET", $focus->address_street);
    $priority = $focus->priority;
}
if (!empty($focus->type)) {
    $xtpl->assign("TYPE", $app_list_strings['bug_type_dom'][$focus->type]);
} else {
    $priority = '';
}
$xtpl->assign("PRIORITY", $app_list_strings['bug_priority_dom'][$focus->priority]);
$xtpl->assign("DESCRIPTION", nl2br(url2html($focus->description)));
$xtpl->assign("DATE_MODIFIED", $focus->date_modified);
$xtpl->assign("DATE_ENTERED", $focus->date_entered);
if (!empty($focus->fixed_in_release)) {
    $xtpl->assign("FIXED_IN_RELEASE", $focus->fixed_in_release_name);
}
if (isset($focus->work_log)) {
    $xtpl->assign("WORK_LOG", nl2br(url2html($focus->work_log)));
}
if (!empty($focus->source)) {
    $xtpl->assign("SOURCE", $app_list_strings['source_dom'][$focus->source]);
}
if (!empty($focus->product_category)) {
    $xtpl->assign("PRODUCT_CATEGORY", $app_list_strings['product_category_dom'][$focus->product_category]);
}
global $current_user;
if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
    $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=" . $_REQUEST['action'] . "&from_module=" . $_REQUEST['module'] . "&record=" . $_REQUEST['record'] . "'>" . get_image($image_path . "EditLayout", "border='0' alt='Edit Layout' align='bottom'") . "</a>");
}
$xtpl->assign("CREATED_BY", $focus->created_by_name);
$xtpl->assign("MODIFIED_BY", $focus->modified_by_name);
$detailView->processListNavigation($xtpl, "BUG", $offset, $focus->is_AuditEnabled());
// adding custom fields:
} else {
    $xtpl->assign("TIME_DUE", $focus->time_due);
}
if ($focus->date_start == '0000-00-00') {
    $xtpl->assign("DATE_START", '');
} else {
    $xtpl->assign("DATE_START", $focus->date_start);
}
if ($focus->time_start == '00:00' || $focus->time_start == '00:00:00') {
    $xtpl->assign("TIME_START", '');
} else {
    $xtpl->assign("TIME_START", $focus->time_start);
}
$xtpl->assign("DATE_MODIFIED", $focus->date_modified);
$xtpl->assign("DATE_ENTERED", $focus->date_entered);
$xtpl->assign("DESCRIPTION", nl2br(url2html($focus->description)));
if (!empty($focus->priority)) {
    $xtpl->assign("PRIORITY", $app_list_strings['task_priority_dom'][$focus->priority]);
}
if (!empty($focus->parent_type)) {
    $xtpl->assign("TYPE", $app_list_strings['record_type_display'][$focus->parent_type]);
}
$xtpl->assign("STATUS", $app_list_strings['task_status_dom'][$focus->status]);
if ($app_list_strings['task_status_dom'][$focus->status] != "Completed") {
    $close_and_create_button = '<input title="' . $app_strings['LBL_CLOSE_AND_CREATE_BUTTON_TITLE'] . '" ' . 'accessKey="' . $app_strings['LBL_CLOSE_AND_CREATE_BUTTON_KEY'] . '" class="button" ' . 'onclick="this.form.status.value=\'Completed\';this.form.action.value=\'Save\';this.form.return_module.value=\'Tasks\';' . 'this.form.isDuplicate.value=true;this.form.isSaveAndNew.value=true;this.form.return_action.value=\'EditView\'; ' . 'this.form.return_id.value=\'' . $focus->id . '\';" type="submit" name="button" ' . 'value="' . $app_strings['LBL_CLOSE_AND_CREATE_BUTTON_LABEL'] . '" >';
    $xtpl->assign("CLOSE_AND_CREATE_BUTTON", $close_and_create_button);
}
$xtpl->assign("TAG", $focus->listviewACLHelper());
$xtpl->parse("main");
$xtpl->out("main");
require_once 'modules/SavedSearch/SavedSearch.php';
}
//HTML2FPDF contains the functions - headerPDF, footerPDF, createHeading, createTr
$pdf = new HTML2FPDF();
//Shortcuts
$total = $focus->total_paper + $focus->total_prepress + $focus->total_press + $focus->total_operations . " " . $mod_strings["LBL_UNITS"];
$total_paper = $focus->total_paper . " " . $mod_strings["LBL_UNITS"];
$total_prepress = $focus->total_prepress . " " . $mod_strings["LBL_UNITS"];
$total_press = $focus->total_press . " " . $mod_strings["LBL_UNITS"];
$total_operations = $focus->total_operations . " " . $mod_strings["LBL_UNITS"];
$status = $app_list_strings['componentestimatecalc_status_dom'][$focus->status];
//begin the Body's html creation (the Header and Footer are called later)
$bodyHtml .= $pdf->sectionHeading($mod_strings["LBL_MODULE_NAME"], $focus->name);
$bodyHtml .= $pdf->createHeading();
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_NAME"], $focus->name, $mod_strings["LBL_ASSIGNED_USER_ID"], $focus->assigned_user_name);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_COMPONENT_NAME"], $focus->component_name, $mod_strings["LBL_ESTIMATE_NAME"], $focus->estimate_name);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_TOTAL"], $total, $mod_strings["LBL_DESCRIPTION"], nl2br(url2html($focus->description)));
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_PAPER_TOTAL"], $total_paper, $mod_strings["LBL_PREPRESS_TOTAL"], $total_prepress);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_PRESS_TOTAL"], $total_press, $mod_strings["LBL_OPERATIONS_TOTAL"], $total_operations);
$bodyHtml .= $pdf->createTr(true, $mod_strings["LBL_STATUS"], $status);
//$bodyHtml .= "<newpage>";
$paperEst = $focus->paperEstimate($focus->component_id, null, false, true);
$pressEst = $focus->pressEstimate($focus->component_id, null, false, true);
$operationsEst = $focus->operationsEstimate($focus->component_id, false, true);
$prepressEst = $focus->prepressEstimate($focus->component_id, false, true);
$compsHtml = "";
$compsHtml .= $pdf->sectionHeading($mod_strings["LBL_DETAILED_INFO"]);
//shortcuts
$singlePrice = $paperEst["paper_singleprice"] . " " . $mod_strings["LBL_UNITS"];
$paperPrice = $paperEst["total_paper_price"] . " " . $mod_strings["LBL_UNITS"];
//paper
$compsHtml .= $pdf->createHeading($mod_strings["LBL_PAPER"]);
$xtpl->assign("GRIDLINE", $gridline);
$xtpl->assign("IMAGE_PATH", $image_path);
$xtpl->assign("PRINT_URL", "index.php?" . $GLOBALS['request_string']);
$xtpl->assign("ID", $focus->id);
$xtpl->assign("ASSIGNED_TO", $focus->assigned_user_name);
$xtpl->assign("STATUS", $app_list_strings['campaign_status_dom'][$focus->status]);
$xtpl->assign("NAME", $focus->name);
$xtpl->assign("TYPE", $app_list_strings['campaign_type_dom'][$focus->campaign_type]);
$xtpl->assign("START_DATE", $focus->start_date);
$xtpl->assign("END_DATE", $focus->end_date);
$xtpl->assign("BUDGET", $focus->budget);
$xtpl->assign("ACTUAL_COST", $focus->actual_cost);
$xtpl->assign("EXPECTED_COST", $focus->expected_cost);
$xtpl->assign("EXPECTED_REVENUE", $focus->expected_revenue);
$xtpl->assign("OBJECTIVE", nl2br($focus->objective));
$xtpl->assign("CONTENT", nl2br(url2html($focus->content)));
$xtpl->assign("DATE_MODIFIED", $focus->date_modified);
$xtpl->assign("DATE_ENTERED", $focus->date_entered);
$xtpl->assign("CREATED_BY", $focus->created_by_name);
$xtpl->assign("MODIFIED_BY", $focus->modified_by_name);
$xtpl->assign("TRACKER_URL", $sugar_config['site_url'] . '/campaign_tracker.php?track=' . $focus->tracker_key);
$xtpl->assign("TRACKER_COUNT", intval($focus->tracker_count));
$xtpl->assign("TRACKER_TEXT", $focus->tracker_text);
$xtpl->assign("REFER_URL", $focus->refer_url);
if ($focus->campaign_type == 'Email') {
    $xtpl->assign("ADD_BUTTON_STATE", "submit");
} else {
    $xtpl->assign("ADD_BUTTON_STATE", "hidden");
    $xtpl->assign("DISABLE_LINK", "display:none");
}
require_once 'modules/Currencies/Currency.php';
$bodyHtml .= $pdf->CompRows($list);
$bodyHtml .= "</table>";
$bodyHtml .= "<newpage>";
$list = null;
$query = "SELECT id FROM `estimates_components` WHERE parent_id='" . $focus->id . "' AND deleted=0";
$result = $focus->db->query($query, true, "Error filling layout fields: ");
while ($row = $focus->db->fetchByAssoc($result)) {
    $list[] = $row['id'];
}
//Initializing of EstimateComponents object, needs to be done for every record
for ($i = 0; $i < count($list); $i++) {
    $estComps = new EstimateComponents();
    $estComps->retrieve($list[$i]);
    //get the $mod_strings from EstimateComponents module
    $comp_mod_strings = return_module_language($current_language, "EstimateComponents");
    $description = nl2br(url2html($estComps->description));
    $type = $app_list_strings['type_options'][$estComps->type];
    $color = $estComps->color_side_a . "x" . $estComps->color_side_b;
    $fsize = $estComps->fsize_h . "x" . $estComps->fsize_w;
    $base = $estComps->base_x . "x" . $estComps->base_y;
    $bleed_size = $estComps->bleed_size_x . "x" . $estComps->bleed_size_y;
    $child = $estComps->child_x . "x" . $estComps->child_y;
    $run_size = $estComps->run_size_x . "x" . $estComps->run_size_y;
    $pressformat = $estComps->pressformat_x . "x" . $estComps->pressformat_y;
    $colorSideA = $comp_mod_strings["LBL_COLOR_SIDE_A"] . "(" . $estComps->color_side_a . ")";
    $colorSideB = $comp_mod_strings["LBL_COLOR_SIDE_B"] . "(" . $estComps->color_side_b . ")";
    $ink_rows = $estComps->getInkRows();
    $inks_side_a = array();
    $inks_side_b = array();
    for ($i = 0; $i < count($ink_rows); $i++) {
        if ($ink_rows[$i]->side == "a") {
<?php 
}
?>
</td>
<td width='37.5%' colspan='3' >
<?php 
if (!$this->_tpl_vars['fields']['description']['hidden']) {
    echo smarty_function_counter(array('name' => 'panelFieldCount'), $this);
    ?>


<span class="sugar_field" id="<?php 
    echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['fields']['description']['name']) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')) ? $this->_run_mod_handler('url2html', true, $_tmp) : url2html($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
    ?>
"><?php 
    echo is_array($_tmp = is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['fields']['description']['value']) ? $this->_run_mod_handler('escape', true, $_tmp, 'htmlentitydecode') : smarty_modifier_escape($_tmp, 'htmlentitydecode')) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')) ? $this->_run_mod_handler('url2html', true, $_tmp) : url2html($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
    ?>
</span>
<?php 
}
?>
</td>
</tr>
<?php 
$this->_smarty_vars['capture']['tr'] = ob_get_contents();
$this->assign('tableRow', ob_get_contents());
ob_end_clean();
if ($this->_tpl_vars['fieldsUsed'] > 0 && $this->_tpl_vars['fieldsUsed'] != $this->_tpl_vars['fieldsHidden']) {
    echo $this->_tpl_vars['tableRow'];
    ?>
$xtpl->assign("ACCOUNT_NAME", $focus->account_name);
$xtpl->assign("ACCOUNT_ID", $focus->account_id);
$xtpl->assign("ASSIGNED_TO", $focus->assigned_user_name);
$xtpl->assign("NAME", $focus->name);
$xtpl->assign("CASE_NUMBER", $focus->case_number);
$xtpl->assign("STATUS", empty($focus->status) ? "" : $app_list_strings['case_status_dom'][$focus->status]);
if (isset($focus->priority)) {
    $priority = $focus->priority;
} else {
    $priority = '';
}
$xtpl->assign("CREATED_BY", $focus->created_by_name);
$xtpl->assign("MODIFIED_BY", $focus->modified_by_name);
$xtpl->assign("PRIORITY", empty($focus->priority) ? "" : $app_list_strings['case_priority_dom'][$focus->priority]);
$xtpl->assign("DESCRIPTION", nl2br(url2html($focus->description)));
$xtpl->assign("RESOLUTION", nl2br(url2html($focus->resolution)));
$xtpl->assign("DATE_MODIFIED", $focus->date_modified);
$xtpl->assign("DATE_ENTERED", $focus->date_entered);
$xtpl->assign("TAG", $focus->listviewACLHelper());
global $current_user;
if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
    $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=" . $_REQUEST['action'] . "&from_module=" . $_REQUEST['module'] . "&record=" . $_REQUEST['record'] . "'>" . get_image($image_path . "EditLayout", "border='0' alt='Edit Layout' align='bottom'") . "</a>");
}
$detailView->processListNavigation($xtpl, "CASE", $offset, $focus->is_AuditEnabled());
// adding custom fields:
require_once 'modules/DynamicFields/templates/Files/DetailView.php';
$xtpl->parse("main.open_source");
$xtpl->parse("main");
$xtpl->out("main");
$sub_xtpl = $xtpl;
require_once 'include/SubPanel/SubPanelTiles.php';