Example #1
0
<table cellpadding="0" cellspacing="0" class='contentblock'>
	<tr>
		<td class="head"><a href="<?php 
echo site_url();
?>
company/<?php 
echo $company['slug'];
?>
"><?php 
echo htmlentitiesX($company['name']);
?>
</a></td>
	</tr>
	<tr>
		<td class="logo">
		<a href="<?php 
echo site_url();
?>
company/<?php 
echo $company['slug'];
?>
" title="<?php 
echo sanitizeX($company['name']);
?>
" alt="<?php 
echo sanitizeX($company['name']);
?>
">
		<?php 
if (trim($company['logo'])) {
    ?>
Example #2
0
    public function ajax_add($contributionid = "")
    {
        if (!$_SESSION['user'] && !$_SESSION['web_user']) {
            return false;
        }
        if (trim($_POST['name'])) {
            //check if company already exists
            $sql = "select `id` from `investment_orgs` where `name`=" . $this->db->escape(trim($_POST['name']));
            $q = $this->db->query($sql);
            $investment_org = $q->result_array();
        }
        $err = 0;
        if (!trim($_POST['name'])) {
            $err = 1;
            ?>
			alertX("<div class='red'>Please input a Name.</div>");
			<?php 
        } else {
            if ($investment_org[0]['id']) {
                $err = 1;
                ?>
			alertX("<div class='red'>Investment organization already exists in the database.</div>");
			<?php 
            } else {
                if (!trim($_POST['description'])) {
                    $err = 1;
                    ?>
			alertX("<div class='red'>Please input a Investment organization description.</div>");
			<?php 
                } else {
                    if (!checkEmail($_POST['email_address'])) {
                        $err = 1;
                        ?>
			alertX("<div class='red'>Please input a valid E-mail.</div>");
			<?php 
                    }
                }
            }
        }
        //save a contribution
        if ($_SESSION['web_user'] && $_POST['web_edit'] && !$err) {
            $sql = "insert into `contributions` set \n\t\t\t\t`web_user_id`='" . $_SESSION['web_user']['id'] . "',\n\t\t\t\t`table`='investment_orgs',\n\t\t\t\t`json_data`='" . mysql_real_escape_string(json_encode($_POST)) . "',\n\t\t\t\t`dateadded_ts` = '" . time() . "',\n\t\t\t\t`dateupdated_ts` = '" . time() . "',\n\t\t\t\t`approved` = 0\n\t\t\t";
            $this->db->query($sql);
            ?>
			alertX("<center>Thanks for the submission. It will be reviewed and approved shortly.</center>");
			setTimeout(function(){ self.location = self.location; }, 2000);
			self.location = self.location;
			//jQuery("#savebutton").val("Submit");
			//jQuery("#company_form *").attr("disabled", true);
			<?php 
            return false;
        }
        if (!$err) {
            $sql = "insert into `investment_orgs` set ";
            $arr = array();
            foreach ($_POST as $key => $value) {
                if (!is_array($value) && $key != 'sid') {
                    $arr[] = "`" . $key . "`=" . $this->db->escape(trim($value));
                }
            }
            if ($_POST['founded']) {
                $mdy = explode("/", $_POST['founded']);
                $arr[] = "`found_month` = " . $this->db->escape(trim($mdy[0]));
                $arr[] = "`found_day` = " . $this->db->escape(trim($mdy[1]));
                $arr[] = "`found_year` = " . $this->db->escape(trim($mdy[2]));
            }
            $sqlext = implode(", ", $arr);
            $sql .= $sqlext . ", `dateadded`=NOW(), `dateupdated`=NOW()";
            $q = $this->db->query($sql);
            $id = $this->db->insert_id();
            $this->slugify($id);
            //update logo url
            $logo = $_POST['logo'];
            if ($logo) {
                $logo = str_replace("temp/" . $_POST['sid'], $id, $logo);
                //replace sid with the company id
                $sql = "update `investment_orgs` set `logo`=" . $this->db->escape($logo) . " where `id`=" . $this->db->escape($id);
                $this->db->query($sql);
                //move files
                $from = dirname(__FILE__) . "/../../media/uploads/investment_orgs/temp/" . $_POST['sid'] . "/logo/" . urldecode(basename($logo));
                $folder = dirname(__FILE__) . "/../../media/uploads/investment_orgs/" . $id . "/";
                if (!is_dir($folder)) {
                    mkdir($folder, 0777);
                }
                $folder = $folder . "logo/";
                if (!is_dir($folder)) {
                    mkdir($folder, 0777);
                }
                $to = $folder . urldecode(basename($logo));
                rename($from, $to);
            }
            if (is_array($_POST['p_ids'])) {
                $sql = "delete from `investment_org_person` where `investment_org_id`=" . $this->db->escape($id);
                $this->db->query($sql);
                foreach ($_POST['p_ids'] as $key => $value) {
                    $start_date_ts = strtotime($_POST['p_start_dates'][$key]);
                    $end_date_ts = 0;
                    if ($_POST['p_end_dates'][$key]) {
                        $end_date_ts = strtotime($_POST['p_end_dates'][$key]);
                    }
                    $sql = "insert into `investment_org_person` set \n\t\t\t\t\t`investment_org_id`=" . $this->db->escape($id) . ", \n\t\t\t\t\t`person_id`=" . $this->db->escape($_POST['p_ids'][$key]) . ",\n\t\t\t\t\t`role`=" . $this->db->escape($_POST['p_roles'][$key]) . ",\n\t\t\t\t\t`start_date`=" . $this->db->escape($_POST['p_start_dates'][$key]) . ",\n\t\t\t\t\t`start_date_ts`=" . $this->db->escape($start_date_ts) . ",\n\t\t\t\t\t`end_date`=" . $this->db->escape($_POST['p_end_dates'][$key]) . ",\n\t\t\t\t\t`end_date_ts`=" . $this->db->escape($end_date_ts);
                    $this->db->query($sql);
                }
            }
            if ($_POST['sid']) {
                $dir = dirname(__FILE__) . "/../../media/uploads/investment_orgs/temp/" . $_POST['sid'];
                SureRemoveDir($dir, "true");
            }
            if ($contributionid) {
                $sql = "update `contributions` set `ipc_id`='" . $id . "', `approved`=1 where `id`='" . mysql_real_escape_string($contributionid) . "'";
                $q = $this->db->query($sql);
            }
            ?>
			alertX("Successfully Added Investment Organization '<?php 
            echo htmlentitiesX($_POST['name']);
            ?>
'.");
			//self.location = "<?php 
            echo site_url();
            ?>
investment_orgs/edit/<?php 
            echo $id;
            ?>
";
			<?php 
            if ($contributionid) {
                ?>
				self.location = "<?php 
                echo site_url();
                ?>
contributions";
				<?php 
            } else {
                ?>
				self.location = "<?php 
                echo site_url();
                ?>
investment_orgs/add";
				<?php 
            }
            $sql = "insert into `logs` set \n\t\t\t\t`action` = 'added',\n\t\t\t\t`table` = 'investment_orgs',\n\t\t\t\t`ipc_id` = " . $this->db->escape($id) . ",\n\t\t\t\t`name` = " . $this->db->escape(trim($_POST['name'])) . ",\n\t\t\t\t`user_id` = " . $this->db->escape(trim($_SESSION['user']['id'])) . ",\n\t\t\t\t`dateadded_ts` = " . time() . ",\n\t\t\t\t`dateadded` = NOW()\n\t\t\t";
            $this->db->query($sql);
        }
        ?>
		jQuery("#savebutton").val("Save");
		jQuery("#investment_org_form *").attr("disabled", false);
		<?php 
        exit;
    }
Example #3
0
File: main.php Project: juslee/e27
    if ($investment_orgs[$i]['active'] == 1) {
        echo "Yes";
    } else {
        echo "No";
    }
    ?>
</td>
			<td>[ <a href="<?php 
    echo site_url();
    ?>
investment_orgs/edit/<?php 
    echo $investment_orgs[$i]['id'];
    ?>
" >Edit</a> ] 
			[ <a style='color: red; cursor:pointer; text-decoration: underline' onclick='deleteInvestmentOrg("<?php 
    echo htmlentitiesX($investment_orgs[$i]['id']);
    ?>
"); ' >Delete</a> ]</td>
		</tr>
		<?php 
}
if ($pages > 0) {
    ?>
		<tr>
			<td colspan="6" class='center font12' >
				There is a total of <?php 
    echo $cnt;
    ?>
 <?php 
    if ($cnt > 1) {
        echo "records";
Example #4
0
        $img = '<img src="data::image/jpg;base64,' . $imgdata . '" />';
    } else {
        $img = "";
    }
    ?>
	<td><?php 
    echo $img;
    ?>
</td>
	<td><?php 
    echo htmlentitiesX($c['country']);
    ?>
</td>
	<td><?php 
    echo htmlentitiesX($c['people']);
    ?>
</td>
	<td><?php 
    echo htmlentitiesX($c['status']);
    ?>
</td>
	<td><?php 
    echo htmlentitiesX($c['active']);
    ?>
</td>
	<?php 
    echo "</tr>";
}
?>
</table>
Example #5
0
File: main.php Project: juslee/e27
	</tr>
	<tr>
		<th style="width:20px"></th>
		<th>Date</th>
		<th>Revised Record</th>
		<th>Revision By</th>
		<th>Status</th>
		<th></th>
		
	</tr>
	<?php 
$t = count($revisions);
for ($i = 0; $i < $t; $i++) {
    ?>
		<tr id="tr<?php 
    echo htmlentitiesX($revisions[$i]['id']);
    ?>
" class="row" >
			<td><?php 
    echo $start + $i + 1;
    ?>
</td>
			<td>
				<?php 
    echo "<a href='" . site_url() . $revisions[$i]['table'] . "/revision/" . $revisions[$i]['id'] . "'>" . date("M d, Y H:i:s", $revisions[$i]['dateupdated_ts']) . "</a>";
    ?>
			</td>
			<td>
				<?php 
    $sql = "select * from `" . $revisions[$i]['table'] . "` where `id`=" . $this->db->escape($revisions[$i]['ipc_id']);
    $q = $this->db->query($sql);
Example #6
0
File: main.php Project: juslee/e27
    if ($people[$i]['active'] == 1) {
        echo "Yes";
    } else {
        echo "No";
    }
    ?>
</td>
			<td>[ <a href="<?php 
    echo site_url();
    ?>
people/edit/<?php 
    echo $people[$i]['id'];
    ?>
" >Edit</a> ] 
			[ <a style='color: red; cursor:pointer; text-decoration: underline' onclick='deletePerson("<?php 
    echo htmlentitiesX($people[$i]['id']);
    ?>
"); ' >Delete</a> ]</td>
		</tr>
		<?php 
}
if ($pages > 0) {
    ?>
		<tr>
			<td colspan="8" class='center font12' >
				There is a total of <?php 
    echo $cnt;
    ?>
 <?php 
    if ($cnt > 1) {
        echo "records";
Example #7
0
        $line .= '"Twitter Username",';
        $line .= '"Facebook Page",';
        $line .= '"LinkedIn Page",';
        $line .= '"Tags",';
        $line .= '"Active?",';
        $line .= '"Companies",';
        $line .= '"Investment Orgs",';
        $line .= '"Investments",';
        $line .= '"Date Added",';
        echo $line . "\n";
        for ($i = 0; $i < $t; $i++) {
            $c = $people[$i];
            $line = "";
            $line .= '"' . htmlentitiesX($c['name']) . '",';
            $line .= '"' . htmlentitiesX($c['description']) . '",';
            $line .= '"' . htmlentitiesX($c['email_address']) . '",';
            $line .= '"' . htmlentitiesX($c['blog_url']) . '",';
            $line .= '"' . htmlentitiesX($c['blog']) . '",';
            $line .= '"' . htmlentitiesX($c['twitter_username']) . '",';
            $line .= '"' . htmlentitiesX($c['facebook']) . '",';
            $line .= '"' . htmlentitiesX($c['linkedin']) . '",';
            $line .= '"' . htmlentitiesX($c['tags']) . '",';
            $line .= '"' . htmlentitiesX($c['active']) . '",';
            $line .= '"' . htmlentitiesX($c['companies']) . '",';
            $line .= '"' . htmlentitiesX($c['investment_orgs']) . '",';
            $line .= '"' . htmlentitiesX($c['milestones']) . '",';
            $line .= '"' . htmlentitiesX(date("M d, Y", strtotime($c['dateadded']))) . '",';
            echo $line . "\n";
        }
    }
}
Example #8
0
File: main.php Project: juslee/e27
    if ($companies[$i]['active'] == 1) {
        echo "Yes";
    } else {
        echo "<a style='color:red'>No</a>";
    }
    ?>
</td>
			<td>[ <a href="<?php 
    echo site_url();
    ?>
companies/edit/<?php 
    echo $companies[$i]['id'];
    ?>
" >Edit</a> ] 
			[ <a style='color: red; cursor:pointer; text-decoration: underline' onclick='deleteCompany("<?php 
    echo htmlentitiesX($companies[$i]['id']);
    ?>
"); ' >Delete</a> ]</td>
		</tr>
		<?php 
}
if ($pages > 0) {
    ?>
		<tr>
			<td colspan="6" class='center font12' >
				There is a total of <?php 
    echo $cnt;
    ?>
 <?php 
    if ($cnt > 1) {
        echo "records";
Example #9
0
File: main.php Project: juslee/e27
		<th>Name</th>
		<th>Type</th>
		<th>Date Added</th>
		<th></th>
		
	</tr>
	<?php 
$t = count($web_users);
for ($i = 0; $i < $t; $i++) {
    $user = getWebUser($web_users[$i]);
    if (!trim($user['name'])) {
        continue;
    }
    ?>
		<tr id="tr<?php 
    echo htmlentitiesX($user['id']);
    ?>
" class="row" >
			<td><?php 
    echo $start + $i + 1;
    ?>
</td>
			<td>
				<?php 
    if (trim($user['business_email'])) {
        echo "<a href='" . site_url() . "webusers/editwebuser/" . $user['id'] . "'>" . $user['business_email'] . "</a>";
    } else {
        if (trim($user['email'])) {
            echo "<a href='" . site_url() . "webusers/editwebuser/" . $user['id'] . "'>" . $user['email'] . "</a>";
        } else {
            echo "<a href='" . site_url() . "webusers/editwebuser/" . $user['id'] . "'>No email</a>";
Example #10
0
    }
    ?>
							</table>
						</td>
					</tr>
				</table>
			<?php 
}
?>
		</td>
		<td class='company_right'>
			<table cellpadding="0" cellspacing="0" class="p100">
				<tr>
					<td class="company_name">
						<?php 
echo htmlentitiesX($person['name']);
if ($companies[0]) {
    ?>
							<div class='person_role'>
							<?php 
    echo trim($companies[0]['role']);
    ?>
							</div>
							<div class='person_company'>
							<?php 
    echo trim($companies[0]['company_name']);
    ?>
							</div>
							<?php 
}
?>
Example #11
0
    }
    ?>
							</table>
						</td>
					</tr>
				</table>
			<?php 
}
?>
		</td>
		<td class='company_right'>
			<table cellpadding="0" cellspacing="0" class="p100">
				<tr>
					<td class="company_name">
						<?php 
echo htmlentitiesX($investment_org['name']);
if ($_SESSION['web_user'] || 1) {
    echo "<div class='edit inline right'><a href='" . site_url() . "editinvestment_org/" . $investment_org['id'] . "/about'>EDIT</div>";
}
?>
					</td>
				</tr>
				<tr>
					<td class="description">
						<div class="description_title">Description</div>
						<div class="description_contents"><?php 
echo nl2br($investment_org['description']);
?>
</div>
					</td>
				</tr>
Example #12
0
 function e27()
 {
     $datefrom = $_GET['datefrom'];
     $dateto = $_GET['dateto'];
     if (!trim($datefrom) || !trim($dateto)) {
         echo "Incomplete parameters!";
         exit;
     }
     $date = date($dateto);
     $day = 24 * 60 * 60;
     $tsnow = strtotime($date);
     $ts = $tsnow;
     header('Content-type: application/ms-excel;');
     header("Content-Type: application/force-download");
     header('Content-Disposition: attachment; filename=e27.xls');
     echo '<table border="1">';
     $datefrom = strtotime($datefrom) - $day;
     $datefrom = date("Y-m-d", $datefrom);
     while (date("Y-m-d", $ts) != $datefrom) {
         $url = "http://www.e27.sg/" . date("Y/m/d", $ts) . "/feed/";
         $rss = @fetch_rss($url);
         foreach ($rss->items as $key => $value) {
             //echo "<pre>";
             //print_r($value);
             //echo "</pre>";
             //exit();
             echo "<tr>";
             echo "<td>" . date("M d, Y", strtotime($value['pubdate'])) . "</td>";
             echo "<td>" . htmlentitiesX($value['title']) . "</td>";
             echo "<td>" . htmlentitiesX($value['dc']['creator']) . "</td>";
             echo "</tr>";
         }
         $ts -= $day;
     }
     echo "</table>";
     //$items = @array_slice($rss->items, 0, 10);
 }
Example #13
0
File: edit.php Project: juslee/e27
				  </td>
				</tr>
				<tr class="even">
				  <td>Twitter:</td>
				  <td>
					<input type='text' style='width:300px;' name='twitter' value="<?php 
echo htmlentitiesX($web_user['twitter']);
?>
" />
				  </td>
				</tr>
				<tr class="odd">
				  <td>Homepage:</td>
				  <td>
					<input type='text' style='width:300px;' name='homepage' value="<?php 
echo htmlentitiesX($web_user['homepage']);
?>
" />
				  </td>
				</tr>
				<?php 
if (trim($web_user['fb_id']) == "" && trim($web_user['in_id']) == "") {
    ?>
						<tr class="even">
						  <td>Password:</td>
						  <td>
							<input type='text' style='width:300px;' name='password' placeholder='Input value to change password.'  />
						  </td>
						</tr>
						<?php 
}
Example #14
0
File: main.php Project: juslee/e27
	</tr>
	<tr>
		<th style="width:20px"></th>
		<th>Date</th>
		<th>Contribution</th>
		<th>Contributed By</th>
		<th>Status</th>
		<th></th>
		
	</tr>
	<?php 
$t = count($contributions);
for ($i = 0; $i < $t; $i++) {
    ?>
		<tr id="tr<?php 
    echo htmlentitiesX($contributions[$i]['id']);
    ?>
" class="row" >
			<td><?php 
    echo $start + $i + 1;
    ?>
</td>
			<td>
				<?php 
    echo "<a href='" . site_url() . $contributions[$i]['table'] . "/contribution/" . $contributions[$i]['id'] . "'>" . date("M d, Y H:i:s", $contributions[$i]['dateadded_ts']) . "</a>";
    ?>
			</td>
			<td>
				<?php 
    if ($contributions[$i]['table'] == 'companies') {
        $table = "Company";
Example #15
0
File: list.php Project: juslee/e27
		<tr id="tr<?php 
    echo htmlentitiesX($list[$i]['id']);
    ?>
" class="row" >
			<td><?php 
    echo $start + $i + 1;
    ?>
</td>
			<td><a href="<?php 
    echo site_url() . $list[$i]['list_type'];
    ?>
/edit/<?php 
    echo $list[$i]['id'];
    ?>
" ><?php 
    echo htmlentitiesX($list[$i]['name']);
    ?>
</a></td>
			<td>
			<?php 
    if (is_array($list[$i]['feed'])) {
        $this->load->view('blogs_rss/feeds', $list[$i]['feed']);
    }
    ?>
			</td>
		</tr>
		<?php 
}
if ($pages > 0) {
    ?>
		<tr>
Example #16
0
										<a href='<?php 
        echo $imgfilebig;
        ?>
' target='_blank'>
										<img style='border:0px' src="<?php 
        echo $imgfile;
        ?>
" alt="<?php 
        echo htmlentitiesX($screenshots[$i]['title']);
        ?>
" title="<?php 
        echo htmlentitiesX($screenshots[$i]['title']);
        ?>
"  />
										<div class='title'><?php 
        echo htmlentitiesX($screenshots[$i]['title']);
        ?>
</div>
										</a>
										<?php 
    }
    /*
    ?>
    <a><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAM0AAAD
    	 NCAMAAAAsYgRbAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5c
    	 cllPAAAABJQTFRF3NSmzMewPxIG//ncJEJsldTou1jHgAAAARBJREFUeNrs2EEK
    	 gCAQBVDLuv+V20dENbMY831wKz4Y/VHb/5RGQ0NDQ0NDQ0NDQ0NDQ0NDQ
    	 0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0PzMWtyaGhoaGhoaGhoaGhoaGhoxtb0QGho
    	 aGhoaGhoaGhoaGhoaMbRLEvv50VTQ9OTQ5OpyZ01GpM2g0bfmDQaL7S+ofFC6x
    	 v3ZpxJiywakzbvd9r3RWPS9I2+MWk0+kbf0Hih9Y17U0nTHibrDDQ0NDQ0NDQ0
    	 NDQ0NDQ0NTXbRSL/AK72o6GhoaGhoRlL8951vwsNDQ0NDQ1NDc0WyHtDTEhD