Esempio n. 1
0
 public function edit($where, $data)
 {
     if (!empty($data['pic'])) {
         $data['pic'] = getAttachment($data['pic']);
     }
     return $this->db->where($where)->data($data)->save();
 }
                    <div class="clear"></div>
                </div>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">

                    <tr>
                        <td  class="bodycolor" style="word-break:break-all;">

                                                <?php 
                    echo stripslashes($row["tReply"]);
                    ?>
                        </td>
                    </tr>
                    <tr>
                        <td >
                                                <?php 
                    echo getAttachment("", $row["nReplyId"]);
                    ?>
                        </td>
                    </tr>


                </table>
            </div>
        </div>

                            <?php 
                }
                //end else correspondance section
            }
        }
    }
Esempio n. 3
0
$atts = array();
while ($att = mysql_fetch_assoc($Q_att)) {
    if (!isset($atts[$att['att_id']])) {
        $atts[$att['att_id']] = $att['att_filename_orig'];
    }
}
$Q_att = mysql_query("\nSELECT\ta.att_id, a.att_filename_orig\nFROM\t`entry_confirm_attachment` a, `entry_type_defaultattachment` e\nWHERE\n\ta.att_id = e.att_id\tAND\n\te.entry_type_id = '" . $entry['entry_type_id'] . "' AND\n\te.area_id = '" . $entry['area_id'] . "'\n;\n\t\t");
while ($att = mysql_fetch_assoc($Q_att)) {
    if (!isset($atts[$att['att_id']])) {
        $atts[$att['att_id']] = $att['att_filename_orig'];
    }
}
natcasesort($atts);
echo '<ul id="vedlegg">';
foreach ($atts as $att_id => $a) {
    $att = getAttachment($att_id);
    if (count($att)) {
        echo '<li id="vedleggValgt' . $att['att_id'] . '">' . '<input type="hidden" value="' . $att['att_id'] . '" name="attachment[]"/>' . iconFiletype($att['att_filetype']) . ' ' . $att['att_filename_orig'] . ' (' . smarty_modifier_file_size($att['att_filesize']) . ')' . '<input type="button" class="attSelected" style="font-size: 10px;" value="Fjern" onclick="removeAttachment(' . $att['att_id'] . ');"/>' . '</li>';
    }
}
echo '</ul>';
echo '</div>';
echo '<input type="button" id="velgVedlegg" class="ui-button ui-state-default ui-corner-all" value="Velg fil(er)">';
echo '</div>';
// Disabled:
echo '<div style="width: 400px; margin-left: 20px; display:none; font-size: 14px;" class="error" id="emailAttachmentDisabled">' . 'Vedlegg er ikke mulig når sendingstype er ren tekst.<br>Velg PDF for vedlegg.</div>';
/* ## SEND BEKREFTELSE ## */
echo '<h2>Send bekreftelse</h2>';
echo '<div style="margin-left: 20px;">';
echo '<div class="notice" id="noPDF" style="display:none;">' . '<h2>Ingen mal valgt</h2>' . 'Du har ikke valgt mal og PDF-vedlegg blir da ikke sendt (eller e-posten blir tom).<br>' . 'Er du sikker på at du vil fortsette?<br><br>' . '<label><input type="checkbox" id="nopdf_confirm"> Ja, jeg vil fortsette</label>' . '</div>' . chr(10) . chr(10);
echo '<div class="notice" id="failedEmail" style="display:none;">' . '<h2>Feil med en eller flere e-poster</h2>' . 'Du har en eller flere e-post-adressene med feil. Sjekk disse over.<br>' . '</div>' . chr(10) . chr(10);
Esempio n. 4
0
 public function update_store_logo()
 {
     if (IS_POST) {
         $store = M('Store');
         if (isset($_POST['store_logo'])) {
             $logo = getAttachment($_POST['store_logo']);
         } else {
             $logo = '';
         }
         $data = array();
         if ($logo) {
             $data['logo'] = $logo;
             $where = array();
             $where['store_id'] = $this->store_session['store_id'];
             $store->setting($where, $data);
             //替换session
             $_SESSION['store']['logo'] = getAttachmentUrl($logo);
             json_return(0, '修改店铺logo成功!');
         }
     }
 }
Esempio n. 5
0
 public function property_value_img()
 {
     $vid = $_GET['vid'];
     $image = $_GET['image'];
     if (empty($vid)) {
         json_return(1001, '缺少参数');
     }
     if (empty($image)) {
         json_return(1001, '请上传图片');
     }
     $image = getAttachment($image);
     $product_property_value = D('Product_property_value')->where(array('vid' => $vid))->find();
     if (empty($product_property_value)) {
         json_return(1001, '未找到相应的属性值');
     }
     D('Product_property_value')->where(array('vid' => $vid))->data(array('image' => $image))->save();
     json_return(0, '上传完成');
 }
