/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $post = ['title' => $request->input('title'), 'author' => Auth::getName(), 'content_raw' => $request->input('editorValue'), 'content_html' => $request->input('editorValue'), 'published_at' => carbon::now()]; Post::create($post); return redirect('/admin/post'); // }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $article = ['title' => $request->input('title'), 'author' => User::find(Auth::id())->username, 'content_raw' => $request->input('editorValue'), 'content_html' => $request->input('editorValue'), 'page_image' => $request->input('coverImage'), 'published_at' => carbon::now()]; Article::create($article); return redirect('/admin/article'); // }
public function adPreviousMonth($month) { $time = carbon::parse($month); $time = $time->subMonth(1); $clients = Client::orderBy('lastName', 'asc')->get(); return view('clients.index', compact('clients', 'time')); }
public function transformUser($user, $locale = 'ru') { return ['id' => $user->id, 'name' => $user->name, 'email' => $user->email, 'phone' => $this->transformPhone($user->phone), 'phones' => $this->transformPhones($user->phones->filter(function ($phone) use($user) { return $user->phone_id != $phone->id; })->values()), 'birthday' => $user->birthday, 'age' => Carbon::now()->diff(carbon::parse($user->birthday))->y, 'city' => $user->city, 'img' => ['thumb' => $user->img_small, 'middle' => $user->img_middle, 'origin' => $user->img_large], 'sex' => $user->sex, 'about' => $user->about, 'completed' => $user->completed, 'cars' => $this->transformcars($user->cars->filter(function ($car) use($user) { return $user->car_id != $car->id; })->values()), 'updated_at' => $user->updated_at]; }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $input = Request::all(); $input['ETD_ORIGIN'] = carbon::now(); $input['ETA_JKT'] = carbon::now(); $input['PIB_Payment'] = carbon::now(); $input['Custom_Clearance'] = carbon::now(); $input['ETA_AIIA'] = carbon::now(); import::create($input); return redirect('import'); }
public function detailedInvoice($id) { $folio_services = DB::table('folio_services')->join('services', 'services.service_id', '=', 'folio_services.service_id')->select('folio_services.folio_num as folio_num', 'folio_services.date as date', 'folio_services.price as price', 'services.service_name as service_name', 'folio_services.service_count as count')->where('folio_num', '=', $id)->orderBy('folio_services.date', 'asc')->get(); $cus_id = DB::table('reservation')->select('cus_id')->where('res_id', '=', $id)->first(); $cus_name = DB::table('customer')->select('name')->where('cus_id', '=', $cus_id->cus_id)->first(); $date = carbon::now(); $date = $date->toDateString(); //generating the pdf $pdf = App::make('dompdf.wrapper'); $pdf->loadView('test3', array('args' => $folio_services, 'res_id' => $id, 'cus_name' => $cus_name->name)); return $pdf->download('Reservation_No_' . sprintf("%007d", $id) . "__" . $date . '.pdf'); }
public function edit($id) { $warehouse = Bodega::find($id); $bodega_id = $warehouse->id; $bodega_foto = $warehouse->foto; $bodega_precio = \App\Dinero::money_format($warehouse->precio); $bodega_pais = $warehouse->pais; $bodega_estado = $warehouse->estado; $bodega_ciudad = $warehouse->ciudad; $bodega_calle_num = $warehouse->calle_num; $bodega_colonia = $warehouse->colonia; $bodega_ancho = $warehouse->ancho; $bodega_largo = $warehouse->largo; $bodega_alto = $warehouse->alto; $bodega_area = $bodega_ancho * $bodega_largo; $fecha = carbon::now(); $view = \View::make('bodega.pdf', compact('bodega_id', 'bodega_foto', 'bodega_precio', 'bodega_pais', 'bodega_estado', 'bodega_ciudad', 'bodega_calle_num', 'bodega_colonia', 'bodega_ancho', 'bodega_alto', 'bodega_largo', 'bodega_area', 'fecha'))->render(); $pdf = \App::make('dompdf.wrapper'); $pdf->loadHTML($view); return $pdf->stream('detalle_bodega'); }
<?php if ($_POST) { $username = $_POST['username']; $password = $_POST['password']; carbon::login($username, $password); } elseif (carbon::logged() == 0) { ?> <form action='?page=login' method='post'> <table border='0' cellpadding='0' cellspacing='1' align='center' width='100%'> <tr> <td width='100px'> Username: </td> <td> <input type='text' name='username' class='login_box'> </td> </tr> <tr>
require dirname(__DIR__) . '/vendor/autoload.php'; use Carbon\Carbon; $ip = "Current IP Address: " . $_SERVER['REMOTE_ADDR']; ?> <div class="footer row"> <section class="col-sm-8"> <?php echo $ip; ?> </section> <section class="col-sm-4 "> <?php if (isset($login->login) && $login->login == 1) { $timeZone = new UserPDO(); echo carbon::now($timeZone->getTimeZoneByUserId($_COOKIE["phpContactId"]))->format('l jS \\of F Y'); } ?> </section> </div> <!-- Eastern ........... America/New_York Central ........... America/Chicago Mountain .......... America/Denver Mountain no DST ... America/Phoenix Pacific ........... America/Los_Angeles Alaska ............ America/Anchorage Hawaii ............ America/Adak
<img src="./template/<?php carbon::config("template", 1); ?> /images/bottomright.gif" width="19" height="20"> </td> </tr> <tr> <td colspan='2' align="center"> <?php carbon::version(); ?> </td> </tr> </table> </body> </html> <?php carbon::disconnect();
<?php date_default_timezone_set('Asia/Taipei'); require __DIR__ . '/bootstrap.php'; use Carbon\Carbon; carbon::setLocale('zh-tw'); // connect to dabase try { $dsn = 'mysql:host=' . DB_HOST . ';port=' . DB_PORT . ';dbname=' . DB_DATABASE . ';charset=' . DB_CHARSET; $pdo = new PDO($dsn, DB_USERNAME, DB_PASSWORD); } catch (PDOException $e) { echo "Error: " . $e->getMessage() . "<br/>"; die; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>Laravel 道場訓練教材:運用 Carbon 顯示資料庫內文章時間</title> <!-- Bootstrap Core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet">
carbon::config("template", 1); ?> /images/nav-right.gif' width='' height=''> </td> </tr> </table> </td> <td valign="top"> <img src='./template/<?php carbon::config("template", 1); ?> /images/right.gif'> </td> </tr> <tr> <td> </td> <td>
$templ = "./template/"; $templ .= $this->_template; $templ .= "/_comments.php"; $open = fopen($templ, "r"); $contents = fread($open, filesize($templ)); $contents = str_ireplace('{ID}', $n_id, $contents); $contents = str_ireplace('{TITLE}', $c_title, $contents); $contents = str_ireplace('{UID}', $u_id, $contents); $contents = str_ireplace('{POST}', $c_body, $contents); $contents = str_ireplace('{DATE}', $c_date, $contents); $contents = str_ireplace('{USERNAME}', $c_username, $contents); $contents = str_ireplace('{SIG}', $c_sig, $contents); $c_delete = "<a href='?page=news&id={$n_id}&delete={$cid}'>Delete</a>"; if ($u_id == $_COOKIE['user'] || carbon::rank() > 1) { $contents = str_ireplace('{DELETE}', $c_delete, $contents); } else { $contents = str_ireplace('{DELETE}', '', $contents); } fclose($open); echo $contents; } # Delete comment if ($_GET['delete'] != NULL) { if ($u_id == $_COOKIE['user'] || carbon::rank() > 1) { $sql->delete(array('db' => $database, 'table' => 'news_comments', 'where' => array('id = ' . $_GET['delete']))); echo "<META HTTP-EQUIV=Refresh CONTENT='0; URL=?page=news&id={$n_id}'>"; } } #end delete comment } }
function site() { global $sql; global $database; $page = $_GET['page']; $page_dir = './pages/'; if ($page == NULL) { $page = carbon::config('front_page', 0); } $mods_installed = $sql->select(array('db' => $database, 'table' => 'module', 'where' => array('mod_name =' . $page))); if ($mods_installed[0]['active'] == 1) { echo "<center> Module is not currently active </center>"; } else { if (is_file($page_dir . $page . '.php')) { $contents = file($page_dir . $page . '.php'); $something = file_get_contents($page_dir . $page . '.php'); $check = strpos($something, '#member = 1'); $check2 = strpos($something, '#member = 2'); $check = $check + 10; $check2 = $check2 + 10; if ($something[$check] == '1') { if (carbon::logged() == TRUE) { include $page_dir . $page . '.php'; } else { echo "<center>Error: You must be logged in to view this page</center>"; } } elseif ($something[$check2] == '2') { if (carbon::rank() >= 2 && carbon::logged() == TRUE) { include $page_dir . $page . '.php'; } else { echo "<center>Error: You must be an Admin to view this page</center>"; } } else { if ($mods_installed[0]['active'] == 2 or $mods_installed[0]['active'] == 3) { include $page_dir . $page . '.php'; } else { echo "<center> An error has occured: The following page you've requested - <em>{$page}</em> - could not be found. </center>"; } } } else { echo "<center> An error has occured: The following page you've requested - <em>{$page}</em> - could not be found. </center>"; } } }
</td> <td class='message_center_top' width='25%'> <strong>Sender:</strong> </td> <td class='message_center_top' width='20%'> <strong>Date:</strong> </td> </tr> <?php carbon::message_center_fetch('1'); ?> </table> <?php } elseif ($_GET['read'] == 'read') { carbon::message_center_fetch('2'); } elseif ($_GET['read'] == 'reply') { carbon::message_center_fetch('3'); } else { carbon::message_center_fetch('4'); }
<?php carbon::logout();
<input type='reset' value='Reset' class='submit'> </td> </tr> </table> </form> <sup>1</sup> Username must be atleast: <?php carbon::config(min_user_length, 1); ?> characters long. <br /> <sup>2</sup> Password must be atleast: <?php carbon::config(min_pass_length, 1); ?> characters long. <br /> <sup>3</sup> Usernames cannot contain spaces and are not case sensitive. <br /> <sup>4</sup> No HTML can be used in any text field. <?php } else { echo "<center>User registration is currently disabled.</center>"; } } else { echo "<center>Error: You are currently logged in and cannot create another account.</center>"; }
echo "<center>News Options have been updated. \n <br /> \n <a href='?page=admin&function=pref&pref=news_prefs&sub=options'>Click Here</a> to go back. </center>"; } else { echo "<a href='?page=admin&function=pref&pref=news_prefs'><strong>Back</strong></a> \n <br /> <br /> \n\n\n\t\t\t\t\t\n\t\t\t\t\t<form action='?page=admin&function=pref&pref=news_prefs&sub=options' method='post'>\n\t\t\t\t\t\n\t\t\t\t\t<table border='0' cellpadding='0' cellspacing='1' width='100%'>\n\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\n\t\t\t\t\t\t<td width='175px'>\n\n\t\t\t\t\t\t\tGlobal News Comments:\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tEnabled <input type='radio' name='news_comments' value='1'"; if (carbon::config(comments, 0) == 1) { echo "checked"; } echo ">\n\t\t\t\t\t\t\tDisabled <input type='radio' name='news_comments' value='0'"; if (carbon::config(comments, 0) == 0) { echo "checked"; } echo ">\n\t\t\t\t\t\t\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\n\t\t\t\t\t\t<td width='175px'>\n\n\t\t\t\t\t\t\tPublic Commenting:\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td valign='top'>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tEnabled <input type='radio' name='news_comments_logged' value='1'"; if (carbon::config(news_comments_logged, 0) == 1) { echo "checked"; } echo ">\n\t\t\t\t\t\t\tDisabled <input type='radio' name='news_comments_logged' value='0'"; if (carbon::config(news_comments_logged, 0) == 0) { echo "checked"; } echo ">\n\t\t\t\t\t\t\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t\n\t\t\t\t\t\t<td colspan='2' align='center'>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t<input type='submit' value='Update' class='submit'>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\n\t\t\t\t\t</table>\n\t\t\t\t\t"; } break; case "new": if ($_POST) { switch ($_POST['news_lines']) { case 1: $news_body = nl2br(stripslashes($_POST['news_body'])); $news_desc = nl2br(stripslashes($_POST['news_desc'])); break; case 0: $news_body = stripslashes($_POST['news_body']); $news_desc = stripslashes($_POST['news_desc']);
<?php require "carbon2.class.php"; $carbon = new carbon(); $carbon->header(); $carbon->site(); $carbon->footer();
if (carbon::config(user_reg, 0) == 1) { echo 'checked'; } echo ">\r\n\t\t\t\t\t\t\tDisabled <input type='radio' name='user_reg' value='0' "; if (carbon::config(user_reg, 0) == 0) { echo 'checked'; } echo ">\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<tr>\r\n\t\t\r\n\t\t\t\t\t\t<td width='175px'>\r\n\r\n\t\t\t\t\t\t\tActivation Required:\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tYes <input type='radio' name='active' value='1' "; if (carbon::config(active, 0) == 1) { echo 'checked'; } echo ">\r\n\t\t\t\t\t\t\tNo <input type='radio' name='active' value='0' "; if (carbon::config(active, 0) == 0) { echo 'checked'; } echo ">\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<tr>\r\n\t\t\r\n\t\t\t\t\t\t<td width='175px'>\r\n\r\n\t\t\t\t\t\t\tMin. Password Length:\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<input type='text' name='min_pass' class='login_box' value='" . carbon::config(min_pass_length, 0) . "'>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<tr>\r\n\t\t\r\n\t\t\t\t\t\t<td width='175px'>\r\n\r\n\t\t\t\t\t\t\tMin. Username Length:\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<input type='text' name='min_user' class='login_box' value='" . carbon::config(min_user_length, 0) . "'>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<br /> \n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<strong>Misc.</strong>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tMaximum Signature Length:\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<input type='text' name='sig_length' class='login_box' value='" . carbon::config(sig_length, 0) . "'>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t<td colspan='2' align='center'>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<input type='submit' name='submit' value='Update' class='submit'>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t\r\n\t\t\t\t</table>\r\n\t\t\t\r\n\t\t\t</form>\r\n\t\t\t\r\n\t\t\t"; } break; case "module": echo "<a href='?page=admin'><strong>Back</strong></a> \n <br /> <br /> \n"; /*********/ if ($_GET['deactivate'] != NULL) { $sql->update(array('db' => $database, 'table' => 'module', 'where' => array('id = ' . $_GET['deactivate']), 'values' => array('active' => '1'))); $sql->delete(array('db' => $database, 'table' => 'nav', 'where' => array('id = ' . $_GET['deactivate']))); echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL=./?page=admin&function=module">'; } elseif ($_GET['activate'] != NULL) { $sql->update(array('db' => $database, 'table' => 'module', 'where' => array('id = ' . $_GET['activate']), 'values' => array('active' => '2'))); $grab = $sql->select(array('db' => $database, 'table' => 'module', 'where' => array('id = ' . $_GET['activate']))); $mod_name = $grab[0]['mod_name']; $mod_page = $mod_name . ".php"; $mod_short = $mod_name;
/** * Display a listing of the resource. * * @return Response */ public function index() { if (Auth::check()) { $currentPage = ""; $mainMenu = "DASHBOARD"; //customers or Inquiries $todaysCustomerReg = Customers::getCustomertodaysRegCount(); $customerCount = Customers::getCustomerCount(); //Members or Family Members $todaysMemberReg = CustomerMembership::getMembertodaysRegCount(); $membersCount = CustomerMembership::getMemberCount(); //Non Members or prospects $todaysNonmemberReg = CustomerMembership::getNonMembertodaysRegCount(); $NonmembersCount = CustomerMembership::getNonMemberCount(); //Enrolled customers(kids) $todaysEnrolledCustomers = StudentClasses::getTodaysEnrolledCustomers(); $enrolledCustomers = StudentClasses::getEnrolledCustomers(); //for followups $reminderCount = Comments::getReminderCountByFranchiseeId(); //Introvisit $totalIntrovisitCount = IntroVisit::getIntrovistCount(); $introVisitCount = IntroVisit::getIntrovisitBytoday(); $allIntrovisits = IntroVisit::getAllActiveIntrovisit(); for ($i = 0; $i < count($allIntrovisits); $i++) { $data = Comments::where('introvisit_id', '=', $allIntrovisits[$i]['id'])->orderBy('id', 'DESC')->first(); if (isset($data)) { $allIntrovisits[$i]['followup_status'] = $data['followup_status']; } } //for courses $totalParentchildCourse = Classes::getallParentchildCourseCount(); $totalPrekgKindergarten = Classes::getallPrekgKindergartenCount(); $totalGradeschool = Classes::getallGradeschoolCount(); $totalCourses = $totalParentchildCourse + $totalPrekgKindergarten + $totalGradeschool; //for birthdayparty $totalbpartyCount = BirthdayParties::getBpartyCount(); $todaysbpartycount = BirthdayParties::getBpartyCountBytoday(); $todaysFollowup = Comments::getAllFollowup(); $todaysIntrovisit = BatchSchedule::getTodaysIntroVisits(); $activeRemindersCount = Comments::getAllFollowupActive(); //get birthday dates $startdate = new carbon(); $startdate->startOfYear(); $endofyear = new carbon(); $endofyear = $endofyear->endOfYear(); $student_id = array(); $birthday_celebration_data = BirthdayParties::where('created_at', '>=', $startdate->toDateString())->where('created_at', '<=', $endofyear->toDateString())->select('student_id')->get(); //var_dump($birthday_celebration_data); die(); for ($i = 0; $i < count($birthday_celebration_data); $i++) { $student_id[$i] = $birthday_celebration_data[$i]['student_id']; } $dat = new carbon(); $month = $dat->month; $presentdate = $dat->day; // for rest of the days of month $birthday_data = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $month)->where(DB::raw('DATE(student_date_of_birth)'), '>', $presentdate)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get(); // echo $month; die(); for ($i = 0; $i < count($birthday_data); $i++) { $customer_data = Customers::where('id', '=', $birthday_data[$i]['customer_id'])->get(); $birthday_data[$i]['customer_name'] = $customer_data[0]['customer_name']; $birthday_data[$i]['mobile_no'] = $customer_data[0]['mobile_no']; $birthday_data[$i]['membership'] = CustomerMembership::where('customer_id', '=', $birthday_data[$i]['customer_id'])->count(); } $m = $month; $m++; while ($m <= 12) { $birthday_data_month[] = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $m)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get(); $m++; } // for starting months $m = 1; while ($m < $month) { $birthday_data_month[] = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $m)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get(); $m++; } for ($i = 0; $i < count($birthday_data_month); $i++) { for ($j = 0; $j < count($birthday_data_month[$i]); $j++) { $customer_data = Customers::where('id', '=', $birthday_data_month[$i][$j]['customer_id'])->get(); $birthday_data_month[$i][$j]['customer_name'] = $customer_data[0]['customer_name']; $birthday_data_month[$i][$j]['mobile_no'] = $customer_data[0]['mobile_no']; $birthday_data_month[$i][$j]['membership'] = CustomerMembership::where('customer_id', '=', $birthday_data_month[$i][$j]['customer_id'])->count(); } } // var_dump($birthday_data_month);exit(); //for starting days of present month $birthday_month_startdays = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $month)->where(DB::raw('DATE(student_date_of_birth)'), '<', $presentdate)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get(); for ($i = 0; $i < count($birthday_month_startdays); $i++) { $customer_data = Customers::where('id', '=', $birthday_month_startdays[$i]['customer_id'])->get(); $birthday_month_startdays[$i]['customer_name'] = $customer_data[0]['customer_name']; $birthday_month_startdays[$i]['mobile_no'] = $customer_data[0]['mobile_no']; $birthday_month_startdays[$i]['membership'] = CustomerMembership::where('customer_id', '=', $birthday_month_startdays[$i]['customer_id'])->count(); } //for birthday celebration this week $presentdate = new carbon(); $weeekdate = new carbon(); $weeekdate->addDays(7); $birthdayPresentWeek = BirthdayParties::where('birthday_party_date', '>=', $presentdate->toDateString())->where('birthday_party_date', '<=', $weeekdate->toDateString())->get(); for ($i = 0; $i < count($birthdayPresentWeek); $i++) { $customer_data = Customers::where('id', '=', $birthdayPresentWeek[$i]['customer_id'])->get(); $birthdayPresentWeek[$i]['customer_name'] = $customer_data[0]['customer_name']; $birthdayPresentWeek[$i]['mobile_no'] = $customer_data[0]['mobile_no']; $birthdayPresentWeek[$i]['franchisee_id'] = $customer_data[0]['franchisee_id']; $student_data = Students::where('id', '=', $birthdayPresentWeek[$i]['student_id'])->get(); $birthdayPresentWeek[$i]['student_name'] = $student_data[0]['student_name']; } $f_id = Session::get('franchiseId'); $viewData = array('currentPage', 'mainMenu', 'f_id', 'birthday_data', 'birthday_data_month', 'birthday_month_startdays', 'birthdayPresentWeek', 'todaysMemberReg', 'membersCount', 'todaysNonmemberReg', 'NonmembersCount', 'customerCount', "reminderCount", 'totalbpartyCount', 'todaysbpartycount', 'totalParentchildCourse', 'totalPrekgKindergarten', 'totalGradeschool', 'totalCourses', 'todaysCustomerReg', 'todaysEnrolledCustomers', 'enrolledCustomers', 'totalIntrovisitCount', 'introVisitCount', 'allIntrovisits', 'todaysFollowup', 'todaysIntrovisit', 'activeRemindersCount'); return View::make('pages.dashboard.upcoming', compact($viewData)); } else { return Redirect::to("/"); } }
carbon::loggedin(0); ?> <!-- rounded corners - bottom **** --> <div class="rbottom"><div class="r4"></div><div class="r3"></div><div class="r2"></div><div class="r1"></div></div> </div> <div class="sidebaritem"> <!-- rounded corners - top **** --> <div class="rtop"><div class="r1"></div><div class="r2"></div><div class="r3"></div><div class="r4"></div></div> <center><strong>News Headlines</strong></center> <br /> <?php carbon::news_feed(1); ?> <!-- rounded corners - bottom **** --> <div class="rbottom"><div class="r4"></div><div class="r3"></div><div class="r2"></div><div class="r1"></div></div> </div> </div> <div id="content">
public function addIntroVisit() { $inputs = Input::all(); $result = IntroVisit::addSchedule($inputs); $commentsInput['customerId'] = $inputs['customerId']; $commentsInput['student_id'] = $inputs['studentIdIntroVisit']; $commentsInput['introvisit_id'] = $result->id; $commentsInput['commentText'] = Config::get('constants.IV_SCHEDULED_COMMENT') . ' ' . $inputs['customerCommentTxtarea']; $commentsInput['commentStatus'] = 'ACTIVE/SCHEDULED'; $commentsInput['commentType'] = $inputs['commentType']; $commentsInput['followupType'] = $inputs['followupType']; //$commentsInput['reminderDate'] = date('Y-m-d', strtotime($inputs['reminderTxtBox'])); $iv_date = Carbon::createFromFormat('m/d/Y', $inputs['introVisitTxtBox']); if ($iv_date->eq(carbon::now())) { Comments::addComments($commentsInput); } else { $iv_date->subDay(); $commentsInput['reminderDate'] = $iv_date->toDateString(); Comments::addComments($commentsInput); } if ($result) { return Response::json(array("status" => "success")); } return Response::json(array("status" => "failed")); }
<?php carbon::loggedin(0); ?> </div> <div class="clearer"> </div> </div> <div class="footer"> <span class="left"> Powered by Carbon2 <?php carbon::version(); ?> </span> <span class="right"> <a href="http://templates.arcsin.se">Website template</a> by <a href="http://arcsin.se">Arcsin</a> </span> <div class="clearer"> </div> </div> </div>
public function printAnnualReport($date) { $clients = Client::orderBy('lname', 'asc')->get(); $time = carbon::parse($date); $year = $time->year; return view('report.annual_report_view', compact('clients', 'year')); }