Esempio n. 6
0
$phpmailer = initPHPMailer();
$debug = true;
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminsettings')) {
    print_cp_no_permission();
}
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
showDebug("Running campaign cron...");
showDebug();
$sql = "SELECT * FROM " . TABLE_PREFIX . "qhvbmailer_campaigns WHERE send_when <= '" . TIMENOW . "' AND send_switch='0'";
$campaigns = $vbulletin->db->query_read_slave($sql);
while ($campaign = $vbulletin->db->fetch_array($campaigns)) {
    if ($template = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "qhvbmailer_templates WHERE id='" . $campaign['template_id'] . "'")) {
        $attachment = getAttachment($campaign['attachment_id']);
        showDebug("Checking campaign '" . $campaign['subject'] . "' [ID: " . $campaign['id'] . "]");
        if ($campaign['send_to'] > 0) {
            //$extra_sql = " WHERE usergroupid='" . $campaign['send_to'] . "'";
            //$extra_sql .= " OR membergroupids like '%" . $campaign['send_to'] . "%'";
            $extra_sql = " WHERE concat(',', usergroupid, if(STRCMP(membergroupids, ''), ',', ''), membergroupids) LIKE '%," . $campaign['send_to'] . "%'";
        }
        $sql = "SELECT * FROM " . TABLE_PREFIX . "user" . $extra_sql;
        $users = $vbulletin->db->query_read_slave($sql);
        while ($user = $vbulletin->db->fetch_array($users)) {
            $userinfo = fetch_userinfo($user['userid'], 1);
            // lwe added overrider for bloodless pros usergroup.
            if ($campaign['send_to'] == '20' || $userinfo['adminemail'] > 0) {
                $subject = getQHPhrase($userinfo['languageid'], $campaign['template_id'], 'subject');
                $text = getQHPhrase($userinfo['languageid'], $campaign['template_id'], 'text');
                $html = getQHPhrase($userinfo['languageid'], $campaign['template_id'], 'html');
Esempio n. 7
0
 /**
  * 
  *  清空数组里空的字段 
  * 
  */
 protected function clear_field($array)
 {
     $new_array = array();
     if (is_array($array)) {
         if (!empty($array['goods'])) {
             $goods = array();
             foreach ($array['goods'] as $product) {
                 $product['title'] = htmlspecialchars($product['title'], ENT_QUOTES);
                 //解决serialize序列化单引号问题
                 $product['image'] = getAttachment($product['image']);
                 $goods[] = $product;
             }
             $array['goods'] = $goods;
         } else {
             if (strtolower($array['type']) == 'rich_text') {
                 $array['content'] = htmlspecialchars($array['content'], ENT_QUOTES);
             } else {
                 if (strtolower($array['type']) == 'title') {
                     $array['title'] = htmlspecialchars($array['title'], ENT_QUOTES);
                     $array['sub_title'] = htmlspecialchars($array['sub_title'], ENT_QUOTES);
                 } else {
                     if (strtolower($array['type']) == 'text_nav') {
                         $type = array_pop($array);
                         $text_navs = array();
                         foreach ($array as $key => $nav) {
                             $nav['title'] = htmlspecialchars($nav['title'], ENT_QUOTES);
                             $nav['name'] = htmlspecialchars($nav['name'], ENT_QUOTES);
                             $text_navs[$key] = $nav;
                         }
                         $array = $text_navs;
                         $array['type'] = $type;
                     } else {
                         if (strtolower($array['type']) == 'image_nav') {
                             $type = array_pop($array);
                             $image_navs = array();
                             foreach ($array as $key => $nav) {
                                 $nav['title'] = htmlspecialchars($nav['title'], ENT_QUOTES);
                                 $nav['name'] = htmlspecialchars($nav['name'], ENT_QUOTES);
                                 $image_navs[$key] = $nav;
                             }
                             $array = $image_navs;
                             $array['type'] = $type;
                         } else {
                             if (strtolower($array['type']) == 'link') {
                                 $type = array_pop($array);
                                 $links = array();
                                 foreach ($array as $key => $link) {
                                     $link['title'] = htmlspecialchars($link['title'], ENT_QUOTES);
                                     $link['name'] = htmlspecialchars($link['name'], ENT_QUOTES);
                                     $links[$key] = $link;
                                 }
                                 $array = $links;
                                 $array['type'] = $type;
                             } else {
                                 if (strtolower($array['type']) == 'notice') {
                                     $array['content'] = htmlspecialchars($array['content'], ENT_QUOTES);
                                 } else {
                                     if (strtolower($array['type']) == 'component') {
                                         $array['name'] = htmlspecialchars($array['name'], ENT_QUOTES);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         foreach ($array as $key => $value) {
             if (!empty($value) && $key != 'type') {
                 $new_array[$key] = $value;
             }
         }
     }
     return $new_array;
 }
Esempio n. 8
0
function searchDetail($pp_kod)
{
    $product = "SELECT * FROM p_product\n              WHERE pp_kod='{$pp_kod}'";
    $p_result = selQuery($product);
    $p_row = mysqli_fetch_assoc($p_result);
    $manu = "SELECT * FROM p_product_manu\n           WHERE ppm_pp_kod='{$pp_kod}' AND ppm_rmr_kod=1";
    $m_result = selQuery($manu);
    $m_row = mysqli_fetch_assoc($m_result);
    $manu = $m_row['ppm_osa_kod'];
    $m_sykt = "SELECT os_sykt,osa_alamat1,osa_alamat2,osa_alamat3,osa_poskod,osa_email,osa_notel FROM o_syarikat_add\n             JOIN o_syarikat ON o_syarikat.os_kod=o_syarikat_add.osa_os_kod\n             WHERE osa_kod='{$manu}'";
    $ms_result = selQuery($m_sykt);
    $ms_row = mysqli_fetch_assoc($ms_result);
    $holder = $p_row['pp_osa_kod_holder'];
    $h_sykt = "SELECT os_sykt,osa_alamat1,osa_alamat2,osa_alamat3,osa_poskod,osa_email,osa_notel FROM o_syarikat_add\n             JOIN o_syarikat ON o_syarikat.os_kod=o_syarikat_add.osa_os_kod\n             WHERE osa_kod='{$holder}'";
    $hs_result = selQuery($h_sykt);
    $hs_row = mysqli_fetch_assoc($hs_result);
    $dca = "SELECT pskm_no_msykt,pskm_tkh_msykt FROM p_product,p_skr_kmesyuarat\n          WHERE pp_kod='{$pp_kod}' AND p_product.pp_pskm_no_msykt=p_skr_kmesyuarat.pskm_kod";
    $dca_result = selQuery($dca);
    $dca_row = mysqli_fetch_assoc($dca_result);
    ?>
<div class="row" id="preview">
  <div class="tab-content pn br-n admin-form">
    <div class="col-md-12">
      <blockquote class="blockquote-primary">Product Details</blockquote>
    </div>
    <div class="col-md-12">
      <div class="panel">
        <div class="panel-body">
          <table width="100%" class="table" cellpadding="5">
            <tr>
              <td width="24%">DCA Meeting No</td>
              <td width="1%">:</td>
              <td width="25%"><?php 
    echo isEmpty($dca_row['pskm_no_msykt']);
    ?>
</td>
              <td width="24%">Product Name</td>
              <td width="1%">:</td>
              <td width="25%"><?php 
    echo isEmpty($p_row['pp_nama']);
    ?>
</td>
            </tr>
            <tr>
              <td>DCA Meeting Date</td>
              <td>:</td>
              <td><?php 
    echo displayDate($dca_row['pskm_tkh_msykt']);
    ?>
</td>
              <td>Registration Date</td>
              <td>:</td>
              <td><?php 
    echo displayDate($p_row['pp_tkh_reg']);
    ?>
</td>
            </tr>
            <tr>
              <td>Registration No</td>
              <td>:</td>
              <td><?php 
    echo isEmpty($p_row['pp_reg_no']);
    ?>
</td>
              <td>Dosage Form</td>
              <td>:</td>
              <td><?php 
    echo isEmpty(getSelDosage($p_row['pp_rd_kod']));
    ?>
</td>
            </tr>
            <tr>
              <td>Reference No</td>
              <td>:</td>
              <td><?php 
    echo isEmpty($p_row['pp_ref_no']);
    ?>
</td>
              <td>Registration Status</td>
              <td>:</td>
              <td><?php 
    echo isEmpty($p_row['pp_reg_no']);
    ?>
</td>
            </tr>
            <tr>
              <td>Product Classification</td>
              <td>:</td>
              <td><?php 
    echo productClass($p_row['pp_rkatp_kod']);
    ?>
</td>
              <td>Product Category</td>
              <td>:</td>
              <td><?php 
    echo productCategory($p_row['pp_rkatp_kod']);
    ?>
</td>
            </tr>
            <tr>
              <td>Product Status</td>
              <td>:</td>
              <td><?php 
    echo getAllStatus($p_row['pp_rs_kod'], $p_row['pp_status_nopayment']);
    ?>
</td>
              <td>Lab Status</td>
              <td>:</td>
              <td><?php 
    echo getAllStatus($p_row['pp_rs_kod_lab'], $p_row['pp_status_nopayment']);
    ?>
</td>
            </tr>
          </table>
        </div>
      </div>
    </div>
    <div class="col-md-12">
      <div class="panel">
        <div class="panel-body">
          <table width="100%" class="table" cellpadding="5">
            <tr>
              <td width="24%">Manufacturer</td>
              <td width="1%">:</td>
              <td width="25%"><?php 
    echo $ms_row['os_sykt'];
    ?>
</td>
              <td width="24%">Holder</td>
              <td width="1%">:</td>
              <td width="25%"><?php 
    echo $hs_row['os_sykt'];
    ?>
</td>
            </tr>
            <tr>
              <td>Address Manufacturer</td>
              <td>:</td>
              <td><?php 
    echo $ms_row['osa_alamat1'] . "<br/>" . $ms_row['osa_alamat2'] . "<br/>" . $ms_row['osa_alamat3'] . "<br/>" . $ms_row['osa_poskod'];
    ?>
</td>
              <td>Address Holder</td>
              <td>:</td>
              <td><?php 
    echo $hs_row['osa_alamat1'] . "<br/>" . $hs_row['osa_alamat2'] . "<br/>" . $hs_row['osa_alamat3'] . "<br/>" . $hs_row['osa_poskod'];
    ?>
</td>
            </tr>
            <tr>
              <td>Email Manufacturer</td>
              <td>:</td>
              <td><?php 
    echo isEmpty($ms_row['osa_email']);
    ?>
</td>
              <td>Email Holder</td>
              <td>:</td>
              <td><?php 
    echo isEmpty($hs_row['osa_email']);
    ?>
</td>
            </tr>
            <tr>
              <td>Phone No Manufacturer</td>
              <td>:</td>
              <td><?php 
    echo isEmpty($ms_row['osa_notel']);
    ?>
</td>
              <td>Phone No Holder</td>
              <td>:</td>
              <td><?php 
    echo isEmpty($hs_row['osa_notel']);
    ?>
</td>
            </tr>
            <tr>
              <td>Contract Manufacturer</td>
              <td>:</td>
              <td>
                <?php 
    if ($m_row['ppm_contract'] == "Y") {
        echo "<i class='fa fa-check text-success'></i>'";
    } else {
        echo "<i class='fa fa-close text-danger'></i>";
    }
    ?>
              </td>
              <td>Repacker</td>
              <td>:</td>
              <td>
                <?php 
    if ($p_row['pp_repacker'] == "Y") {
        echo "<i class='fa fa-check text-success'></i>";
    } else {
        echo "<i class='fa fa-close text-danger'></i>";
    }
    ?>
              </td>
            </tr>
          </table>
        </div>
      </div>
    </div>
    <div class="col-md-12">
      <blockquote class="blockquote-primary">Attachment</blockquote>
    </div>
    <div class="col-md-12">
      <div class="panel panel-primary">
        <div class="panel-body">
          <table width="100%" class="table" cellpadding="5">
            <tr>
              <td width="24%">COA Finished Product</td>
              <td width="1%">:</td>
              <td width="25%"><?php 
    echo getAttachment($pp_kod, 34);
    ?>
</td>
              <td width="24%">Protocol of Analysis</td>
              <td width="1%">:</td>
              <td width="25%"><?php 
    echo getAttachment($pp_kod, 34);
    ?>
</td>
            </tr>
            <tr>
              <td>COA API</td>
              <td>:</td>
              <td><?php 
    echo getAttachment($pp_kod, 34);
    ?>
</td>
              <td>Summary of Validation</td>
              <td>:</td>
              <td><?php 
    echo getAttachment($pp_kod, "sumofMethod");
    ?>
</td>
            </tr>
            <tr>
              <td>Additional Info</td>
              <td>:</td>
              <td colspan="4"><?php 
    echo getAttachment($pp_kod, 34);
    ?>
</td>
            </tr>
          </table>
        </div>
      </div>
    </div>
    <div class="col-md-12">
      <blockquote class="blockquote-primary">Active Ingredient</blockquote>
    </div>
    <div class="col-md-12">
      <table id="tbl_ai" class="table table-striped table-hover" width="100%" cellspacing="0">
        <thead>
          <tr align="center" class="primary">
            <td width="5%">No</td>
            <td width="60%">Active Ingredient</td>
            <td width="15%">Strength</td>
            <td width="20%">Remarks</td>
          </tr>
        </thead>
        <tbody>
          <?php 
    $count = 1;
    $the = "SELECT ras_desc,pba_kekuatan,rbab_desc,pba_catatan\n            FROM p_bhn_aktif\n          \tLEFT JOIN ref_aktif_substance ON ras_kod = pba_ras_kod\n          \tLEFT JOIN ref_bhn_aktif_bhgn ON rbab_kod = pba_rbab_kod\n            WHERE pba_pp_kod ='{$pp_kod}'";
    $t_result = selQuery($the);
    while ($t_row = mysqli_fetch_assoc($t_result)) {
        ?>
            <tr align="center">
              <td><?php 
        echo $count++;
        ?>
</td>
              <td align="left"><?php 
        echo $t_row['ras_desc'];
        ?>
</td>
              <td><?php 
        echo $t_row['pba_kekuatan'];
        ?>
</td>
              <td align="left"><?php 
        echo $t_row['pba_catatan'];
        ?>
</td>
            </tr>
            <?php 
    }
    ?>
        </tbody>
      </table>
    </div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-12">
      <blockquote class="blockquote-primary">Excipient</blockquote>
    </div>
    <div class="col-md-12">
      <table id="tbl_exp" class="table table-striped table-hover" width="100%" cellspacing="0">
        <thead>
          <tr align="center" class="primary">
            <td width="5%">No</td>
            <td width="40%">Excipients</td>
            <td width="15%">Strength</td>
            <td width="20%">Function</td>
            <td width="20%">Remarks</td>
          </tr>
        </thead>
        <tbody>
          <?php 
    $count = 1;
    $query = "SELECT res_desc,ref_desc,pe_kekuatan,pe_remarks FROM p_eksipien\n                      LEFT JOIN ref_eksipien_substance ON res_kod = pe_res_kod\n                      LEFT JOIN ref_eksipien_fungsi ON ref_kod = pe_ref_kod\n                      WHERE pe_pp_kod='{$pp_kod}'";
    $t_result = selQuery($query);
    while ($t_row = mysqli_fetch_assoc($t_result)) {
        ?>
            <tr align="center">
              <td><?php 
        echo $count++;
        ?>
</td>
              <td align="left"><?php 
        echo $t_row['res_desc'];
        ?>
</td>
              <td><?php 
        echo $t_row['pe_kekuatan'];
        ?>
</td>
              <td align="left"><?php 
        echo $t_row['ref_desc'];
        ?>
</td>
              <td align="left"><?php 
        echo $t_row['pe_remarks'];
        ?>
</td>
            </tr>
            <?php 
    }
    ?>
        </tbody>
      </table>
    </div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-12">
      <blockquote class="blockquote-primary">Therapeutical</blockquote>
    </div>
    <div class="col-md-12">
      <table id="tbl_the" class="table table-striped table-hover" width="100%" cellspacing="0">
        <thead>
          <tr align="center" class="primary">
            <td width="5%">No</td>
            <td width="25%">Therapeutical Code</td>
            <td width="70%">Therapeutical Description</td>
          </tr>
        </thead>
        <tbody>
          <?php 
    $count = 1;
    $the = "SELECT pth_kod,pth_thera_code FROM p_therapeutical";
    $the .= " WHERE pth_pp_kod='{$pp_kod}'";
    $t_result = selQuery($the);
    while ($t_row = mysqli_fetch_assoc($t_result)) {
        ?>
            <tr align="center">
              <td><?php 
        echo $count++;
        ?>
</td>
              <td><?php 
        echo $t_row['pth_kod'];
        ?>
</td>
              <td><?php 
        echo $t_row['pth_thera_code'];
        ?>
</td>
            </tr>
            <?php 
    }
    ?>
        </tbody>
      </table>
    </div>
    <div class="col-md-12">&nbsp;</div>
    <div class="col-md-12">
      <blockquote class="blockquote-primary">Product Indication</blockquote>
    </div>
    <div class="col-md-12">
      <div class="section">
        <?php 
    $ind = "SELECT pp_indication FROM p_product_sec_a";
    $ind .= " WHERE ppa_pp_kod='{$pp_kod}'";
    $i_result = selQuery($ind);
    $i_row = mysqli_fetch_assoc($i_result);
    ?>
        <label class="field prepend-icon">
          <textarea class="gui-textarea" readonly=""></textarea>
          <label for="comment" class="field-icon">
            <i class="fa fa-comments"></i>
          </label>
            <span class="input-footer">Product Indication</span>
        </label>
      </div>
    </div>
    <div class="col-md-12">
      <blockquote class="blockquote-primary">Packaging Details</blockquote>
    </div>
    <div class="col-md-12">
      <div class="panel panel-primary">
        <div class="panel-body">
          <table width="100%" class="table" cellpadding="5">
            <tr>
              <td width="24%">Pack Size</td>
              <td width="1%">:</td>
              <td width="25%"></td>
              <td width="24%">Package Insert</td>
              <td width="1%">:</td>
              <td width="25%"><?php 
    echo getAttachment($pp_kod, 34);
    ?>
</td>
            </tr>
            <tr>
              <td>Container Type</td>
              <td>:</td>
              <td></td>
              <td>Mockup Label</td>
              <td>:</td>
              <td><?php 
    echo getAttachment($pp_kod, 34);
    ?>
</td>
            </tr>
            <tr>
              <td>Container Description</td>
              <td>:</td>
              <td colspan="4"></td>
            </tr>
          </table>
        </div>
      </div>
    </div>
  </div>
</div>
<?php 
}
Esempio n. 9
0
    echo '<h2 style="font-weight: bold; font-size: 14px; padding: 5px; margin-bottom: 0">10 sist brukte vedlegg:</h2>';
    echo '	<ul style="padding-left: 0px; margin-top: 0px; list-style-image:none; list-style-position:outside; list-style-type:none;">';
    while ($R_att = mysql_fetch_assoc($Q_att)) {
        $att = getAttachment($R_att['att_id']);
        if (count($att)) {
            echo '		<li class="attSelector attid' . $att['att_id'] . '" id="attId-' . $att['att_id'] . '">' . iconFiletype($att['att_filetype']) . ' ' . $att['att_filename_orig'] . ' (' . smarty_modifier_file_size($att['att_filesize']) . ')';
        }
    }
    echo '	</ul>';
}
$Q_att = mysql_query("\n\tSELECT att.att_id\n\tFROM `entry_confirm_attachment` att\n\tORDER BY att.att_uploadtime desc LIMIT 10");
if (mysql_num_rows($Q_att)) {
    echo '<h2 style="font-weight: bold; font-size: 14px; padding: 5px; margin-bottom: 0">10 sist opplastet vedlegg:</h2>';
    echo '	<ul style="padding-left: 0px; margin-top: 0px; list-style-image:none; list-style-position:outside; list-style-type:none;">';
    while ($R_att = mysql_fetch_assoc($Q_att)) {
        $att = getAttachment($R_att['att_id']);
        if (count($att)) {
            echo '		<li class="attSelector attid' . $att['att_id'] . '" id="attId-' . $att['att_id'] . '">' . iconFiletype($att['att_filetype']) . ' ' . $att['att_filename_orig'] . ' (' . smarty_modifier_file_size($att['att_filesize']) . ')';
        }
    }
    echo '	</ul>';
}
?>

	<h2 style="font-weight: bold; font-size: 14px; padding: 5px; margin-bottom: 0">Søk etter andre vedlegg:</h2>
	<form id="attSearchForm">
	Filnavn: <input type="text" value="" id="attSearch"> <input type="button" value="Søk" id="attSearchButton">
	</form>
	<ul style="padding-left: 0px; margin-top: 0px; list-style-image:none; list-style-position:outside; list-style-type:none;" id="attSearchResult">
	</ul>
</div>
Esempio n. 10
0
/**
 * Get all Threads in the user's mailbox.
 *
 * @param  Google_Service_Gmail $service Authorized Gmail API instance.
 * @param  string $userId User's email address. The special value 'me'
 * can be used to indicate the authenticated user.
 * @return array Array of Threads.
 */
function listThreads($service, $maxResults)
{
    $user = '******';
    $pageToken = NULL;
    $opt_param = array();
    $opt_param['includeSpamTrash'] = false;
    // $opt_param['maxResults'] = $maxResults;
    $opt_param['maxResults'] = 5;
    $opt_param['labelIds'] = 'INBOX';
    $threads = array();
    $threadsResponse = $service->users_threads->listUsersThreads($user, $opt_param);
    if ($threadsResponse->getThreads()) {
        $threads = array_merge($threads, $threadsResponse->getThreads());
    }
    $threadsList = new ThreadList();
    $mimeTypes = array("image/png", "image/bmp", "image/gif", "image/jpeg", "image/tiff");
    foreach ($threads as $thread) {
        $threadItem = thread_get($service, $user, $thread->getId());
        $threadObject = new Thread($threadItem->getId(), $threadItem->getHistoryId(), $threadItem->getSnippet());
        $threadMessages = $threadItem->getMessages();
        foreach ($threadMessages as $threadMessage) {
            $threadMessageObject = new Message($threadMessage->getId(), $threadMessage->getHistoryId(), $threadMessage->getSizeEstimate(), $threadMessage->getSnippet(), $threadMessage->getThreadId());
            foreach ($threadMessage->getLabelIds() as $label) {
                $threadMessageObject->addLabels($label);
            }
            $payloads = $threadMessage->getPayload();
            // gets parts
            $payloadObject = new Payload($payloads->getFilename(), $payloads->getMimeType(), $payloads->getPartId());
            $payloadBody = $payloads->getBody();
            $payloadBodyObject = new Body($payloadBody->getSize(), $payloadBody->getData(), $payloadBody->getAttachmentId());
            $payloadObject->setBody($payloadBodyObject);
            $payloadHeaders = $payloads->getHeaders();
            foreach ($payloadHeaders as $payloadHeader) {
                $payloadObject->addHeaders($payloadHeader->getName(), $payloadHeader->getValue());
            }
            $payloadParts = $payloads->getParts();
            foreach ($payloadParts as $payloadPart) {
                $payloadPartObject = new Part($payloadPart->getPartId(), $payloadPart->getMimeType(), $payloadPart->getFilename());
                $partHeaders = $payloadPart->getHeaders();
                foreach ($partHeaders as $partHeader) {
                    $payloadPartObject->addHeaders($partHeader->getName(), $partHeader->getValue());
                }
                $partBody = $payloadPart->getBody();
                $mimeType = $payloadPart->getMimeType();
                $fileName = $payloadPart->getFilename();
                $partBodyData = $partBody->getData();
                if ($mimeType == "text/html") {
                    $partBodyData = stripStyle($partBodyData);
                }
                // get attachment
                if (in_array($mimeType, $mimeTypes)) {
                    $payloadObject->setHasAttachments(true);
                    $messageId = $threadMessage->getId();
                    $attachmentId = $partBody->getAttachmentId();
                    // $messageId = "1517ad66755a3a4e";
                    // $attachmentId = "ANGjdJ_NHguibEZ714ypsmh4AaLozb2ljIe9UnAwH9txKGemrt_5LedqDr3KZ6RLyw40lb5n584YB5ZKMOtiw5o9OT7ClArfD8PDezzdA7cOyf6HW0CNwK_L_vRDPiEoMBRfQljfntWQoC9oAr1C-PjC-wmMuEMDzhezghpQ5vqpKV4nBGhFZ8AHf4QAwvrtT0T8dgn3L6uKGce2WEAkUMKSdCDDAruntSb4cUA9joHouiJ9zFSzQz0Wwc4Ru2MSofkPMWi9F1f2pb1MdCgzUTMgfSEfoLbJGSYgNen5WES7t8OO8B1SPn2STcHOeNg";
                    $attachment = getAttachment($service, $user, $messageId, $attachmentId);
                    $image = getAttachmentAndWrite($service, $user, $messageId, $attachmentId, $fileName, $mimeType);
                    $payloadObject->addImage($image);
                    $payloadPartObject->addBody(new Body($partBody->getSize(), $partBodyData, $partBody->getAttachmentId(), $attachment, $image));
                } else {
                    $payloadPartObject->addBody(new Body($partBody->getSize(), $partBodyData, $partBody->getAttachmentId()));
                }
                // ----------------------------------------------------------
                $payloadPartsSub = $payloadPart->getParts();
                foreach ($payloadPartsSub as $payloadPartSub) {
                    $payloadPartSubObject = new Part($payloadPartSub->getPartId(), $payloadPartSub->getMimeType(), $payloadPartSub->getFilename());
                    $partHeaders = $payloadPartSub->getHeaders();
                    foreach ($partHeaders as $partHeader) {
                        $payloadPartSubObject->addHeaders($partHeader->getName(), $partHeader->getValue());
                    }
                    $partBody = $payloadPartSub->getBody();
                    $partBodyData = $partBody->getData();
                    if ($payloadPartSub->getMimeType() == "text/html") {
                        $partBodyData = stripStyle($partBodyData);
                    }
                    $payloadPartSubObject->addBody(new Body($partBody->getSize(), $partBodyData, $partBody->getAttachmentId()));
                    $payloadPartObject->addParts($payloadPartSubObject);
                }
                // -----------------------------------------------------------------------
                $payloadObject->addParts($payloadPartObject);
            }
            if ($payloadObject->getHasAttachments()) {
                foreach ($payloadObject->getParts() as $key => $parts) {
                    if ($parts->mimeType == "multipart/alternative") {
                        foreach ($parts->getParts() as $key1 => $part) {
                            if ($part->mimeType == "text/html") {
                                $data = subImagesInHtml($part, $payloadObject->getImages());
                                $payloadObject->parts[$key]->parts[$key1]->body[0]->data = $data;
                            }
                        }
                    }
                }
            }
            $threadMessageObject->setPayload($payloadObject);
            $threadObject->addMessage($threadMessageObject);
        }
        $threadsList->addThread($threadObject);
    }
    echo json_encode($threadsList);
    // echo json_last_error_msg();
}
Esempio n. 11
0
 public function physical_edit()
 {
     if (IS_POST) {
         $condition_store_physical['pigcms_id'] = $_POST['pigcms_id'];
         $condition_store_physical['store_id'] = $this->store_session['store_id'];
         $data_store_physical['name'] = $_POST['name'];
         $data_store_physical['phone1'] = $_POST['phone1'];
         $data_store_physical['phone2'] = $_POST['phone2'];
         $data_store_physical['province'] = $_POST['province'];
         $data_store_physical['city'] = $_POST['city'];
         $data_store_physical['county'] = $_POST['county'];
         $data_store_physical['address'] = $_POST['address'];
         $data_store_physical['long'] = $_POST['map_long'];
         $data_store_physical['lat'] = $_POST['map_lat'];
         $data_store_physical['last_time'] = $_SERVER['REQUEST_TIME'];
         if (is_array($_POST['images'])) {
             foreach ($_POST['images'] as &$images_value) {
                 $images_value = getAttachment($images_value);
             }
             $data_store_physical['images'] = implode(',', $_POST['images']);
         } else {
             json_return(1, '门店照片不存在,修改失败');
         }
         $data_store_physical['images'] = implode(',', $_POST['images']);
         $data_store_physical['business_hours'] = $_POST['business_hours'];
         $data_store_physical['description'] = $_POST['description'];
         $database_store_physical = D('Store_physical');
         if ($database_store_physical->where($condition_store_physical)->data($data_store_physical)->save()) {
             json_return(0, '修改成功');
         } else {
             json_return(1, '修改失败');
         }
     } else {
         json_return(1, '非法访问!');
     }
 }
Esempio n. 12
0
        $attachments_lastused[] = $att;
    }
}
$attachments_lastupload = array();
$Q_att = mysql_query("\n\tSELECT att.att_id\n\tFROM `entry_confirm_attachment` att\n\tORDER BY att.att_uploadtime desc LIMIT 10");
while ($R_att = mysql_fetch_assoc($Q_att)) {
    $att = getAttachment($R_att['att_id'], true);
    if (count($att)) {
        $attachments_lastupload[] = $att;
    }
}
if (isset($_GET['viewall'])) {
    $attachments = array();
    $Q_att = mysql_query("\n\t\tSELECT att.att_id\n\t\tFROM `entry_confirm_attachment` att\n\t\tORDER BY att.att_filename_orig");
    while ($R_att = mysql_fetch_assoc($Q_att)) {
        $att = getAttachment($R_att['att_id'], true);
        if (count($att)) {
            $attachments[] = $att;
        } else {
            echo 'err';
            exit;
        }
    }
}
$smarty = new Smarty();
templateAssignSystemvars('smarty');
$smarty->assign('feilmelding', $feilmelding);
if (isset($_GET['viewall'])) {
    $smarty->assign('attachments', $attachments);
    $smarty->assign('viewall', true);
} else {
Esempio n. 13
0
function getConfirm($id)
{
    if (!is_numeric($id) || $id == '0') {
        return array();
    } else {
        $id = (int) $id;
        $Q = mysql_query("select * from `entry_confirm` where confirm_id = '" . $id . "' limit 1");
        if (!mysql_num_rows($Q)) {
            return array();
        } else {
            $return = mysql_fetch_assoc($Q);
            $return['confirm_to'] = unserialize($return['confirm_to']);
            // Get used attachments, if any
            $return['confirm_usedatt'] = array();
            $Q = mysql_query("select att_id from `entry_confirm_usedatt` where confirm_id = '" . $id . "'");
            while ($R = mysql_fetch_assoc($Q)) {
                $att = getAttachment($R['att_id']);
                if (count($att)) {
                    $return['confirm_usedatt'][$att['att_id']] = $att;
                }
            }
            return $return;
        }
    }
}
Esempio n. 14
0
    $templates[] = $template;
}
foreach ($templates as $template) {
    showDebug("Checking autosender [ID: " . $template['id'] . "]");
    $day = number_format($template['orderr'], 0) - 1;
    $sql = "SELECT * FROM " . TABLE_PREFIX . "user WHERE qhvbmailer_ar_day='" . $day . "' AND qhvbmailer_ar_last < '" . dateOnly() . "'";
    $users = $vbulletin->db->query_read_slave($sql);
    while ($user = $vbulletin->db->fetch_array($users)) {
        $userinfo = fetch_userinfo($user['userid'], 1);
        if ($userinfo['adminemail'] > 0) {
            $ntemplates = array_reverse($templates);
            foreach ($ntemplates as $template2) {
                $day2 = number_format($template2['orderr'], 0) - 1;
                if ($day2 == $user['qhvbmailer_ar_day']) {
                    $subject = getQHPhrase($userinfo['languageid'], $template2['id'], 'subject', 'ar');
                    $attachment = getAttachment($template2['attachment_id']);
                    $text = getQHPhrase($userinfo['languageid'], $template2['id'], 'text', 'ar');
                    $html = getQHPhrase($userinfo['languageid'], $template2['id'], 'html', 'ar');
                    if (!empty($subject) && !empty($text) && !empty($html)) {
                        if (sendEmail($user, $subject, $text, $html, 0, $attachment)) {
                            showDebug("Email sent to '" . $user['email'] . "' [ID: " . $user['userid'] . "]");
                            $sends++;
                            if ($sends == $vbulletin->options['qhvbmailer_sleepafter']) {
                                showDebug("Sleeping for " . $vbulletin->options['qhvbmailer_sleepamount'] . " seconds");
                                sleep($vbulletin->options['qhvbmailer_sleepamount']);
                                $sends = 0;
                            }
                        } else {
                            showDebug("Email cannot be sent to '" . $user['email'] . "' [ID: " . $user['userid'] . "]", 2);
                        }
                    } else {
Esempio n. 15
0
// ########################################################################
showDebug("Running newsletter cron...");
$sql = "SELECT * FROM " . TABLE_PREFIX . "qhvbmailer_templates WHERE orderr < 1 AND nl_every > 0 ORDER BY created DESC";
$newsletters = $vbulletin->db->query_read_slave($sql);
while ($newsletter = $vbulletin->db->fetch_array($newsletters)) {
    $days = floor((TIMENOW - $newsletter['nl_last']) / 86400);
    if ($days >= $newsletter['nl_every']) {
        showDebug();
        showDebug("Time to send '" . $newsletter['varname'] . "'");
        $sql = "SELECT * FROM " . TABLE_PREFIX . "user";
        $users = $vbulletin->db->query_read_slave($sql);
        while ($user = $vbulletin->db->fetch_array($users)) {
            $userinfo = fetch_userinfo($user['userid'], 1);
            if ($userinfo['adminemail'] > 0) {
                $subject = getQHPhrase($userinfo['languageid'], $newsletter['id'], 'subject', 'nl');
                $attachment = getAttachment($newsletter['attachment_id']);
                $text = getQHPhrase($userinfo['languageid'], $newsletter['id'], 'text', 'nl');
                $html = getQHPhrase($userinfo['languageid'], $newsletter['id'], 'html', 'nl');
                if (!empty($subject) && !empty($text) && !empty($html)) {
                    if (sendEmail($user, $subject, $text, $html, 0, $attachment)) {
                        showDebug("Email sent to '" . $user['email'] . "' [ID: " . $user['userid'] . "]");
                        $sends++;
                        if ($sends == $vbulletin->options['qhvbmailer_sleepafter']) {
                            showDebug("Sleeping for " . $vbulletin->options['qhvbmailer_sleepamount'] . " seconds");
                            sleep($vbulletin->options['qhvbmailer_sleepamount']);
                            $sends = 0;
                        }
                    } else {
                        showDebug("Email cannot be sent to '" . $user['email'] . "' [ID: " . $user['userid'] . "]", 2);
                    }
                } else {
Esempio n. 16
0
                    echo $asesor["vStaffname"];
                    ?>
</b></td>
                                            <td colspan="4"></td>
                                        </tr>
                                    <?php 
                }
                ?>

                                </table>
                            </div>

                            <div class="clear btm_brdr">
                                <table cellpadding="0" cellspacing="0" border="0" class="comm_tbl2" width="100%">
                                    <?php 
                $attach = getAttachment($var_ticketid, "");
                ?>
                                    <tr>
                                        <td width="12%"><?php 
                echo TEXT_TITLE;
                ?>
:</td>
                                        <td width="88%" colspan="4"><b><?php 
                echo htmlentities($row["vTitle"]);
                ?>
</b></td>
                                    </tr>
                                    <tr>
                                        <td width="12%"><?php 
                echo TICKET_DESCRIPTION;
                ?>